From d4829ad0cc24c11ab5d2a7c97dafaedf7f3ca7db Mon Sep 17 00:00:00 2001 From: "Tristan Helmich (omniIT)" Date: Mon, 5 Oct 2020 17:36:56 +0000 Subject: [PATCH] ESLint setup --- .eslintrc.json | 19 + node_modules/.bin/acorn | 1 + node_modules/.bin/eslint | 1 + node_modules/.bin/esparse | 1 + node_modules/.bin/esvalidate | 1 + node_modules/.bin/js-yaml | 1 + node_modules/.bin/json5 | 1 + node_modules/.bin/mkdirp | 1 + node_modules/.bin/node-which | 1 + node_modules/.bin/rimraf | 1 + node_modules/.bin/semver | 1 + node_modules/@babel/code-frame/LICENSE | 22 + node_modules/@babel/code-frame/README.md | 19 + node_modules/@babel/code-frame/lib/index.js | 167 + node_modules/@babel/code-frame/package.json | 57 + .../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 | 51 + .../scripts/generate-identifier-regex.js | 75 + node_modules/@babel/highlight/LICENSE | 22 + node_modules/@babel/highlight/README.md | 19 + node_modules/@babel/highlight/lib/index.js | 107 + .../highlight/node_modules/chalk/index.js | 228 + .../node_modules/chalk/index.js.flow | 93 + .../highlight/node_modules/chalk/license | 9 + .../highlight/node_modules/chalk/package.json | 103 + .../highlight/node_modules/chalk/readme.md | 314 + .../highlight/node_modules/chalk/templates.js | 128 + .../node_modules/chalk/types/index.d.ts | 97 + node_modules/@babel/highlight/package.json | 62 + node_modules/@eslint/eslintrc/CHANGELOG.md | 4 + node_modules/@eslint/eslintrc/LICENSE | 21 + node_modules/@eslint/eslintrc/README.md | 21 + .../@eslint/eslintrc/conf/category-list.json | 39 + .../@eslint/eslintrc/conf/config-schema.js | 81 + .../eslintrc/conf/default-cli-options.js | 31 + .../@eslint/eslintrc/conf/environments.js | 179 + .../@eslint/eslintrc/conf/eslint-all.js | 32 + .../eslintrc/conf/eslint-recommended.js | 72 + .../@eslint/eslintrc/conf/replacements.json | 22 + .../lib/cascading-config-array-factory.js | 501 + .../eslintrc/lib/config-array-factory.js | 1080 + .../eslintrc/lib/config-array/config-array.js | 524 + .../lib/config-array/config-dependency.js | 116 + .../lib/config-array/extracted-config.js | 146 + .../lib/config-array/ignore-pattern.js | 237 + .../eslintrc/lib/config-array/index.js | 20 + .../lib/config-array/override-tester.js | 223 + node_modules/@eslint/eslintrc/lib/index.js | 51 + .../@eslint/eslintrc/lib/shared/ajv.js | 34 + .../@eslint/eslintrc/lib/shared/config-ops.js | 130 + .../eslintrc/lib/shared/config-validator.js | 324 + .../lib/shared/deprecation-warnings.js | 56 + .../@eslint/eslintrc/lib/shared/naming.js | 97 + .../lib/shared/relative-module-resolver.js | 44 + node_modules/@eslint/eslintrc/package.json | 90 + node_modules/@types/json5/README.md | 18 + node_modules/@types/json5/index.d.ts | 44 + node_modules/@types/json5/package.json | 49 + node_modules/@types/json5/types-metadata.json | 25 + node_modules/acorn-jsx/LICENSE | 19 + node_modules/acorn-jsx/README.md | 40 + node_modules/acorn-jsx/index.js | 488 + node_modules/acorn-jsx/package.json | 55 + node_modules/acorn-jsx/xhtml.js | 255 + node_modules/acorn/CHANGELOG.md | 620 + node_modules/acorn/LICENSE | 21 + node_modules/acorn/README.md | 269 + node_modules/acorn/bin/acorn | 4 + node_modules/acorn/dist/acorn.d.ts | 209 + node_modules/acorn/dist/acorn.js | 5186 +++++ node_modules/acorn/dist/acorn.js.map | 1 + node_modules/acorn/dist/acorn.mjs | 5155 +++++ node_modules/acorn/dist/acorn.mjs.d.ts | 2 + node_modules/acorn/dist/acorn.mjs.map | 1 + node_modules/acorn/dist/bin.js | 64 + node_modules/acorn/package.json | 67 + node_modules/ansi-colors/LICENSE | 21 + node_modules/ansi-colors/README.md | 315 + node_modules/ansi-colors/index.js | 177 + node_modules/ansi-colors/package.json | 152 + node_modules/ansi-colors/symbols.js | 70 + node_modules/ansi-colors/types/index.d.ts | 161 + node_modules/ansi-regex/index.d.ts | 37 + node_modules/ansi-regex/index.js | 10 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 87 + node_modules/ansi-regex/readme.md | 78 + node_modules/ansi-styles/index.js | 165 + node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 89 + node_modules/ansi-styles/readme.md | 147 + node_modules/argparse/CHANGELOG.md | 185 + node_modules/argparse/LICENSE | 21 + node_modules/argparse/README.md | 257 + node_modules/argparse/index.js | 3 + node_modules/argparse/lib/action.js | 146 + node_modules/argparse/lib/action/append.js | 53 + .../argparse/lib/action/append/constant.js | 47 + node_modules/argparse/lib/action/count.js | 40 + node_modules/argparse/lib/action/help.js | 47 + node_modules/argparse/lib/action/store.js | 50 + .../argparse/lib/action/store/constant.js | 43 + .../argparse/lib/action/store/false.js | 27 + .../argparse/lib/action/store/true.js | 26 + .../argparse/lib/action/subparsers.js | 149 + node_modules/argparse/lib/action/version.js | 47 + node_modules/argparse/lib/action_container.js | 482 + node_modules/argparse/lib/argparse.js | 14 + node_modules/argparse/lib/argument/error.js | 50 + .../argparse/lib/argument/exclusive.js | 54 + node_modules/argparse/lib/argument/group.js | 75 + node_modules/argparse/lib/argument_parser.js | 1161 ++ node_modules/argparse/lib/const.js | 21 + .../argparse/lib/help/added_formatters.js | 87 + node_modules/argparse/lib/help/formatter.js | 795 + node_modules/argparse/lib/namespace.js | 76 + node_modules/argparse/lib/utils.js | 57 + node_modules/argparse/package.json | 70 + node_modules/array-includes/.editorconfig | 13 + node_modules/array-includes/.eslintrc | 22 + .../array-includes/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/array-includes/.travis.yml | 12 + node_modules/array-includes/CHANGELOG.md | 101 + node_modules/array-includes/LICENSE | 21 + node_modules/array-includes/README.md | 94 + node_modules/array-includes/auto.js | 3 + node_modules/array-includes/implementation.js | 35 + node_modules/array-includes/index.js | 26 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 395 + .../node_modules/es-abstract/GetIntrinsic.js | 225 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../node_modules/es-abstract/es5.js | 49 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 34 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 139 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ node_modules/array-includes/package.json | 130 + node_modules/array-includes/polyfill.js | 7 + node_modules/array-includes/shim.js | 14 + node_modules/array-includes/test.html | 14606 +++++++++++++ node_modules/array-includes/test/index.js | 17 + node_modules/array-includes/test/shimmed.js | 36 + node_modules/array-includes/test/tests.js | 94 + .../array.prototype.flat/.editorconfig | 20 + node_modules/array.prototype.flat/.eslintrc | 40 + .../array.prototype.flat/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/array.prototype.flat/.nycrc | 13 + node_modules/array.prototype.flat/.travis.yml | 9 + .../array.prototype.flat/CHANGELOG.md | 53 + node_modules/array.prototype.flat/LICENSE | 21 + node_modules/array.prototype.flat/README.md | 72 + node_modules/array.prototype.flat/auto.js | 3 + .../array.prototype.flat/implementation.js | 22 + node_modules/array.prototype.flat/index.js | 19 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 395 + .../node_modules/es-abstract/GetIntrinsic.js | 225 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../node_modules/es-abstract/es5.js | 49 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 34 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 139 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ .../array.prototype.flat/package.json | 137 + node_modules/array.prototype.flat/polyfill.js | 7 + node_modules/array.prototype.flat/shim.js | 14 + .../array.prototype.flat/test/index.js | 17 + .../array.prototype.flat/test/shimmed.js | 36 + .../array.prototype.flat/test/tests.js | 30 + node_modules/astral-regex/index.js | 4 + node_modules/astral-regex/license | 9 + node_modules/astral-regex/package.json | 64 + node_modules/astral-regex/readme.md | 43 + node_modules/balanced-match/.npmignore | 5 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 91 + node_modules/balanced-match/index.js | 59 + node_modules/balanced-match/package.json | 77 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + node_modules/brace-expansion/package.json | 75 + node_modules/callsites/index.d.ts | 96 + node_modules/callsites/index.js | 13 + node_modules/callsites/license | 9 + node_modules/callsites/package.json | 71 + node_modules/callsites/readme.md | 48 + node_modules/chalk/index.d.ts | 415 + node_modules/chalk/license | 9 + .../chalk/node_modules/ansi-styles/index.d.ts | 345 + .../chalk/node_modules/ansi-styles/index.js | 163 + .../chalk/node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 88 + .../chalk/node_modules/ansi-styles/readme.md | 152 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../chalk/node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 + .../chalk/node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 83 + .../chalk/node_modules/color-convert/route.js | 97 + .../chalk/node_modules/color-name/LICENSE | 8 + .../chalk/node_modules/color-name/README.md | 11 + .../chalk/node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 56 + .../chalk/node_modules/has-flag/index.d.ts | 39 + .../chalk/node_modules/has-flag/index.js | 8 + .../chalk/node_modules/has-flag/license | 9 + .../chalk/node_modules/has-flag/package.json | 78 + .../chalk/node_modules/has-flag/readme.md | 89 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 135 + .../chalk/node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 85 + .../node_modules/supports-color/readme.md | 76 + node_modules/chalk/package.json | 100 + node_modules/chalk/readme.md | 293 + node_modules/chalk/source/index.js | 229 + node_modules/chalk/source/templates.js | 134 + node_modules/chalk/source/util.js | 39 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 868 + node_modules/color-convert/index.js | 78 + node_modules/color-convert/package.json | 81 + node_modules/color-convert/route.js | 97 + node_modules/color-name/.eslintrc.json | 43 + node_modules/color-name/.npmignore | 107 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 + node_modules/color-name/package.json | 53 + node_modules/color-name/test.js | 7 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 88 + node_modules/concat-map/test/map.js | 39 + .../confusing-browser-globals/LICENSE | 21 + .../confusing-browser-globals/README.md | 45 + .../confusing-browser-globals/index.js | 69 + .../confusing-browser-globals/package.json | 55 + node_modules/contains-path/LICENSE | 21 + node_modules/contains-path/README.md | 83 + node_modules/contains-path/index.js | 33 + node_modules/contains-path/package.json | 86 + node_modules/cross-spawn/CHANGELOG.md | 130 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 96 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 91 + node_modules/cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + node_modules/cross-spawn/package.json | 104 + node_modules/debug/LICENSE | 19 + node_modules/debug/README.md | 455 + node_modules/debug/package.json | 102 + node_modules/debug/src/browser.js | 259 + node_modules/debug/src/common.js | 264 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/node.js | 257 + node_modules/deep-is/.npmignore | 1 + node_modules/deep-is/.travis.yml | 6 + node_modules/deep-is/LICENSE | 22 + node_modules/deep-is/README.markdown | 70 + node_modules/deep-is/example/cmp.js | 11 + node_modules/deep-is/index.js | 102 + node_modules/deep-is/package.json | 90 + node_modules/deep-is/test/NaN.js | 16 + node_modules/deep-is/test/cmp.js | 23 + node_modules/deep-is/test/neg-vs-pos-0.js | 15 + node_modules/define-properties/.editorconfig | 13 + node_modules/define-properties/.eslintrc | 12 + node_modules/define-properties/.jscs.json | 175 + node_modules/define-properties/.travis.yml | 233 + node_modules/define-properties/CHANGELOG.md | 44 + node_modules/define-properties/LICENSE | 21 + node_modules/define-properties/README.md | 86 + node_modules/define-properties/index.js | 58 + node_modules/define-properties/package.json | 102 + node_modules/define-properties/test/index.js | 125 + node_modules/doctrine/CHANGELOG.md | 101 + node_modules/doctrine/LICENSE | 177 + .../doctrine/LICENSE.closure-compiler | 202 + node_modules/doctrine/LICENSE.esprima | 19 + node_modules/doctrine/README.md | 165 + node_modules/doctrine/lib/doctrine.js | 898 + node_modules/doctrine/lib/typed.js | 1305 ++ node_modules/doctrine/lib/utility.js | 35 + node_modules/doctrine/package.json | 89 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 73 + node_modules/emoji-regex/es2015/index.js | 6 + node_modules/emoji-regex/es2015/text.js | 6 + node_modules/emoji-regex/index.d.ts | 5 + node_modules/emoji-regex/index.js | 6 + node_modules/emoji-regex/package.json | 78 + node_modules/emoji-regex/text.js | 6 + node_modules/enquirer/CHANGELOG.md | 135 + node_modules/enquirer/LICENSE | 21 + node_modules/enquirer/README.md | 1752 ++ node_modules/enquirer/index.d.ts | 151 + node_modules/enquirer/index.js | 250 + node_modules/enquirer/lib/ansi.js | 116 + node_modules/enquirer/lib/combos.js | 75 + node_modules/enquirer/lib/completer.js | 52 + node_modules/enquirer/lib/interpolate.js | 266 + node_modules/enquirer/lib/keypress.js | 243 + node_modules/enquirer/lib/placeholder.js | 63 + node_modules/enquirer/lib/prompt.js | 485 + .../enquirer/lib/prompts/autocomplete.js | 113 + .../enquirer/lib/prompts/basicauth.js | 41 + node_modules/enquirer/lib/prompts/confirm.js | 13 + node_modules/enquirer/lib/prompts/editable.js | 136 + node_modules/enquirer/lib/prompts/form.js | 196 + node_modules/enquirer/lib/prompts/index.js | 28 + node_modules/enquirer/lib/prompts/input.js | 55 + .../enquirer/lib/prompts/invisible.js | 11 + node_modules/enquirer/lib/prompts/list.js | 36 + .../enquirer/lib/prompts/multiselect.js | 11 + node_modules/enquirer/lib/prompts/numeral.js | 1 + node_modules/enquirer/lib/prompts/password.js | 18 + node_modules/enquirer/lib/prompts/quiz.js | 37 + node_modules/enquirer/lib/prompts/scale.js | 237 + node_modules/enquirer/lib/prompts/select.js | 139 + node_modules/enquirer/lib/prompts/snippet.js | 185 + node_modules/enquirer/lib/prompts/sort.js | 37 + node_modules/enquirer/lib/prompts/survey.js | 163 + node_modules/enquirer/lib/prompts/text.js | 1 + node_modules/enquirer/lib/prompts/toggle.js | 109 + node_modules/enquirer/lib/render.js | 33 + node_modules/enquirer/lib/roles.js | 46 + node_modules/enquirer/lib/state.js | 69 + node_modules/enquirer/lib/styles.js | 144 + node_modules/enquirer/lib/symbols.js | 66 + node_modules/enquirer/lib/theme.js | 11 + node_modules/enquirer/lib/timer.js | 38 + node_modules/enquirer/lib/types/array.js | 658 + node_modules/enquirer/lib/types/auth.js | 29 + node_modules/enquirer/lib/types/boolean.js | 88 + node_modules/enquirer/lib/types/index.js | 7 + node_modules/enquirer/lib/types/number.js | 86 + node_modules/enquirer/lib/types/string.js | 185 + node_modules/enquirer/lib/utils.js | 268 + node_modules/enquirer/package.json | 148 + node_modules/error-ex/LICENSE | 21 + node_modules/error-ex/README.md | 144 + node_modules/error-ex/index.js | 141 + node_modules/error-ex/package.json | 86 + node_modules/es-abstract/.editorconfig | 13 + node_modules/es-abstract/.eslintignore | 1 + node_modules/es-abstract/.eslintrc | 72 + node_modules/es-abstract/.gitattributes | 612 + node_modules/es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + node_modules/es-abstract/.nycrc | 14 + node_modules/es-abstract/.travis.yml | 38 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + node_modules/es-abstract/2015/DateFromTime.js | 54 + node_modules/es-abstract/2015/Day.js | 11 + node_modules/es-abstract/2015/DayFromYear.js | 10 + .../es-abstract/2015/DayWithinYear.js | 11 + node_modules/es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2015/Get.js | 30 + node_modules/es-abstract/2015/GetIterator.js | 35 + node_modules/es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + node_modules/es-abstract/2015/HasProperty.js | 20 + node_modules/es-abstract/2015/HourFromTime.js | 14 + node_modules/es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2015/IsArray.js | 14 + node_modules/es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + node_modules/es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2015/IsInteger.js | 17 + node_modules/es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + node_modules/es-abstract/2015/IteratorNext.js | 18 + node_modules/es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + node_modules/es-abstract/2015/MakeDate.js | 13 + node_modules/es-abstract/2015/MakeDay.js | 33 + node_modules/es-abstract/2015/MakeTime.js | 23 + node_modules/es-abstract/2015/MinFromTime.js | 14 + .../es-abstract/2015/MonthFromTime.js | 47 + node_modules/es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryCreateFromConstructor.js | 20 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/QuoteJSONString.js | 52 + node_modules/es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + node_modules/es-abstract/2015/SecFromTime.js | 14 + node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2015/TimeClip.js | 21 + node_modules/es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 12 + node_modules/es-abstract/2015/ToBoolean.js | 5 + node_modules/es-abstract/2015/ToDateString.js | 22 + node_modules/es-abstract/2015/ToInt16.js | 10 + node_modules/es-abstract/2015/ToInt32.js | 9 + node_modules/es-abstract/2015/ToInt8.js | 10 + node_modules/es-abstract/2015/ToInteger.js | 12 + node_modules/es-abstract/2015/ToLength.js | 12 + node_modules/es-abstract/2015/ToNumber.js | 59 + node_modules/es-abstract/2015/ToObject.js | 14 + node_modules/es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + node_modules/es-abstract/2015/ToString.js | 15 + node_modules/es-abstract/2015/ToUint16.js | 19 + node_modules/es-abstract/2015/ToUint32.js | 9 + node_modules/es-abstract/2015/ToUint8.js | 20 + node_modules/es-abstract/2015/ToUint8Clamp.js | 19 + node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2015/WeekDay.js | 10 + node_modules/es-abstract/2015/YearFromTime.js | 16 + node_modules/es-abstract/2015/abs.js | 11 + node_modules/es-abstract/2015/floor.js | 11 + node_modules/es-abstract/2015/modulo.js | 9 + node_modules/es-abstract/2015/msFromTime.js | 11 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + node_modules/es-abstract/2016/DateFromTime.js | 54 + node_modules/es-abstract/2016/Day.js | 11 + node_modules/es-abstract/2016/DayFromYear.js | 10 + .../es-abstract/2016/DayWithinYear.js | 11 + node_modules/es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2016/Get.js | 30 + node_modules/es-abstract/2016/GetIterator.js | 35 + node_modules/es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + node_modules/es-abstract/2016/HasProperty.js | 20 + node_modules/es-abstract/2016/HourFromTime.js | 14 + node_modules/es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2016/IsArray.js | 14 + node_modules/es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + node_modules/es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2016/IsInteger.js | 17 + node_modules/es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + node_modules/es-abstract/2016/IteratorNext.js | 18 + node_modules/es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + node_modules/es-abstract/2016/MakeDate.js | 13 + node_modules/es-abstract/2016/MakeDay.js | 33 + node_modules/es-abstract/2016/MakeTime.js | 23 + node_modules/es-abstract/2016/MinFromTime.js | 14 + .../es-abstract/2016/MonthFromTime.js | 47 + node_modules/es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryCreateFromConstructor.js | 20 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/QuoteJSONString.js | 52 + node_modules/es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + node_modules/es-abstract/2016/SecFromTime.js | 14 + node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2016/TimeClip.js | 21 + node_modules/es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 12 + node_modules/es-abstract/2016/ToBoolean.js | 5 + node_modules/es-abstract/2016/ToDateString.js | 22 + node_modules/es-abstract/2016/ToInt16.js | 10 + node_modules/es-abstract/2016/ToInt32.js | 9 + node_modules/es-abstract/2016/ToInt8.js | 10 + node_modules/es-abstract/2016/ToInteger.js | 12 + node_modules/es-abstract/2016/ToLength.js | 12 + node_modules/es-abstract/2016/ToNumber.js | 59 + node_modules/es-abstract/2016/ToObject.js | 14 + node_modules/es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + node_modules/es-abstract/2016/ToString.js | 15 + node_modules/es-abstract/2016/ToUint16.js | 19 + node_modules/es-abstract/2016/ToUint32.js | 9 + node_modules/es-abstract/2016/ToUint8.js | 20 + node_modules/es-abstract/2016/ToUint8Clamp.js | 19 + node_modules/es-abstract/2016/Type.js | 12 + .../es-abstract/2016/UTF16Encoding.js | 23 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2016/WeekDay.js | 10 + node_modules/es-abstract/2016/YearFromTime.js | 16 + node_modules/es-abstract/2016/abs.js | 11 + node_modules/es-abstract/2016/floor.js | 11 + node_modules/es-abstract/2016/modulo.js | 9 + node_modules/es-abstract/2016/msFromTime.js | 11 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + node_modules/es-abstract/2017/DateFromTime.js | 54 + node_modules/es-abstract/2017/Day.js | 11 + node_modules/es-abstract/2017/DayFromYear.js | 10 + .../es-abstract/2017/DayWithinYear.js | 11 + node_modules/es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2017/Get.js | 30 + node_modules/es-abstract/2017/GetIterator.js | 35 + node_modules/es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + node_modules/es-abstract/2017/HasProperty.js | 20 + node_modules/es-abstract/2017/HourFromTime.js | 14 + node_modules/es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2017/IsArray.js | 14 + node_modules/es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + node_modules/es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2017/IsInteger.js | 17 + node_modules/es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + node_modules/es-abstract/2017/IteratorNext.js | 18 + node_modules/es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + node_modules/es-abstract/2017/MakeDate.js | 13 + node_modules/es-abstract/2017/MakeDay.js | 33 + node_modules/es-abstract/2017/MakeTime.js | 23 + node_modules/es-abstract/2017/MinFromTime.js | 14 + .../es-abstract/2017/MonthFromTime.js | 47 + node_modules/es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryCreateFromConstructor.js | 20 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/QuoteJSONString.js | 52 + node_modules/es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + node_modules/es-abstract/2017/SecFromTime.js | 14 + node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../es-abstract/2017/StringGetOwnProperty.js | 48 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2017/TimeClip.js | 21 + node_modules/es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 12 + node_modules/es-abstract/2017/ToBoolean.js | 5 + node_modules/es-abstract/2017/ToDateString.js | 22 + node_modules/es-abstract/2017/ToIndex.js | 26 + node_modules/es-abstract/2017/ToInt16.js | 10 + node_modules/es-abstract/2017/ToInt32.js | 9 + node_modules/es-abstract/2017/ToInt8.js | 10 + node_modules/es-abstract/2017/ToInteger.js | 12 + node_modules/es-abstract/2017/ToLength.js | 12 + node_modules/es-abstract/2017/ToNumber.js | 59 + node_modules/es-abstract/2017/ToObject.js | 14 + node_modules/es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + node_modules/es-abstract/2017/ToString.js | 15 + node_modules/es-abstract/2017/ToUint16.js | 19 + node_modules/es-abstract/2017/ToUint32.js | 9 + node_modules/es-abstract/2017/ToUint8.js | 20 + node_modules/es-abstract/2017/ToUint8Clamp.js | 19 + node_modules/es-abstract/2017/Type.js | 12 + .../es-abstract/2017/UTF16Encoding.js | 23 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2017/WeekDay.js | 10 + node_modules/es-abstract/2017/YearFromTime.js | 16 + node_modules/es-abstract/2017/abs.js | 11 + node_modules/es-abstract/2017/floor.js | 11 + node_modules/es-abstract/2017/modulo.js | 9 + node_modules/es-abstract/2017/msFromTime.js | 11 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + node_modules/es-abstract/2018/DateFromTime.js | 54 + node_modules/es-abstract/2018/DateString.js | 30 + node_modules/es-abstract/2018/Day.js | 11 + node_modules/es-abstract/2018/DayFromYear.js | 10 + .../es-abstract/2018/DayWithinYear.js | 11 + node_modules/es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2018/Get.js | 30 + node_modules/es-abstract/2018/GetIterator.js | 35 + node_modules/es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + node_modules/es-abstract/2018/HasProperty.js | 20 + node_modules/es-abstract/2018/HourFromTime.js | 14 + node_modules/es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2018/IsArray.js | 14 + node_modules/es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + node_modules/es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2018/IsInteger.js | 17 + node_modules/es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + node_modules/es-abstract/2018/IteratorNext.js | 18 + node_modules/es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + node_modules/es-abstract/2018/MakeDate.js | 13 + node_modules/es-abstract/2018/MakeDay.js | 33 + node_modules/es-abstract/2018/MakeTime.js | 23 + node_modules/es-abstract/2018/MinFromTime.js | 14 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + node_modules/es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryCreateFromConstructor.js | 20 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/QuoteJSONString.js | 48 + node_modules/es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + node_modules/es-abstract/2018/SecFromTime.js | 14 + node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionLength.js | 31 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../es-abstract/2018/StringGetOwnProperty.js | 48 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2018/TimeClip.js | 21 + node_modules/es-abstract/2018/TimeFromYear.js | 11 + node_modules/es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 12 + node_modules/es-abstract/2018/ToBoolean.js | 5 + node_modules/es-abstract/2018/ToDateString.js | 22 + node_modules/es-abstract/2018/ToIndex.js | 26 + node_modules/es-abstract/2018/ToInt16.js | 10 + node_modules/es-abstract/2018/ToInt32.js | 9 + node_modules/es-abstract/2018/ToInt8.js | 10 + node_modules/es-abstract/2018/ToInteger.js | 12 + node_modules/es-abstract/2018/ToLength.js | 12 + node_modules/es-abstract/2018/ToNumber.js | 59 + node_modules/es-abstract/2018/ToObject.js | 14 + node_modules/es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + node_modules/es-abstract/2018/ToString.js | 15 + node_modules/es-abstract/2018/ToUint16.js | 19 + node_modules/es-abstract/2018/ToUint32.js | 9 + node_modules/es-abstract/2018/ToUint8.js | 20 + node_modules/es-abstract/2018/ToUint8Clamp.js | 19 + node_modules/es-abstract/2018/Type.js | 12 + .../es-abstract/2018/UTF16Encoding.js | 23 + .../es-abstract/2018/UnicodeEscape.js | 26 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2018/WeekDay.js | 10 + node_modules/es-abstract/2018/YearFromTime.js | 16 + node_modules/es-abstract/2018/abs.js | 11 + node_modules/es-abstract/2018/floor.js | 11 + node_modules/es-abstract/2018/modulo.js | 9 + node_modules/es-abstract/2018/msFromTime.js | 11 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 47 + node_modules/es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + node_modules/es-abstract/2019/DateFromTime.js | 54 + node_modules/es-abstract/2019/DateString.js | 30 + node_modules/es-abstract/2019/Day.js | 11 + node_modules/es-abstract/2019/DayFromYear.js | 10 + .../es-abstract/2019/DayWithinYear.js | 11 + node_modules/es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2019/Get.js | 30 + node_modules/es-abstract/2019/GetIterator.js | 35 + node_modules/es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + node_modules/es-abstract/2019/HasProperty.js | 20 + node_modules/es-abstract/2019/HourFromTime.js | 14 + node_modules/es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2019/IsArray.js | 14 + node_modules/es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + node_modules/es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2019/IsInteger.js | 17 + node_modules/es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + node_modules/es-abstract/2019/IteratorNext.js | 18 + node_modules/es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + node_modules/es-abstract/2019/MakeDate.js | 13 + node_modules/es-abstract/2019/MakeDay.js | 33 + node_modules/es-abstract/2019/MakeTime.js | 23 + node_modules/es-abstract/2019/MinFromTime.js | 14 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + node_modules/es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryCreateFromConstructor.js | 20 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/QuoteJSONString.js | 55 + node_modules/es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + node_modules/es-abstract/2019/SecFromTime.js | 14 + node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionLength.js | 31 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../es-abstract/2019/StringGetOwnProperty.js | 48 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2019/TimeClip.js | 21 + node_modules/es-abstract/2019/TimeFromYear.js | 11 + node_modules/es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 12 + node_modules/es-abstract/2019/ToBoolean.js | 5 + node_modules/es-abstract/2019/ToDateString.js | 22 + node_modules/es-abstract/2019/ToIndex.js | 26 + node_modules/es-abstract/2019/ToInt16.js | 10 + node_modules/es-abstract/2019/ToInt32.js | 9 + node_modules/es-abstract/2019/ToInt8.js | 10 + node_modules/es-abstract/2019/ToInteger.js | 12 + node_modules/es-abstract/2019/ToLength.js | 12 + node_modules/es-abstract/2019/ToNumber.js | 59 + node_modules/es-abstract/2019/ToObject.js | 14 + node_modules/es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + node_modules/es-abstract/2019/ToString.js | 15 + node_modules/es-abstract/2019/ToUint16.js | 19 + node_modules/es-abstract/2019/ToUint32.js | 9 + node_modules/es-abstract/2019/ToUint8.js | 20 + node_modules/es-abstract/2019/ToUint8Clamp.js | 19 + node_modules/es-abstract/2019/TrimString.js | 29 + node_modules/es-abstract/2019/Type.js | 12 + .../es-abstract/2019/UTF16Encoding.js | 23 + .../es-abstract/2019/UnicodeEscape.js | 26 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2019/WeekDay.js | 10 + node_modules/es-abstract/2019/YearFromTime.js | 16 + node_modules/es-abstract/2019/abs.js | 11 + node_modules/es-abstract/2019/floor.js | 11 + node_modules/es-abstract/2019/modulo.js | 9 + node_modules/es-abstract/2019/msFromTime.js | 11 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../2020/AbstractEqualityComparison.js | 37 + .../2020/AbstractRelationalComparison.js | 66 + .../2020/AddEntriesFromIterable.js | 52 + .../es-abstract/2020/AdvanceStringIndex.js | 34 + node_modules/es-abstract/2020/ArrayCreate.js | 53 + .../es-abstract/2020/ArraySetLength.js | 85 + .../es-abstract/2020/ArraySpeciesCreate.js | 46 + .../es-abstract/2020/BigIntBitwiseOp.js | 66 + node_modules/es-abstract/2020/BinaryAnd.js | 14 + node_modules/es-abstract/2020/BinaryOr.js | 14 + node_modules/es-abstract/2020/BinaryXor.js | 14 + node_modules/es-abstract/2020/Call.js | 13 + .../2020/CanonicalNumericIndexString.js | 22 + node_modules/es-abstract/2020/CodePointAt.js | 58 + .../2020/CompletePropertyDescriptor.js | 39 + .../es-abstract/2020/CopyDataProperties.js | 68 + .../es-abstract/2020/CreateDataProperty.js | 45 + .../2020/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2020/CreateHTML.js | 30 + .../2020/CreateIterResultObject.js | 19 + .../2020/CreateListFromArrayLike.js | 44 + .../es-abstract/2020/CreateMethodProperty.js | 40 + node_modules/es-abstract/2020/DateFromTime.js | 54 + node_modules/es-abstract/2020/DateString.js | 30 + node_modules/es-abstract/2020/Day.js | 11 + node_modules/es-abstract/2020/DayFromYear.js | 10 + .../es-abstract/2020/DayWithinYear.js | 11 + node_modules/es-abstract/2020/DaysInYear.js | 18 + .../es-abstract/2020/DefinePropertyOrThrow.js | 50 + .../es-abstract/2020/DeletePropertyOrThrow.js | 27 + .../2020/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2020/FlattenIntoArray.js | 58 + .../2020/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2020/Get.js | 30 + node_modules/es-abstract/2020/GetIterator.js | 35 + node_modules/es-abstract/2020/GetMethod.js | 42 + .../es-abstract/2020/GetOwnPropertyKeys.js | 31 + .../2020/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2020/GetSubstitution.js | 128 + node_modules/es-abstract/2020/GetV.js | 29 + .../es-abstract/2020/HasOwnProperty.js | 22 + node_modules/es-abstract/2020/HasProperty.js | 20 + node_modules/es-abstract/2020/HourFromTime.js | 14 + node_modules/es-abstract/2020/InLeapYear.js | 21 + .../es-abstract/2020/InstanceofOperator.js | 30 + node_modules/es-abstract/2020/Invoke.js | 22 + .../es-abstract/2020/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2020/IsArray.js | 14 + .../es-abstract/2020/IsBigIntElementType.js | 7 + node_modules/es-abstract/2020/IsCallable.js | 5 + .../es-abstract/2020/IsConcatSpreadable.js | 25 + .../es-abstract/2020/IsConstructor.js | 40 + .../es-abstract/2020/IsDataDescriptor.js | 23 + node_modules/es-abstract/2020/IsExtensible.js | 20 + .../es-abstract/2020/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2020/IsInteger.js | 17 + .../es-abstract/2020/IsNoTearConfiguration.js | 16 + .../es-abstract/2020/IsNonNegativeInteger.js | 9 + node_modules/es-abstract/2020/IsPromise.js | 24 + .../es-abstract/2020/IsPropertyKey.js | 7 + node_modules/es-abstract/2020/IsRegExp.js | 24 + .../es-abstract/2020/IsStringPrefix.js | 47 + .../2020/IsUnclampedIntegerElementType.js | 12 + .../es-abstract/2020/IsUnsignedElementType.js | 11 + .../es-abstract/2020/IterableToList.js | 24 + .../es-abstract/2020/IteratorClose.js | 50 + .../es-abstract/2020/IteratorComplete.js | 18 + node_modules/es-abstract/2020/IteratorNext.js | 18 + node_modules/es-abstract/2020/IteratorStep.js | 13 + .../es-abstract/2020/IteratorValue.js | 18 + .../es-abstract/2020/LengthOfArrayLike.js | 20 + node_modules/es-abstract/2020/MakeDate.js | 13 + node_modules/es-abstract/2020/MakeDay.js | 33 + node_modules/es-abstract/2020/MakeTime.js | 23 + node_modules/es-abstract/2020/MinFromTime.js | 14 + .../es-abstract/2020/MonthFromTime.js | 47 + .../es-abstract/2020/NumberBitwiseOp.js | 25 + .../2020/OrdinaryCreateFromConstructor.js | 20 + .../2020/OrdinaryDefineOwnProperty.js | 61 + .../2020/OrdinaryGetOwnProperty.js | 44 + .../2020/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2020/OrdinaryHasInstance.js | 25 + .../es-abstract/2020/OrdinaryHasProperty.js | 20 + .../es-abstract/2020/OrdinaryObjectCreate.js | 46 + .../2020/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2020/PromiseResolve.js | 15 + .../es-abstract/2020/QuoteJSONString.js | 55 + node_modules/es-abstract/2020/RegExpExec.js | 32 + .../2020/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2020/SameValue.js | 13 + .../es-abstract/2020/SameValueNonNumeric.js | 21 + .../es-abstract/2020/SameValueZero.js | 9 + node_modules/es-abstract/2020/SecFromTime.js | 14 + node_modules/es-abstract/2020/Set.js | 47 + .../es-abstract/2020/SetFunctionLength.js | 31 + .../es-abstract/2020/SetFunctionName.js | 44 + .../es-abstract/2020/SetIntegrityLevel.js | 57 + .../es-abstract/2020/SpeciesConstructor.js | 32 + .../2020/StrictEqualityComparison.js | 17 + .../es-abstract/2020/StringGetOwnProperty.js | 48 + node_modules/es-abstract/2020/StringPad.js | 43 + .../2020/SymbolDescriptiveString.js | 20 + .../es-abstract/2020/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2020/TimeClip.js | 21 + node_modules/es-abstract/2020/TimeFromYear.js | 11 + node_modules/es-abstract/2020/TimeString.js | 25 + .../es-abstract/2020/TimeWithinDay.js | 12 + node_modules/es-abstract/2020/ToBoolean.js | 5 + node_modules/es-abstract/2020/ToDateString.js | 22 + node_modules/es-abstract/2020/ToIndex.js | 26 + node_modules/es-abstract/2020/ToInt16.js | 10 + node_modules/es-abstract/2020/ToInt32.js | 9 + node_modules/es-abstract/2020/ToInt8.js | 10 + node_modules/es-abstract/2020/ToInteger.js | 15 + node_modules/es-abstract/2020/ToLength.js | 12 + node_modules/es-abstract/2020/ToNumber.js | 59 + node_modules/es-abstract/2020/ToNumeric.js | 21 + node_modules/es-abstract/2020/ToObject.js | 14 + node_modules/es-abstract/2020/ToPrimitive.js | 12 + .../es-abstract/2020/ToPropertyDescriptor.js | 52 + .../es-abstract/2020/ToPropertyKey.js | 15 + node_modules/es-abstract/2020/ToString.js | 15 + node_modules/es-abstract/2020/ToUint16.js | 19 + node_modules/es-abstract/2020/ToUint32.js | 9 + node_modules/es-abstract/2020/ToUint8.js | 20 + node_modules/es-abstract/2020/ToUint8Clamp.js | 19 + node_modules/es-abstract/2020/TrimString.js | 29 + node_modules/es-abstract/2020/Type.js | 15 + .../es-abstract/2020/UTF16DecodeString.js | 29 + .../2020/UTF16DecodeSurrogatePair.js | 19 + .../es-abstract/2020/UTF16Encoding.js | 23 + .../es-abstract/2020/UnicodeEscape.js | 27 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2020/WeekDay.js | 10 + node_modules/es-abstract/2020/YearFromTime.js | 16 + node_modules/es-abstract/2020/abs.js | 11 + node_modules/es-abstract/2020/floor.js | 11 + node_modules/es-abstract/2020/modulo.js | 9 + node_modules/es-abstract/2020/msFromTime.js | 11 + .../es-abstract/2020/thisBigIntValue.js | 22 + .../es-abstract/2020/thisBooleanValue.js | 15 + .../es-abstract/2020/thisNumberValue.js | 18 + .../es-abstract/2020/thisStringValue.js | 15 + .../es-abstract/2020/thisSymbolValue.js | 19 + .../es-abstract/2020/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + node_modules/es-abstract/5/DateFromTime.js | 54 + node_modules/es-abstract/5/Day.js | 11 + node_modules/es-abstract/5/DayFromYear.js | 10 + node_modules/es-abstract/5/DayWithinYear.js | 11 + node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + node_modules/es-abstract/5/HourFromTime.js | 14 + node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + node_modules/es-abstract/5/MakeDate.js | 13 + node_modules/es-abstract/5/MakeDay.js | 33 + node_modules/es-abstract/5/MakeTime.js | 23 + node_modules/es-abstract/5/MinFromTime.js | 14 + node_modules/es-abstract/5/MonthFromTime.js | 47 + node_modules/es-abstract/5/SameValue.js | 13 + node_modules/es-abstract/5/SecFromTime.js | 14 + .../es-abstract/5/StrictEqualityComparison.js | 17 + node_modules/es-abstract/5/TimeClip.js | 21 + node_modules/es-abstract/5/TimeFromYear.js | 11 + node_modules/es-abstract/5/TimeWithinDay.js | 12 + node_modules/es-abstract/5/ToBoolean.js | 5 + node_modules/es-abstract/5/ToInt32.js | 9 + node_modules/es-abstract/5/ToInteger.js | 18 + node_modules/es-abstract/5/ToNumber.js | 7 + node_modules/es-abstract/5/ToObject.js | 14 + node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + node_modules/es-abstract/5/ToString.js | 12 + node_modules/es-abstract/5/ToUint16.js | 19 + node_modules/es-abstract/5/ToUint32.js | 9 + node_modules/es-abstract/5/Type.js | 24 + node_modules/es-abstract/5/WeekDay.js | 10 + node_modules/es-abstract/5/YearFromTime.js | 16 + node_modules/es-abstract/5/abs.js | 11 + node_modules/es-abstract/5/floor.js | 11 + node_modules/es-abstract/5/modulo.js | 9 + node_modules/es-abstract/5/msFromTime.js | 11 + node_modules/es-abstract/CHANGELOG.md | 387 + node_modules/es-abstract/GetIntrinsic.js | 289 + node_modules/es-abstract/LICENSE | 21 + node_modules/es-abstract/README.md | 48 + node_modules/es-abstract/es2015.js | 119 + node_modules/es-abstract/es2016.js | 124 + node_modules/es-abstract/es2017.js | 126 + node_modules/es-abstract/es2018.js | 134 + node_modules/es-abstract/es2019.js | 137 + node_modules/es-abstract/es2020.js | 153 + node_modules/es-abstract/es5.js | 51 + node_modules/es-abstract/es6.js | 3 + node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + node_modules/es-abstract/helpers/assign.js | 22 + node_modules/es-abstract/helpers/callBind.js | 34 + node_modules/es-abstract/helpers/callBound.js | 15 + node_modules/es-abstract/helpers/every.js | 10 + node_modules/es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + node_modules/es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + node_modules/es-abstract/helpers/isFinite.js | 5 + .../es-abstract/helpers/isLeadingSurrogate.js | 5 + node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../helpers/isTrailingSurrogate.js | 5 + .../es-abstract/helpers/maxSafeInteger.js | 8 + node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + node_modules/es-abstract/helpers/setProto.js | 16 + node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + node_modules/es-abstract/index.js | 28 + node_modules/es-abstract/operations/.eslintrc | 5 + node_modules/es-abstract/operations/2015.js | 249 + node_modules/es-abstract/operations/2016.js | 276 + node_modules/es-abstract/operations/2017.js | 324 + node_modules/es-abstract/operations/2018.js | 350 + node_modules/es-abstract/operations/2019.js | 355 + node_modules/es-abstract/package.json | 145 + node_modules/es-abstract/test/GetIntrinsic.js | 207 + node_modules/es-abstract/test/diffOps.js | 27 + node_modules/es-abstract/test/es2015.js | 146 + node_modules/es-abstract/test/es2016.js | 168 + node_modules/es-abstract/test/es2017.js | 214 + node_modules/es-abstract/test/es2018.js | 233 + node_modules/es-abstract/test/es2019.js | 238 + node_modules/es-abstract/test/es2020.js | 267 + node_modules/es-abstract/test/es5.js | 786 + node_modules/es-abstract/test/es6.js | 18 + node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 27 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 127 + node_modules/es-abstract/test/index.js | 36 + node_modules/es-abstract/test/ses-compat.js | 8 + node_modules/es-abstract/test/tests.js | 4933 +++++ node_modules/es-to-primitive/.eslintrc | 22 + .../es-to-primitive/.github/FUNDING.yml | 12 + node_modules/es-to-primitive/.travis.yml | 15 + node_modules/es-to-primitive/CHANGELOG.md | 49 + node_modules/es-to-primitive/LICENSE | 22 + node_modules/es-to-primitive/Makefile | 61 + node_modules/es-to-primitive/README.md | 49 + node_modules/es-to-primitive/es2015.js | 75 + node_modules/es-to-primitive/es5.js | 45 + node_modules/es-to-primitive/es6.js | 3 + .../es-to-primitive/helpers/isPrimitive.js | 5 + node_modules/es-to-primitive/index.js | 17 + node_modules/es-to-primitive/package.json | 119 + node_modules/es-to-primitive/test/es2015.js | 151 + node_modules/es-to-primitive/test/es5.js | 118 + node_modules/es-to-primitive/test/es6.js | 151 + node_modules/es-to-primitive/test/index.js | 20 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 81 + node_modules/escape-string-regexp/readme.md | 27 + .../eslint-config-airbnb-base/.babelrc | 3 + .../eslint-config-airbnb-base/.eslintrc | 8 + .../eslint-config-airbnb-base/CHANGELOG.md | 347 + .../eslint-config-airbnb-base/LICENSE.md | 21 + .../eslint-config-airbnb-base/README.md | 99 + .../eslint-config-airbnb-base/index.js | 17 + .../eslint-config-airbnb-base/legacy.js | 34 + .../eslint-config-airbnb-base/package.json | 108 + .../rules/best-practices.js | 361 + .../eslint-config-airbnb-base/rules/errors.js | 165 + .../eslint-config-airbnb-base/rules/es6.js | 186 + .../rules/imports.js | 262 + .../eslint-config-airbnb-base/rules/node.js | 43 + .../eslint-config-airbnb-base/rules/strict.js | 6 + .../eslint-config-airbnb-base/rules/style.js | 528 + .../rules/variables.js | 44 + .../eslint-config-airbnb-base/test/.eslintrc | 8 + .../test/requires.js | 13 + .../test/test-base.js | 32 + .../eslint-config-airbnb-base/whitespace.js | 91 + .../eslint-import-resolver-node/CHANGELOG.md | 63 + .../eslint-import-resolver-node/LICENSE | 22 + .../eslint-import-resolver-node/README.md | 44 + .../eslint-import-resolver-node/index.js | 47 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + .../eslint-import-resolver-node/package.json | 75 + .../eslint-module-utils/.eslintrc.yml | 3 + node_modules/eslint-module-utils/CHANGELOG.md | 103 + node_modules/eslint-module-utils/LICENSE | 22 + .../eslint-module-utils/ModuleCache.js | 47 + .../eslint-module-utils/declaredScope.js | 14 + node_modules/eslint-module-utils/hash.js | 59 + node_modules/eslint-module-utils/ignore.js | 60 + .../eslint-module-utils/module-require.js | 30 + .../eslint-module-utils/moduleVisitor.js | 141 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + node_modules/eslint-module-utils/package.json | 60 + node_modules/eslint-module-utils/parse.js | 82 + node_modules/eslint-module-utils/resolve.js | 241 + .../eslint-module-utils/unambiguous.js | 30 + .../eslint-plugin-import/CHANGELOG.md | 1278 ++ .../eslint-plugin-import/CONTRIBUTING.md | 116 + node_modules/eslint-plugin-import/LICENSE | 22 + node_modules/eslint-plugin-import/README.md | 505 + node_modules/eslint-plugin-import/RELEASE.md | 54 + node_modules/eslint-plugin-import/SECURITY.md | 11 + .../eslint-plugin-import/config/electron.js | 8 + .../eslint-plugin-import/config/errors.js | 14 + .../config/react-native.js | 13 + .../eslint-plugin-import/config/react.js | 18 + .../config/recommended.js | 28 + .../eslint-plugin-import/config/stage-0.js | 12 + .../eslint-plugin-import/config/typescript.js | 28 + .../eslint-plugin-import/config/warnings.js | 12 + .../docs/rules/default.md | 71 + .../docs/rules/dynamic-import-chunkname.md | 85 + .../eslint-plugin-import/docs/rules/export.md | 32 + .../docs/rules/exports-last.md | 50 + .../docs/rules/extensions.md | 167 + .../eslint-plugin-import/docs/rules/first.md | 70 + .../docs/rules/group-exports.md | 117 + .../docs/rules/imports-first.md | 3 + .../docs/rules/max-dependencies.md | 44 + .../eslint-plugin-import/docs/rules/named.md | 98 + .../docs/rules/namespace.md | 99 + .../docs/rules/newline-after-import.md | 87 + .../docs/rules/no-absolute-path.md | 48 + .../eslint-plugin-import/docs/rules/no-amd.md | 35 + .../docs/rules/no-anonymous-default-export.md | 73 + .../docs/rules/no-commonjs.md | 95 + .../docs/rules/no-cycle.md | 92 + .../docs/rules/no-default-export.md | 63 + .../docs/rules/no-deprecated.md | 61 + .../docs/rules/no-duplicates.md | 69 + .../docs/rules/no-dynamic-require.md | 23 + .../docs/rules/no-extraneous-dependencies.md | 124 + .../docs/rules/no-internal-modules.md | 70 + .../docs/rules/no-mutable-exports.md | 52 + .../docs/rules/no-named-as-default-member.md | 47 + .../docs/rules/no-named-as-default.md | 46 + .../docs/rules/no-named-default.md | 27 + .../docs/rules/no-named-export.md | 77 + .../docs/rules/no-namespace.md | 30 + .../docs/rules/no-nodejs-modules.md | 40 + .../docs/rules/no-relative-parent-imports.md | 120 + .../docs/rules/no-restricted-paths.md | 80 + .../docs/rules/no-self-import.md | 30 + .../docs/rules/no-unassigned-import.md | 59 + .../docs/rules/no-unresolved.md | 91 + .../docs/rules/no-unused-modules.md | 107 + .../docs/rules/no-useless-path-segments.md | 79 + .../docs/rules/no-webpack-loader-syntax.md | 36 + .../eslint-plugin-import/docs/rules/order.md | 264 + .../docs/rules/prefer-default-export.md | 58 + .../docs/rules/unambiguous.md | 54 + .../eslint-plugin-import/lib/ExportMap.js | 735 + .../lib/core/importType.js | 102 + .../lib/core/staticRequire.js | 11 + .../eslint-plugin-import/lib/docsUrl.js | 8 + .../lib/importDeclaration.js | 5 + .../eslint-plugin-import/lib/index.js | 67 + .../eslint-plugin-import/lib/rules/default.js | 40 + .../lib/rules/dynamic-import-chunkname.js | 119 + .../eslint-plugin-import/lib/rules/export.js | 170 + .../lib/rules/exports-last.js | 41 + .../lib/rules/extensions.js | 189 + .../eslint-plugin-import/lib/rules/first.js | 132 + .../lib/rules/group-exports.js | 153 + .../lib/rules/imports-first.js | 13 + .../lib/rules/max-dependencies.js | 58 + .../eslint-plugin-import/lib/rules/named.js | 72 + .../lib/rules/namespace.js | 217 + .../lib/rules/newline-after-import.js | 179 + .../lib/rules/no-absolute-path.js | 24 + .../eslint-plugin-import/lib/rules/no-amd.js | 46 + .../lib/rules/no-anonymous-default-export.js | 104 + .../lib/rules/no-commonjs.js | 135 + .../lib/rules/no-cycle.js | 105 + .../lib/rules/no-default-export.js | 41 + .../lib/rules/no-deprecated.js | 143 + .../lib/rules/no-duplicates.js | 288 + .../lib/rules/no-dynamic-require.js | 37 + .../lib/rules/no-extraneous-dependencies.js | 207 + .../lib/rules/no-internal-modules.js | 110 + .../lib/rules/no-mutable-exports.js | 57 + .../lib/rules/no-named-as-default-member.js | 107 + .../lib/rules/no-named-as-default.js | 43 + .../lib/rules/no-named-default.js | 25 + .../lib/rules/no-named-export.js | 35 + .../lib/rules/no-namespace.js | 160 + .../lib/rules/no-nodejs-modules.js | 49 + .../lib/rules/no-relative-parent-imports.js | 49 + .../lib/rules/no-restricted-paths.js | 125 + .../lib/rules/no-self-import.js | 45 + .../lib/rules/no-unassigned-import.js | 76 + .../lib/rules/no-unresolved.js | 49 + .../lib/rules/no-unused-modules.js | 907 + .../lib/rules/no-useless-path-segments.js | 145 + .../lib/rules/no-webpack-loader-syntax.js | 33 + .../eslint-plugin-import/lib/rules/order.js | 686 + .../lib/rules/prefer-default-export.js | 96 + .../lib/rules/unambiguous.js | 36 + .../eslint-plugin-import/memo-parser/LICENSE | 22 + .../memo-parser/README.md | 23 + .../eslint-plugin-import/memo-parser/index.js | 41 + .../memo-parser/package.json | 34 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/doctrine/CHANGELOG.md | 70 + .../node_modules/doctrine/LICENSE.BSD | 22 + .../doctrine/LICENSE.closure-compiler | 202 + .../node_modules/doctrine/LICENSE.esprima | 19 + .../node_modules/doctrine/README.md | 174 + .../node_modules/doctrine/lib/doctrine.js | 897 + .../node_modules/doctrine/lib/typed.js | 1283 ++ .../node_modules/doctrine/lib/utility.js | 35 + .../node_modules/doctrine/package.json | 96 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + .../eslint-plugin-import/package.json | 157 + node_modules/eslint-scope/CHANGELOG.md | 70 + node_modules/eslint-scope/LICENSE | 22 + node_modules/eslint-scope/README.md | 54 + node_modules/eslint-scope/lib/definition.js | 86 + node_modules/eslint-scope/lib/index.js | 165 + .../eslint-scope/lib/pattern-visitor.js | 152 + node_modules/eslint-scope/lib/reference.js | 167 + node_modules/eslint-scope/lib/referencer.js | 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 | 76 + node_modules/eslint-utils/LICENSE | 21 + node_modules/eslint-utils/README.md | 38 + node_modules/eslint-utils/index.js | 1880 ++ node_modules/eslint-utils/index.js.map | 1 + node_modules/eslint-utils/index.mjs | 1838 ++ node_modules/eslint-utils/index.mjs.map | 1 + node_modules/eslint-utils/package.json | 92 + node_modules/eslint-visitor-keys/CHANGELOG.md | 25 + node_modules/eslint-visitor-keys/LICENSE | 201 + node_modules/eslint-visitor-keys/README.md | 98 + node_modules/eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 284 + node_modules/eslint-visitor-keys/package.json | 73 + node_modules/eslint/CHANGELOG.md | 6216 ++++++ node_modules/eslint/LICENSE | 19 + node_modules/eslint/README.md | 276 + node_modules/eslint/bin/eslint.js | 146 + node_modules/eslint/conf/category-list.json | 39 + node_modules/eslint/conf/config-schema.js | 93 + .../eslint/conf/default-cli-options.js | 31 + node_modules/eslint/conf/eslint-all.js | 31 + .../eslint/conf/eslint-recommended.js | 72 + node_modules/eslint/conf/replacements.json | 22 + node_modules/eslint/lib/api.js | 34 + .../cascading-config-array-factory.js | 502 + .../eslint/lib/cli-engine/cli-engine.js | 1026 + .../lib/cli-engine/config-array-factory.js | 1092 + .../cli-engine/config-array/config-array.js | 536 + .../config-array/config-dependency.js | 128 + .../config-array/extracted-config.js | 158 + .../cli-engine/config-array/ignore-pattern.js | 249 + .../lib/cli-engine/config-array/index.js | 32 + .../config-array/override-tester.js | 235 + .../eslint/lib/cli-engine/file-enumerator.js | 528 + .../lib/cli-engine/formatters/checkstyle.js | 60 + .../lib/cli-engine/formatters/codeframe.js | 138 + .../lib/cli-engine/formatters/compact.js | 60 + .../formatters/html-template-message.html | 8 + .../formatters/html-template-page.html | 115 + .../formatters/html-template-result.html | 6 + .../eslint/lib/cli-engine/formatters/html.js | 140 + .../lib/cli-engine/formatters/jslint-xml.js | 41 + .../formatters/json-with-metadata.js | 16 + .../eslint/lib/cli-engine/formatters/json.js | 13 + .../eslint/lib/cli-engine/formatters/junit.js | 82 + .../lib/cli-engine/formatters/stylish.js | 101 + .../eslint/lib/cli-engine/formatters/table.js | 159 + .../eslint/lib/cli-engine/formatters/tap.js | 95 + .../eslint/lib/cli-engine/formatters/unix.js | 58 + .../lib/cli-engine/formatters/visualstudio.js | 63 + node_modules/eslint/lib/cli-engine/hash.js | 35 + node_modules/eslint/lib/cli-engine/index.js | 7 + .../lib/cli-engine/lint-result-cache.js | 142 + .../eslint/lib/cli-engine/load-rules.js | 46 + .../eslint/lib/cli-engine/xml-escape.js | 34 + node_modules/eslint/lib/cli.js | 326 + node_modules/eslint/lib/eslint/eslint.js | 662 + node_modules/eslint/lib/eslint/index.js | 7 + node_modules/eslint/lib/init/autoconfig.js | 348 + node_modules/eslint/lib/init/config-file.js | 143 + .../eslint/lib/init/config-initializer.js | 690 + node_modules/eslint/lib/init/config-rule.js | 317 + node_modules/eslint/lib/init/npm-utils.js | 178 + .../eslint/lib/init/source-code-utils.js | 109 + .../lib/linter/apply-disable-directives.js | 167 + .../code-path-analysis/code-path-analyzer.js | 760 + .../code-path-analysis/code-path-segment.js | 236 + .../code-path-analysis/code-path-state.js | 1480 ++ .../linter/code-path-analysis/code-path.js | 238 + .../code-path-analysis/debug-helpers.js | 203 + .../linter/code-path-analysis/fork-context.js | 249 + .../linter/code-path-analysis/id-generator.js | 46 + .../lib/linter/config-comment-parser.js | 141 + node_modules/eslint/lib/linter/index.js | 13 + node_modules/eslint/lib/linter/interpolate.js | 28 + node_modules/eslint/lib/linter/linter.js | 1467 ++ .../eslint/lib/linter/node-event-generator.js | 311 + .../eslint/lib/linter/report-translator.js | 347 + node_modules/eslint/lib/linter/rule-fixer.js | 140 + node_modules/eslint/lib/linter/rules.js | 77 + .../eslint/lib/linter/safe-emitter.js | 52 + .../eslint/lib/linter/source-code-fixer.js | 152 + node_modules/eslint/lib/linter/timing.js | 139 + node_modules/eslint/lib/options.js | 262 + node_modules/eslint/lib/rule-tester/index.js | 5 + .../eslint/lib/rule-tester/rule-tester.js | 903 + .../eslint/lib/rules/accessor-pairs.js | 354 + .../eslint/lib/rules/array-bracket-newline.js | 258 + .../eslint/lib/rules/array-bracket-spacing.js | 241 + .../eslint/lib/rules/array-callback-return.js | 296 + .../eslint/lib/rules/array-element-newline.js | 301 + .../eslint/lib/rules/arrow-body-style.js | 286 + node_modules/eslint/lib/rules/arrow-parens.js | 183 + .../eslint/lib/rules/arrow-spacing.js | 161 + .../eslint/lib/rules/block-scoped-var.js | 122 + .../eslint/lib/rules/block-spacing.js | 164 + node_modules/eslint/lib/rules/brace-style.js | 188 + .../eslint/lib/rules/callback-return.js | 186 + node_modules/eslint/lib/rules/camelcase.js | 325 + .../eslint/lib/rules/capitalized-comments.js | 300 + .../lib/rules/class-methods-use-this.js | 125 + node_modules/eslint/lib/rules/comma-dangle.js | 340 + .../eslint/lib/rules/comma-spacing.js | 195 + node_modules/eslint/lib/rules/comma-style.js | 310 + node_modules/eslint/lib/rules/complexity.js | 160 + .../lib/rules/computed-property-spacing.js | 204 + .../eslint/lib/rules/consistent-return.js | 185 + .../eslint/lib/rules/consistent-this.js | 151 + .../eslint/lib/rules/constructor-super.js | 412 + node_modules/eslint/lib/rules/curly.js | 495 + .../eslint/lib/rules/default-case-last.js | 44 + node_modules/eslint/lib/rules/default-case.js | 97 + .../eslint/lib/rules/default-param-last.js | 62 + node_modules/eslint/lib/rules/dot-location.js | 105 + node_modules/eslint/lib/rules/dot-notation.js | 176 + node_modules/eslint/lib/rules/eol-last.js | 112 + node_modules/eslint/lib/rules/eqeqeq.js | 174 + .../eslint/lib/rules/for-direction.js | 126 + .../eslint/lib/rules/func-call-spacing.js | 230 + .../eslint/lib/rules/func-name-matching.js | 249 + node_modules/eslint/lib/rules/func-names.js | 190 + node_modules/eslint/lib/rules/func-style.js | 98 + .../rules/function-call-argument-newline.js | 122 + .../lib/rules/function-paren-newline.js | 281 + .../lib/rules/generator-star-spacing.js | 206 + .../eslint/lib/rules/getter-return.js | 173 + .../eslint/lib/rules/global-require.js | 86 + .../lib/rules/grouped-accessor-pairs.js | 224 + node_modules/eslint/lib/rules/guard-for-in.js | 76 + .../eslint/lib/rules/handle-callback-err.js | 99 + node_modules/eslint/lib/rules/id-blacklist.js | 233 + node_modules/eslint/lib/rules/id-denylist.js | 230 + node_modules/eslint/lib/rules/id-length.js | 145 + node_modules/eslint/lib/rules/id-match.js | 226 + .../lib/rules/implicit-arrow-linebreak.js | 81 + .../eslint/lib/rules/indent-legacy.js | 1125 + node_modules/eslint/lib/rules/indent.js | 1706 ++ node_modules/eslint/lib/rules/index.js | 297 + .../eslint/lib/rules/init-declarations.js | 139 + node_modules/eslint/lib/rules/jsx-quotes.js | 95 + node_modules/eslint/lib/rules/key-spacing.js | 674 + .../eslint/lib/rules/keyword-spacing.js | 573 + .../eslint/lib/rules/line-comment-position.js | 122 + .../eslint/lib/rules/linebreak-style.js | 105 + .../eslint/lib/rules/lines-around-comment.js | 404 + .../lib/rules/lines-around-directive.js | 201 + .../lib/rules/lines-between-class-members.js | 133 + .../eslint/lib/rules/max-classes-per-file.js | 65 + node_modules/eslint/lib/rules/max-depth.js | 154 + node_modules/eslint/lib/rules/max-len.js | 433 + .../lib/rules/max-lines-per-function.js | 214 + node_modules/eslint/lib/rules/max-lines.js | 174 + .../eslint/lib/rules/max-nested-callbacks.js | 117 + node_modules/eslint/lib/rules/max-params.js | 103 + .../lib/rules/max-statements-per-line.js | 196 + .../eslint/lib/rules/max-statements.js | 175 + .../lib/rules/multiline-comment-style.js | 435 + .../eslint/lib/rules/multiline-ternary.js | 114 + node_modules/eslint/lib/rules/new-cap.js | 275 + node_modules/eslint/lib/rules/new-parens.js | 99 + .../eslint/lib/rules/newline-after-var.js | 255 + .../eslint/lib/rules/newline-before-return.js | 217 + .../lib/rules/newline-per-chained-call.js | 123 + node_modules/eslint/lib/rules/no-alert.js | 136 + .../eslint/lib/rules/no-array-constructor.js | 54 + .../lib/rules/no-async-promise-executor.js | 39 + .../eslint/lib/rules/no-await-in-loop.js | 106 + node_modules/eslint/lib/rules/no-bitwise.js | 119 + .../eslint/lib/rules/no-buffer-constructor.js | 49 + node_modules/eslint/lib/rules/no-caller.js | 46 + .../eslint/lib/rules/no-case-declarations.js | 64 + .../eslint/lib/rules/no-catch-shadow.js | 80 + .../eslint/lib/rules/no-class-assign.js | 61 + .../eslint/lib/rules/no-compare-neg-zero.js | 60 + .../eslint/lib/rules/no-cond-assign.js | 159 + .../eslint/lib/rules/no-confusing-arrow.js | 85 + node_modules/eslint/lib/rules/no-console.js | 134 + .../eslint/lib/rules/no-const-assign.js | 54 + .../eslint/lib/rules/no-constant-condition.js | 253 + .../eslint/lib/rules/no-constructor-return.js | 62 + node_modules/eslint/lib/rules/no-continue.js | 39 + .../eslint/lib/rules/no-control-regex.js | 113 + node_modules/eslint/lib/rules/no-debugger.js | 43 + .../eslint/lib/rules/no-delete-var.js | 42 + node_modules/eslint/lib/rules/no-div-regex.js | 53 + node_modules/eslint/lib/rules/no-dupe-args.js | 80 + .../eslint/lib/rules/no-dupe-class-members.js | 103 + .../eslint/lib/rules/no-dupe-else-if.js | 122 + node_modules/eslint/lib/rules/no-dupe-keys.js | 143 + .../eslint/lib/rules/no-duplicate-case.js | 71 + .../eslint/lib/rules/no-duplicate-imports.js | 142 + .../eslint/lib/rules/no-else-return.js | 404 + .../lib/rules/no-empty-character-class.js | 64 + .../eslint/lib/rules/no-empty-function.js | 167 + .../eslint/lib/rules/no-empty-pattern.js | 43 + node_modules/eslint/lib/rules/no-empty.js | 86 + node_modules/eslint/lib/rules/no-eq-null.js | 46 + node_modules/eslint/lib/rules/no-eval.js | 277 + node_modules/eslint/lib/rules/no-ex-assign.js | 52 + .../eslint/lib/rules/no-extend-native.js | 178 + .../eslint/lib/rules/no-extra-bind.js | 213 + .../eslint/lib/rules/no-extra-boolean-cast.js | 316 + .../eslint/lib/rules/no-extra-label.js | 149 + .../eslint/lib/rules/no-extra-parens.js | 1177 ++ .../eslint/lib/rules/no-extra-semi.js | 126 + .../eslint/lib/rules/no-fallthrough.js | 142 + .../eslint/lib/rules/no-floating-decimal.js | 70 + .../eslint/lib/rules/no-func-assign.js | 76 + .../eslint/lib/rules/no-global-assign.js | 94 + .../eslint/lib/rules/no-implicit-coercion.js | 305 + .../eslint/lib/rules/no-implicit-globals.js | 140 + .../eslint/lib/rules/no-implied-eval.js | 131 + .../eslint/lib/rules/no-import-assign.js | 239 + .../eslint/lib/rules/no-inline-comments.js | 110 + .../eslint/lib/rules/no-inner-declarations.js | 88 + .../eslint/lib/rules/no-invalid-regexp.js | 130 + .../eslint/lib/rules/no-invalid-this.js | 145 + .../lib/rules/no-irregular-whitespace.js | 261 + node_modules/eslint/lib/rules/no-iterator.js | 52 + node_modules/eslint/lib/rules/no-label-var.js | 79 + node_modules/eslint/lib/rules/no-labels.js | 149 + .../eslint/lib/rules/no-lone-blocks.js | 128 + node_modules/eslint/lib/rules/no-lonely-if.js | 89 + node_modules/eslint/lib/rules/no-loop-func.js | 204 + .../eslint/lib/rules/no-loss-of-precision.js | 206 + .../eslint/lib/rules/no-magic-numbers.js | 226 + .../rules/no-misleading-character-class.js | 200 + .../eslint/lib/rules/no-mixed-operators.js | 243 + .../eslint/lib/rules/no-mixed-requires.js | 237 + .../lib/rules/no-mixed-spaces-and-tabs.js | 113 + .../eslint/lib/rules/no-multi-assign.js | 49 + .../eslint/lib/rules/no-multi-spaces.js | 138 + node_modules/eslint/lib/rules/no-multi-str.js | 65 + .../lib/rules/no-multiple-empty-lines.js | 151 + .../eslint/lib/rules/no-native-reassign.js | 97 + .../eslint/lib/rules/no-negated-condition.js | 95 + .../eslint/lib/rules/no-negated-in-lhs.js | 46 + .../eslint/lib/rules/no-nested-ternary.js | 44 + node_modules/eslint/lib/rules/no-new-func.js | 58 + .../eslint/lib/rules/no-new-object.js | 57 + .../eslint/lib/rules/no-new-require.js | 49 + .../eslint/lib/rules/no-new-symbol.js | 54 + .../eslint/lib/rules/no-new-wrappers.js | 48 + node_modules/eslint/lib/rules/no-new.js | 43 + node_modules/eslint/lib/rules/no-obj-calls.js | 84 + .../eslint/lib/rules/no-octal-escape.js | 56 + node_modules/eslint/lib/rules/no-octal.js | 45 + .../eslint/lib/rules/no-param-reassign.js | 229 + .../eslint/lib/rules/no-path-concat.js | 63 + node_modules/eslint/lib/rules/no-plusplus.js | 105 + .../eslint/lib/rules/no-process-env.js | 50 + .../eslint/lib/rules/no-process-exit.js | 46 + .../lib/rules/no-promise-executor-return.js | 121 + node_modules/eslint/lib/rules/no-proto.js | 48 + .../eslint/lib/rules/no-prototype-builtins.js | 71 + node_modules/eslint/lib/rules/no-redeclare.js | 172 + .../eslint/lib/rules/no-regex-spaces.js | 180 + .../eslint/lib/rules/no-restricted-exports.js | 90 + .../eslint/lib/rules/no-restricted-globals.js | 122 + .../eslint/lib/rules/no-restricted-imports.js | 268 + .../eslint/lib/rules/no-restricted-modules.js | 214 + .../lib/rules/no-restricted-properties.js | 181 + .../eslint/lib/rules/no-restricted-syntax.js | 70 + .../eslint/lib/rules/no-return-assign.js | 80 + .../eslint/lib/rules/no-return-await.js | 103 + .../eslint/lib/rules/no-script-url.js | 48 + .../eslint/lib/rules/no-self-assign.js | 183 + .../eslint/lib/rules/no-self-compare.js | 60 + node_modules/eslint/lib/rules/no-sequences.js | 119 + .../eslint/lib/rules/no-setter-return.js | 224 + .../lib/rules/no-shadow-restricted-names.js | 64 + node_modules/eslint/lib/rules/no-shadow.js | 192 + .../eslint/lib/rules/no-spaced-func.js | 83 + .../eslint/lib/rules/no-sparse-arrays.js | 50 + node_modules/eslint/lib/rules/no-sync.js | 65 + node_modules/eslint/lib/rules/no-tabs.js | 78 + .../lib/rules/no-template-curly-in-string.js | 44 + node_modules/eslint/lib/rules/no-ternary.js | 41 + .../eslint/lib/rules/no-this-before-super.js | 304 + .../eslint/lib/rules/no-throw-literal.js | 51 + .../eslint/lib/rules/no-trailing-spaces.js | 190 + .../eslint/lib/rules/no-undef-init.js | 75 + node_modules/eslint/lib/rules/no-undef.js | 78 + node_modules/eslint/lib/rules/no-undefined.js | 84 + .../eslint/lib/rules/no-underscore-dangle.js | 277 + .../lib/rules/no-unexpected-multiline.js | 120 + .../lib/rules/no-unmodified-loop-condition.js | 360 + .../eslint/lib/rules/no-unneeded-ternary.js | 166 + .../eslint/lib/rules/no-unreachable-loop.js | 150 + .../eslint/lib/rules/no-unreachable.js | 218 + .../eslint/lib/rules/no-unsafe-finally.js | 111 + .../eslint/lib/rules/no-unsafe-negation.js | 127 + .../eslint/lib/rules/no-unused-expressions.js | 172 + .../eslint/lib/rules/no-unused-labels.js | 110 + .../eslint/lib/rules/no-unused-vars.js | 648 + .../eslint/lib/rules/no-use-before-define.js | 233 + .../lib/rules/no-useless-backreference.js | 193 + .../eslint/lib/rules/no-useless-call.js | 90 + .../eslint/lib/rules/no-useless-catch.js | 57 + .../lib/rules/no-useless-computed-key.js | 103 + .../eslint/lib/rules/no-useless-concat.js | 115 + .../lib/rules/no-useless-constructor.js | 181 + .../eslint/lib/rules/no-useless-escape.js | 252 + .../eslint/lib/rules/no-useless-rename.js | 168 + .../eslint/lib/rules/no-useless-return.js | 305 + node_modules/eslint/lib/rules/no-var.js | 334 + node_modules/eslint/lib/rules/no-void.js | 64 + .../eslint/lib/rules/no-warning-comments.js | 196 + .../rules/no-whitespace-before-property.js | 113 + node_modules/eslint/lib/rules/no-with.js | 39 + .../rules/nonblock-statement-body-position.js | 124 + .../eslint/lib/rules/object-curly-newline.js | 306 + .../eslint/lib/rules/object-curly-spacing.js | 308 + .../lib/rules/object-property-newline.js | 99 + .../eslint/lib/rules/object-shorthand.js | 508 + .../lib/rules/one-var-declaration-per-line.js | 92 + node_modules/eslint/lib/rules/one-var.js | 535 + .../eslint/lib/rules/operator-assignment.js | 204 + .../eslint/lib/rules/operator-linebreak.js | 247 + .../eslint/lib/rules/padded-blocks.js | 298 + .../rules/padding-line-between-statements.js | 632 + .../eslint/lib/rules/prefer-arrow-callback.js | 379 + node_modules/eslint/lib/rules/prefer-const.js | 476 + .../eslint/lib/rules/prefer-destructuring.js | 279 + .../rules/prefer-exponentiation-operator.js | 189 + .../lib/rules/prefer-named-capture-group.js | 110 + .../lib/rules/prefer-numeric-literals.js | 148 + .../eslint/lib/rules/prefer-object-spread.js | 299 + .../lib/rules/prefer-promise-reject-errors.js | 131 + .../eslint/lib/rules/prefer-reflect.js | 127 + .../eslint/lib/rules/prefer-regex-literals.js | 180 + .../eslint/lib/rules/prefer-rest-params.js | 115 + .../eslint/lib/rules/prefer-spread.js | 87 + .../eslint/lib/rules/prefer-template.js | 283 + node_modules/eslint/lib/rules/quote-props.js | 307 + node_modules/eslint/lib/rules/quotes.js | 332 + node_modules/eslint/lib/rules/radix.js | 181 + .../lib/rules/require-atomic-updates.js | 283 + .../eslint/lib/rules/require-await.js | 113 + .../eslint/lib/rules/require-jsdoc.js | 121 + .../lib/rules/require-unicode-regexp.js | 69 + .../eslint/lib/rules/require-yield.js | 78 + .../eslint/lib/rules/rest-spread-spacing.js | 120 + node_modules/eslint/lib/rules/semi-spacing.js | 244 + node_modules/eslint/lib/rules/semi-style.js | 151 + node_modules/eslint/lib/rules/semi.js | 336 + node_modules/eslint/lib/rules/sort-imports.js | 241 + node_modules/eslint/lib/rules/sort-keys.js | 187 + node_modules/eslint/lib/rules/sort-vars.js | 104 + .../eslint/lib/rules/space-before-blocks.js | 164 + .../lib/rules/space-before-function-paren.js | 164 + .../eslint/lib/rules/space-in-parens.js | 282 + .../eslint/lib/rules/space-infix-ops.js | 169 + .../eslint/lib/rules/space-unary-ops.js | 321 + .../eslint/lib/rules/spaced-comment.js | 382 + node_modules/eslint/lib/rules/strict.js | 277 + .../eslint/lib/rules/switch-colon-spacing.js | 141 + .../eslint/lib/rules/symbol-description.js | 71 + .../lib/rules/template-curly-spacing.js | 141 + .../eslint/lib/rules/template-tag-spacing.js | 90 + node_modules/eslint/lib/rules/unicode-bom.js | 73 + node_modules/eslint/lib/rules/use-isnan.js | 138 + .../eslint/lib/rules/utils/ast-utils.js | 1794 ++ .../eslint/lib/rules/utils/fix-tracker.js | 114 + .../eslint/lib/rules/utils/keywords.js | 67 + .../lib/rules/utils/lazy-loading-rule-map.js | 115 + .../lib/rules/utils/patterns/letters.js | 36 + .../eslint/lib/rules/utils/unicode/index.js | 11 + .../utils/unicode/is-combining-character.js | 13 + .../rules/utils/unicode/is-emoji-modifier.js | 13 + .../unicode/is-regional-indicator-symbol.js | 13 + .../rules/utils/unicode/is-surrogate-pair.js | 14 + node_modules/eslint/lib/rules/valid-jsdoc.js | 515 + node_modules/eslint/lib/rules/valid-typeof.js | 85 + node_modules/eslint/lib/rules/vars-on-top.js | 144 + node_modules/eslint/lib/rules/wrap-iife.js | 204 + node_modules/eslint/lib/rules/wrap-regex.js | 59 + .../eslint/lib/rules/yield-star-spacing.js | 127 + node_modules/eslint/lib/rules/yoda.js | 352 + node_modules/eslint/lib/shared/ajv.js | 34 + node_modules/eslint/lib/shared/ast-utils.js | 29 + .../eslint/lib/shared/config-validator.js | 338 + .../eslint/lib/shared/deprecation-warnings.js | 56 + node_modules/eslint/lib/shared/logging.js | 30 + .../lib/shared/relative-module-resolver.js | 56 + .../eslint/lib/shared/runtime-info.js | 163 + node_modules/eslint/lib/shared/traverser.js | 195 + node_modules/eslint/lib/shared/types.js | 150 + node_modules/eslint/lib/source-code/index.js | 5 + .../eslint/lib/source-code/source-code.js | 586 + .../backward-token-comment-cursor.js | 57 + .../token-store/backward-token-cursor.js | 58 + .../lib/source-code/token-store/cursor.js | 76 + .../lib/source-code/token-store/cursors.js | 90 + .../token-store/decorative-cursor.js | 39 + .../source-code/token-store/filter-cursor.js | 43 + .../forward-token-comment-cursor.js | 57 + .../token-store/forward-token-cursor.js | 63 + .../lib/source-code/token-store/index.js | 627 + .../source-code/token-store/limit-cursor.js | 40 + .../token-store/padded-token-cursor.js | 38 + .../source-code/token-store/skip-cursor.js | 42 + .../lib/source-code/token-store/utils.js | 100 + .../eslint/messages/all-files-ignored.txt | 8 + .../eslint/messages/extend-config-missing.txt | 5 + .../eslint/messages/failed-to-read-json.txt | 3 + .../eslint/messages/file-not-found.txt | 2 + .../eslint/messages/no-config-found.txt | 7 + .../eslint/messages/plugin-conflict.txt | 7 + .../eslint/messages/plugin-invalid.txt | 8 + .../eslint/messages/plugin-missing.txt | 11 + .../print-config-with-directory-path.txt | 2 + .../eslint/messages/whitespace-found.txt | 3 + node_modules/eslint/package.json | 180 + node_modules/espree/CHANGELOG.md | 503 + node_modules/espree/LICENSE | 25 + node_modules/espree/README.md | 233 + node_modules/espree/espree.js | 177 + node_modules/espree/lib/ast-node-types.js | 96 + node_modules/espree/lib/espree.js | 286 + node_modules/espree/lib/features.js | 29 + node_modules/espree/lib/options.js | 106 + node_modules/espree/lib/token-translator.js | 263 + node_modules/espree/lib/visitor-keys.js | 123 + node_modules/espree/package.json | 96 + node_modules/esprima/ChangeLog | 235 + node_modules/esprima/LICENSE.BSD | 21 + node_modules/esprima/README.md | 46 + node_modules/esprima/bin/esparse.js | 139 + node_modules/esprima/bin/esvalidate.js | 236 + node_modules/esprima/dist/esprima.js | 6709 ++++++ node_modules/esprima/package.json | 137 + node_modules/esquery/README.md | 27 + node_modules/esquery/dist/esquery.esm.js | 4545 ++++ node_modules/esquery/dist/esquery.esm.min.js | 2 + .../esquery/dist/esquery.esm.min.js.map | 1 + node_modules/esquery/dist/esquery.js | 4553 ++++ node_modules/esquery/dist/esquery.min.js | 2 + node_modules/esquery/dist/esquery.min.js.map | 1 + node_modules/esquery/license.txt | 24 + .../esquery/node_modules/estraverse/.jshintrc | 16 + .../node_modules/estraverse/LICENSE.BSD | 19 + .../esquery/node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 801 + .../node_modules/estraverse/gulpfile.js | 70 + .../node_modules/estraverse/package.json | 68 + node_modules/esquery/package.json | 108 + node_modules/esquery/parser.js | 2572 +++ node_modules/esrecurse/.babelrc | 3 + node_modules/esrecurse/README.md | 171 + node_modules/esrecurse/esrecurse.js | 117 + node_modules/esrecurse/gulpfile.babel.js | 92 + .../node_modules/estraverse/.jshintrc | 16 + .../node_modules/estraverse/LICENSE.BSD | 19 + .../node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 801 + .../node_modules/estraverse/gulpfile.js | 70 + .../node_modules/estraverse/package.json | 68 + node_modules/esrecurse/package.json | 80 + node_modules/estraverse/.jshintrc | 16 + node_modules/estraverse/LICENSE.BSD | 19 + node_modules/estraverse/README.md | 153 + node_modules/estraverse/estraverse.js | 782 + node_modules/estraverse/gulpfile.js | 70 + node_modules/estraverse/package.json | 68 + node_modules/esutils/LICENSE.BSD | 19 + 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 | 74 + node_modules/fast-levenshtein/LICENSE.md | 25 + node_modules/fast-levenshtein/README.md | 104 + node_modules/fast-levenshtein/levenshtein.js | 136 + node_modules/fast-levenshtein/package.json | 72 + node_modules/file-entry-cache/LICENSE | 22 + node_modules/file-entry-cache/README.md | 112 + node_modules/file-entry-cache/cache.js | 286 + node_modules/file-entry-cache/changelog.md | 141 + node_modules/file-entry-cache/package.json | 116 + node_modules/find-up/index.js | 48 + node_modules/find-up/license | 21 + node_modules/find-up/package.json | 86 + node_modules/find-up/readme.md | 85 + node_modules/flat-cache/LICENSE | 22 + node_modules/flat-cache/README.md | 73 + node_modules/flat-cache/cache.js | 197 + node_modules/flat-cache/changelog.md | 300 + node_modules/flat-cache/del.js | 13 + node_modules/flat-cache/package.json | 119 + node_modules/flat-cache/utils.js | 39 + node_modules/flatted/.github/FUNDING.yml | 8 + node_modules/flatted/LICENSE | 15 + node_modules/flatted/README.md | 65 + node_modules/flatted/SPECS.md | 94 + node_modules/flatted/cjs/index.js | 114 + node_modules/flatted/esm/index.js | 116 + node_modules/flatted/index.js | 113 + node_modules/flatted/min.js | 2 + node_modules/flatted/package.json | 71 + node_modules/flatted/types.d.ts | 19 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 59 + node_modules/function-bind/.editorconfig | 20 + node_modules/function-bind/.eslintrc | 15 + node_modules/function-bind/.jscs.json | 176 + node_modules/function-bind/.npmignore | 22 + node_modules/function-bind/.travis.yml | 168 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 48 + node_modules/function-bind/implementation.js | 52 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 102 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + .../functional-red-black-tree/.npmignore | 16 + .../functional-red-black-tree/LICENSE | 22 + .../functional-red-black-tree/README.md | 237 + .../functional-red-black-tree/bench/test.js | 11 + .../functional-red-black-tree/package.json | 68 + .../functional-red-black-tree/rbtree.js | 996 + .../functional-red-black-tree/test/test.js | 479 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 137 + node_modules/glob-parent/index.js | 41 + node_modules/glob-parent/package.json | 90 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 375 + node_modules/glob/changelog.md | 67 + node_modules/glob/common.js | 240 + node_modules/glob/glob.js | 790 + node_modules/glob/package.json | 79 + node_modules/glob/sync.js | 486 + node_modules/globals/globals.json | 1586 ++ node_modules/globals/index.d.ts | 6 + node_modules/globals/index.js | 2 + node_modules/globals/license | 9 + node_modules/globals/package.json | 85 + node_modules/globals/readme.md | 56 + node_modules/graceful-fs/LICENSE | 15 + node_modules/graceful-fs/README.md | 133 + node_modules/graceful-fs/clone.js | 19 + node_modules/graceful-fs/graceful-fs.js | 354 + node_modules/graceful-fs/legacy-streams.js | 118 + node_modules/graceful-fs/package.json | 79 + node_modules/graceful-fs/polyfills.js | 342 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 76 + node_modules/has-flag/readme.md | 70 + node_modules/has-symbols/.eslintrc | 11 + node_modules/has-symbols/.github/FUNDING.yml | 12 + .../has-symbols/.github/workflows/rebase.yml | 15 + node_modules/has-symbols/.travis.yml | 12 + node_modules/has-symbols/CHANGELOG.md | 34 + node_modules/has-symbols/LICENSE | 21 + node_modules/has-symbols/README.md | 45 + node_modules/has-symbols/index.js | 13 + node_modules/has-symbols/package.json | 127 + node_modules/has-symbols/shams.js | 42 + node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + node_modules/has-symbols/test/tests.js | 54 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 82 + node_modules/has/src/index.js | 5 + node_modules/has/test/index.js | 10 + node_modules/hosted-git-info/CHANGELOG.md | 141 + node_modules/hosted-git-info/LICENSE | 13 + node_modules/hosted-git-info/README.md | 133 + node_modules/hosted-git-info/git-host-info.js | 79 + node_modules/hosted-git-info/git-host.js | 156 + node_modules/hosted-git-info/index.js | 148 + node_modules/hosted-git-info/package.json | 69 + node_modules/ignore/CHANGELOG.md | 19 + node_modules/ignore/LICENSE-MIT | 21 + node_modules/ignore/README.md | 307 + node_modules/ignore/index.d.ts | 45 + node_modules/ignore/index.js | 463 + node_modules/ignore/legacy.js | 466 + node_modules/ignore/package.json | 93 + node_modules/import-fresh/index.d.ts | 28 + node_modules/import-fresh/index.js | 32 + node_modules/import-fresh/license | 9 + node_modules/import-fresh/package.json | 75 + node_modules/import-fresh/readme.md | 52 + node_modules/imurmurhash/README.md | 122 + node_modules/imurmurhash/imurmurhash.js | 138 + node_modules/imurmurhash/imurmurhash.min.js | 12 + node_modules/imurmurhash/package.json | 63 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 58 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 61 + node_modules/is-arrayish/.editorconfig | 18 + node_modules/is-arrayish/.istanbul.yml | 4 + node_modules/is-arrayish/.npmignore | 5 + node_modules/is-arrayish/.travis.yml | 17 + node_modules/is-arrayish/LICENSE | 21 + node_modules/is-arrayish/README.md | 16 + node_modules/is-arrayish/index.js | 10 + node_modules/is-arrayish/package.json | 66 + node_modules/is-callable/.editorconfig | 21 + node_modules/is-callable/.eslintrc | 21 + node_modules/is-callable/.github/FUNDING.yml | 12 + .../is-callable/.github/main.workflow | 14 + .../is-callable/.github/workflows/rebase.yml | 15 + node_modules/is-callable/.istanbul.yml | 47 + node_modules/is-callable/.travis.yml | 12 + node_modules/is-callable/CHANGELOG.md | 86 + node_modules/is-callable/LICENSE | 22 + node_modules/is-callable/README.md | 68 + node_modules/is-callable/index.js | 70 + node_modules/is-callable/package.json | 136 + node_modules/is-callable/test/index.js | 190 + node_modules/is-date-object/.eslintrc | 9 + .../is-date-object/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/is-date-object/.jscs.json | 176 + node_modules/is-date-object/.travis.yml | 12 + node_modules/is-date-object/CHANGELOG.md | 76 + node_modules/is-date-object/LICENSE | 22 + node_modules/is-date-object/README.md | 53 + node_modules/is-date-object/index.js | 22 + node_modules/is-date-object/package.json | 104 + node_modules/is-date-object/test/index.js | 36 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 107 + node_modules/is-extglob/index.js | 20 + node_modules/is-extglob/package.json | 100 + node_modules/is-fullwidth-code-point/index.js | 46 + node_modules/is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 78 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 206 + node_modules/is-glob/index.js | 48 + node_modules/is-glob/package.json | 122 + node_modules/is-negative-zero/.eslintrc | 10 + node_modules/is-negative-zero/.jscs.json | 104 + node_modules/is-negative-zero/.npmignore | 15 + node_modules/is-negative-zero/.travis.yml | 46 + node_modules/is-negative-zero/LICENSE | 20 + node_modules/is-negative-zero/README.md | 56 + node_modules/is-negative-zero/index.js | 6 + node_modules/is-negative-zero/package.json | 91 + node_modules/is-negative-zero/test.js | 28 + node_modules/is-regex/.editorconfig | 20 + node_modules/is-regex/.eslintrc | 19 + .../is-regex/.github/workflows/rebase.yml | 15 + node_modules/is-regex/.travis.yml | 12 + node_modules/is-regex/CHANGELOG.md | 163 + node_modules/is-regex/LICENSE | 20 + node_modules/is-regex/README.md | 54 + node_modules/is-regex/index.js | 58 + node_modules/is-regex/package.json | 117 + node_modules/is-regex/test/index.js | 105 + node_modules/is-string/.eslintrc | 19 + node_modules/is-string/.github/FUNDING.yml | 12 + .../is-string/.github/workflows/rebase.yml | 15 + node_modules/is-string/.travis.yml | 12 + node_modules/is-string/CHANGELOG.md | 84 + node_modules/is-string/LICENSE | 22 + node_modules/is-string/README.md | 57 + node_modules/is-string/index.js | 24 + node_modules/is-string/package.json | 108 + node_modules/is-string/test/index.js | 39 + node_modules/is-symbol/.editorconfig | 13 + node_modules/is-symbol/.eslintrc | 14 + node_modules/is-symbol/.github/FUNDING.yml | 12 + .../is-symbol/.github/workflows/rebase.yml | 15 + node_modules/is-symbol/.nvmrc | 1 + node_modules/is-symbol/.travis.yml | 12 + node_modules/is-symbol/CHANGELOG.md | 86 + node_modules/is-symbol/LICENSE | 22 + node_modules/is-symbol/Makefile | 61 + node_modules/is-symbol/README.md | 44 + node_modules/is-symbol/index.js | 35 + node_modules/is-symbol/package.json | 105 + node_modules/is-symbol/test/index.js | 92 + node_modules/isarray/.npmignore | 1 + node_modules/isarray/.travis.yml | 4 + node_modules/isarray/Makefile | 6 + node_modules/isarray/README.md | 60 + node_modules/isarray/component.json | 19 + node_modules/isarray/index.js | 5 + node_modules/isarray/package.json | 73 + node_modules/isarray/test.js | 20 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 60 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + node_modules/js-tokens/CHANGELOG.md | 151 + node_modules/js-tokens/LICENSE | 21 + node_modules/js-tokens/README.md | 240 + node_modules/js-tokens/index.js | 23 + node_modules/js-tokens/package.json | 64 + node_modules/js-yaml/CHANGELOG.md | 551 + node_modules/js-yaml/LICENSE | 21 + node_modules/js-yaml/README.md | 299 + node_modules/js-yaml/bin/js-yaml.js | 132 + node_modules/js-yaml/dist/js-yaml.js | 3989 ++++ node_modules/js-yaml/dist/js-yaml.min.js | 1 + node_modules/js-yaml/index.js | 7 + node_modules/js-yaml/lib/js-yaml.js | 39 + node_modules/js-yaml/lib/js-yaml/common.js | 59 + node_modules/js-yaml/lib/js-yaml/dumper.js | 850 + node_modules/js-yaml/lib/js-yaml/exception.js | 43 + node_modules/js-yaml/lib/js-yaml/loader.js | 1644 ++ node_modules/js-yaml/lib/js-yaml/mark.js | 76 + node_modules/js-yaml/lib/js-yaml/schema.js | 108 + .../js-yaml/lib/js-yaml/schema/core.js | 18 + .../lib/js-yaml/schema/default_full.js | 25 + .../lib/js-yaml/schema/default_safe.js | 28 + .../js-yaml/lib/js-yaml/schema/failsafe.js | 17 + .../js-yaml/lib/js-yaml/schema/json.js | 25 + node_modules/js-yaml/lib/js-yaml/type.js | 61 + .../js-yaml/lib/js-yaml/type/binary.js | 138 + node_modules/js-yaml/lib/js-yaml/type/bool.js | 35 + .../js-yaml/lib/js-yaml/type/float.js | 116 + node_modules/js-yaml/lib/js-yaml/type/int.js | 173 + .../js-yaml/lib/js-yaml/type/js/function.js | 93 + .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 + .../js-yaml/lib/js-yaml/type/js/undefined.js | 28 + node_modules/js-yaml/lib/js-yaml/type/map.js | 8 + .../js-yaml/lib/js-yaml/type/merge.js | 12 + node_modules/js-yaml/lib/js-yaml/type/null.js | 34 + node_modules/js-yaml/lib/js-yaml/type/omap.js | 44 + .../js-yaml/lib/js-yaml/type/pairs.js | 53 + node_modules/js-yaml/lib/js-yaml/type/seq.js | 8 + node_modules/js-yaml/lib/js-yaml/type/set.js | 29 + node_modules/js-yaml/lib/js-yaml/type/str.js | 8 + .../js-yaml/lib/js-yaml/type/timestamp.js | 88 + node_modules/js-yaml/package.json | 96 + .../.npmignore | 1 + .../.travis.yml | 4 + .../LICENSE | 18 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../example/str.js | 3 + .../example/value_cmp.js | 7 + .../index.js | 82 + .../package.json | 72 + .../readme.markdown | 132 + .../test/cmp.js | 11 + .../test/nested.js | 42 + .../test/replacer.js | 74 + .../test/space.js | 59 + .../test/str.js | 32 + .../test/to-json.js | 20 + node_modules/json5/CHANGELOG.md | 274 + node_modules/json5/LICENSE.md | 23 + node_modules/json5/README.md | 234 + node_modules/json5/dist/index.js | 1 + node_modules/json5/lib/cli.js | 2 + node_modules/json5/lib/index.js | 1 + node_modules/json5/lib/parse.js | 1 + node_modules/json5/lib/register.js | 1 + node_modules/json5/lib/require.js | 1 + node_modules/json5/lib/stringify.js | 1 + node_modules/json5/lib/unicode.js | 1 + node_modules/json5/lib/util.js | 1 + node_modules/json5/package.json | 115 + node_modules/levn/LICENSE | 22 + node_modules/levn/README.md | 196 + node_modules/levn/lib/cast.js | 327 + node_modules/levn/lib/index.js | 22 + node_modules/levn/lib/parse-string.js | 113 + node_modules/levn/package.json | 77 + node_modules/load-json-file/index.js | 11 + node_modules/load-json-file/license | 21 + node_modules/load-json-file/package.json | 75 + node_modules/load-json-file/readme.md | 45 + node_modules/locate-path/index.js | 24 + node_modules/locate-path/license | 21 + node_modules/locate-path/package.json | 79 + node_modules/locate-path/readme.md | 99 + node_modules/lodash/LICENSE | 47 + node_modules/lodash/README.md | 39 + node_modules/lodash/_DataView.js | 7 + node_modules/lodash/_Hash.js | 32 + node_modules/lodash/_LazyWrapper.js | 28 + node_modules/lodash/_ListCache.js | 32 + node_modules/lodash/_LodashWrapper.js | 22 + node_modules/lodash/_Map.js | 7 + node_modules/lodash/_MapCache.js | 32 + node_modules/lodash/_Promise.js | 7 + node_modules/lodash/_Set.js | 7 + node_modules/lodash/_SetCache.js | 27 + node_modules/lodash/_Stack.js | 27 + node_modules/lodash/_Symbol.js | 6 + node_modules/lodash/_Uint8Array.js | 6 + node_modules/lodash/_WeakMap.js | 7 + node_modules/lodash/_apply.js | 21 + node_modules/lodash/_arrayAggregator.js | 22 + node_modules/lodash/_arrayEach.js | 22 + node_modules/lodash/_arrayEachRight.js | 21 + node_modules/lodash/_arrayEvery.js | 23 + node_modules/lodash/_arrayFilter.js | 25 + node_modules/lodash/_arrayIncludes.js | 17 + node_modules/lodash/_arrayIncludesWith.js | 22 + node_modules/lodash/_arrayLikeKeys.js | 49 + node_modules/lodash/_arrayMap.js | 21 + node_modules/lodash/_arrayPush.js | 20 + node_modules/lodash/_arrayReduce.js | 26 + node_modules/lodash/_arrayReduceRight.js | 24 + node_modules/lodash/_arraySample.js | 15 + node_modules/lodash/_arraySampleSize.js | 17 + node_modules/lodash/_arrayShuffle.js | 15 + node_modules/lodash/_arraySome.js | 23 + node_modules/lodash/_asciiSize.js | 12 + node_modules/lodash/_asciiToArray.js | 12 + node_modules/lodash/_asciiWords.js | 15 + node_modules/lodash/_assignMergeValue.js | 20 + node_modules/lodash/_assignValue.js | 28 + node_modules/lodash/_assocIndexOf.js | 21 + node_modules/lodash/_baseAggregator.js | 21 + node_modules/lodash/_baseAssign.js | 17 + node_modules/lodash/_baseAssignIn.js | 17 + node_modules/lodash/_baseAssignValue.js | 25 + node_modules/lodash/_baseAt.js | 23 + node_modules/lodash/_baseClamp.js | 22 + node_modules/lodash/_baseClone.js | 166 + node_modules/lodash/_baseConforms.js | 18 + node_modules/lodash/_baseConformsTo.js | 27 + node_modules/lodash/_baseCreate.js | 30 + node_modules/lodash/_baseDelay.js | 21 + node_modules/lodash/_baseDifference.js | 67 + node_modules/lodash/_baseEach.js | 14 + node_modules/lodash/_baseEachRight.js | 14 + node_modules/lodash/_baseEvery.js | 21 + node_modules/lodash/_baseExtremum.js | 32 + node_modules/lodash/_baseFill.js | 32 + node_modules/lodash/_baseFilter.js | 21 + node_modules/lodash/_baseFindIndex.js | 24 + node_modules/lodash/_baseFindKey.js | 23 + node_modules/lodash/_baseFlatten.js | 38 + node_modules/lodash/_baseFor.js | 16 + node_modules/lodash/_baseForOwn.js | 16 + node_modules/lodash/_baseForOwnRight.js | 16 + node_modules/lodash/_baseForRight.js | 15 + node_modules/lodash/_baseFunctions.js | 19 + node_modules/lodash/_baseGet.js | 24 + node_modules/lodash/_baseGetAllKeys.js | 20 + node_modules/lodash/_baseGetTag.js | 28 + node_modules/lodash/_baseGt.js | 14 + node_modules/lodash/_baseHas.js | 19 + node_modules/lodash/_baseHasIn.js | 13 + node_modules/lodash/_baseInRange.js | 18 + node_modules/lodash/_baseIndexOf.js | 20 + node_modules/lodash/_baseIndexOfWith.js | 23 + node_modules/lodash/_baseIntersection.js | 74 + node_modules/lodash/_baseInverter.js | 21 + node_modules/lodash/_baseInvoke.js | 24 + node_modules/lodash/_baseIsArguments.js | 18 + node_modules/lodash/_baseIsArrayBuffer.js | 17 + node_modules/lodash/_baseIsDate.js | 18 + node_modules/lodash/_baseIsEqual.js | 28 + node_modules/lodash/_baseIsEqualDeep.js | 83 + node_modules/lodash/_baseIsMap.js | 18 + node_modules/lodash/_baseIsMatch.js | 62 + node_modules/lodash/_baseIsNaN.js | 12 + node_modules/lodash/_baseIsNative.js | 47 + node_modules/lodash/_baseIsRegExp.js | 18 + node_modules/lodash/_baseIsSet.js | 18 + node_modules/lodash/_baseIsTypedArray.js | 60 + node_modules/lodash/_baseIteratee.js | 31 + node_modules/lodash/_baseKeys.js | 30 + node_modules/lodash/_baseKeysIn.js | 33 + node_modules/lodash/_baseLodash.js | 10 + node_modules/lodash/_baseLt.js | 14 + node_modules/lodash/_baseMap.js | 22 + node_modules/lodash/_baseMatches.js | 22 + node_modules/lodash/_baseMatchesProperty.js | 33 + node_modules/lodash/_baseMean.js | 20 + node_modules/lodash/_baseMerge.js | 42 + node_modules/lodash/_baseMergeDeep.js | 94 + node_modules/lodash/_baseNth.js | 20 + node_modules/lodash/_baseOrderBy.js | 49 + node_modules/lodash/_basePick.js | 19 + node_modules/lodash/_basePickBy.js | 30 + node_modules/lodash/_baseProperty.js | 14 + node_modules/lodash/_basePropertyDeep.js | 16 + node_modules/lodash/_basePropertyOf.js | 14 + node_modules/lodash/_basePullAll.js | 51 + node_modules/lodash/_basePullAt.js | 37 + node_modules/lodash/_baseRandom.js | 18 + node_modules/lodash/_baseRange.js | 28 + node_modules/lodash/_baseReduce.js | 23 + node_modules/lodash/_baseRepeat.js | 35 + node_modules/lodash/_baseRest.js | 17 + node_modules/lodash/_baseSample.js | 15 + node_modules/lodash/_baseSampleSize.js | 18 + node_modules/lodash/_baseSet.js | 51 + node_modules/lodash/_baseSetData.js | 17 + node_modules/lodash/_baseSetToString.js | 22 + node_modules/lodash/_baseShuffle.js | 15 + node_modules/lodash/_baseSlice.js | 31 + node_modules/lodash/_baseSome.js | 22 + node_modules/lodash/_baseSortBy.js | 21 + node_modules/lodash/_baseSortedIndex.js | 42 + node_modules/lodash/_baseSortedIndexBy.js | 67 + node_modules/lodash/_baseSortedUniq.js | 30 + node_modules/lodash/_baseSum.js | 24 + node_modules/lodash/_baseTimes.js | 20 + node_modules/lodash/_baseToNumber.js | 24 + node_modules/lodash/_baseToPairs.js | 18 + node_modules/lodash/_baseToString.js | 37 + node_modules/lodash/_baseUnary.js | 14 + node_modules/lodash/_baseUniq.js | 72 + node_modules/lodash/_baseUnset.js | 20 + node_modules/lodash/_baseUpdate.js | 18 + node_modules/lodash/_baseValues.js | 19 + node_modules/lodash/_baseWhile.js | 26 + node_modules/lodash/_baseWrapperValue.js | 25 + node_modules/lodash/_baseXor.js | 36 + node_modules/lodash/_baseZipObject.js | 23 + node_modules/lodash/_cacheHas.js | 13 + node_modules/lodash/_castArrayLikeObject.js | 14 + node_modules/lodash/_castFunction.js | 14 + node_modules/lodash/_castPath.js | 21 + node_modules/lodash/_castRest.js | 14 + node_modules/lodash/_castSlice.js | 18 + node_modules/lodash/_charsEndIndex.js | 19 + node_modules/lodash/_charsStartIndex.js | 20 + node_modules/lodash/_cloneArrayBuffer.js | 16 + node_modules/lodash/_cloneBuffer.js | 35 + node_modules/lodash/_cloneDataView.js | 16 + node_modules/lodash/_cloneRegExp.js | 17 + node_modules/lodash/_cloneSymbol.js | 18 + node_modules/lodash/_cloneTypedArray.js | 16 + node_modules/lodash/_compareAscending.js | 41 + node_modules/lodash/_compareMultiple.js | 44 + node_modules/lodash/_composeArgs.js | 39 + node_modules/lodash/_composeArgsRight.js | 41 + node_modules/lodash/_copyArray.js | 20 + node_modules/lodash/_copyObject.js | 40 + node_modules/lodash/_copySymbols.js | 16 + node_modules/lodash/_copySymbolsIn.js | 16 + node_modules/lodash/_coreJsData.js | 6 + node_modules/lodash/_countHolders.js | 21 + node_modules/lodash/_createAggregator.js | 23 + node_modules/lodash/_createAssigner.js | 37 + node_modules/lodash/_createBaseEach.js | 32 + node_modules/lodash/_createBaseFor.js | 25 + node_modules/lodash/_createBind.js | 28 + node_modules/lodash/_createCaseFirst.js | 33 + node_modules/lodash/_createCompounder.js | 24 + node_modules/lodash/_createCtor.js | 37 + node_modules/lodash/_createCurry.js | 46 + node_modules/lodash/_createFind.js | 25 + node_modules/lodash/_createFlow.js | 78 + node_modules/lodash/_createHybrid.js | 92 + node_modules/lodash/_createInverter.js | 17 + node_modules/lodash/_createMathOperation.js | 38 + node_modules/lodash/_createOver.js | 27 + node_modules/lodash/_createPadding.js | 33 + node_modules/lodash/_createPartial.js | 43 + node_modules/lodash/_createRange.js | 30 + node_modules/lodash/_createRecurry.js | 56 + .../lodash/_createRelationalOperation.js | 20 + node_modules/lodash/_createRound.js | 35 + node_modules/lodash/_createSet.js | 19 + node_modules/lodash/_createToPairs.js | 30 + node_modules/lodash/_createWrap.js | 106 + .../lodash/_customDefaultsAssignIn.js | 29 + node_modules/lodash/_customDefaultsMerge.js | 28 + node_modules/lodash/_customOmitClone.js | 16 + node_modules/lodash/_deburrLetter.js | 71 + node_modules/lodash/_defineProperty.js | 11 + node_modules/lodash/_equalArrays.js | 84 + node_modules/lodash/_equalByTag.js | 112 + node_modules/lodash/_equalObjects.js | 90 + node_modules/lodash/_escapeHtmlChar.js | 21 + node_modules/lodash/_escapeStringChar.js | 22 + node_modules/lodash/_flatRest.js | 16 + node_modules/lodash/_freeGlobal.js | 4 + node_modules/lodash/_getAllKeys.js | 16 + node_modules/lodash/_getAllKeysIn.js | 17 + node_modules/lodash/_getData.js | 15 + node_modules/lodash/_getFuncName.js | 31 + node_modules/lodash/_getHolder.js | 13 + node_modules/lodash/_getMapData.js | 18 + node_modules/lodash/_getMatchData.js | 24 + node_modules/lodash/_getNative.js | 17 + node_modules/lodash/_getPrototype.js | 6 + node_modules/lodash/_getRawTag.js | 46 + node_modules/lodash/_getSymbols.js | 30 + node_modules/lodash/_getSymbolsIn.js | 25 + node_modules/lodash/_getTag.js | 58 + node_modules/lodash/_getValue.js | 13 + node_modules/lodash/_getView.js | 33 + node_modules/lodash/_getWrapDetails.js | 17 + node_modules/lodash/_hasPath.js | 39 + node_modules/lodash/_hasUnicode.js | 26 + node_modules/lodash/_hasUnicodeWord.js | 15 + node_modules/lodash/_hashClear.js | 15 + node_modules/lodash/_hashDelete.js | 17 + node_modules/lodash/_hashGet.js | 30 + node_modules/lodash/_hashHas.js | 23 + node_modules/lodash/_hashSet.js | 23 + node_modules/lodash/_initCloneArray.js | 26 + node_modules/lodash/_initCloneByTag.js | 77 + node_modules/lodash/_initCloneObject.js | 18 + node_modules/lodash/_insertWrapDetails.js | 23 + node_modules/lodash/_isFlattenable.js | 20 + node_modules/lodash/_isIndex.js | 25 + node_modules/lodash/_isIterateeCall.js | 30 + node_modules/lodash/_isKey.js | 29 + node_modules/lodash/_isKeyable.js | 15 + node_modules/lodash/_isLaziable.js | 28 + node_modules/lodash/_isMaskable.js | 14 + node_modules/lodash/_isMasked.js | 20 + node_modules/lodash/_isPrototype.js | 18 + node_modules/lodash/_isStrictComparable.js | 15 + node_modules/lodash/_iteratorToArray.js | 18 + node_modules/lodash/_lazyClone.js | 23 + node_modules/lodash/_lazyReverse.js | 23 + node_modules/lodash/_lazyValue.js | 69 + node_modules/lodash/_listCacheClear.js | 13 + node_modules/lodash/_listCacheDelete.js | 35 + node_modules/lodash/_listCacheGet.js | 19 + node_modules/lodash/_listCacheHas.js | 16 + node_modules/lodash/_listCacheSet.js | 26 + node_modules/lodash/_mapCacheClear.js | 21 + node_modules/lodash/_mapCacheDelete.js | 18 + node_modules/lodash/_mapCacheGet.js | 16 + node_modules/lodash/_mapCacheHas.js | 16 + node_modules/lodash/_mapCacheSet.js | 22 + node_modules/lodash/_mapToArray.js | 18 + .../lodash/_matchesStrictComparable.js | 20 + node_modules/lodash/_memoizeCapped.js | 26 + node_modules/lodash/_mergeData.js | 90 + node_modules/lodash/_metaMap.js | 6 + node_modules/lodash/_nativeCreate.js | 6 + node_modules/lodash/_nativeKeys.js | 6 + node_modules/lodash/_nativeKeysIn.js | 20 + node_modules/lodash/_nodeUtil.js | 30 + node_modules/lodash/_objectToString.js | 22 + node_modules/lodash/_overArg.js | 15 + node_modules/lodash/_overRest.js | 36 + node_modules/lodash/_parent.js | 16 + node_modules/lodash/_reEscape.js | 4 + node_modules/lodash/_reEvaluate.js | 4 + node_modules/lodash/_reInterpolate.js | 4 + node_modules/lodash/_realNames.js | 4 + node_modules/lodash/_reorder.js | 29 + node_modules/lodash/_replaceHolders.js | 29 + node_modules/lodash/_root.js | 9 + node_modules/lodash/_safeGet.js | 21 + node_modules/lodash/_setCacheAdd.js | 19 + node_modules/lodash/_setCacheHas.js | 14 + node_modules/lodash/_setData.js | 20 + node_modules/lodash/_setToArray.js | 18 + node_modules/lodash/_setToPairs.js | 18 + node_modules/lodash/_setToString.js | 14 + node_modules/lodash/_setWrapToString.js | 21 + node_modules/lodash/_shortOut.js | 37 + node_modules/lodash/_shuffleSelf.js | 28 + node_modules/lodash/_stackClear.js | 15 + node_modules/lodash/_stackDelete.js | 18 + node_modules/lodash/_stackGet.js | 14 + node_modules/lodash/_stackHas.js | 14 + node_modules/lodash/_stackSet.js | 34 + node_modules/lodash/_strictIndexOf.js | 23 + node_modules/lodash/_strictLastIndexOf.js | 21 + node_modules/lodash/_stringSize.js | 18 + node_modules/lodash/_stringToArray.js | 18 + node_modules/lodash/_stringToPath.js | 27 + node_modules/lodash/_toKey.js | 21 + node_modules/lodash/_toSource.js | 26 + node_modules/lodash/_unescapeHtmlChar.js | 21 + node_modules/lodash/_unicodeSize.js | 44 + node_modules/lodash/_unicodeToArray.js | 40 + node_modules/lodash/_unicodeWords.js | 69 + node_modules/lodash/_updateWrapDetails.js | 46 + node_modules/lodash/_wrapperClone.js | 23 + node_modules/lodash/add.js | 22 + node_modules/lodash/after.js | 42 + node_modules/lodash/array.js | 67 + node_modules/lodash/ary.js | 29 + node_modules/lodash/assign.js | 58 + node_modules/lodash/assignIn.js | 40 + node_modules/lodash/assignInWith.js | 38 + node_modules/lodash/assignWith.js | 37 + node_modules/lodash/at.js | 23 + node_modules/lodash/attempt.js | 35 + node_modules/lodash/before.js | 40 + node_modules/lodash/bind.js | 57 + node_modules/lodash/bindAll.js | 41 + node_modules/lodash/bindKey.js | 68 + node_modules/lodash/camelCase.js | 29 + node_modules/lodash/capitalize.js | 23 + node_modules/lodash/castArray.js | 44 + node_modules/lodash/ceil.js | 26 + node_modules/lodash/chain.js | 38 + node_modules/lodash/chunk.js | 50 + node_modules/lodash/clamp.js | 39 + node_modules/lodash/clone.js | 36 + node_modules/lodash/cloneDeep.js | 29 + node_modules/lodash/cloneDeepWith.js | 40 + node_modules/lodash/cloneWith.js | 42 + node_modules/lodash/collection.js | 30 + node_modules/lodash/commit.js | 33 + node_modules/lodash/compact.js | 31 + node_modules/lodash/concat.js | 43 + node_modules/lodash/cond.js | 60 + node_modules/lodash/conforms.js | 35 + node_modules/lodash/conformsTo.js | 32 + node_modules/lodash/constant.js | 26 + node_modules/lodash/core.js | 3877 ++++ node_modules/lodash/core.min.js | 30 + node_modules/lodash/countBy.js | 40 + node_modules/lodash/create.js | 43 + node_modules/lodash/curry.js | 57 + node_modules/lodash/curryRight.js | 54 + node_modules/lodash/date.js | 3 + node_modules/lodash/debounce.js | 191 + node_modules/lodash/deburr.js | 45 + node_modules/lodash/defaultTo.js | 25 + node_modules/lodash/defaults.js | 64 + node_modules/lodash/defaultsDeep.js | 30 + node_modules/lodash/defer.js | 26 + node_modules/lodash/delay.js | 28 + node_modules/lodash/difference.js | 33 + node_modules/lodash/differenceBy.js | 44 + node_modules/lodash/differenceWith.js | 40 + node_modules/lodash/divide.js | 22 + node_modules/lodash/drop.js | 38 + node_modules/lodash/dropRight.js | 39 + node_modules/lodash/dropRightWhile.js | 45 + node_modules/lodash/dropWhile.js | 45 + node_modules/lodash/each.js | 1 + node_modules/lodash/eachRight.js | 1 + node_modules/lodash/endsWith.js | 43 + node_modules/lodash/entries.js | 1 + node_modules/lodash/entriesIn.js | 1 + node_modules/lodash/eq.js | 37 + node_modules/lodash/escape.js | 43 + node_modules/lodash/escapeRegExp.js | 32 + node_modules/lodash/every.js | 56 + node_modules/lodash/extend.js | 1 + node_modules/lodash/extendWith.js | 1 + node_modules/lodash/fill.js | 45 + node_modules/lodash/filter.js | 52 + node_modules/lodash/find.js | 42 + node_modules/lodash/findIndex.js | 55 + node_modules/lodash/findKey.js | 44 + node_modules/lodash/findLast.js | 25 + node_modules/lodash/findLastIndex.js | 59 + node_modules/lodash/findLastKey.js | 44 + node_modules/lodash/first.js | 1 + node_modules/lodash/flatMap.js | 29 + node_modules/lodash/flatMapDeep.js | 31 + node_modules/lodash/flatMapDepth.js | 31 + node_modules/lodash/flatten.js | 22 + node_modules/lodash/flattenDeep.js | 25 + node_modules/lodash/flattenDepth.js | 33 + node_modules/lodash/flip.js | 28 + node_modules/lodash/floor.js | 26 + node_modules/lodash/flow.js | 27 + node_modules/lodash/flowRight.js | 26 + node_modules/lodash/forEach.js | 41 + node_modules/lodash/forEachRight.js | 31 + node_modules/lodash/forIn.js | 39 + node_modules/lodash/forInRight.js | 37 + node_modules/lodash/forOwn.js | 36 + node_modules/lodash/forOwnRight.js | 34 + node_modules/lodash/fp.js | 2 + node_modules/lodash/fp/F.js | 1 + node_modules/lodash/fp/T.js | 1 + node_modules/lodash/fp/__.js | 1 + node_modules/lodash/fp/_baseConvert.js | 569 + node_modules/lodash/fp/_convertBrowser.js | 18 + node_modules/lodash/fp/_falseOptions.js | 7 + node_modules/lodash/fp/_mapping.js | 358 + node_modules/lodash/fp/_util.js | 16 + node_modules/lodash/fp/add.js | 5 + node_modules/lodash/fp/after.js | 5 + node_modules/lodash/fp/all.js | 1 + node_modules/lodash/fp/allPass.js | 1 + node_modules/lodash/fp/always.js | 1 + node_modules/lodash/fp/any.js | 1 + node_modules/lodash/fp/anyPass.js | 1 + node_modules/lodash/fp/apply.js | 1 + node_modules/lodash/fp/array.js | 2 + node_modules/lodash/fp/ary.js | 5 + node_modules/lodash/fp/assign.js | 5 + node_modules/lodash/fp/assignAll.js | 5 + node_modules/lodash/fp/assignAllWith.js | 5 + node_modules/lodash/fp/assignIn.js | 5 + node_modules/lodash/fp/assignInAll.js | 5 + node_modules/lodash/fp/assignInAllWith.js | 5 + node_modules/lodash/fp/assignInWith.js | 5 + node_modules/lodash/fp/assignWith.js | 5 + node_modules/lodash/fp/assoc.js | 1 + node_modules/lodash/fp/assocPath.js | 1 + node_modules/lodash/fp/at.js | 5 + node_modules/lodash/fp/attempt.js | 5 + node_modules/lodash/fp/before.js | 5 + node_modules/lodash/fp/bind.js | 5 + node_modules/lodash/fp/bindAll.js | 5 + node_modules/lodash/fp/bindKey.js | 5 + node_modules/lodash/fp/camelCase.js | 5 + node_modules/lodash/fp/capitalize.js | 5 + node_modules/lodash/fp/castArray.js | 5 + node_modules/lodash/fp/ceil.js | 5 + node_modules/lodash/fp/chain.js | 5 + node_modules/lodash/fp/chunk.js | 5 + node_modules/lodash/fp/clamp.js | 5 + node_modules/lodash/fp/clone.js | 5 + node_modules/lodash/fp/cloneDeep.js | 5 + node_modules/lodash/fp/cloneDeepWith.js | 5 + node_modules/lodash/fp/cloneWith.js | 5 + node_modules/lodash/fp/collection.js | 2 + node_modules/lodash/fp/commit.js | 5 + node_modules/lodash/fp/compact.js | 5 + node_modules/lodash/fp/complement.js | 1 + node_modules/lodash/fp/compose.js | 1 + node_modules/lodash/fp/concat.js | 5 + node_modules/lodash/fp/cond.js | 5 + node_modules/lodash/fp/conforms.js | 1 + node_modules/lodash/fp/conformsTo.js | 5 + node_modules/lodash/fp/constant.js | 5 + node_modules/lodash/fp/contains.js | 1 + node_modules/lodash/fp/convert.js | 18 + node_modules/lodash/fp/countBy.js | 5 + node_modules/lodash/fp/create.js | 5 + node_modules/lodash/fp/curry.js | 5 + node_modules/lodash/fp/curryN.js | 5 + node_modules/lodash/fp/curryRight.js | 5 + node_modules/lodash/fp/curryRightN.js | 5 + node_modules/lodash/fp/date.js | 2 + node_modules/lodash/fp/debounce.js | 5 + node_modules/lodash/fp/deburr.js | 5 + node_modules/lodash/fp/defaultTo.js | 5 + node_modules/lodash/fp/defaults.js | 5 + node_modules/lodash/fp/defaultsAll.js | 5 + node_modules/lodash/fp/defaultsDeep.js | 5 + node_modules/lodash/fp/defaultsDeepAll.js | 5 + node_modules/lodash/fp/defer.js | 5 + node_modules/lodash/fp/delay.js | 5 + node_modules/lodash/fp/difference.js | 5 + node_modules/lodash/fp/differenceBy.js | 5 + node_modules/lodash/fp/differenceWith.js | 5 + node_modules/lodash/fp/dissoc.js | 1 + node_modules/lodash/fp/dissocPath.js | 1 + node_modules/lodash/fp/divide.js | 5 + node_modules/lodash/fp/drop.js | 5 + node_modules/lodash/fp/dropLast.js | 1 + node_modules/lodash/fp/dropLastWhile.js | 1 + node_modules/lodash/fp/dropRight.js | 5 + node_modules/lodash/fp/dropRightWhile.js | 5 + node_modules/lodash/fp/dropWhile.js | 5 + node_modules/lodash/fp/each.js | 1 + node_modules/lodash/fp/eachRight.js | 1 + node_modules/lodash/fp/endsWith.js | 5 + node_modules/lodash/fp/entries.js | 1 + node_modules/lodash/fp/entriesIn.js | 1 + node_modules/lodash/fp/eq.js | 5 + node_modules/lodash/fp/equals.js | 1 + node_modules/lodash/fp/escape.js | 5 + node_modules/lodash/fp/escapeRegExp.js | 5 + node_modules/lodash/fp/every.js | 5 + node_modules/lodash/fp/extend.js | 1 + node_modules/lodash/fp/extendAll.js | 1 + node_modules/lodash/fp/extendAllWith.js | 1 + node_modules/lodash/fp/extendWith.js | 1 + node_modules/lodash/fp/fill.js | 5 + node_modules/lodash/fp/filter.js | 5 + node_modules/lodash/fp/find.js | 5 + node_modules/lodash/fp/findFrom.js | 5 + node_modules/lodash/fp/findIndex.js | 5 + node_modules/lodash/fp/findIndexFrom.js | 5 + node_modules/lodash/fp/findKey.js | 5 + node_modules/lodash/fp/findLast.js | 5 + node_modules/lodash/fp/findLastFrom.js | 5 + node_modules/lodash/fp/findLastIndex.js | 5 + node_modules/lodash/fp/findLastIndexFrom.js | 5 + node_modules/lodash/fp/findLastKey.js | 5 + node_modules/lodash/fp/first.js | 1 + node_modules/lodash/fp/flatMap.js | 5 + node_modules/lodash/fp/flatMapDeep.js | 5 + node_modules/lodash/fp/flatMapDepth.js | 5 + node_modules/lodash/fp/flatten.js | 5 + node_modules/lodash/fp/flattenDeep.js | 5 + node_modules/lodash/fp/flattenDepth.js | 5 + node_modules/lodash/fp/flip.js | 5 + node_modules/lodash/fp/floor.js | 5 + node_modules/lodash/fp/flow.js | 5 + node_modules/lodash/fp/flowRight.js | 5 + node_modules/lodash/fp/forEach.js | 5 + node_modules/lodash/fp/forEachRight.js | 5 + node_modules/lodash/fp/forIn.js | 5 + node_modules/lodash/fp/forInRight.js | 5 + node_modules/lodash/fp/forOwn.js | 5 + node_modules/lodash/fp/forOwnRight.js | 5 + node_modules/lodash/fp/fromPairs.js | 5 + node_modules/lodash/fp/function.js | 2 + node_modules/lodash/fp/functions.js | 5 + node_modules/lodash/fp/functionsIn.js | 5 + node_modules/lodash/fp/get.js | 5 + node_modules/lodash/fp/getOr.js | 5 + node_modules/lodash/fp/groupBy.js | 5 + node_modules/lodash/fp/gt.js | 5 + node_modules/lodash/fp/gte.js | 5 + node_modules/lodash/fp/has.js | 5 + node_modules/lodash/fp/hasIn.js | 5 + node_modules/lodash/fp/head.js | 5 + node_modules/lodash/fp/identical.js | 1 + node_modules/lodash/fp/identity.js | 5 + node_modules/lodash/fp/inRange.js | 5 + node_modules/lodash/fp/includes.js | 5 + node_modules/lodash/fp/includesFrom.js | 5 + node_modules/lodash/fp/indexBy.js | 1 + node_modules/lodash/fp/indexOf.js | 5 + node_modules/lodash/fp/indexOfFrom.js | 5 + node_modules/lodash/fp/init.js | 1 + node_modules/lodash/fp/initial.js | 5 + node_modules/lodash/fp/intersection.js | 5 + node_modules/lodash/fp/intersectionBy.js | 5 + node_modules/lodash/fp/intersectionWith.js | 5 + node_modules/lodash/fp/invert.js | 5 + node_modules/lodash/fp/invertBy.js | 5 + node_modules/lodash/fp/invertObj.js | 1 + node_modules/lodash/fp/invoke.js | 5 + node_modules/lodash/fp/invokeArgs.js | 5 + node_modules/lodash/fp/invokeArgsMap.js | 5 + node_modules/lodash/fp/invokeMap.js | 5 + node_modules/lodash/fp/isArguments.js | 5 + node_modules/lodash/fp/isArray.js | 5 + node_modules/lodash/fp/isArrayBuffer.js | 5 + node_modules/lodash/fp/isArrayLike.js | 5 + node_modules/lodash/fp/isArrayLikeObject.js | 5 + node_modules/lodash/fp/isBoolean.js | 5 + node_modules/lodash/fp/isBuffer.js | 5 + node_modules/lodash/fp/isDate.js | 5 + node_modules/lodash/fp/isElement.js | 5 + node_modules/lodash/fp/isEmpty.js | 5 + node_modules/lodash/fp/isEqual.js | 5 + node_modules/lodash/fp/isEqualWith.js | 5 + node_modules/lodash/fp/isError.js | 5 + node_modules/lodash/fp/isFinite.js | 5 + node_modules/lodash/fp/isFunction.js | 5 + node_modules/lodash/fp/isInteger.js | 5 + node_modules/lodash/fp/isLength.js | 5 + node_modules/lodash/fp/isMap.js | 5 + node_modules/lodash/fp/isMatch.js | 5 + node_modules/lodash/fp/isMatchWith.js | 5 + node_modules/lodash/fp/isNaN.js | 5 + node_modules/lodash/fp/isNative.js | 5 + node_modules/lodash/fp/isNil.js | 5 + node_modules/lodash/fp/isNull.js | 5 + node_modules/lodash/fp/isNumber.js | 5 + node_modules/lodash/fp/isObject.js | 5 + node_modules/lodash/fp/isObjectLike.js | 5 + node_modules/lodash/fp/isPlainObject.js | 5 + node_modules/lodash/fp/isRegExp.js | 5 + node_modules/lodash/fp/isSafeInteger.js | 5 + node_modules/lodash/fp/isSet.js | 5 + node_modules/lodash/fp/isString.js | 5 + node_modules/lodash/fp/isSymbol.js | 5 + node_modules/lodash/fp/isTypedArray.js | 5 + node_modules/lodash/fp/isUndefined.js | 5 + node_modules/lodash/fp/isWeakMap.js | 5 + node_modules/lodash/fp/isWeakSet.js | 5 + node_modules/lodash/fp/iteratee.js | 5 + node_modules/lodash/fp/join.js | 5 + node_modules/lodash/fp/juxt.js | 1 + node_modules/lodash/fp/kebabCase.js | 5 + node_modules/lodash/fp/keyBy.js | 5 + node_modules/lodash/fp/keys.js | 5 + node_modules/lodash/fp/keysIn.js | 5 + node_modules/lodash/fp/lang.js | 2 + node_modules/lodash/fp/last.js | 5 + node_modules/lodash/fp/lastIndexOf.js | 5 + node_modules/lodash/fp/lastIndexOfFrom.js | 5 + node_modules/lodash/fp/lowerCase.js | 5 + node_modules/lodash/fp/lowerFirst.js | 5 + node_modules/lodash/fp/lt.js | 5 + node_modules/lodash/fp/lte.js | 5 + node_modules/lodash/fp/map.js | 5 + node_modules/lodash/fp/mapKeys.js | 5 + node_modules/lodash/fp/mapValues.js | 5 + node_modules/lodash/fp/matches.js | 1 + node_modules/lodash/fp/matchesProperty.js | 5 + node_modules/lodash/fp/math.js | 2 + node_modules/lodash/fp/max.js | 5 + node_modules/lodash/fp/maxBy.js | 5 + node_modules/lodash/fp/mean.js | 5 + node_modules/lodash/fp/meanBy.js | 5 + node_modules/lodash/fp/memoize.js | 5 + node_modules/lodash/fp/merge.js | 5 + node_modules/lodash/fp/mergeAll.js | 5 + node_modules/lodash/fp/mergeAllWith.js | 5 + node_modules/lodash/fp/mergeWith.js | 5 + node_modules/lodash/fp/method.js | 5 + node_modules/lodash/fp/methodOf.js | 5 + node_modules/lodash/fp/min.js | 5 + node_modules/lodash/fp/minBy.js | 5 + node_modules/lodash/fp/mixin.js | 5 + node_modules/lodash/fp/multiply.js | 5 + node_modules/lodash/fp/nAry.js | 1 + node_modules/lodash/fp/negate.js | 5 + node_modules/lodash/fp/next.js | 5 + node_modules/lodash/fp/noop.js | 5 + node_modules/lodash/fp/now.js | 5 + node_modules/lodash/fp/nth.js | 5 + node_modules/lodash/fp/nthArg.js | 5 + node_modules/lodash/fp/number.js | 2 + node_modules/lodash/fp/object.js | 2 + node_modules/lodash/fp/omit.js | 5 + node_modules/lodash/fp/omitAll.js | 1 + node_modules/lodash/fp/omitBy.js | 5 + node_modules/lodash/fp/once.js | 5 + node_modules/lodash/fp/orderBy.js | 5 + node_modules/lodash/fp/over.js | 5 + node_modules/lodash/fp/overArgs.js | 5 + node_modules/lodash/fp/overEvery.js | 5 + node_modules/lodash/fp/overSome.js | 5 + node_modules/lodash/fp/pad.js | 5 + node_modules/lodash/fp/padChars.js | 5 + node_modules/lodash/fp/padCharsEnd.js | 5 + node_modules/lodash/fp/padCharsStart.js | 5 + node_modules/lodash/fp/padEnd.js | 5 + node_modules/lodash/fp/padStart.js | 5 + node_modules/lodash/fp/parseInt.js | 5 + node_modules/lodash/fp/partial.js | 5 + node_modules/lodash/fp/partialRight.js | 5 + node_modules/lodash/fp/partition.js | 5 + node_modules/lodash/fp/path.js | 1 + node_modules/lodash/fp/pathEq.js | 1 + node_modules/lodash/fp/pathOr.js | 1 + node_modules/lodash/fp/paths.js | 1 + node_modules/lodash/fp/pick.js | 5 + node_modules/lodash/fp/pickAll.js | 1 + node_modules/lodash/fp/pickBy.js | 5 + node_modules/lodash/fp/pipe.js | 1 + node_modules/lodash/fp/placeholder.js | 6 + node_modules/lodash/fp/plant.js | 5 + node_modules/lodash/fp/pluck.js | 1 + node_modules/lodash/fp/prop.js | 1 + node_modules/lodash/fp/propEq.js | 1 + node_modules/lodash/fp/propOr.js | 1 + node_modules/lodash/fp/property.js | 1 + node_modules/lodash/fp/propertyOf.js | 5 + node_modules/lodash/fp/props.js | 1 + node_modules/lodash/fp/pull.js | 5 + node_modules/lodash/fp/pullAll.js | 5 + node_modules/lodash/fp/pullAllBy.js | 5 + node_modules/lodash/fp/pullAllWith.js | 5 + node_modules/lodash/fp/pullAt.js | 5 + node_modules/lodash/fp/random.js | 5 + node_modules/lodash/fp/range.js | 5 + node_modules/lodash/fp/rangeRight.js | 5 + node_modules/lodash/fp/rangeStep.js | 5 + node_modules/lodash/fp/rangeStepRight.js | 5 + node_modules/lodash/fp/rearg.js | 5 + node_modules/lodash/fp/reduce.js | 5 + node_modules/lodash/fp/reduceRight.js | 5 + node_modules/lodash/fp/reject.js | 5 + node_modules/lodash/fp/remove.js | 5 + node_modules/lodash/fp/repeat.js | 5 + node_modules/lodash/fp/replace.js | 5 + node_modules/lodash/fp/rest.js | 5 + node_modules/lodash/fp/restFrom.js | 5 + node_modules/lodash/fp/result.js | 5 + node_modules/lodash/fp/reverse.js | 5 + node_modules/lodash/fp/round.js | 5 + node_modules/lodash/fp/sample.js | 5 + node_modules/lodash/fp/sampleSize.js | 5 + node_modules/lodash/fp/seq.js | 2 + node_modules/lodash/fp/set.js | 5 + node_modules/lodash/fp/setWith.js | 5 + node_modules/lodash/fp/shuffle.js | 5 + node_modules/lodash/fp/size.js | 5 + node_modules/lodash/fp/slice.js | 5 + node_modules/lodash/fp/snakeCase.js | 5 + node_modules/lodash/fp/some.js | 5 + node_modules/lodash/fp/sortBy.js | 5 + node_modules/lodash/fp/sortedIndex.js | 5 + node_modules/lodash/fp/sortedIndexBy.js | 5 + node_modules/lodash/fp/sortedIndexOf.js | 5 + node_modules/lodash/fp/sortedLastIndex.js | 5 + node_modules/lodash/fp/sortedLastIndexBy.js | 5 + node_modules/lodash/fp/sortedLastIndexOf.js | 5 + node_modules/lodash/fp/sortedUniq.js | 5 + node_modules/lodash/fp/sortedUniqBy.js | 5 + node_modules/lodash/fp/split.js | 5 + node_modules/lodash/fp/spread.js | 5 + node_modules/lodash/fp/spreadFrom.js | 5 + node_modules/lodash/fp/startCase.js | 5 + node_modules/lodash/fp/startsWith.js | 5 + node_modules/lodash/fp/string.js | 2 + node_modules/lodash/fp/stubArray.js | 5 + node_modules/lodash/fp/stubFalse.js | 5 + node_modules/lodash/fp/stubObject.js | 5 + node_modules/lodash/fp/stubString.js | 5 + node_modules/lodash/fp/stubTrue.js | 5 + node_modules/lodash/fp/subtract.js | 5 + node_modules/lodash/fp/sum.js | 5 + node_modules/lodash/fp/sumBy.js | 5 + node_modules/lodash/fp/symmetricDifference.js | 1 + .../lodash/fp/symmetricDifferenceBy.js | 1 + .../lodash/fp/symmetricDifferenceWith.js | 1 + node_modules/lodash/fp/tail.js | 5 + node_modules/lodash/fp/take.js | 5 + node_modules/lodash/fp/takeLast.js | 1 + node_modules/lodash/fp/takeLastWhile.js | 1 + node_modules/lodash/fp/takeRight.js | 5 + node_modules/lodash/fp/takeRightWhile.js | 5 + node_modules/lodash/fp/takeWhile.js | 5 + node_modules/lodash/fp/tap.js | 5 + node_modules/lodash/fp/template.js | 5 + node_modules/lodash/fp/templateSettings.js | 5 + node_modules/lodash/fp/throttle.js | 5 + node_modules/lodash/fp/thru.js | 5 + node_modules/lodash/fp/times.js | 5 + node_modules/lodash/fp/toArray.js | 5 + node_modules/lodash/fp/toFinite.js | 5 + node_modules/lodash/fp/toInteger.js | 5 + node_modules/lodash/fp/toIterator.js | 5 + node_modules/lodash/fp/toJSON.js | 5 + node_modules/lodash/fp/toLength.js | 5 + node_modules/lodash/fp/toLower.js | 5 + node_modules/lodash/fp/toNumber.js | 5 + node_modules/lodash/fp/toPairs.js | 5 + node_modules/lodash/fp/toPairsIn.js | 5 + node_modules/lodash/fp/toPath.js | 5 + node_modules/lodash/fp/toPlainObject.js | 5 + node_modules/lodash/fp/toSafeInteger.js | 5 + node_modules/lodash/fp/toString.js | 5 + node_modules/lodash/fp/toUpper.js | 5 + node_modules/lodash/fp/transform.js | 5 + node_modules/lodash/fp/trim.js | 5 + node_modules/lodash/fp/trimChars.js | 5 + node_modules/lodash/fp/trimCharsEnd.js | 5 + node_modules/lodash/fp/trimCharsStart.js | 5 + node_modules/lodash/fp/trimEnd.js | 5 + node_modules/lodash/fp/trimStart.js | 5 + node_modules/lodash/fp/truncate.js | 5 + node_modules/lodash/fp/unapply.js | 1 + node_modules/lodash/fp/unary.js | 5 + node_modules/lodash/fp/unescape.js | 5 + node_modules/lodash/fp/union.js | 5 + node_modules/lodash/fp/unionBy.js | 5 + node_modules/lodash/fp/unionWith.js | 5 + node_modules/lodash/fp/uniq.js | 5 + node_modules/lodash/fp/uniqBy.js | 5 + node_modules/lodash/fp/uniqWith.js | 5 + node_modules/lodash/fp/uniqueId.js | 5 + node_modules/lodash/fp/unnest.js | 1 + node_modules/lodash/fp/unset.js | 5 + node_modules/lodash/fp/unzip.js | 5 + node_modules/lodash/fp/unzipWith.js | 5 + node_modules/lodash/fp/update.js | 5 + node_modules/lodash/fp/updateWith.js | 5 + node_modules/lodash/fp/upperCase.js | 5 + node_modules/lodash/fp/upperFirst.js | 5 + node_modules/lodash/fp/useWith.js | 1 + node_modules/lodash/fp/util.js | 2 + node_modules/lodash/fp/value.js | 5 + node_modules/lodash/fp/valueOf.js | 5 + node_modules/lodash/fp/values.js | 5 + node_modules/lodash/fp/valuesIn.js | 5 + node_modules/lodash/fp/where.js | 1 + node_modules/lodash/fp/whereEq.js | 1 + node_modules/lodash/fp/without.js | 5 + node_modules/lodash/fp/words.js | 5 + node_modules/lodash/fp/wrap.js | 5 + node_modules/lodash/fp/wrapperAt.js | 5 + node_modules/lodash/fp/wrapperChain.js | 5 + node_modules/lodash/fp/wrapperLodash.js | 5 + node_modules/lodash/fp/wrapperReverse.js | 5 + node_modules/lodash/fp/wrapperValue.js | 5 + node_modules/lodash/fp/xor.js | 5 + node_modules/lodash/fp/xorBy.js | 5 + node_modules/lodash/fp/xorWith.js | 5 + node_modules/lodash/fp/zip.js | 5 + node_modules/lodash/fp/zipAll.js | 5 + node_modules/lodash/fp/zipObj.js | 1 + node_modules/lodash/fp/zipObject.js | 5 + node_modules/lodash/fp/zipObjectDeep.js | 5 + node_modules/lodash/fp/zipWith.js | 5 + node_modules/lodash/fromPairs.js | 28 + node_modules/lodash/function.js | 25 + node_modules/lodash/functions.js | 31 + node_modules/lodash/functionsIn.js | 31 + node_modules/lodash/get.js | 33 + node_modules/lodash/groupBy.js | 41 + node_modules/lodash/gt.js | 29 + node_modules/lodash/gte.js | 30 + node_modules/lodash/has.js | 35 + node_modules/lodash/hasIn.js | 34 + node_modules/lodash/head.js | 23 + node_modules/lodash/identity.js | 21 + node_modules/lodash/inRange.js | 55 + node_modules/lodash/includes.js | 53 + node_modules/lodash/index.js | 1 + node_modules/lodash/indexOf.js | 42 + node_modules/lodash/initial.js | 22 + node_modules/lodash/intersection.js | 30 + node_modules/lodash/intersectionBy.js | 45 + node_modules/lodash/intersectionWith.js | 41 + node_modules/lodash/invert.js | 42 + node_modules/lodash/invertBy.js | 56 + node_modules/lodash/invoke.js | 24 + node_modules/lodash/invokeMap.js | 41 + node_modules/lodash/isArguments.js | 36 + node_modules/lodash/isArray.js | 26 + node_modules/lodash/isArrayBuffer.js | 27 + node_modules/lodash/isArrayLike.js | 33 + node_modules/lodash/isArrayLikeObject.js | 33 + node_modules/lodash/isBoolean.js | 29 + node_modules/lodash/isBuffer.js | 38 + node_modules/lodash/isDate.js | 27 + node_modules/lodash/isElement.js | 25 + node_modules/lodash/isEmpty.js | 77 + node_modules/lodash/isEqual.js | 35 + node_modules/lodash/isEqualWith.js | 41 + node_modules/lodash/isError.js | 36 + node_modules/lodash/isFinite.js | 36 + node_modules/lodash/isFunction.js | 37 + node_modules/lodash/isInteger.js | 33 + node_modules/lodash/isLength.js | 35 + node_modules/lodash/isMap.js | 27 + node_modules/lodash/isMatch.js | 36 + node_modules/lodash/isMatchWith.js | 41 + node_modules/lodash/isNaN.js | 38 + node_modules/lodash/isNative.js | 40 + node_modules/lodash/isNil.js | 25 + node_modules/lodash/isNull.js | 22 + node_modules/lodash/isNumber.js | 38 + node_modules/lodash/isObject.js | 31 + node_modules/lodash/isObjectLike.js | 29 + node_modules/lodash/isPlainObject.js | 62 + node_modules/lodash/isRegExp.js | 27 + node_modules/lodash/isSafeInteger.js | 37 + node_modules/lodash/isSet.js | 27 + node_modules/lodash/isString.js | 30 + node_modules/lodash/isSymbol.js | 29 + node_modules/lodash/isTypedArray.js | 27 + node_modules/lodash/isUndefined.js | 22 + node_modules/lodash/isWeakMap.js | 28 + node_modules/lodash/isWeakSet.js | 28 + node_modules/lodash/iteratee.js | 53 + node_modules/lodash/join.js | 26 + node_modules/lodash/kebabCase.js | 28 + node_modules/lodash/keyBy.js | 36 + node_modules/lodash/keys.js | 37 + node_modules/lodash/keysIn.js | 32 + node_modules/lodash/lang.js | 58 + node_modules/lodash/last.js | 20 + node_modules/lodash/lastIndexOf.js | 46 + node_modules/lodash/lodash.js | 17161 ++++++++++++++++ node_modules/lodash/lodash.min.js | 139 + node_modules/lodash/lowerCase.js | 27 + node_modules/lodash/lowerFirst.js | 22 + node_modules/lodash/lt.js | 29 + node_modules/lodash/lte.js | 30 + node_modules/lodash/map.js | 53 + node_modules/lodash/mapKeys.js | 36 + node_modules/lodash/mapValues.js | 43 + node_modules/lodash/matches.js | 46 + node_modules/lodash/matchesProperty.js | 44 + node_modules/lodash/math.js | 17 + node_modules/lodash/max.js | 29 + node_modules/lodash/maxBy.js | 34 + node_modules/lodash/mean.js | 22 + node_modules/lodash/meanBy.js | 31 + node_modules/lodash/memoize.js | 73 + node_modules/lodash/merge.js | 39 + node_modules/lodash/mergeWith.js | 39 + node_modules/lodash/method.js | 34 + node_modules/lodash/methodOf.js | 33 + node_modules/lodash/min.js | 29 + node_modules/lodash/minBy.js | 34 + node_modules/lodash/mixin.js | 74 + node_modules/lodash/multiply.js | 22 + node_modules/lodash/negate.js | 40 + node_modules/lodash/next.js | 35 + node_modules/lodash/noop.js | 17 + node_modules/lodash/now.js | 23 + node_modules/lodash/nth.js | 29 + node_modules/lodash/nthArg.js | 32 + node_modules/lodash/number.js | 5 + node_modules/lodash/object.js | 49 + node_modules/lodash/omit.js | 57 + node_modules/lodash/omitBy.js | 29 + node_modules/lodash/once.js | 25 + node_modules/lodash/orderBy.js | 47 + node_modules/lodash/over.js | 24 + node_modules/lodash/overArgs.js | 61 + node_modules/lodash/overEvery.js | 34 + node_modules/lodash/overSome.js | 37 + node_modules/lodash/package.json | 65 + node_modules/lodash/pad.js | 49 + node_modules/lodash/padEnd.js | 39 + node_modules/lodash/padStart.js | 39 + node_modules/lodash/parseInt.js | 43 + node_modules/lodash/partial.js | 50 + node_modules/lodash/partialRight.js | 49 + node_modules/lodash/partition.js | 43 + node_modules/lodash/pick.js | 25 + node_modules/lodash/pickBy.js | 37 + node_modules/lodash/plant.js | 48 + node_modules/lodash/property.js | 32 + node_modules/lodash/propertyOf.js | 30 + node_modules/lodash/pull.js | 29 + node_modules/lodash/pullAll.js | 29 + node_modules/lodash/pullAllBy.js | 33 + node_modules/lodash/pullAllWith.js | 32 + node_modules/lodash/pullAt.js | 43 + node_modules/lodash/random.js | 82 + node_modules/lodash/range.js | 46 + node_modules/lodash/rangeRight.js | 41 + node_modules/lodash/rearg.js | 33 + node_modules/lodash/reduce.js | 51 + node_modules/lodash/reduceRight.js | 36 + node_modules/lodash/reject.js | 46 + node_modules/lodash/remove.js | 53 + node_modules/lodash/repeat.js | 37 + node_modules/lodash/replace.js | 29 + node_modules/lodash/rest.js | 40 + node_modules/lodash/result.js | 56 + node_modules/lodash/reverse.js | 34 + node_modules/lodash/round.js | 26 + node_modules/lodash/sample.js | 24 + node_modules/lodash/sampleSize.js | 37 + node_modules/lodash/seq.js | 16 + node_modules/lodash/set.js | 35 + node_modules/lodash/setWith.js | 32 + node_modules/lodash/shuffle.js | 25 + node_modules/lodash/size.js | 46 + node_modules/lodash/slice.js | 37 + node_modules/lodash/snakeCase.js | 28 + node_modules/lodash/some.js | 51 + node_modules/lodash/sortBy.js | 48 + node_modules/lodash/sortedIndex.js | 24 + node_modules/lodash/sortedIndexBy.js | 33 + node_modules/lodash/sortedIndexOf.js | 31 + node_modules/lodash/sortedLastIndex.js | 25 + node_modules/lodash/sortedLastIndexBy.js | 33 + node_modules/lodash/sortedLastIndexOf.js | 31 + node_modules/lodash/sortedUniq.js | 24 + node_modules/lodash/sortedUniqBy.js | 26 + node_modules/lodash/split.js | 52 + node_modules/lodash/spread.js | 63 + node_modules/lodash/startCase.js | 29 + node_modules/lodash/startsWith.js | 39 + node_modules/lodash/string.js | 33 + node_modules/lodash/stubArray.js | 23 + node_modules/lodash/stubFalse.js | 18 + node_modules/lodash/stubObject.js | 23 + node_modules/lodash/stubString.js | 18 + node_modules/lodash/stubTrue.js | 18 + node_modules/lodash/subtract.js | 22 + node_modules/lodash/sum.js | 24 + node_modules/lodash/sumBy.js | 33 + node_modules/lodash/tail.js | 22 + node_modules/lodash/take.js | 37 + node_modules/lodash/takeRight.js | 39 + node_modules/lodash/takeRightWhile.js | 45 + node_modules/lodash/takeWhile.js | 45 + node_modules/lodash/tap.js | 29 + node_modules/lodash/template.js | 251 + node_modules/lodash/templateSettings.js | 67 + node_modules/lodash/throttle.js | 69 + node_modules/lodash/thru.js | 28 + node_modules/lodash/times.js | 51 + node_modules/lodash/toArray.js | 58 + node_modules/lodash/toFinite.js | 42 + node_modules/lodash/toInteger.js | 36 + node_modules/lodash/toIterator.js | 23 + node_modules/lodash/toJSON.js | 1 + node_modules/lodash/toLength.js | 38 + node_modules/lodash/toLower.js | 28 + node_modules/lodash/toNumber.js | 66 + node_modules/lodash/toPairs.js | 30 + node_modules/lodash/toPairsIn.js | 30 + node_modules/lodash/toPath.js | 33 + node_modules/lodash/toPlainObject.js | 32 + node_modules/lodash/toSafeInteger.js | 37 + node_modules/lodash/toString.js | 28 + node_modules/lodash/toUpper.js | 28 + node_modules/lodash/transform.js | 65 + node_modules/lodash/trim.js | 49 + node_modules/lodash/trimEnd.js | 43 + node_modules/lodash/trimStart.js | 43 + node_modules/lodash/truncate.js | 111 + node_modules/lodash/unary.js | 22 + node_modules/lodash/unescape.js | 34 + node_modules/lodash/union.js | 26 + node_modules/lodash/unionBy.js | 39 + node_modules/lodash/unionWith.js | 34 + node_modules/lodash/uniq.js | 25 + node_modules/lodash/uniqBy.js | 31 + node_modules/lodash/uniqWith.js | 28 + node_modules/lodash/uniqueId.js | 28 + node_modules/lodash/unset.js | 34 + node_modules/lodash/unzip.js | 45 + node_modules/lodash/unzipWith.js | 39 + node_modules/lodash/update.js | 35 + node_modules/lodash/updateWith.js | 33 + node_modules/lodash/upperCase.js | 27 + node_modules/lodash/upperFirst.js | 22 + node_modules/lodash/util.js | 34 + node_modules/lodash/value.js | 1 + node_modules/lodash/valueOf.js | 1 + node_modules/lodash/values.js | 34 + node_modules/lodash/valuesIn.js | 32 + node_modules/lodash/without.js | 31 + node_modules/lodash/words.js | 35 + node_modules/lodash/wrap.js | 30 + node_modules/lodash/wrapperAt.js | 48 + node_modules/lodash/wrapperChain.js | 34 + node_modules/lodash/wrapperLodash.js | 147 + node_modules/lodash/wrapperReverse.js | 44 + node_modules/lodash/wrapperValue.js | 21 + node_modules/lodash/xor.js | 28 + node_modules/lodash/xorBy.js | 39 + node_modules/lodash/xorWith.js | 34 + node_modules/lodash/zip.js | 22 + node_modules/lodash/zipObject.js | 24 + node_modules/lodash/zipObjectDeep.js | 23 + node_modules/lodash/zipWith.js | 32 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 209 + node_modules/minimatch/minimatch.js | 923 + node_modules/minimatch/package.json | 66 + node_modules/minimist/.travis.yml | 8 + node_modules/minimist/LICENSE | 18 + node_modules/minimist/example/parse.js | 2 + node_modules/minimist/index.js | 245 + node_modules/minimist/package.json | 75 + node_modules/minimist/readme.markdown | 95 + node_modules/minimist/test/all_bool.js | 32 + node_modules/minimist/test/bool.js | 178 + node_modules/minimist/test/dash.js | 31 + node_modules/minimist/test/default_bool.js | 35 + node_modules/minimist/test/dotted.js | 22 + node_modules/minimist/test/kv_short.js | 16 + node_modules/minimist/test/long.js | 31 + node_modules/minimist/test/num.js | 36 + node_modules/minimist/test/parse.js | 197 + node_modules/minimist/test/parse_modified.js | 9 + node_modules/minimist/test/proto.js | 44 + node_modules/minimist/test/short.js | 67 + node_modules/minimist/test/stop_early.js | 15 + node_modules/minimist/test/unknown.js | 102 + node_modules/minimist/test/whitespace.js | 8 + node_modules/mkdirp/LICENSE | 21 + node_modules/mkdirp/bin/cmd.js | 33 + node_modules/mkdirp/bin/usage.txt | 12 + node_modules/mkdirp/index.js | 99 + node_modules/mkdirp/package.json | 69 + node_modules/mkdirp/readme.markdown | 100 + node_modules/ms/index.js | 162 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 69 + node_modules/ms/readme.md | 60 + node_modules/natural-compare/README.md | 125 + node_modules/natural-compare/index.js | 57 + node_modules/natural-compare/package.json | 73 + node_modules/normalize-package-data/AUTHORS | 4 + node_modules/normalize-package-data/LICENSE | 30 + node_modules/normalize-package-data/README.md | 106 + .../lib/extract_description.js | 14 + .../normalize-package-data/lib/fixer.js | 418 + .../lib/make_warning.js | 23 + .../normalize-package-data/lib/normalize.js | 39 + .../normalize-package-data/lib/safe_format.js | 9 + .../normalize-package-data/lib/typos.json | 25 + .../lib/warning_messages.json | 30 + .../node_modules/.bin/semver | 1 + .../node_modules/semver/CHANGELOG.md | 39 + .../node_modules/semver/LICENSE | 15 + .../node_modules/semver/README.md | 412 + .../node_modules/semver/bin/semver | 160 + .../node_modules/semver/package.json | 60 + .../node_modules/semver/range.bnf | 16 + .../node_modules/semver/semver.js | 1483 ++ .../normalize-package-data/package.json | 77 + node_modules/object-inspect/.eslintignore | 1 + node_modules/object-inspect/.eslintrc | 64 + .../.github/workflows/rebase.yml | 15 + node_modules/object-inspect/.nycrc | 17 + node_modules/object-inspect/.travis.yml | 53 + node_modules/object-inspect/LICENSE | 21 + node_modules/object-inspect/example/all.js | 23 + .../object-inspect/example/circular.js | 6 + node_modules/object-inspect/example/fn.js | 5 + .../object-inspect/example/inspect.js | 10 + node_modules/object-inspect/index.js | 383 + node_modules/object-inspect/package.json | 107 + node_modules/object-inspect/readme.markdown | 62 + node_modules/object-inspect/test-core-js.js | 26 + node_modules/object-inspect/test/bigint.js | 31 + .../object-inspect/test/browser/dom.js | 15 + node_modules/object-inspect/test/circular.js | 9 + node_modules/object-inspect/test/deep.js | 9 + node_modules/object-inspect/test/element.js | 53 + node_modules/object-inspect/test/err.js | 31 + node_modules/object-inspect/test/fn.js | 28 + node_modules/object-inspect/test/has.js | 34 + node_modules/object-inspect/test/holes.js | 15 + .../object-inspect/test/indent-option.js | 271 + node_modules/object-inspect/test/inspect.js | 35 + node_modules/object-inspect/test/lowbyte.js | 12 + node_modules/object-inspect/test/number.js | 12 + .../object-inspect/test/quoteStyle.js | 17 + node_modules/object-inspect/test/undef.js | 12 + node_modules/object-inspect/test/values.js | 171 + node_modules/object-inspect/util.inspect.js | 1 + node_modules/object-keys/.editorconfig | 13 + node_modules/object-keys/.eslintrc | 17 + node_modules/object-keys/.travis.yml | 277 + node_modules/object-keys/CHANGELOG.md | 232 + node_modules/object-keys/LICENSE | 21 + node_modules/object-keys/README.md | 76 + node_modules/object-keys/implementation.js | 122 + node_modules/object-keys/index.js | 32 + node_modules/object-keys/isArguments.js | 17 + node_modules/object-keys/package.json | 125 + node_modules/object-keys/test/index.js | 5 + node_modules/object.assign/.editorconfig | 20 + node_modules/object.assign/.eslintignore | 1 + node_modules/object.assign/.eslintrc | 26 + .../object.assign/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + .../.github/workflows/require-allow-edits.yml | 14 + node_modules/object.assign/CHANGELOG.md | 194 + node_modules/object.assign/LICENSE | 21 + node_modules/object.assign/README.md | 135 + node_modules/object.assign/auto.js | 3 + node_modules/object.assign/dist/browser.js | 840 + node_modules/object.assign/hasSymbols.js | 43 + node_modules/object.assign/implementation.js | 42 + node_modules/object.assign/index.js | 22 + node_modules/object.assign/package.json | 122 + node_modules/object.assign/polyfill.js | 55 + node_modules/object.assign/shim.js | 14 + node_modules/object.assign/test/index.js | 17 + node_modules/object.assign/test/native.js | 49 + node_modules/object.assign/test/ses-compat.js | 15 + node_modules/object.assign/test/shimmed.js | 52 + node_modules/object.assign/test/tests.js | 237 + node_modules/object.entries/.editorconfig | 20 + node_modules/object.entries/.eslintrc | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/object.entries/.travis.yml | 8 + node_modules/object.entries/CHANGELOG.md | 124 + node_modules/object.entries/LICENSE | 22 + node_modules/object.entries/README.md | 59 + node_modules/object.entries/auto.js | 3 + node_modules/object.entries/implementation.js | 17 + node_modules/object.entries/index.js | 18 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 395 + .../node_modules/es-abstract/GetIntrinsic.js | 225 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../node_modules/es-abstract/es5.js | 49 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 34 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 139 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ node_modules/object.entries/package.json | 129 + node_modules/object.entries/polyfill.js | 7 + node_modules/object.entries/shim.js | 14 + node_modules/object.entries/test/.eslintrc | 11 + node_modules/object.entries/test/index.js | 17 + node_modules/object.entries/test/shimmed.js | 36 + node_modules/object.entries/test/tests.js | 82 + node_modules/object.values/.eslintrc | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/object.values/.travis.yml | 12 + node_modules/object.values/CHANGELOG.md | 44 + node_modules/object.values/LICENSE | 22 + node_modules/object.values/README.md | 59 + node_modules/object.values/auto.js | 3 + node_modules/object.values/implementation.js | 18 + node_modules/object.values/index.js | 17 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 395 + .../node_modules/es-abstract/GetIntrinsic.js | 225 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../node_modules/es-abstract/es5.js | 49 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 34 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 139 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ node_modules/object.values/package.json | 121 + node_modules/object.values/polyfill.js | 7 + node_modules/object.values/shim.js | 14 + node_modules/object.values/test/.eslintrc | 11 + node_modules/object.values/test/index.js | 17 + node_modules/object.values/test/shimmed.js | 36 + node_modules/object.values/test/tests.js | 82 + node_modules/optionator/CHANGELOG.md | 59 + node_modules/optionator/LICENSE | 22 + node_modules/optionator/README.md | 238 + node_modules/optionator/lib/help.js | 260 + node_modules/optionator/lib/index.js | 465 + node_modules/optionator/lib/util.js | 54 + node_modules/optionator/package.json | 73 + node_modules/p-limit/index.js | 42 + node_modules/p-limit/license | 9 + node_modules/p-limit/package.json | 81 + node_modules/p-limit/readme.md | 69 + node_modules/p-locate/index.js | 31 + node_modules/p-locate/license | 21 + node_modules/p-locate/package.json | 86 + node_modules/p-locate/readme.md | 86 + node_modules/p-try/index.js | 4 + node_modules/p-try/license | 21 + node_modules/p-try/package.json | 75 + node_modules/p-try/readme.md | 38 + node_modules/parent-module/index.js | 37 + node_modules/parent-module/license | 9 + node_modules/parent-module/package.json | 78 + node_modules/parent-module/readme.md | 67 + node_modules/parse-json/index.js | 35 + node_modules/parse-json/license | 21 + node_modules/parse-json/package.json | 78 + node_modules/parse-json/readme.md | 83 + node_modules/parse-json/vendor/parse.js | 752 + node_modules/parse-json/vendor/unicode.js | 71 + node_modules/path-exists/index.js | 17 + node_modules/path-exists/license | 21 + node_modules/path-exists/package.json | 72 + node_modules/path-exists/readme.md | 50 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 75 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-key/index.d.ts | 40 + node_modules/path-key/index.js | 16 + node_modules/path-key/license | 9 + node_modules/path-key/package.json | 71 + node_modules/path-key/readme.md | 61 + node_modules/path-parse/.travis.yml | 9 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 93 + node_modules/path-parse/package.json | 61 + node_modules/path-parse/test.js | 77 + node_modules/path-type/index.js | 26 + node_modules/path-type/license | 21 + node_modules/path-type/package.json | 80 + node_modules/path-type/readme.md | 42 + node_modules/pify/index.js | 68 + node_modules/pify/license | 21 + node_modules/pify/package.json | 81 + node_modules/pify/readme.md | 119 + node_modules/pkg-dir/index.js | 10 + node_modules/pkg-dir/license | 21 + node_modules/pkg-dir/package.json | 85 + node_modules/pkg-dir/readme.md | 64 + node_modules/prelude-ls/CHANGELOG.md | 108 + node_modules/prelude-ls/LICENSE | 22 + node_modules/prelude-ls/README.md | 15 + node_modules/prelude-ls/lib/Func.js | 69 + node_modules/prelude-ls/lib/List.js | 716 + node_modules/prelude-ls/lib/Num.js | 130 + node_modules/prelude-ls/lib/Obj.js | 154 + node_modules/prelude-ls/lib/Str.js | 92 + node_modules/prelude-ls/lib/index.js | 178 + node_modules/prelude-ls/package.json | 78 + node_modules/progress/CHANGELOG.md | 115 + node_modules/progress/LICENSE | 22 + node_modules/progress/Makefile | 8 + node_modules/progress/Readme.md | 146 + node_modules/progress/index.js | 1 + node_modules/progress/lib/node-progress.js | 236 + node_modules/progress/package.json | 70 + node_modules/read-pkg-up/index.js | 26 + node_modules/read-pkg-up/license | 21 + node_modules/read-pkg-up/package.json | 94 + node_modules/read-pkg-up/readme.md | 80 + node_modules/read-pkg/index.js | 47 + node_modules/read-pkg/license | 21 + node_modules/read-pkg/package.json | 77 + node_modules/read-pkg/readme.md | 79 + node_modules/regexpp/LICENSE | 21 + node_modules/regexpp/README.md | 178 + node_modules/regexpp/index.d.ts | 247 + node_modules/regexpp/index.js | 2085 ++ node_modules/regexpp/index.js.map | 1 + node_modules/regexpp/index.mjs | 2076 ++ node_modules/regexpp/index.mjs.map | 1 + node_modules/regexpp/package.json | 112 + node_modules/resolve-from/index.js | 47 + node_modules/resolve-from/license | 9 + node_modules/resolve-from/package.json | 66 + node_modules/resolve-from/readme.md | 72 + node_modules/resolve/.editorconfig | 20 + node_modules/resolve/.eslintignore | 1 + node_modules/resolve/.eslintrc | 39 + node_modules/resolve/.travis.yml | 8 + node_modules/resolve/LICENSE | 21 + node_modules/resolve/appveyor.yml | 54 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 6 + node_modules/resolve/lib/async.js | 298 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/core.js | 53 + node_modules/resolve/lib/core.json | 75 + node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + node_modules/resolve/lib/normalize-options.js | 10 + node_modules/resolve/lib/sync.js | 191 + node_modules/resolve/package.json | 78 + node_modules/resolve/readme.markdown | 242 + node_modules/resolve/test/.eslintrc | 5 + node_modules/resolve/test/core.js | 85 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 2 + node_modules/resolve/test/dotdot/index.js | 1 + node_modules/resolve/test/faulty_basedir.js | 29 + node_modules/resolve/test/filter.js | 34 + node_modules/resolve/test/filter_sync.js | 33 + node_modules/resolve/test/mock.js | 239 + node_modules/resolve/test/mock_sync.js | 141 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + node_modules/resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + node_modules/resolve/test/resolver.js | 450 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 358 + node_modules/resolve/test/shadowed_core.js | 38 + .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 173 + node_modules/rimraf/LICENSE | 15 + node_modules/rimraf/README.md | 101 + node_modules/rimraf/bin.js | 50 + node_modules/rimraf/package.json | 67 + node_modules/rimraf/rimraf.js | 364 + node_modules/semver/CHANGELOG.md | 111 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 566 + node_modules/semver/bin/semver.js | 173 + node_modules/semver/classes/comparator.js | 139 + node_modules/semver/classes/index.js | 5 + node_modules/semver/classes/range.js | 463 + node_modules/semver/classes/semver.js | 290 + node_modules/semver/functions/clean.js | 6 + node_modules/semver/functions/cmp.js | 48 + node_modules/semver/functions/coerce.js | 51 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + node_modules/semver/functions/compare.js | 5 + node_modules/semver/functions/diff.js | 23 + node_modules/semver/functions/eq.js | 3 + node_modules/semver/functions/gt.js | 3 + node_modules/semver/functions/gte.js | 3 + node_modules/semver/functions/inc.js | 15 + node_modules/semver/functions/lt.js | 3 + node_modules/semver/functions/lte.js | 3 + node_modules/semver/functions/major.js | 3 + node_modules/semver/functions/minor.js | 3 + node_modules/semver/functions/neq.js | 3 + node_modules/semver/functions/parse.js | 37 + node_modules/semver/functions/patch.js | 3 + node_modules/semver/functions/prerelease.js | 6 + node_modules/semver/functions/rcompare.js | 3 + node_modules/semver/functions/rsort.js | 3 + node_modules/semver/functions/satisfies.js | 10 + node_modules/semver/functions/sort.js | 3 + node_modules/semver/functions/valid.js | 6 + node_modules/semver/index.js | 48 + node_modules/semver/internal/constants.js | 17 + node_modules/semver/internal/debug.js | 9 + node_modules/semver/internal/identifiers.js | 23 + node_modules/semver/internal/re.js | 182 + node_modules/semver/package.json | 70 + node_modules/semver/preload.js | 2 + node_modules/semver/range.bnf | 16 + node_modules/semver/ranges/gtr.js | 4 + node_modules/semver/ranges/intersects.js | 7 + node_modules/semver/ranges/ltr.js | 4 + node_modules/semver/ranges/max-satisfying.js | 25 + node_modules/semver/ranges/min-satisfying.js | 24 + node_modules/semver/ranges/min-version.js | 57 + node_modules/semver/ranges/outside.js | 80 + node_modules/semver/ranges/simplify.js | 44 + node_modules/semver/ranges/subset.js | 155 + node_modules/semver/ranges/to-comparators.js | 8 + node_modules/semver/ranges/valid.js | 11 + node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 9 + node_modules/shebang-command/package.json | 66 + node_modules/shebang-command/readme.md | 34 + node_modules/shebang-regex/index.d.ts | 22 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 9 + node_modules/shebang-regex/package.json | 67 + node_modules/shebang-regex/readme.md | 33 + node_modules/slice-ansi/index.js | 59 + node_modules/slice-ansi/license | 9 + node_modules/slice-ansi/package.json | 83 + node_modules/slice-ansi/readme.md | 64 + node_modules/spdx-correct/LICENSE | 202 + node_modules/spdx-correct/README.md | 14 + node_modules/spdx-correct/index.js | 364 + node_modules/spdx-correct/package.json | 88 + node_modules/spdx-exceptions/README.md | 36 + node_modules/spdx-exceptions/index.json | 40 + node_modules/spdx-exceptions/package.json | 55 + node_modules/spdx-expression-parse/AUTHORS | 4 + node_modules/spdx-expression-parse/LICENSE | 22 + node_modules/spdx-expression-parse/README.md | 91 + node_modules/spdx-expression-parse/index.js | 8 + .../spdx-expression-parse/package.json | 96 + node_modules/spdx-expression-parse/parse.js | 138 + node_modules/spdx-expression-parse/scan.js | 131 + node_modules/spdx-license-ids/README.md | 52 + node_modules/spdx-license-ids/deprecated.json | 26 + node_modules/spdx-license-ids/index.json | 414 + node_modules/spdx-license-ids/package.json | 75 + node_modules/sprintf-js/.npmignore | 1 + node_modules/sprintf-js/LICENSE | 24 + node_modules/sprintf-js/README.md | 88 + node_modules/sprintf-js/bower.json | 14 + node_modules/sprintf-js/demo/angular.html | 20 + .../sprintf-js/dist/angular-sprintf.min.js | 4 + .../dist/angular-sprintf.min.js.map | 1 + .../sprintf-js/dist/angular-sprintf.min.map | 1 + node_modules/sprintf-js/dist/sprintf.min.js | 4 + .../sprintf-js/dist/sprintf.min.js.map | 1 + node_modules/sprintf-js/dist/sprintf.min.map | 1 + node_modules/sprintf-js/gruntfile.js | 36 + node_modules/sprintf-js/package.json | 54 + .../sprintf-js/src/angular-sprintf.js | 18 + node_modules/sprintf-js/src/sprintf.js | 208 + node_modules/sprintf-js/test/test.js | 82 + node_modules/string-width/index.js | 39 + node_modules/string-width/license | 9 + .../node_modules/ansi-regex/index.js | 14 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 85 + .../node_modules/ansi-regex/readme.md | 87 + .../node_modules/strip-ansi/index.d.ts | 15 + .../node_modules/strip-ansi/index.js | 7 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 86 + .../node_modules/strip-ansi/readme.md | 61 + node_modules/string-width/package.json | 88 + node_modules/string-width/readme.md | 45 + .../string.prototype.trimend/.editorconfig | 20 + .../string.prototype.trimend/.eslintrc | 15 + .../.github/workflows/rebase.yml | 15 + .../string.prototype.trimend/.travis.yml | 8 + .../string.prototype.trimend/CHANGELOG.md | 44 + node_modules/string.prototype.trimend/LICENSE | 21 + .../string.prototype.trimend/README.md | 47 + node_modules/string.prototype.trimend/auto.js | 3 + .../implementation.js | 12 + .../string.prototype.trimend/index.js | 18 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 395 + .../node_modules/es-abstract/GetIntrinsic.js | 225 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../node_modules/es-abstract/es5.js | 49 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 34 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 139 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ .../string.prototype.trimend/package.json | 121 + .../string.prototype.trimend/polyfill.js | 15 + node_modules/string.prototype.trimend/shim.js | 14 + .../string.prototype.trimend/test/index.js | 17 + .../string.prototype.trimend/test/shimmed.js | 37 + .../string.prototype.trimend/test/tests.js | 26 + .../string.prototype.trimstart/.editorconfig | 20 + .../string.prototype.trimstart/.eslintrc | 15 + .../.github/workflows/rebase.yml | 15 + .../string.prototype.trimstart/.travis.yml | 12 + .../string.prototype.trimstart/CHANGELOG.md | 44 + .../string.prototype.trimstart/LICENSE | 21 + .../string.prototype.trimstart/README.md | 47 + .../string.prototype.trimstart/auto.js | 3 + .../implementation.js | 12 + .../string.prototype.trimstart/index.js | 18 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 395 + .../node_modules/es-abstract/GetIntrinsic.js | 225 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../node_modules/es-abstract/es5.js | 49 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 34 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 139 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ .../string.prototype.trimstart/package.json | 121 + .../string.prototype.trimstart/polyfill.js | 15 + .../string.prototype.trimstart/shim.js | 14 + .../string.prototype.trimstart/test/index.js | 18 + .../test/shimmed.js | 37 + .../string.prototype.trimstart/test/tests.js | 26 + node_modules/strip-ansi/index.d.ts | 17 + node_modules/strip-ansi/index.js | 4 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 86 + node_modules/strip-ansi/readme.md | 46 + node_modules/strip-bom/index.js | 14 + node_modules/strip-bom/license | 21 + node_modules/strip-bom/package.json | 73 + node_modules/strip-bom/readme.md | 36 + node_modules/strip-json-comments/index.d.ts | 36 + node_modules/strip-json-comments/index.js | 77 + node_modules/strip-json-comments/license | 9 + node_modules/strip-json-comments/package.json | 80 + node_modules/strip-json-comments/readme.md | 78 + node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 131 + node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 85 + node_modules/supports-color/readme.md | 66 + node_modules/table/LICENSE | 24 + node_modules/table/README.md | 735 + node_modules/table/dist/alignString.js | 108 + node_modules/table/dist/alignString.js.flow | 96 + node_modules/table/dist/alignString.js.map | 1 + node_modules/table/dist/alignTableData.js | 35 + .../table/dist/alignTableData.js.flow | 21 + node_modules/table/dist/alignTableData.js.map | 1 + .../table/dist/calculateCellHeight.js | 38 + .../table/dist/calculateCellHeight.js.flow | 24 + .../table/dist/calculateCellHeight.js.map | 1 + .../table/dist/calculateCellWidthIndex.js | 28 + .../dist/calculateCellWidthIndex.js.flow | 17 + .../table/dist/calculateCellWidthIndex.js.map | 1 + .../dist/calculateMaximumColumnWidthIndex.js | 37 + .../calculateMaximumColumnWidthIndex.js.flow | 27 + .../calculateMaximumColumnWidthIndex.js.map | 1 + .../table/dist/calculateRowHeightIndex.js | 48 + .../dist/calculateRowHeightIndex.js.flow | 35 + .../table/dist/calculateRowHeightIndex.js.map | 1 + node_modules/table/dist/createStream.js | 132 + node_modules/table/dist/createStream.js.flow | 127 + node_modules/table/dist/createStream.js.map | 1 + node_modules/table/dist/drawBorder.js | 110 + node_modules/table/dist/drawBorder.js.flow | 101 + node_modules/table/dist/drawBorder.js.map | 1 + node_modules/table/dist/drawRow.js | 26 + node_modules/table/dist/drawRow.js.flow | 15 + node_modules/table/dist/drawRow.js.map | 1 + node_modules/table/dist/drawTable.js | 59 + node_modules/table/dist/drawTable.js.flow | 53 + node_modules/table/dist/drawTable.js.map | 1 + .../table/dist/getBorderCharacters.js | 119 + .../table/dist/getBorderCharacters.js.flow | 120 + .../table/dist/getBorderCharacters.js.map | 1 + node_modules/table/dist/index.js | 32 + node_modules/table/dist/index.js.flow | 9 + node_modules/table/dist/index.js.map | 1 + node_modules/table/dist/makeConfig.js | 94 + node_modules/table/dist/makeConfig.js.flow | 76 + node_modules/table/dist/makeConfig.js.map | 1 + node_modules/table/dist/makeStreamConfig.js | 101 + .../table/dist/makeStreamConfig.js.flow | 83 + .../table/dist/makeStreamConfig.js.map | 1 + .../table/dist/mapDataUsingRowHeightIndex.js | 44 + .../dist/mapDataUsingRowHeightIndex.js.flow | 34 + .../dist/mapDataUsingRowHeightIndex.js.map | 1 + node_modules/table/dist/padTableData.js | 24 + node_modules/table/dist/padTableData.js.flow | 14 + node_modules/table/dist/padTableData.js.map | 1 + node_modules/table/dist/schemas/config.json | 114 + .../table/dist/schemas/streamConfig.json | 114 + node_modules/table/dist/stringifyTableData.js | 22 + .../table/dist/stringifyTableData.js.flow | 11 + .../table/dist/stringifyTableData.js.map | 1 + node_modules/table/dist/table.js | 110 + node_modules/table/dist/table.js.flow | 96 + node_modules/table/dist/table.js.map | 1 + node_modules/table/dist/truncateTableData.js | 30 + .../table/dist/truncateTableData.js.flow | 17 + .../table/dist/truncateTableData.js.map | 1 + node_modules/table/dist/validateConfig.js | 752 + .../table/dist/validateConfig.js.flow | 34 + node_modules/table/dist/validateConfig.js.map | 1 + .../table/dist/validateStreamConfig.js | 739 + node_modules/table/dist/validateTableData.js | 96 + .../table/dist/validateTableData.js.flow | 44 + .../table/dist/validateTableData.js.map | 1 + node_modules/table/dist/wrapCell.js | 48 + node_modules/table/dist/wrapCell.js.flow | 35 + node_modules/table/dist/wrapCell.js.map | 1 + node_modules/table/dist/wrapString.js | 40 + node_modules/table/dist/wrapString.js.flow | 29 + node_modules/table/dist/wrapString.js.map | 1 + node_modules/table/dist/wrapWord.js | 47 + node_modules/table/dist/wrapWord.js.flow | 39 + node_modules/table/dist/wrapWord.js.map | 1 + node_modules/table/package.json | 113 + node_modules/text-table/.travis.yml | 4 + node_modules/text-table/LICENSE | 18 + node_modules/text-table/example/align.js | 8 + node_modules/text-table/example/center.js | 8 + node_modules/text-table/example/dotalign.js | 9 + node_modules/text-table/example/doubledot.js | 11 + node_modules/text-table/example/table.js | 6 + node_modules/text-table/index.js | 86 + node_modules/text-table/package.json | 73 + node_modules/text-table/readme.markdown | 134 + node_modules/text-table/test/align.js | 18 + node_modules/text-table/test/ansi-colors.js | 32 + node_modules/text-table/test/center.js | 18 + node_modules/text-table/test/dotalign.js | 20 + node_modules/text-table/test/doubledot.js | 24 + node_modules/text-table/test/table.js | 14 + node_modules/tsconfig-paths/.nycrc.json | 8 + node_modules/tsconfig-paths/CHANGELOG.md | 307 + node_modules/tsconfig-paths/LICENSE | 21 + node_modules/tsconfig-paths/README.md | 231 + .../tsconfig-paths/lib/config-loader.d.ts | 33 + .../tsconfig-paths/lib/config-loader.js | 55 + .../tsconfig-paths/lib/filesystem.d.ts | 33 + node_modules/tsconfig-paths/lib/filesystem.js | 53 + node_modules/tsconfig-paths/lib/index.d.ts | 5 + node_modules/tsconfig-paths/lib/index.js | 13 + .../tsconfig-paths/lib/mapping-entry.d.ts | 17 + .../tsconfig-paths/lib/mapping-entry.js | 51 + .../tsconfig-paths/lib/match-path-async.d.ts | 21 + .../tsconfig-paths/lib/match-path-async.js | 113 + .../tsconfig-paths/lib/match-path-sync.d.ts | 30 + .../tsconfig-paths/lib/match-path-sync.js | 87 + node_modules/tsconfig-paths/lib/options.d.ts | 4 + node_modules/tsconfig-paths/lib/options.js | 13 + node_modules/tsconfig-paths/lib/register.d.ts | 6 + node_modules/tsconfig-paths/lib/register.js | 82 + node_modules/tsconfig-paths/lib/try-path.d.ts | 15 + node_modules/tsconfig-paths/lib/try-path.js | 91 + .../tsconfig-paths/lib/tsconfig-loader.d.ts | 28 + .../tsconfig-paths/lib/tsconfig-loader.js | 97 + node_modules/tsconfig-paths/package.json | 97 + node_modules/tsconfig-paths/register.js | 1 + .../test/config-loader-tests.ts | 90 + .../test/data/match-path-data.ts | 212 + .../tsconfig-paths/test/filesystem-tests.ts | 46 + .../tsconfig-paths/test/mapping-entry-test.ts | 47 + .../test/match-path-async-tests.ts | 27 + .../test/match-path-sync-tests.ts | 23 + node_modules/tsconfig-paths/test/mocha.opts | 3 + .../tsconfig-paths/test/try-path-tests.ts | 99 + .../test/tsconfig-loader-tests.ts | 203 + .../tsconfig-paths/test/tsconfig-named.json | 10 + .../tsconfig-paths/test/tsconfig.json | 9 + node_modules/tsconfig-paths/tslint.json | 88 + node_modules/type-check/LICENSE | 22 + node_modules/type-check/README.md | 210 + node_modules/type-check/lib/check.js | 128 + node_modules/type-check/lib/index.js | 16 + node_modules/type-check/lib/parse-type.js | 198 + node_modules/type-check/package.json | 70 + node_modules/type-fest/index.d.ts | 20 + node_modules/type-fest/license | 9 + node_modules/type-fest/package.json | 83 + node_modules/type-fest/readme.md | 635 + node_modules/type-fest/source/basic.d.ts | 67 + node_modules/type-fest/source/except.d.ts | 22 + .../type-fest/source/literal-union.d.ts | 33 + .../type-fest/source/merge-exclusive.d.ts | 39 + node_modules/type-fest/source/merge.d.ts | 22 + node_modules/type-fest/source/mutable.d.ts | 22 + node_modules/type-fest/source/opaque.d.ts | 40 + .../type-fest/source/package-json.d.ts | 501 + .../type-fest/source/partial-deep.d.ts | 72 + node_modules/type-fest/source/promisable.d.ts | 23 + .../type-fest/source/readonly-deep.d.ts | 59 + .../source/require-at-least-one.d.ts | 32 + .../type-fest/source/require-exactly-one.d.ts | 36 + .../type-fest/source/set-optional.d.ts | 32 + .../type-fest/source/set-required.d.ts | 32 + node_modules/v8-compile-cache/CHANGELOG.md | 45 + node_modules/v8-compile-cache/LICENSE | 21 + node_modules/v8-compile-cache/README.md | 53 + node_modules/v8-compile-cache/package.json | 65 + .../v8-compile-cache/v8-compile-cache.js | 367 + .../validate-npm-package-license/LICENSE | 202 + .../validate-npm-package-license/README.md | 113 + .../validate-npm-package-license/index.js | 86 + .../validate-npm-package-license/package.json | 67 + node_modules/which/CHANGELOG.md | 166 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 54 + node_modules/which/bin/node-which | 52 + node_modules/which/package.json | 76 + node_modules/which/which.js | 125 + node_modules/word-wrap/LICENSE | 21 + node_modules/word-wrap/README.md | 182 + node_modules/word-wrap/index.d.ts | 50 + node_modules/word-wrap/index.js | 46 + node_modules/word-wrap/package.json | 137 + node_modules/write/LICENSE | 21 + node_modules/write/README.md | 178 + node_modules/write/index.js | 160 + node_modules/write/package.json | 111 + package-lock.json | 1530 ++ package.json | 5 + 8104 files changed, 524796 insertions(+) create mode 100644 .eslintrc.json create mode 120000 node_modules/.bin/acorn create mode 120000 node_modules/.bin/eslint create mode 120000 node_modules/.bin/esparse create mode 120000 node_modules/.bin/esvalidate create mode 120000 node_modules/.bin/js-yaml create mode 120000 node_modules/.bin/json5 create mode 120000 node_modules/.bin/mkdirp create mode 120000 node_modules/.bin/node-which create mode 120000 node_modules/.bin/rimraf create mode 120000 node_modules/.bin/semver create mode 100644 node_modules/@babel/code-frame/LICENSE create mode 100644 node_modules/@babel/code-frame/README.md create mode 100644 node_modules/@babel/code-frame/lib/index.js create mode 100644 node_modules/@babel/code-frame/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/LICENSE create mode 100644 node_modules/@babel/helper-validator-identifier/README.md create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js create mode 100644 node_modules/@babel/helper-validator-identifier/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js create mode 100644 node_modules/@babel/highlight/LICENSE create mode 100644 node_modules/@babel/highlight/README.md create mode 100644 node_modules/@babel/highlight/lib/index.js create mode 100644 node_modules/@babel/highlight/node_modules/chalk/index.js create mode 100644 node_modules/@babel/highlight/node_modules/chalk/index.js.flow create mode 100644 node_modules/@babel/highlight/node_modules/chalk/license create mode 100644 node_modules/@babel/highlight/node_modules/chalk/package.json create mode 100644 node_modules/@babel/highlight/node_modules/chalk/readme.md create mode 100644 node_modules/@babel/highlight/node_modules/chalk/templates.js create mode 100644 node_modules/@babel/highlight/node_modules/chalk/types/index.d.ts create mode 100644 node_modules/@babel/highlight/package.json create mode 100644 node_modules/@eslint/eslintrc/CHANGELOG.md create mode 100644 node_modules/@eslint/eslintrc/LICENSE create mode 100644 node_modules/@eslint/eslintrc/README.md create mode 100644 node_modules/@eslint/eslintrc/conf/category-list.json create mode 100644 node_modules/@eslint/eslintrc/conf/config-schema.js create mode 100644 node_modules/@eslint/eslintrc/conf/default-cli-options.js create mode 100644 node_modules/@eslint/eslintrc/conf/environments.js create mode 100644 node_modules/@eslint/eslintrc/conf/eslint-all.js create mode 100644 node_modules/@eslint/eslintrc/conf/eslint-recommended.js create mode 100644 node_modules/@eslint/eslintrc/conf/replacements.json create mode 100644 node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array-factory.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/config-array.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/index.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/override-tester.js create mode 100644 node_modules/@eslint/eslintrc/lib/index.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/ajv.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/config-ops.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/config-validator.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/naming.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js create mode 100644 node_modules/@eslint/eslintrc/package.json create mode 100644 node_modules/@types/json5/README.md create mode 100644 node_modules/@types/json5/index.d.ts create mode 100644 node_modules/@types/json5/package.json create mode 100644 node_modules/@types/json5/types-metadata.json create mode 100644 node_modules/acorn-jsx/LICENSE create mode 100644 node_modules/acorn-jsx/README.md create mode 100644 node_modules/acorn-jsx/index.js create mode 100644 node_modules/acorn-jsx/package.json create mode 100644 node_modules/acorn-jsx/xhtml.js create mode 100644 node_modules/acorn/CHANGELOG.md create mode 100644 node_modules/acorn/LICENSE create mode 100644 node_modules/acorn/README.md create mode 100755 node_modules/acorn/bin/acorn create mode 100644 node_modules/acorn/dist/acorn.d.ts create mode 100644 node_modules/acorn/dist/acorn.js create mode 100644 node_modules/acorn/dist/acorn.js.map create mode 100644 node_modules/acorn/dist/acorn.mjs create mode 100644 node_modules/acorn/dist/acorn.mjs.d.ts create mode 100644 node_modules/acorn/dist/acorn.mjs.map create mode 100644 node_modules/acorn/dist/bin.js create mode 100644 node_modules/acorn/package.json create mode 100644 node_modules/ansi-colors/LICENSE create mode 100644 node_modules/ansi-colors/README.md create mode 100644 node_modules/ansi-colors/index.js create mode 100644 node_modules/ansi-colors/package.json create mode 100644 node_modules/ansi-colors/symbols.js create mode 100644 node_modules/ansi-colors/types/index.d.ts create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/argparse/LICENSE create mode 100644 node_modules/argparse/README.md create mode 100644 node_modules/argparse/index.js create mode 100644 node_modules/argparse/lib/action.js create mode 100644 node_modules/argparse/lib/action/append.js create mode 100644 node_modules/argparse/lib/action/append/constant.js create mode 100644 node_modules/argparse/lib/action/count.js create mode 100644 node_modules/argparse/lib/action/help.js create mode 100644 node_modules/argparse/lib/action/store.js create mode 100644 node_modules/argparse/lib/action/store/constant.js create mode 100644 node_modules/argparse/lib/action/store/false.js create mode 100644 node_modules/argparse/lib/action/store/true.js create mode 100644 node_modules/argparse/lib/action/subparsers.js create mode 100644 node_modules/argparse/lib/action/version.js create mode 100644 node_modules/argparse/lib/action_container.js create mode 100644 node_modules/argparse/lib/argparse.js create mode 100644 node_modules/argparse/lib/argument/error.js create mode 100644 node_modules/argparse/lib/argument/exclusive.js create mode 100644 node_modules/argparse/lib/argument/group.js create mode 100644 node_modules/argparse/lib/argument_parser.js create mode 100644 node_modules/argparse/lib/const.js create mode 100644 node_modules/argparse/lib/help/added_formatters.js create mode 100644 node_modules/argparse/lib/help/formatter.js create mode 100644 node_modules/argparse/lib/namespace.js create mode 100644 node_modules/argparse/lib/utils.js create mode 100644 node_modules/argparse/package.json create mode 100644 node_modules/array-includes/.editorconfig create mode 100644 node_modules/array-includes/.eslintrc create mode 100644 node_modules/array-includes/.github/FUNDING.yml create mode 100644 node_modules/array-includes/.github/workflows/rebase.yml create mode 100644 node_modules/array-includes/.travis.yml create mode 100644 node_modules/array-includes/CHANGELOG.md create mode 100644 node_modules/array-includes/LICENSE create mode 100644 node_modules/array-includes/README.md create mode 100644 node_modules/array-includes/auto.js create mode 100644 node_modules/array-includes/implementation.js create mode 100644 node_modules/array-includes/index.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/array-includes/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/array-includes/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/array-includes/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/array-includes/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/array-includes/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/array-includes/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/array-includes/node_modules/es-abstract/.nycrc create mode 100644 node_modules/array-includes/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/LICENSE create mode 100644 node_modules/array-includes/node_modules/es-abstract/README.md create mode 100644 node_modules/array-includes/node_modules/es-abstract/es2015.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es2016.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es2017.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es2018.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es2019.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es5.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es6.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/es7.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/index.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/array-includes/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/package.json create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/index.js create mode 100644 node_modules/array-includes/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/array-includes/package.json create mode 100644 node_modules/array-includes/polyfill.js create mode 100644 node_modules/array-includes/shim.js create mode 100644 node_modules/array-includes/test.html create mode 100644 node_modules/array-includes/test/index.js create mode 100644 node_modules/array-includes/test/shimmed.js create mode 100644 node_modules/array-includes/test/tests.js create mode 100644 node_modules/array.prototype.flat/.editorconfig create mode 100644 node_modules/array.prototype.flat/.eslintrc create mode 100644 node_modules/array.prototype.flat/.github/FUNDING.yml create mode 100644 node_modules/array.prototype.flat/.github/workflows/rebase.yml create mode 100644 node_modules/array.prototype.flat/.nycrc create mode 100644 node_modules/array.prototype.flat/.travis.yml create mode 100644 node_modules/array.prototype.flat/CHANGELOG.md create mode 100644 node_modules/array.prototype.flat/LICENSE create mode 100644 node_modules/array.prototype.flat/README.md create mode 100644 node_modules/array.prototype.flat/auto.js create mode 100644 node_modules/array.prototype.flat/implementation.js create mode 100644 node_modules/array.prototype.flat/index.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.nycrc create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/LICENSE create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/README.md create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es2015.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es2016.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es2017.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es2018.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es2019.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es5.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es6.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/es7.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/index.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/package.json create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/index.js create mode 100644 node_modules/array.prototype.flat/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/array.prototype.flat/package.json create mode 100644 node_modules/array.prototype.flat/polyfill.js create mode 100644 node_modules/array.prototype.flat/shim.js create mode 100644 node_modules/array.prototype.flat/test/index.js create mode 100644 node_modules/array.prototype.flat/test/shimmed.js create mode 100644 node_modules/array.prototype.flat/test/tests.js create mode 100644 node_modules/astral-regex/index.js create mode 100644 node_modules/astral-regex/license create mode 100644 node_modules/astral-regex/package.json create mode 100644 node_modules/astral-regex/readme.md create mode 100644 node_modules/balanced-match/.npmignore create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/callsites/index.d.ts create mode 100644 node_modules/callsites/index.js create mode 100644 node_modules/callsites/license create mode 100644 node_modules/callsites/package.json create mode 100644 node_modules/callsites/readme.md create mode 100644 node_modules/chalk/index.d.ts create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/chalk/node_modules/ansi-styles/index.js create mode 100644 node_modules/chalk/node_modules/ansi-styles/license create mode 100644 node_modules/chalk/node_modules/ansi-styles/package.json create mode 100644 node_modules/chalk/node_modules/ansi-styles/readme.md create mode 100644 node_modules/chalk/node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/chalk/node_modules/color-convert/LICENSE create mode 100644 node_modules/chalk/node_modules/color-convert/README.md create mode 100644 node_modules/chalk/node_modules/color-convert/conversions.js create mode 100644 node_modules/chalk/node_modules/color-convert/index.js create mode 100644 node_modules/chalk/node_modules/color-convert/package.json create mode 100644 node_modules/chalk/node_modules/color-convert/route.js create mode 100644 node_modules/chalk/node_modules/color-name/LICENSE create mode 100644 node_modules/chalk/node_modules/color-name/README.md create mode 100644 node_modules/chalk/node_modules/color-name/index.js create mode 100644 node_modules/chalk/node_modules/color-name/package.json create mode 100644 node_modules/chalk/node_modules/has-flag/index.d.ts create mode 100644 node_modules/chalk/node_modules/has-flag/index.js create mode 100644 node_modules/chalk/node_modules/has-flag/license create mode 100644 node_modules/chalk/node_modules/has-flag/package.json create mode 100644 node_modules/chalk/node_modules/has-flag/readme.md create mode 100644 node_modules/chalk/node_modules/supports-color/browser.js create mode 100644 node_modules/chalk/node_modules/supports-color/index.js create mode 100644 node_modules/chalk/node_modules/supports-color/license create mode 100644 node_modules/chalk/node_modules/supports-color/package.json create mode 100644 node_modules/chalk/node_modules/supports-color/readme.md create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/source/index.js create mode 100644 node_modules/chalk/source/templates.js create mode 100644 node_modules/chalk/source/util.js create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/.eslintrc.json create mode 100644 node_modules/color-name/.npmignore create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/color-name/test.js create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/confusing-browser-globals/LICENSE create mode 100644 node_modules/confusing-browser-globals/README.md create mode 100644 node_modules/confusing-browser-globals/index.js create mode 100644 node_modules/confusing-browser-globals/package.json create mode 100644 node_modules/contains-path/LICENSE create mode 100644 node_modules/contains-path/README.md create mode 100644 node_modules/contains-path/index.js create mode 100644 node_modules/contains-path/package.json create mode 100644 node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/common.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/deep-is/.npmignore create mode 100644 node_modules/deep-is/.travis.yml create mode 100644 node_modules/deep-is/LICENSE create mode 100644 node_modules/deep-is/README.markdown create mode 100644 node_modules/deep-is/example/cmp.js create mode 100644 node_modules/deep-is/index.js create mode 100644 node_modules/deep-is/package.json create mode 100644 node_modules/deep-is/test/NaN.js create mode 100644 node_modules/deep-is/test/cmp.js create mode 100644 node_modules/deep-is/test/neg-vs-pos-0.js create mode 100644 node_modules/define-properties/.editorconfig create mode 100644 node_modules/define-properties/.eslintrc create mode 100644 node_modules/define-properties/.jscs.json create mode 100644 node_modules/define-properties/.travis.yml create mode 100644 node_modules/define-properties/CHANGELOG.md create mode 100644 node_modules/define-properties/LICENSE create mode 100644 node_modules/define-properties/README.md create mode 100644 node_modules/define-properties/index.js create mode 100644 node_modules/define-properties/package.json create mode 100644 node_modules/define-properties/test/index.js create mode 100644 node_modules/doctrine/CHANGELOG.md create mode 100644 node_modules/doctrine/LICENSE create mode 100644 node_modules/doctrine/LICENSE.closure-compiler create mode 100644 node_modules/doctrine/LICENSE.esprima create mode 100644 node_modules/doctrine/README.md create mode 100644 node_modules/doctrine/lib/doctrine.js create mode 100644 node_modules/doctrine/lib/typed.js create mode 100644 node_modules/doctrine/lib/utility.js create mode 100644 node_modules/doctrine/package.json create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/emoji-regex/text.js create mode 100644 node_modules/enquirer/CHANGELOG.md create mode 100644 node_modules/enquirer/LICENSE create mode 100644 node_modules/enquirer/README.md create mode 100644 node_modules/enquirer/index.d.ts create mode 100644 node_modules/enquirer/index.js create mode 100644 node_modules/enquirer/lib/ansi.js create mode 100644 node_modules/enquirer/lib/combos.js create mode 100644 node_modules/enquirer/lib/completer.js create mode 100644 node_modules/enquirer/lib/interpolate.js create mode 100644 node_modules/enquirer/lib/keypress.js create mode 100644 node_modules/enquirer/lib/placeholder.js create mode 100644 node_modules/enquirer/lib/prompt.js create mode 100644 node_modules/enquirer/lib/prompts/autocomplete.js create mode 100644 node_modules/enquirer/lib/prompts/basicauth.js create mode 100644 node_modules/enquirer/lib/prompts/confirm.js create mode 100644 node_modules/enquirer/lib/prompts/editable.js create mode 100644 node_modules/enquirer/lib/prompts/form.js create mode 100644 node_modules/enquirer/lib/prompts/index.js create mode 100644 node_modules/enquirer/lib/prompts/input.js create mode 100644 node_modules/enquirer/lib/prompts/invisible.js create mode 100644 node_modules/enquirer/lib/prompts/list.js create mode 100644 node_modules/enquirer/lib/prompts/multiselect.js create mode 100644 node_modules/enquirer/lib/prompts/numeral.js create mode 100644 node_modules/enquirer/lib/prompts/password.js create mode 100644 node_modules/enquirer/lib/prompts/quiz.js create mode 100644 node_modules/enquirer/lib/prompts/scale.js create mode 100644 node_modules/enquirer/lib/prompts/select.js create mode 100644 node_modules/enquirer/lib/prompts/snippet.js create mode 100644 node_modules/enquirer/lib/prompts/sort.js create mode 100644 node_modules/enquirer/lib/prompts/survey.js create mode 100644 node_modules/enquirer/lib/prompts/text.js create mode 100644 node_modules/enquirer/lib/prompts/toggle.js create mode 100644 node_modules/enquirer/lib/render.js create mode 100644 node_modules/enquirer/lib/roles.js create mode 100644 node_modules/enquirer/lib/state.js create mode 100644 node_modules/enquirer/lib/styles.js create mode 100644 node_modules/enquirer/lib/symbols.js create mode 100644 node_modules/enquirer/lib/theme.js create mode 100644 node_modules/enquirer/lib/timer.js create mode 100644 node_modules/enquirer/lib/types/array.js create mode 100644 node_modules/enquirer/lib/types/auth.js create mode 100644 node_modules/enquirer/lib/types/boolean.js create mode 100644 node_modules/enquirer/lib/types/index.js create mode 100644 node_modules/enquirer/lib/types/number.js create mode 100644 node_modules/enquirer/lib/types/string.js create mode 100644 node_modules/enquirer/lib/utils.js create mode 100644 node_modules/enquirer/package.json create mode 100644 node_modules/error-ex/LICENSE create mode 100644 node_modules/error-ex/README.md create mode 100644 node_modules/error-ex/index.js create mode 100644 node_modules/error-ex/package.json create mode 100644 node_modules/es-abstract/.editorconfig create mode 100644 node_modules/es-abstract/.eslintignore create mode 100644 node_modules/es-abstract/.eslintrc create mode 100644 node_modules/es-abstract/.gitattributes create mode 100644 node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/es-abstract/.nycrc create mode 100644 node_modules/es-abstract/.travis.yml create mode 100644 node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2015/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/es-abstract/2015/abs.js create mode 100644 node_modules/es-abstract/2015/floor.js create mode 100644 node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2016/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/es-abstract/2016/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/es-abstract/2016/abs.js create mode 100644 node_modules/es-abstract/2016/floor.js create mode 100644 node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2017/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2017/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/es-abstract/2017/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/es-abstract/2017/abs.js create mode 100644 node_modules/es-abstract/2017/floor.js create mode 100644 node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/es-abstract/2018/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/es-abstract/2018/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2018/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/es-abstract/2018/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2018/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/es-abstract/2018/abs.js create mode 100644 node_modules/es-abstract/2018/floor.js create mode 100644 node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/es-abstract/2019/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/es-abstract/2019/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2019/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/es-abstract/2019/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2019/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/es-abstract/2019/abs.js create mode 100644 node_modules/es-abstract/2019/floor.js create mode 100644 node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/es-abstract/2020/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2020/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2020/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2020/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2020/ArrayCreate.js create mode 100644 node_modules/es-abstract/2020/ArraySetLength.js create mode 100644 node_modules/es-abstract/2020/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2020/BigIntBitwiseOp.js create mode 100644 node_modules/es-abstract/2020/BinaryAnd.js create mode 100644 node_modules/es-abstract/2020/BinaryOr.js create mode 100644 node_modules/es-abstract/2020/BinaryXor.js create mode 100644 node_modules/es-abstract/2020/Call.js create mode 100644 node_modules/es-abstract/2020/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2020/CodePointAt.js create mode 100644 node_modules/es-abstract/2020/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2020/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2020/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2020/CreateHTML.js create mode 100644 node_modules/es-abstract/2020/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2020/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2020/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2020/DateFromTime.js create mode 100644 node_modules/es-abstract/2020/DateString.js create mode 100644 node_modules/es-abstract/2020/Day.js create mode 100644 node_modules/es-abstract/2020/DayFromYear.js create mode 100644 node_modules/es-abstract/2020/DayWithinYear.js create mode 100644 node_modules/es-abstract/2020/DaysInYear.js create mode 100644 node_modules/es-abstract/2020/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2020/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2020/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2020/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2020/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/Get.js create mode 100644 node_modules/es-abstract/2020/GetIterator.js create mode 100644 node_modules/es-abstract/2020/GetMethod.js create mode 100644 node_modules/es-abstract/2020/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2020/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2020/GetSubstitution.js create mode 100644 node_modules/es-abstract/2020/GetV.js create mode 100644 node_modules/es-abstract/2020/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2020/HasProperty.js create mode 100644 node_modules/es-abstract/2020/HourFromTime.js create mode 100644 node_modules/es-abstract/2020/InLeapYear.js create mode 100644 node_modules/es-abstract/2020/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2020/Invoke.js create mode 100644 node_modules/es-abstract/2020/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsArray.js create mode 100644 node_modules/es-abstract/2020/IsBigIntElementType.js create mode 100644 node_modules/es-abstract/2020/IsCallable.js create mode 100644 node_modules/es-abstract/2020/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2020/IsConstructor.js create mode 100644 node_modules/es-abstract/2020/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsExtensible.js create mode 100644 node_modules/es-abstract/2020/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2020/IsInteger.js create mode 100644 node_modules/es-abstract/2020/IsNoTearConfiguration.js create mode 100644 node_modules/es-abstract/2020/IsNonNegativeInteger.js create mode 100644 node_modules/es-abstract/2020/IsPromise.js create mode 100644 node_modules/es-abstract/2020/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2020/IsRegExp.js create mode 100644 node_modules/es-abstract/2020/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2020/IsUnclampedIntegerElementType.js create mode 100644 node_modules/es-abstract/2020/IsUnsignedElementType.js create mode 100644 node_modules/es-abstract/2020/IterableToList.js create mode 100644 node_modules/es-abstract/2020/IteratorClose.js create mode 100644 node_modules/es-abstract/2020/IteratorComplete.js create mode 100644 node_modules/es-abstract/2020/IteratorNext.js create mode 100644 node_modules/es-abstract/2020/IteratorStep.js create mode 100644 node_modules/es-abstract/2020/IteratorValue.js create mode 100644 node_modules/es-abstract/2020/LengthOfArrayLike.js create mode 100644 node_modules/es-abstract/2020/MakeDate.js create mode 100644 node_modules/es-abstract/2020/MakeDay.js create mode 100644 node_modules/es-abstract/2020/MakeTime.js create mode 100644 node_modules/es-abstract/2020/MinFromTime.js create mode 100644 node_modules/es-abstract/2020/MonthFromTime.js create mode 100644 node_modules/es-abstract/2020/NumberBitwiseOp.js create mode 100644 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/es-abstract/2020/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2020/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2020/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2020/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2020/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2020/OrdinaryObjectCreate.js create mode 100644 node_modules/es-abstract/2020/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2020/PromiseResolve.js create mode 100644 node_modules/es-abstract/2020/QuoteJSONString.js create mode 100644 node_modules/es-abstract/2020/RegExpExec.js create mode 100644 node_modules/es-abstract/2020/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2020/SameValue.js create mode 100644 node_modules/es-abstract/2020/SameValueNonNumeric.js create mode 100644 node_modules/es-abstract/2020/SameValueZero.js create mode 100644 node_modules/es-abstract/2020/SecFromTime.js create mode 100644 node_modules/es-abstract/2020/Set.js create mode 100644 node_modules/es-abstract/2020/SetFunctionLength.js create mode 100644 node_modules/es-abstract/2020/SetFunctionName.js create mode 100644 node_modules/es-abstract/2020/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2020/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2020/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2020/StringGetOwnProperty.js create mode 100644 node_modules/es-abstract/2020/StringPad.js create mode 100644 node_modules/es-abstract/2020/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2020/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2020/TimeClip.js create mode 100644 node_modules/es-abstract/2020/TimeFromYear.js create mode 100644 node_modules/es-abstract/2020/TimeString.js create mode 100644 node_modules/es-abstract/2020/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2020/ToBoolean.js create mode 100644 node_modules/es-abstract/2020/ToDateString.js create mode 100644 node_modules/es-abstract/2020/ToIndex.js create mode 100644 node_modules/es-abstract/2020/ToInt16.js create mode 100644 node_modules/es-abstract/2020/ToInt32.js create mode 100644 node_modules/es-abstract/2020/ToInt8.js create mode 100644 node_modules/es-abstract/2020/ToInteger.js create mode 100644 node_modules/es-abstract/2020/ToLength.js create mode 100644 node_modules/es-abstract/2020/ToNumber.js create mode 100644 node_modules/es-abstract/2020/ToNumeric.js create mode 100644 node_modules/es-abstract/2020/ToObject.js create mode 100644 node_modules/es-abstract/2020/ToPrimitive.js create mode 100644 node_modules/es-abstract/2020/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2020/ToString.js create mode 100644 node_modules/es-abstract/2020/ToUint16.js create mode 100644 node_modules/es-abstract/2020/ToUint32.js create mode 100644 node_modules/es-abstract/2020/ToUint8.js create mode 100644 node_modules/es-abstract/2020/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2020/TrimString.js create mode 100644 node_modules/es-abstract/2020/Type.js create mode 100644 node_modules/es-abstract/2020/UTF16DecodeString.js create mode 100644 node_modules/es-abstract/2020/UTF16DecodeSurrogatePair.js create mode 100644 node_modules/es-abstract/2020/UTF16Encoding.js create mode 100644 node_modules/es-abstract/2020/UnicodeEscape.js create mode 100644 node_modules/es-abstract/2020/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2020/WeekDay.js create mode 100644 node_modules/es-abstract/2020/YearFromTime.js create mode 100644 node_modules/es-abstract/2020/abs.js create mode 100644 node_modules/es-abstract/2020/floor.js create mode 100644 node_modules/es-abstract/2020/modulo.js create mode 100644 node_modules/es-abstract/2020/msFromTime.js create mode 100644 node_modules/es-abstract/2020/thisBigIntValue.js create mode 100644 node_modules/es-abstract/2020/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2020/thisNumberValue.js create mode 100644 node_modules/es-abstract/2020/thisStringValue.js create mode 100644 node_modules/es-abstract/2020/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2020/thisTimeValue.js create mode 100644 node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/es-abstract/5/Day.js create mode 100644 node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/es-abstract/5/Type.js create mode 100644 node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/es-abstract/5/abs.js create mode 100644 node_modules/es-abstract/5/floor.js create mode 100644 node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/es-abstract/LICENSE create mode 100644 node_modules/es-abstract/README.md create mode 100644 node_modules/es-abstract/es2015.js create mode 100644 node_modules/es-abstract/es2016.js create mode 100644 node_modules/es-abstract/es2017.js create mode 100644 node_modules/es-abstract/es2018.js create mode 100644 node_modules/es-abstract/es2019.js create mode 100644 node_modules/es-abstract/es2020.js create mode 100644 node_modules/es-abstract/es5.js create mode 100644 node_modules/es-abstract/es6.js create mode 100644 node_modules/es-abstract/es7.js create mode 100644 node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/es-abstract/helpers/isLeadingSurrogate.js create mode 100644 node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/isTrailingSurrogate.js create mode 100644 node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/es-abstract/index.js create mode 100644 node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/es-abstract/package.json create mode 100644 node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/es-abstract/test/es2020.js create mode 100644 node_modules/es-abstract/test/es5.js create mode 100644 node_modules/es-abstract/test/es6.js create mode 100644 node_modules/es-abstract/test/es7.js create mode 100644 node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/es-abstract/test/index.js create mode 100644 node_modules/es-abstract/test/ses-compat.js create mode 100644 node_modules/es-abstract/test/tests.js create mode 100644 node_modules/es-to-primitive/.eslintrc create mode 100644 node_modules/es-to-primitive/.github/FUNDING.yml create mode 100644 node_modules/es-to-primitive/.travis.yml create mode 100644 node_modules/es-to-primitive/CHANGELOG.md create mode 100644 node_modules/es-to-primitive/LICENSE create mode 100644 node_modules/es-to-primitive/Makefile create mode 100644 node_modules/es-to-primitive/README.md create mode 100644 node_modules/es-to-primitive/es2015.js create mode 100644 node_modules/es-to-primitive/es5.js create mode 100644 node_modules/es-to-primitive/es6.js create mode 100644 node_modules/es-to-primitive/helpers/isPrimitive.js create mode 100644 node_modules/es-to-primitive/index.js create mode 100644 node_modules/es-to-primitive/package.json create mode 100644 node_modules/es-to-primitive/test/es2015.js create mode 100644 node_modules/es-to-primitive/test/es5.js create mode 100644 node_modules/es-to-primitive/test/es6.js create mode 100644 node_modules/es-to-primitive/test/index.js create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/eslint-config-airbnb-base/.babelrc create mode 100644 node_modules/eslint-config-airbnb-base/.eslintrc create mode 100644 node_modules/eslint-config-airbnb-base/CHANGELOG.md create mode 100644 node_modules/eslint-config-airbnb-base/LICENSE.md create mode 100644 node_modules/eslint-config-airbnb-base/README.md create mode 100644 node_modules/eslint-config-airbnb-base/index.js create mode 100644 node_modules/eslint-config-airbnb-base/legacy.js create mode 100644 node_modules/eslint-config-airbnb-base/package.json create mode 100644 node_modules/eslint-config-airbnb-base/rules/best-practices.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/errors.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/es6.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/imports.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/node.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/strict.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/style.js create mode 100644 node_modules/eslint-config-airbnb-base/rules/variables.js create mode 100644 node_modules/eslint-config-airbnb-base/test/.eslintrc create mode 100644 node_modules/eslint-config-airbnb-base/test/requires.js create mode 100644 node_modules/eslint-config-airbnb-base/test/test-base.js create mode 100644 node_modules/eslint-config-airbnb-base/whitespace.js create mode 100644 node_modules/eslint-import-resolver-node/CHANGELOG.md create mode 100644 node_modules/eslint-import-resolver-node/LICENSE create mode 100644 node_modules/eslint-import-resolver-node/README.md create mode 100644 node_modules/eslint-import-resolver-node/index.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.coveralls.yml create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.eslintrc create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.npmignore create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.travis.yml create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/Makefile create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/README.md create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/component.json create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/karma.conf.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/node.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/package.json create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/debug.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/index.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/license.md create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/package.json create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/readme.md create mode 100644 node_modules/eslint-import-resolver-node/package.json create mode 100644 node_modules/eslint-module-utils/.eslintrc.yml create mode 100644 node_modules/eslint-module-utils/CHANGELOG.md create mode 100644 node_modules/eslint-module-utils/LICENSE create mode 100644 node_modules/eslint-module-utils/ModuleCache.js create mode 100644 node_modules/eslint-module-utils/declaredScope.js create mode 100644 node_modules/eslint-module-utils/hash.js create mode 100644 node_modules/eslint-module-utils/ignore.js create mode 100644 node_modules/eslint-module-utils/module-require.js create mode 100644 node_modules/eslint-module-utils/moduleVisitor.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.coveralls.yml create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.eslintrc create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.npmignore create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.travis.yml create mode 100644 node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/eslint-module-utils/node_modules/debug/LICENSE create mode 100644 node_modules/eslint-module-utils/node_modules/debug/Makefile create mode 100644 node_modules/eslint-module-utils/node_modules/debug/README.md create mode 100644 node_modules/eslint-module-utils/node_modules/debug/component.json create mode 100644 node_modules/eslint-module-utils/node_modules/debug/karma.conf.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/node.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/browser.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/debug.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/node.js create mode 100644 node_modules/eslint-module-utils/node_modules/ms/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/ms/license.md create mode 100644 node_modules/eslint-module-utils/node_modules/ms/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/ms/readme.md create mode 100644 node_modules/eslint-module-utils/package.json create mode 100644 node_modules/eslint-module-utils/parse.js create mode 100644 node_modules/eslint-module-utils/resolve.js create mode 100644 node_modules/eslint-module-utils/unambiguous.js create mode 100644 node_modules/eslint-plugin-import/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-import/CONTRIBUTING.md create mode 100644 node_modules/eslint-plugin-import/LICENSE create mode 100644 node_modules/eslint-plugin-import/README.md create mode 100644 node_modules/eslint-plugin-import/RELEASE.md create mode 100644 node_modules/eslint-plugin-import/SECURITY.md create mode 100644 node_modules/eslint-plugin-import/config/electron.js create mode 100644 node_modules/eslint-plugin-import/config/errors.js create mode 100644 node_modules/eslint-plugin-import/config/react-native.js create mode 100644 node_modules/eslint-plugin-import/config/react.js create mode 100644 node_modules/eslint-plugin-import/config/recommended.js create mode 100644 node_modules/eslint-plugin-import/config/stage-0.js create mode 100644 node_modules/eslint-plugin-import/config/typescript.js create mode 100644 node_modules/eslint-plugin-import/config/warnings.js create mode 100644 node_modules/eslint-plugin-import/docs/rules/default.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/exports-last.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/extensions.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/first.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/group-exports.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/imports-first.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/max-dependencies.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/named.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/namespace.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/newline-after-import.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-amd.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-commonjs.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-cycle.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-default-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-deprecated.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-duplicates.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-default.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-namespace.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-self-import.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-unresolved.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/order.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/unambiguous.md create mode 100644 node_modules/eslint-plugin-import/lib/ExportMap.js create mode 100644 node_modules/eslint-plugin-import/lib/core/importType.js create mode 100644 node_modules/eslint-plugin-import/lib/core/staticRequire.js create mode 100644 node_modules/eslint-plugin-import/lib/docsUrl.js create mode 100644 node_modules/eslint-plugin-import/lib/importDeclaration.js create mode 100644 node_modules/eslint-plugin-import/lib/index.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/default.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/exports-last.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/extensions.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/first.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/group-exports.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/imports-first.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/max-dependencies.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/named.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/namespace.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/newline-after-import.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-amd.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-commonjs.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-cycle.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-default-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-deprecated.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-duplicates.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-default.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-namespace.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-self-import.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-unresolved.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/order.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/unambiguous.js create mode 100644 node_modules/eslint-plugin-import/memo-parser/LICENSE create mode 100644 node_modules/eslint-plugin-import/memo-parser/README.md create mode 100644 node_modules/eslint-plugin-import/memo-parser/index.js create mode 100644 node_modules/eslint-plugin-import/memo-parser/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.coveralls.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.eslintrc create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.npmignore create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.travis.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/LICENSE create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/Makefile create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/README.md create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/component.json create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/karma.conf.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/node.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/browser.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/debug.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/node.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.BSD create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.closure-compiler create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.esprima create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/README.md create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/license.md create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/readme.md create mode 100644 node_modules/eslint-plugin-import/package.json create mode 100644 node_modules/eslint-scope/CHANGELOG.md create mode 100644 node_modules/eslint-scope/LICENSE create mode 100644 node_modules/eslint-scope/README.md create mode 100644 node_modules/eslint-scope/lib/definition.js create mode 100644 node_modules/eslint-scope/lib/index.js create mode 100644 node_modules/eslint-scope/lib/pattern-visitor.js create mode 100644 node_modules/eslint-scope/lib/reference.js create mode 100644 node_modules/eslint-scope/lib/referencer.js create mode 100644 node_modules/eslint-scope/lib/scope-manager.js create mode 100644 node_modules/eslint-scope/lib/scope.js create mode 100644 node_modules/eslint-scope/lib/variable.js create mode 100644 node_modules/eslint-scope/package.json create mode 100644 node_modules/eslint-utils/LICENSE create mode 100644 node_modules/eslint-utils/README.md create mode 100644 node_modules/eslint-utils/index.js create mode 100644 node_modules/eslint-utils/index.js.map create mode 100644 node_modules/eslint-utils/index.mjs create mode 100644 node_modules/eslint-utils/index.mjs.map create mode 100644 node_modules/eslint-utils/package.json create mode 100644 node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/eslint/CHANGELOG.md create mode 100644 node_modules/eslint/LICENSE create mode 100644 node_modules/eslint/README.md create mode 100755 node_modules/eslint/bin/eslint.js create mode 100644 node_modules/eslint/conf/category-list.json create mode 100644 node_modules/eslint/conf/config-schema.js create mode 100644 node_modules/eslint/conf/default-cli-options.js create mode 100644 node_modules/eslint/conf/eslint-all.js create mode 100644 node_modules/eslint/conf/eslint-recommended.js create mode 100644 node_modules/eslint/conf/replacements.json create mode 100644 node_modules/eslint/lib/api.js create mode 100644 node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js create mode 100644 node_modules/eslint/lib/cli-engine/cli-engine.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array-factory.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/config-array.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/config-dependency.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/extracted-config.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/index.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/override-tester.js create mode 100644 node_modules/eslint/lib/cli-engine/file-enumerator.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/checkstyle.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/codeframe.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/compact.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-message.html create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-page.html create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-result.html create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/json.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/junit.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/stylish.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/table.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/tap.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/unix.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/visualstudio.js create mode 100644 node_modules/eslint/lib/cli-engine/hash.js create mode 100644 node_modules/eslint/lib/cli-engine/index.js create mode 100644 node_modules/eslint/lib/cli-engine/lint-result-cache.js create mode 100644 node_modules/eslint/lib/cli-engine/load-rules.js create mode 100644 node_modules/eslint/lib/cli-engine/xml-escape.js create mode 100644 node_modules/eslint/lib/cli.js create mode 100644 node_modules/eslint/lib/eslint/eslint.js create mode 100644 node_modules/eslint/lib/eslint/index.js create mode 100644 node_modules/eslint/lib/init/autoconfig.js create mode 100644 node_modules/eslint/lib/init/config-file.js create mode 100644 node_modules/eslint/lib/init/config-initializer.js create mode 100644 node_modules/eslint/lib/init/config-rule.js create mode 100644 node_modules/eslint/lib/init/npm-utils.js create mode 100644 node_modules/eslint/lib/init/source-code-utils.js create mode 100644 node_modules/eslint/lib/linter/apply-disable-directives.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/fork-context.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/id-generator.js create mode 100644 node_modules/eslint/lib/linter/config-comment-parser.js create mode 100644 node_modules/eslint/lib/linter/index.js create mode 100644 node_modules/eslint/lib/linter/interpolate.js create mode 100644 node_modules/eslint/lib/linter/linter.js create mode 100644 node_modules/eslint/lib/linter/node-event-generator.js create mode 100644 node_modules/eslint/lib/linter/report-translator.js create mode 100644 node_modules/eslint/lib/linter/rule-fixer.js create mode 100644 node_modules/eslint/lib/linter/rules.js create mode 100644 node_modules/eslint/lib/linter/safe-emitter.js create mode 100644 node_modules/eslint/lib/linter/source-code-fixer.js create mode 100644 node_modules/eslint/lib/linter/timing.js create mode 100644 node_modules/eslint/lib/options.js create mode 100644 node_modules/eslint/lib/rule-tester/index.js create mode 100644 node_modules/eslint/lib/rule-tester/rule-tester.js create mode 100644 node_modules/eslint/lib/rules/accessor-pairs.js create mode 100644 node_modules/eslint/lib/rules/array-bracket-newline.js create mode 100644 node_modules/eslint/lib/rules/array-bracket-spacing.js create mode 100644 node_modules/eslint/lib/rules/array-callback-return.js create mode 100644 node_modules/eslint/lib/rules/array-element-newline.js create mode 100644 node_modules/eslint/lib/rules/arrow-body-style.js create mode 100644 node_modules/eslint/lib/rules/arrow-parens.js create mode 100644 node_modules/eslint/lib/rules/arrow-spacing.js create mode 100644 node_modules/eslint/lib/rules/block-scoped-var.js create mode 100644 node_modules/eslint/lib/rules/block-spacing.js create mode 100644 node_modules/eslint/lib/rules/brace-style.js create mode 100644 node_modules/eslint/lib/rules/callback-return.js create mode 100644 node_modules/eslint/lib/rules/camelcase.js create mode 100644 node_modules/eslint/lib/rules/capitalized-comments.js create mode 100644 node_modules/eslint/lib/rules/class-methods-use-this.js create mode 100644 node_modules/eslint/lib/rules/comma-dangle.js create mode 100644 node_modules/eslint/lib/rules/comma-spacing.js create mode 100644 node_modules/eslint/lib/rules/comma-style.js create mode 100644 node_modules/eslint/lib/rules/complexity.js create mode 100644 node_modules/eslint/lib/rules/computed-property-spacing.js create mode 100644 node_modules/eslint/lib/rules/consistent-return.js create mode 100644 node_modules/eslint/lib/rules/consistent-this.js create mode 100644 node_modules/eslint/lib/rules/constructor-super.js create mode 100644 node_modules/eslint/lib/rules/curly.js create mode 100644 node_modules/eslint/lib/rules/default-case-last.js create mode 100644 node_modules/eslint/lib/rules/default-case.js create mode 100644 node_modules/eslint/lib/rules/default-param-last.js create mode 100644 node_modules/eslint/lib/rules/dot-location.js create mode 100644 node_modules/eslint/lib/rules/dot-notation.js create mode 100644 node_modules/eslint/lib/rules/eol-last.js create mode 100644 node_modules/eslint/lib/rules/eqeqeq.js create mode 100644 node_modules/eslint/lib/rules/for-direction.js create mode 100644 node_modules/eslint/lib/rules/func-call-spacing.js create mode 100644 node_modules/eslint/lib/rules/func-name-matching.js create mode 100644 node_modules/eslint/lib/rules/func-names.js create mode 100644 node_modules/eslint/lib/rules/func-style.js create mode 100644 node_modules/eslint/lib/rules/function-call-argument-newline.js create mode 100644 node_modules/eslint/lib/rules/function-paren-newline.js create mode 100644 node_modules/eslint/lib/rules/generator-star-spacing.js create mode 100644 node_modules/eslint/lib/rules/getter-return.js create mode 100644 node_modules/eslint/lib/rules/global-require.js create mode 100644 node_modules/eslint/lib/rules/grouped-accessor-pairs.js create mode 100644 node_modules/eslint/lib/rules/guard-for-in.js create mode 100644 node_modules/eslint/lib/rules/handle-callback-err.js create mode 100644 node_modules/eslint/lib/rules/id-blacklist.js create mode 100644 node_modules/eslint/lib/rules/id-denylist.js create mode 100644 node_modules/eslint/lib/rules/id-length.js create mode 100644 node_modules/eslint/lib/rules/id-match.js create mode 100644 node_modules/eslint/lib/rules/implicit-arrow-linebreak.js create mode 100644 node_modules/eslint/lib/rules/indent-legacy.js create mode 100644 node_modules/eslint/lib/rules/indent.js create mode 100644 node_modules/eslint/lib/rules/index.js create mode 100644 node_modules/eslint/lib/rules/init-declarations.js create mode 100644 node_modules/eslint/lib/rules/jsx-quotes.js create mode 100644 node_modules/eslint/lib/rules/key-spacing.js create mode 100644 node_modules/eslint/lib/rules/keyword-spacing.js create mode 100644 node_modules/eslint/lib/rules/line-comment-position.js create mode 100644 node_modules/eslint/lib/rules/linebreak-style.js create mode 100644 node_modules/eslint/lib/rules/lines-around-comment.js create mode 100644 node_modules/eslint/lib/rules/lines-around-directive.js create mode 100644 node_modules/eslint/lib/rules/lines-between-class-members.js create mode 100644 node_modules/eslint/lib/rules/max-classes-per-file.js create mode 100644 node_modules/eslint/lib/rules/max-depth.js create mode 100644 node_modules/eslint/lib/rules/max-len.js create mode 100644 node_modules/eslint/lib/rules/max-lines-per-function.js create mode 100644 node_modules/eslint/lib/rules/max-lines.js create mode 100644 node_modules/eslint/lib/rules/max-nested-callbacks.js create mode 100644 node_modules/eslint/lib/rules/max-params.js create mode 100644 node_modules/eslint/lib/rules/max-statements-per-line.js create mode 100644 node_modules/eslint/lib/rules/max-statements.js create mode 100644 node_modules/eslint/lib/rules/multiline-comment-style.js create mode 100644 node_modules/eslint/lib/rules/multiline-ternary.js create mode 100644 node_modules/eslint/lib/rules/new-cap.js create mode 100644 node_modules/eslint/lib/rules/new-parens.js create mode 100644 node_modules/eslint/lib/rules/newline-after-var.js create mode 100644 node_modules/eslint/lib/rules/newline-before-return.js create mode 100644 node_modules/eslint/lib/rules/newline-per-chained-call.js create mode 100644 node_modules/eslint/lib/rules/no-alert.js create mode 100644 node_modules/eslint/lib/rules/no-array-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-async-promise-executor.js create mode 100644 node_modules/eslint/lib/rules/no-await-in-loop.js create mode 100644 node_modules/eslint/lib/rules/no-bitwise.js create mode 100644 node_modules/eslint/lib/rules/no-buffer-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-caller.js create mode 100644 node_modules/eslint/lib/rules/no-case-declarations.js create mode 100644 node_modules/eslint/lib/rules/no-catch-shadow.js create mode 100644 node_modules/eslint/lib/rules/no-class-assign.js create mode 100644 node_modules/eslint/lib/rules/no-compare-neg-zero.js create mode 100644 node_modules/eslint/lib/rules/no-cond-assign.js create mode 100644 node_modules/eslint/lib/rules/no-confusing-arrow.js create mode 100644 node_modules/eslint/lib/rules/no-console.js create mode 100644 node_modules/eslint/lib/rules/no-const-assign.js create mode 100644 node_modules/eslint/lib/rules/no-constant-condition.js create mode 100644 node_modules/eslint/lib/rules/no-constructor-return.js create mode 100644 node_modules/eslint/lib/rules/no-continue.js create mode 100644 node_modules/eslint/lib/rules/no-control-regex.js create mode 100644 node_modules/eslint/lib/rules/no-debugger.js create mode 100644 node_modules/eslint/lib/rules/no-delete-var.js create mode 100644 node_modules/eslint/lib/rules/no-div-regex.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-args.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-class-members.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-else-if.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-keys.js create mode 100644 node_modules/eslint/lib/rules/no-duplicate-case.js create mode 100644 node_modules/eslint/lib/rules/no-duplicate-imports.js create mode 100644 node_modules/eslint/lib/rules/no-else-return.js create mode 100644 node_modules/eslint/lib/rules/no-empty-character-class.js create mode 100644 node_modules/eslint/lib/rules/no-empty-function.js create mode 100644 node_modules/eslint/lib/rules/no-empty-pattern.js create mode 100644 node_modules/eslint/lib/rules/no-empty.js create mode 100644 node_modules/eslint/lib/rules/no-eq-null.js create mode 100644 node_modules/eslint/lib/rules/no-eval.js create mode 100644 node_modules/eslint/lib/rules/no-ex-assign.js create mode 100644 node_modules/eslint/lib/rules/no-extend-native.js create mode 100644 node_modules/eslint/lib/rules/no-extra-bind.js create mode 100644 node_modules/eslint/lib/rules/no-extra-boolean-cast.js create mode 100644 node_modules/eslint/lib/rules/no-extra-label.js create mode 100644 node_modules/eslint/lib/rules/no-extra-parens.js create mode 100644 node_modules/eslint/lib/rules/no-extra-semi.js create mode 100644 node_modules/eslint/lib/rules/no-fallthrough.js create mode 100644 node_modules/eslint/lib/rules/no-floating-decimal.js create mode 100644 node_modules/eslint/lib/rules/no-func-assign.js create mode 100644 node_modules/eslint/lib/rules/no-global-assign.js create mode 100644 node_modules/eslint/lib/rules/no-implicit-coercion.js create mode 100644 node_modules/eslint/lib/rules/no-implicit-globals.js create mode 100644 node_modules/eslint/lib/rules/no-implied-eval.js create mode 100644 node_modules/eslint/lib/rules/no-import-assign.js create mode 100644 node_modules/eslint/lib/rules/no-inline-comments.js create mode 100644 node_modules/eslint/lib/rules/no-inner-declarations.js create mode 100644 node_modules/eslint/lib/rules/no-invalid-regexp.js create mode 100644 node_modules/eslint/lib/rules/no-invalid-this.js create mode 100644 node_modules/eslint/lib/rules/no-irregular-whitespace.js create mode 100644 node_modules/eslint/lib/rules/no-iterator.js create mode 100644 node_modules/eslint/lib/rules/no-label-var.js create mode 100644 node_modules/eslint/lib/rules/no-labels.js create mode 100644 node_modules/eslint/lib/rules/no-lone-blocks.js create mode 100644 node_modules/eslint/lib/rules/no-lonely-if.js create mode 100644 node_modules/eslint/lib/rules/no-loop-func.js create mode 100644 node_modules/eslint/lib/rules/no-loss-of-precision.js create mode 100644 node_modules/eslint/lib/rules/no-magic-numbers.js create mode 100644 node_modules/eslint/lib/rules/no-misleading-character-class.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-operators.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-requires.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js create mode 100644 node_modules/eslint/lib/rules/no-multi-assign.js create mode 100644 node_modules/eslint/lib/rules/no-multi-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-multi-str.js create mode 100644 node_modules/eslint/lib/rules/no-multiple-empty-lines.js create mode 100644 node_modules/eslint/lib/rules/no-native-reassign.js create mode 100644 node_modules/eslint/lib/rules/no-negated-condition.js create mode 100644 node_modules/eslint/lib/rules/no-negated-in-lhs.js create mode 100644 node_modules/eslint/lib/rules/no-nested-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-new-func.js create mode 100644 node_modules/eslint/lib/rules/no-new-object.js create mode 100644 node_modules/eslint/lib/rules/no-new-require.js create mode 100644 node_modules/eslint/lib/rules/no-new-symbol.js create mode 100644 node_modules/eslint/lib/rules/no-new-wrappers.js create mode 100644 node_modules/eslint/lib/rules/no-new.js create mode 100644 node_modules/eslint/lib/rules/no-obj-calls.js create mode 100644 node_modules/eslint/lib/rules/no-octal-escape.js create mode 100644 node_modules/eslint/lib/rules/no-octal.js create mode 100644 node_modules/eslint/lib/rules/no-param-reassign.js create mode 100644 node_modules/eslint/lib/rules/no-path-concat.js create mode 100644 node_modules/eslint/lib/rules/no-plusplus.js create mode 100644 node_modules/eslint/lib/rules/no-process-env.js create mode 100644 node_modules/eslint/lib/rules/no-process-exit.js create mode 100644 node_modules/eslint/lib/rules/no-promise-executor-return.js create mode 100644 node_modules/eslint/lib/rules/no-proto.js create mode 100644 node_modules/eslint/lib/rules/no-prototype-builtins.js create mode 100644 node_modules/eslint/lib/rules/no-redeclare.js create mode 100644 node_modules/eslint/lib/rules/no-regex-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-exports.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-globals.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-imports.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-modules.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-properties.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-syntax.js create mode 100644 node_modules/eslint/lib/rules/no-return-assign.js create mode 100644 node_modules/eslint/lib/rules/no-return-await.js create mode 100644 node_modules/eslint/lib/rules/no-script-url.js create mode 100644 node_modules/eslint/lib/rules/no-self-assign.js create mode 100644 node_modules/eslint/lib/rules/no-self-compare.js create mode 100644 node_modules/eslint/lib/rules/no-sequences.js create mode 100644 node_modules/eslint/lib/rules/no-setter-return.js create mode 100644 node_modules/eslint/lib/rules/no-shadow-restricted-names.js create mode 100644 node_modules/eslint/lib/rules/no-shadow.js create mode 100644 node_modules/eslint/lib/rules/no-spaced-func.js create mode 100644 node_modules/eslint/lib/rules/no-sparse-arrays.js create mode 100644 node_modules/eslint/lib/rules/no-sync.js create mode 100644 node_modules/eslint/lib/rules/no-tabs.js create mode 100644 node_modules/eslint/lib/rules/no-template-curly-in-string.js create mode 100644 node_modules/eslint/lib/rules/no-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-this-before-super.js create mode 100644 node_modules/eslint/lib/rules/no-throw-literal.js create mode 100644 node_modules/eslint/lib/rules/no-trailing-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-undef-init.js create mode 100644 node_modules/eslint/lib/rules/no-undef.js create mode 100644 node_modules/eslint/lib/rules/no-undefined.js create mode 100644 node_modules/eslint/lib/rules/no-underscore-dangle.js create mode 100644 node_modules/eslint/lib/rules/no-unexpected-multiline.js create mode 100644 node_modules/eslint/lib/rules/no-unmodified-loop-condition.js create mode 100644 node_modules/eslint/lib/rules/no-unneeded-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-unreachable-loop.js create mode 100644 node_modules/eslint/lib/rules/no-unreachable.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-finally.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-negation.js create mode 100644 node_modules/eslint/lib/rules/no-unused-expressions.js create mode 100644 node_modules/eslint/lib/rules/no-unused-labels.js create mode 100644 node_modules/eslint/lib/rules/no-unused-vars.js create mode 100644 node_modules/eslint/lib/rules/no-use-before-define.js create mode 100644 node_modules/eslint/lib/rules/no-useless-backreference.js create mode 100644 node_modules/eslint/lib/rules/no-useless-call.js create mode 100644 node_modules/eslint/lib/rules/no-useless-catch.js create mode 100644 node_modules/eslint/lib/rules/no-useless-computed-key.js create mode 100644 node_modules/eslint/lib/rules/no-useless-concat.js create mode 100644 node_modules/eslint/lib/rules/no-useless-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-useless-escape.js create mode 100644 node_modules/eslint/lib/rules/no-useless-rename.js create mode 100644 node_modules/eslint/lib/rules/no-useless-return.js create mode 100644 node_modules/eslint/lib/rules/no-var.js create mode 100644 node_modules/eslint/lib/rules/no-void.js create mode 100644 node_modules/eslint/lib/rules/no-warning-comments.js create mode 100644 node_modules/eslint/lib/rules/no-whitespace-before-property.js create mode 100644 node_modules/eslint/lib/rules/no-with.js create mode 100644 node_modules/eslint/lib/rules/nonblock-statement-body-position.js create mode 100644 node_modules/eslint/lib/rules/object-curly-newline.js create mode 100644 node_modules/eslint/lib/rules/object-curly-spacing.js create mode 100644 node_modules/eslint/lib/rules/object-property-newline.js create mode 100644 node_modules/eslint/lib/rules/object-shorthand.js create mode 100644 node_modules/eslint/lib/rules/one-var-declaration-per-line.js create mode 100644 node_modules/eslint/lib/rules/one-var.js create mode 100644 node_modules/eslint/lib/rules/operator-assignment.js create mode 100644 node_modules/eslint/lib/rules/operator-linebreak.js create mode 100644 node_modules/eslint/lib/rules/padded-blocks.js create mode 100644 node_modules/eslint/lib/rules/padding-line-between-statements.js create mode 100644 node_modules/eslint/lib/rules/prefer-arrow-callback.js create mode 100644 node_modules/eslint/lib/rules/prefer-const.js create mode 100644 node_modules/eslint/lib/rules/prefer-destructuring.js create mode 100644 node_modules/eslint/lib/rules/prefer-exponentiation-operator.js create mode 100644 node_modules/eslint/lib/rules/prefer-named-capture-group.js create mode 100644 node_modules/eslint/lib/rules/prefer-numeric-literals.js create mode 100644 node_modules/eslint/lib/rules/prefer-object-spread.js create mode 100644 node_modules/eslint/lib/rules/prefer-promise-reject-errors.js create mode 100644 node_modules/eslint/lib/rules/prefer-reflect.js create mode 100644 node_modules/eslint/lib/rules/prefer-regex-literals.js create mode 100644 node_modules/eslint/lib/rules/prefer-rest-params.js create mode 100644 node_modules/eslint/lib/rules/prefer-spread.js create mode 100644 node_modules/eslint/lib/rules/prefer-template.js create mode 100644 node_modules/eslint/lib/rules/quote-props.js create mode 100644 node_modules/eslint/lib/rules/quotes.js create mode 100644 node_modules/eslint/lib/rules/radix.js create mode 100644 node_modules/eslint/lib/rules/require-atomic-updates.js create mode 100644 node_modules/eslint/lib/rules/require-await.js create mode 100644 node_modules/eslint/lib/rules/require-jsdoc.js create mode 100644 node_modules/eslint/lib/rules/require-unicode-regexp.js create mode 100644 node_modules/eslint/lib/rules/require-yield.js create mode 100644 node_modules/eslint/lib/rules/rest-spread-spacing.js create mode 100644 node_modules/eslint/lib/rules/semi-spacing.js create mode 100644 node_modules/eslint/lib/rules/semi-style.js create mode 100644 node_modules/eslint/lib/rules/semi.js create mode 100644 node_modules/eslint/lib/rules/sort-imports.js create mode 100644 node_modules/eslint/lib/rules/sort-keys.js create mode 100644 node_modules/eslint/lib/rules/sort-vars.js create mode 100644 node_modules/eslint/lib/rules/space-before-blocks.js create mode 100644 node_modules/eslint/lib/rules/space-before-function-paren.js create mode 100644 node_modules/eslint/lib/rules/space-in-parens.js create mode 100644 node_modules/eslint/lib/rules/space-infix-ops.js create mode 100644 node_modules/eslint/lib/rules/space-unary-ops.js create mode 100644 node_modules/eslint/lib/rules/spaced-comment.js create mode 100644 node_modules/eslint/lib/rules/strict.js create mode 100644 node_modules/eslint/lib/rules/switch-colon-spacing.js create mode 100644 node_modules/eslint/lib/rules/symbol-description.js create mode 100644 node_modules/eslint/lib/rules/template-curly-spacing.js create mode 100644 node_modules/eslint/lib/rules/template-tag-spacing.js create mode 100644 node_modules/eslint/lib/rules/unicode-bom.js create mode 100644 node_modules/eslint/lib/rules/use-isnan.js create mode 100644 node_modules/eslint/lib/rules/utils/ast-utils.js create mode 100644 node_modules/eslint/lib/rules/utils/fix-tracker.js create mode 100644 node_modules/eslint/lib/rules/utils/keywords.js create mode 100644 node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js create mode 100644 node_modules/eslint/lib/rules/utils/patterns/letters.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/index.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js create mode 100644 node_modules/eslint/lib/rules/valid-jsdoc.js create mode 100644 node_modules/eslint/lib/rules/valid-typeof.js create mode 100644 node_modules/eslint/lib/rules/vars-on-top.js create mode 100644 node_modules/eslint/lib/rules/wrap-iife.js create mode 100644 node_modules/eslint/lib/rules/wrap-regex.js create mode 100644 node_modules/eslint/lib/rules/yield-star-spacing.js create mode 100644 node_modules/eslint/lib/rules/yoda.js create mode 100644 node_modules/eslint/lib/shared/ajv.js create mode 100644 node_modules/eslint/lib/shared/ast-utils.js create mode 100644 node_modules/eslint/lib/shared/config-validator.js create mode 100644 node_modules/eslint/lib/shared/deprecation-warnings.js create mode 100644 node_modules/eslint/lib/shared/logging.js create mode 100644 node_modules/eslint/lib/shared/relative-module-resolver.js create mode 100644 node_modules/eslint/lib/shared/runtime-info.js create mode 100644 node_modules/eslint/lib/shared/traverser.js create mode 100644 node_modules/eslint/lib/shared/types.js create mode 100644 node_modules/eslint/lib/source-code/index.js create mode 100644 node_modules/eslint/lib/source-code/source-code.js create mode 100644 node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/cursors.js create mode 100644 node_modules/eslint/lib/source-code/token-store/decorative-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/filter-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/index.js create mode 100644 node_modules/eslint/lib/source-code/token-store/limit-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/skip-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/utils.js create mode 100644 node_modules/eslint/messages/all-files-ignored.txt create mode 100644 node_modules/eslint/messages/extend-config-missing.txt create mode 100644 node_modules/eslint/messages/failed-to-read-json.txt create mode 100644 node_modules/eslint/messages/file-not-found.txt create mode 100644 node_modules/eslint/messages/no-config-found.txt create mode 100644 node_modules/eslint/messages/plugin-conflict.txt create mode 100644 node_modules/eslint/messages/plugin-invalid.txt create mode 100644 node_modules/eslint/messages/plugin-missing.txt create mode 100644 node_modules/eslint/messages/print-config-with-directory-path.txt create mode 100644 node_modules/eslint/messages/whitespace-found.txt create mode 100644 node_modules/eslint/package.json create mode 100644 node_modules/espree/CHANGELOG.md create mode 100644 node_modules/espree/LICENSE create mode 100644 node_modules/espree/README.md create mode 100644 node_modules/espree/espree.js create mode 100644 node_modules/espree/lib/ast-node-types.js create mode 100644 node_modules/espree/lib/espree.js create mode 100644 node_modules/espree/lib/features.js create mode 100644 node_modules/espree/lib/options.js create mode 100644 node_modules/espree/lib/token-translator.js create mode 100644 node_modules/espree/lib/visitor-keys.js create mode 100644 node_modules/espree/package.json create mode 100644 node_modules/esprima/ChangeLog create mode 100644 node_modules/esprima/LICENSE.BSD create mode 100644 node_modules/esprima/README.md create mode 100755 node_modules/esprima/bin/esparse.js create mode 100755 node_modules/esprima/bin/esvalidate.js create mode 100644 node_modules/esprima/dist/esprima.js create mode 100644 node_modules/esprima/package.json create mode 100644 node_modules/esquery/README.md create mode 100644 node_modules/esquery/dist/esquery.esm.js create mode 100644 node_modules/esquery/dist/esquery.esm.min.js create mode 100644 node_modules/esquery/dist/esquery.esm.min.js.map create mode 100644 node_modules/esquery/dist/esquery.js create mode 100644 node_modules/esquery/dist/esquery.min.js create mode 100644 node_modules/esquery/dist/esquery.min.js.map create mode 100644 node_modules/esquery/license.txt create mode 100644 node_modules/esquery/node_modules/estraverse/.jshintrc create mode 100644 node_modules/esquery/node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/esquery/node_modules/estraverse/README.md create mode 100644 node_modules/esquery/node_modules/estraverse/estraverse.js create mode 100644 node_modules/esquery/node_modules/estraverse/gulpfile.js create mode 100644 node_modules/esquery/node_modules/estraverse/package.json create mode 100644 node_modules/esquery/package.json create mode 100644 node_modules/esquery/parser.js create mode 100644 node_modules/esrecurse/.babelrc create mode 100644 node_modules/esrecurse/README.md create mode 100644 node_modules/esrecurse/esrecurse.js create mode 100644 node_modules/esrecurse/gulpfile.babel.js create mode 100644 node_modules/esrecurse/node_modules/estraverse/.jshintrc create mode 100644 node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/esrecurse/node_modules/estraverse/README.md create mode 100644 node_modules/esrecurse/node_modules/estraverse/estraverse.js create mode 100644 node_modules/esrecurse/node_modules/estraverse/gulpfile.js create mode 100644 node_modules/esrecurse/node_modules/estraverse/package.json create mode 100755 node_modules/esrecurse/package.json create mode 100644 node_modules/estraverse/.jshintrc create mode 100644 node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/estraverse/README.md create mode 100644 node_modules/estraverse/estraverse.js create mode 100644 node_modules/estraverse/gulpfile.js create mode 100644 node_modules/estraverse/package.json create mode 100644 node_modules/esutils/LICENSE.BSD create mode 100644 node_modules/esutils/README.md create mode 100644 node_modules/esutils/lib/ast.js create mode 100644 node_modules/esutils/lib/code.js create mode 100644 node_modules/esutils/lib/keyword.js create mode 100644 node_modules/esutils/lib/utils.js create mode 100644 node_modules/esutils/package.json create mode 100644 node_modules/fast-levenshtein/LICENSE.md create mode 100644 node_modules/fast-levenshtein/README.md create mode 100644 node_modules/fast-levenshtein/levenshtein.js create mode 100644 node_modules/fast-levenshtein/package.json create mode 100644 node_modules/file-entry-cache/LICENSE create mode 100644 node_modules/file-entry-cache/README.md create mode 100644 node_modules/file-entry-cache/cache.js create mode 100644 node_modules/file-entry-cache/changelog.md create mode 100644 node_modules/file-entry-cache/package.json create mode 100644 node_modules/find-up/index.js create mode 100644 node_modules/find-up/license create mode 100644 node_modules/find-up/package.json create mode 100644 node_modules/find-up/readme.md create mode 100644 node_modules/flat-cache/LICENSE create mode 100644 node_modules/flat-cache/README.md create mode 100644 node_modules/flat-cache/cache.js create mode 100644 node_modules/flat-cache/changelog.md create mode 100644 node_modules/flat-cache/del.js create mode 100644 node_modules/flat-cache/package.json create mode 100644 node_modules/flat-cache/utils.js create mode 100644 node_modules/flatted/.github/FUNDING.yml create mode 100644 node_modules/flatted/LICENSE create mode 100644 node_modules/flatted/README.md create mode 100644 node_modules/flatted/SPECS.md create mode 100644 node_modules/flatted/cjs/index.js create mode 100644 node_modules/flatted/esm/index.js create mode 100644 node_modules/flatted/index.js create mode 100644 node_modules/flatted/min.js create mode 100644 node_modules/flatted/package.json create mode 100644 node_modules/flatted/types.d.ts create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/function-bind/.editorconfig create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.jscs.json create mode 100644 node_modules/function-bind/.npmignore create mode 100644 node_modules/function-bind/.travis.yml create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/functional-red-black-tree/.npmignore create mode 100644 node_modules/functional-red-black-tree/LICENSE create mode 100644 node_modules/functional-red-black-tree/README.md create mode 100644 node_modules/functional-red-black-tree/bench/test.js create mode 100644 node_modules/functional-red-black-tree/package.json create mode 100644 node_modules/functional-red-black-tree/rbtree.js create mode 100644 node_modules/functional-red-black-tree/test/test.js create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/package.json create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/changelog.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/globals/globals.json create mode 100644 node_modules/globals/index.d.ts create mode 100644 node_modules/globals/index.js create mode 100644 node_modules/globals/license create mode 100644 node_modules/globals/package.json create mode 100644 node_modules/globals/readme.md create mode 100644 node_modules/graceful-fs/LICENSE create mode 100644 node_modules/graceful-fs/README.md create mode 100644 node_modules/graceful-fs/clone.js create mode 100644 node_modules/graceful-fs/graceful-fs.js create mode 100644 node_modules/graceful-fs/legacy-streams.js create mode 100644 node_modules/graceful-fs/package.json create mode 100644 node_modules/graceful-fs/polyfills.js create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/has-symbols/.eslintrc create mode 100644 node_modules/has-symbols/.github/FUNDING.yml create mode 100644 node_modules/has-symbols/.github/workflows/rebase.yml create mode 100644 node_modules/has-symbols/.travis.yml create mode 100644 node_modules/has-symbols/CHANGELOG.md create mode 100644 node_modules/has-symbols/LICENSE create mode 100644 node_modules/has-symbols/README.md create mode 100644 node_modules/has-symbols/index.js create mode 100644 node_modules/has-symbols/package.json create mode 100644 node_modules/has-symbols/shams.js create mode 100644 node_modules/has-symbols/test/index.js create mode 100644 node_modules/has-symbols/test/shams/core-js.js create mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-symbols/test/tests.js create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/hosted-git-info/CHANGELOG.md create mode 100644 node_modules/hosted-git-info/LICENSE create mode 100644 node_modules/hosted-git-info/README.md create mode 100644 node_modules/hosted-git-info/git-host-info.js create mode 100644 node_modules/hosted-git-info/git-host.js create mode 100644 node_modules/hosted-git-info/index.js create mode 100644 node_modules/hosted-git-info/package.json create mode 100644 node_modules/ignore/CHANGELOG.md create mode 100755 node_modules/ignore/LICENSE-MIT create mode 100755 node_modules/ignore/README.md create mode 100644 node_modules/ignore/index.d.ts create mode 100755 node_modules/ignore/index.js create mode 100644 node_modules/ignore/legacy.js create mode 100644 node_modules/ignore/package.json create mode 100644 node_modules/import-fresh/index.d.ts create mode 100644 node_modules/import-fresh/index.js create mode 100644 node_modules/import-fresh/license create mode 100644 node_modules/import-fresh/package.json create mode 100644 node_modules/import-fresh/readme.md create mode 100644 node_modules/imurmurhash/README.md create mode 100644 node_modules/imurmurhash/imurmurhash.js create mode 100644 node_modules/imurmurhash/imurmurhash.min.js create mode 100644 node_modules/imurmurhash/package.json create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/is-arrayish/.editorconfig create mode 100644 node_modules/is-arrayish/.istanbul.yml create mode 100644 node_modules/is-arrayish/.npmignore create mode 100644 node_modules/is-arrayish/.travis.yml create mode 100644 node_modules/is-arrayish/LICENSE create mode 100644 node_modules/is-arrayish/README.md create mode 100644 node_modules/is-arrayish/index.js create mode 100644 node_modules/is-arrayish/package.json create mode 100644 node_modules/is-callable/.editorconfig create mode 100644 node_modules/is-callable/.eslintrc create mode 100644 node_modules/is-callable/.github/FUNDING.yml create mode 100644 node_modules/is-callable/.github/main.workflow create mode 100644 node_modules/is-callable/.github/workflows/rebase.yml create mode 100644 node_modules/is-callable/.istanbul.yml create mode 100644 node_modules/is-callable/.travis.yml create mode 100644 node_modules/is-callable/CHANGELOG.md create mode 100644 node_modules/is-callable/LICENSE create mode 100644 node_modules/is-callable/README.md create mode 100644 node_modules/is-callable/index.js create mode 100644 node_modules/is-callable/package.json create mode 100644 node_modules/is-callable/test/index.js create mode 100644 node_modules/is-date-object/.eslintrc create mode 100644 node_modules/is-date-object/.github/FUNDING.yml create mode 100644 node_modules/is-date-object/.github/workflows/rebase.yml create mode 100644 node_modules/is-date-object/.jscs.json create mode 100644 node_modules/is-date-object/.travis.yml create mode 100644 node_modules/is-date-object/CHANGELOG.md create mode 100644 node_modules/is-date-object/LICENSE create mode 100644 node_modules/is-date-object/README.md create mode 100644 node_modules/is-date-object/index.js create mode 100644 node_modules/is-date-object/package.json create mode 100644 node_modules/is-date-object/test/index.js create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-negative-zero/.eslintrc create mode 100644 node_modules/is-negative-zero/.jscs.json create mode 100644 node_modules/is-negative-zero/.npmignore create mode 100644 node_modules/is-negative-zero/.travis.yml create mode 100644 node_modules/is-negative-zero/LICENSE create mode 100644 node_modules/is-negative-zero/README.md create mode 100644 node_modules/is-negative-zero/index.js create mode 100644 node_modules/is-negative-zero/package.json create mode 100644 node_modules/is-negative-zero/test.js create mode 100644 node_modules/is-regex/.editorconfig create mode 100644 node_modules/is-regex/.eslintrc create mode 100644 node_modules/is-regex/.github/workflows/rebase.yml create mode 100644 node_modules/is-regex/.travis.yml create mode 100644 node_modules/is-regex/CHANGELOG.md create mode 100644 node_modules/is-regex/LICENSE create mode 100644 node_modules/is-regex/README.md create mode 100644 node_modules/is-regex/index.js create mode 100644 node_modules/is-regex/package.json create mode 100644 node_modules/is-regex/test/index.js create mode 100644 node_modules/is-string/.eslintrc create mode 100644 node_modules/is-string/.github/FUNDING.yml create mode 100644 node_modules/is-string/.github/workflows/rebase.yml create mode 100644 node_modules/is-string/.travis.yml create mode 100644 node_modules/is-string/CHANGELOG.md create mode 100644 node_modules/is-string/LICENSE create mode 100644 node_modules/is-string/README.md create mode 100644 node_modules/is-string/index.js create mode 100644 node_modules/is-string/package.json create mode 100644 node_modules/is-string/test/index.js create mode 100644 node_modules/is-symbol/.editorconfig create mode 100644 node_modules/is-symbol/.eslintrc create mode 100644 node_modules/is-symbol/.github/FUNDING.yml create mode 100644 node_modules/is-symbol/.github/workflows/rebase.yml create mode 100644 node_modules/is-symbol/.nvmrc create mode 100644 node_modules/is-symbol/.travis.yml create mode 100644 node_modules/is-symbol/CHANGELOG.md create mode 100644 node_modules/is-symbol/LICENSE create mode 100644 node_modules/is-symbol/Makefile create mode 100644 node_modules/is-symbol/README.md create mode 100644 node_modules/is-symbol/index.js create mode 100644 node_modules/is-symbol/package.json create mode 100644 node_modules/is-symbol/test/index.js create mode 100644 node_modules/isarray/.npmignore create mode 100644 node_modules/isarray/.travis.yml create mode 100644 node_modules/isarray/Makefile create mode 100644 node_modules/isarray/README.md create mode 100644 node_modules/isarray/component.json create mode 100644 node_modules/isarray/index.js create mode 100644 node_modules/isarray/package.json create mode 100644 node_modules/isarray/test.js create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/js-tokens/CHANGELOG.md create mode 100644 node_modules/js-tokens/LICENSE create mode 100644 node_modules/js-tokens/README.md create mode 100644 node_modules/js-tokens/index.js create mode 100644 node_modules/js-tokens/package.json create mode 100644 node_modules/js-yaml/CHANGELOG.md create mode 100644 node_modules/js-yaml/LICENSE create mode 100644 node_modules/js-yaml/README.md create mode 100755 node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/js-yaml/index.js create mode 100644 node_modules/js-yaml/lib/js-yaml.js create mode 100644 node_modules/js-yaml/lib/js-yaml/common.js create mode 100644 node_modules/js-yaml/lib/js-yaml/dumper.js create mode 100644 node_modules/js-yaml/lib/js-yaml/exception.js create mode 100644 node_modules/js-yaml/lib/js-yaml/loader.js create mode 100644 node_modules/js-yaml/lib/js-yaml/mark.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/core.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_full.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_safe.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/failsafe.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/json.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/binary.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/bool.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/float.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/int.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/function.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/regexp.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/undefined.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/map.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/merge.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/null.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/omap.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/pairs.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/seq.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/set.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/str.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/timestamp.js create mode 100644 node_modules/js-yaml/package.json create mode 100644 node_modules/json-stable-stringify-without-jsonify/.npmignore create mode 100644 node_modules/json-stable-stringify-without-jsonify/.travis.yml create mode 100644 node_modules/json-stable-stringify-without-jsonify/LICENSE create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/index.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/package.json create mode 100644 node_modules/json-stable-stringify-without-jsonify/readme.markdown create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/replacer.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/space.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/to-json.js create mode 100644 node_modules/json5/CHANGELOG.md create mode 100644 node_modules/json5/LICENSE.md create mode 100644 node_modules/json5/README.md create mode 100644 node_modules/json5/dist/index.js create mode 100755 node_modules/json5/lib/cli.js create mode 100644 node_modules/json5/lib/index.js create mode 100644 node_modules/json5/lib/parse.js create mode 100644 node_modules/json5/lib/register.js create mode 100644 node_modules/json5/lib/require.js create mode 100644 node_modules/json5/lib/stringify.js create mode 100644 node_modules/json5/lib/unicode.js create mode 100644 node_modules/json5/lib/util.js create mode 100644 node_modules/json5/package.json create mode 100644 node_modules/levn/LICENSE create mode 100644 node_modules/levn/README.md create mode 100644 node_modules/levn/lib/cast.js create mode 100644 node_modules/levn/lib/index.js create mode 100644 node_modules/levn/lib/parse-string.js create mode 100644 node_modules/levn/package.json create mode 100644 node_modules/load-json-file/index.js create mode 100644 node_modules/load-json-file/license create mode 100644 node_modules/load-json-file/package.json create mode 100644 node_modules/load-json-file/readme.md create mode 100644 node_modules/locate-path/index.js create mode 100644 node_modules/locate-path/license create mode 100644 node_modules/locate-path/package.json create mode 100644 node_modules/locate-path/readme.md create mode 100644 node_modules/lodash/LICENSE create mode 100644 node_modules/lodash/README.md create mode 100644 node_modules/lodash/_DataView.js create mode 100644 node_modules/lodash/_Hash.js create mode 100644 node_modules/lodash/_LazyWrapper.js create mode 100644 node_modules/lodash/_ListCache.js create mode 100644 node_modules/lodash/_LodashWrapper.js create mode 100644 node_modules/lodash/_Map.js create mode 100644 node_modules/lodash/_MapCache.js create mode 100644 node_modules/lodash/_Promise.js create mode 100644 node_modules/lodash/_Set.js create mode 100644 node_modules/lodash/_SetCache.js create mode 100644 node_modules/lodash/_Stack.js create mode 100644 node_modules/lodash/_Symbol.js create mode 100644 node_modules/lodash/_Uint8Array.js create mode 100644 node_modules/lodash/_WeakMap.js create mode 100644 node_modules/lodash/_apply.js create mode 100644 node_modules/lodash/_arrayAggregator.js create mode 100644 node_modules/lodash/_arrayEach.js create mode 100644 node_modules/lodash/_arrayEachRight.js create mode 100644 node_modules/lodash/_arrayEvery.js create mode 100644 node_modules/lodash/_arrayFilter.js create mode 100644 node_modules/lodash/_arrayIncludes.js create mode 100644 node_modules/lodash/_arrayIncludesWith.js create mode 100644 node_modules/lodash/_arrayLikeKeys.js create mode 100644 node_modules/lodash/_arrayMap.js create mode 100644 node_modules/lodash/_arrayPush.js create mode 100644 node_modules/lodash/_arrayReduce.js create mode 100644 node_modules/lodash/_arrayReduceRight.js create mode 100644 node_modules/lodash/_arraySample.js create mode 100644 node_modules/lodash/_arraySampleSize.js create mode 100644 node_modules/lodash/_arrayShuffle.js create mode 100644 node_modules/lodash/_arraySome.js create mode 100644 node_modules/lodash/_asciiSize.js create mode 100644 node_modules/lodash/_asciiToArray.js create mode 100644 node_modules/lodash/_asciiWords.js create mode 100644 node_modules/lodash/_assignMergeValue.js create mode 100644 node_modules/lodash/_assignValue.js create mode 100644 node_modules/lodash/_assocIndexOf.js create mode 100644 node_modules/lodash/_baseAggregator.js create mode 100644 node_modules/lodash/_baseAssign.js create mode 100644 node_modules/lodash/_baseAssignIn.js create mode 100644 node_modules/lodash/_baseAssignValue.js create mode 100644 node_modules/lodash/_baseAt.js create mode 100644 node_modules/lodash/_baseClamp.js create mode 100644 node_modules/lodash/_baseClone.js create mode 100644 node_modules/lodash/_baseConforms.js create mode 100644 node_modules/lodash/_baseConformsTo.js create mode 100644 node_modules/lodash/_baseCreate.js create mode 100644 node_modules/lodash/_baseDelay.js create mode 100644 node_modules/lodash/_baseDifference.js create mode 100644 node_modules/lodash/_baseEach.js create mode 100644 node_modules/lodash/_baseEachRight.js create mode 100644 node_modules/lodash/_baseEvery.js create mode 100644 node_modules/lodash/_baseExtremum.js create mode 100644 node_modules/lodash/_baseFill.js create mode 100644 node_modules/lodash/_baseFilter.js create mode 100644 node_modules/lodash/_baseFindIndex.js create mode 100644 node_modules/lodash/_baseFindKey.js create mode 100644 node_modules/lodash/_baseFlatten.js create mode 100644 node_modules/lodash/_baseFor.js create mode 100644 node_modules/lodash/_baseForOwn.js create mode 100644 node_modules/lodash/_baseForOwnRight.js create mode 100644 node_modules/lodash/_baseForRight.js create mode 100644 node_modules/lodash/_baseFunctions.js create mode 100644 node_modules/lodash/_baseGet.js create mode 100644 node_modules/lodash/_baseGetAllKeys.js create mode 100644 node_modules/lodash/_baseGetTag.js create mode 100644 node_modules/lodash/_baseGt.js create mode 100644 node_modules/lodash/_baseHas.js create mode 100644 node_modules/lodash/_baseHasIn.js create mode 100644 node_modules/lodash/_baseInRange.js create mode 100644 node_modules/lodash/_baseIndexOf.js create mode 100644 node_modules/lodash/_baseIndexOfWith.js create mode 100644 node_modules/lodash/_baseIntersection.js create mode 100644 node_modules/lodash/_baseInverter.js create mode 100644 node_modules/lodash/_baseInvoke.js create mode 100644 node_modules/lodash/_baseIsArguments.js create mode 100644 node_modules/lodash/_baseIsArrayBuffer.js create mode 100644 node_modules/lodash/_baseIsDate.js create mode 100644 node_modules/lodash/_baseIsEqual.js create mode 100644 node_modules/lodash/_baseIsEqualDeep.js create mode 100644 node_modules/lodash/_baseIsMap.js create mode 100644 node_modules/lodash/_baseIsMatch.js create mode 100644 node_modules/lodash/_baseIsNaN.js create mode 100644 node_modules/lodash/_baseIsNative.js create mode 100644 node_modules/lodash/_baseIsRegExp.js create mode 100644 node_modules/lodash/_baseIsSet.js create mode 100644 node_modules/lodash/_baseIsTypedArray.js create mode 100644 node_modules/lodash/_baseIteratee.js create mode 100644 node_modules/lodash/_baseKeys.js create mode 100644 node_modules/lodash/_baseKeysIn.js create mode 100644 node_modules/lodash/_baseLodash.js create mode 100644 node_modules/lodash/_baseLt.js create mode 100644 node_modules/lodash/_baseMap.js create mode 100644 node_modules/lodash/_baseMatches.js create mode 100644 node_modules/lodash/_baseMatchesProperty.js create mode 100644 node_modules/lodash/_baseMean.js create mode 100644 node_modules/lodash/_baseMerge.js create mode 100644 node_modules/lodash/_baseMergeDeep.js create mode 100644 node_modules/lodash/_baseNth.js create mode 100644 node_modules/lodash/_baseOrderBy.js create mode 100644 node_modules/lodash/_basePick.js create mode 100644 node_modules/lodash/_basePickBy.js create mode 100644 node_modules/lodash/_baseProperty.js create mode 100644 node_modules/lodash/_basePropertyDeep.js create mode 100644 node_modules/lodash/_basePropertyOf.js create mode 100644 node_modules/lodash/_basePullAll.js create mode 100644 node_modules/lodash/_basePullAt.js create mode 100644 node_modules/lodash/_baseRandom.js create mode 100644 node_modules/lodash/_baseRange.js create mode 100644 node_modules/lodash/_baseReduce.js create mode 100644 node_modules/lodash/_baseRepeat.js create mode 100644 node_modules/lodash/_baseRest.js create mode 100644 node_modules/lodash/_baseSample.js create mode 100644 node_modules/lodash/_baseSampleSize.js create mode 100644 node_modules/lodash/_baseSet.js create mode 100644 node_modules/lodash/_baseSetData.js create mode 100644 node_modules/lodash/_baseSetToString.js create mode 100644 node_modules/lodash/_baseShuffle.js create mode 100644 node_modules/lodash/_baseSlice.js create mode 100644 node_modules/lodash/_baseSome.js create mode 100644 node_modules/lodash/_baseSortBy.js create mode 100644 node_modules/lodash/_baseSortedIndex.js create mode 100644 node_modules/lodash/_baseSortedIndexBy.js create mode 100644 node_modules/lodash/_baseSortedUniq.js create mode 100644 node_modules/lodash/_baseSum.js create mode 100644 node_modules/lodash/_baseTimes.js create mode 100644 node_modules/lodash/_baseToNumber.js create mode 100644 node_modules/lodash/_baseToPairs.js create mode 100644 node_modules/lodash/_baseToString.js create mode 100644 node_modules/lodash/_baseUnary.js create mode 100644 node_modules/lodash/_baseUniq.js create mode 100644 node_modules/lodash/_baseUnset.js create mode 100644 node_modules/lodash/_baseUpdate.js create mode 100644 node_modules/lodash/_baseValues.js create mode 100644 node_modules/lodash/_baseWhile.js create mode 100644 node_modules/lodash/_baseWrapperValue.js create mode 100644 node_modules/lodash/_baseXor.js create mode 100644 node_modules/lodash/_baseZipObject.js create mode 100644 node_modules/lodash/_cacheHas.js create mode 100644 node_modules/lodash/_castArrayLikeObject.js create mode 100644 node_modules/lodash/_castFunction.js create mode 100644 node_modules/lodash/_castPath.js create mode 100644 node_modules/lodash/_castRest.js create mode 100644 node_modules/lodash/_castSlice.js create mode 100644 node_modules/lodash/_charsEndIndex.js create mode 100644 node_modules/lodash/_charsStartIndex.js create mode 100644 node_modules/lodash/_cloneArrayBuffer.js create mode 100644 node_modules/lodash/_cloneBuffer.js create mode 100644 node_modules/lodash/_cloneDataView.js create mode 100644 node_modules/lodash/_cloneRegExp.js create mode 100644 node_modules/lodash/_cloneSymbol.js create mode 100644 node_modules/lodash/_cloneTypedArray.js create mode 100644 node_modules/lodash/_compareAscending.js create mode 100644 node_modules/lodash/_compareMultiple.js create mode 100644 node_modules/lodash/_composeArgs.js create mode 100644 node_modules/lodash/_composeArgsRight.js create mode 100644 node_modules/lodash/_copyArray.js create mode 100644 node_modules/lodash/_copyObject.js create mode 100644 node_modules/lodash/_copySymbols.js create mode 100644 node_modules/lodash/_copySymbolsIn.js create mode 100644 node_modules/lodash/_coreJsData.js create mode 100644 node_modules/lodash/_countHolders.js create mode 100644 node_modules/lodash/_createAggregator.js create mode 100644 node_modules/lodash/_createAssigner.js create mode 100644 node_modules/lodash/_createBaseEach.js create mode 100644 node_modules/lodash/_createBaseFor.js create mode 100644 node_modules/lodash/_createBind.js create mode 100644 node_modules/lodash/_createCaseFirst.js create mode 100644 node_modules/lodash/_createCompounder.js create mode 100644 node_modules/lodash/_createCtor.js create mode 100644 node_modules/lodash/_createCurry.js create mode 100644 node_modules/lodash/_createFind.js create mode 100644 node_modules/lodash/_createFlow.js create mode 100644 node_modules/lodash/_createHybrid.js create mode 100644 node_modules/lodash/_createInverter.js create mode 100644 node_modules/lodash/_createMathOperation.js create mode 100644 node_modules/lodash/_createOver.js create mode 100644 node_modules/lodash/_createPadding.js create mode 100644 node_modules/lodash/_createPartial.js create mode 100644 node_modules/lodash/_createRange.js create mode 100644 node_modules/lodash/_createRecurry.js create mode 100644 node_modules/lodash/_createRelationalOperation.js create mode 100644 node_modules/lodash/_createRound.js create mode 100644 node_modules/lodash/_createSet.js create mode 100644 node_modules/lodash/_createToPairs.js create mode 100644 node_modules/lodash/_createWrap.js create mode 100644 node_modules/lodash/_customDefaultsAssignIn.js create mode 100644 node_modules/lodash/_customDefaultsMerge.js create mode 100644 node_modules/lodash/_customOmitClone.js create mode 100644 node_modules/lodash/_deburrLetter.js create mode 100644 node_modules/lodash/_defineProperty.js create mode 100644 node_modules/lodash/_equalArrays.js create mode 100644 node_modules/lodash/_equalByTag.js create mode 100644 node_modules/lodash/_equalObjects.js create mode 100644 node_modules/lodash/_escapeHtmlChar.js create mode 100644 node_modules/lodash/_escapeStringChar.js create mode 100644 node_modules/lodash/_flatRest.js create mode 100644 node_modules/lodash/_freeGlobal.js create mode 100644 node_modules/lodash/_getAllKeys.js create mode 100644 node_modules/lodash/_getAllKeysIn.js create mode 100644 node_modules/lodash/_getData.js create mode 100644 node_modules/lodash/_getFuncName.js create mode 100644 node_modules/lodash/_getHolder.js create mode 100644 node_modules/lodash/_getMapData.js create mode 100644 node_modules/lodash/_getMatchData.js create mode 100644 node_modules/lodash/_getNative.js create mode 100644 node_modules/lodash/_getPrototype.js create mode 100644 node_modules/lodash/_getRawTag.js create mode 100644 node_modules/lodash/_getSymbols.js create mode 100644 node_modules/lodash/_getSymbolsIn.js create mode 100644 node_modules/lodash/_getTag.js create mode 100644 node_modules/lodash/_getValue.js create mode 100644 node_modules/lodash/_getView.js create mode 100644 node_modules/lodash/_getWrapDetails.js create mode 100644 node_modules/lodash/_hasPath.js create mode 100644 node_modules/lodash/_hasUnicode.js create mode 100644 node_modules/lodash/_hasUnicodeWord.js create mode 100644 node_modules/lodash/_hashClear.js create mode 100644 node_modules/lodash/_hashDelete.js create mode 100644 node_modules/lodash/_hashGet.js create mode 100644 node_modules/lodash/_hashHas.js create mode 100644 node_modules/lodash/_hashSet.js create mode 100644 node_modules/lodash/_initCloneArray.js create mode 100644 node_modules/lodash/_initCloneByTag.js create mode 100644 node_modules/lodash/_initCloneObject.js create mode 100644 node_modules/lodash/_insertWrapDetails.js create mode 100644 node_modules/lodash/_isFlattenable.js create mode 100644 node_modules/lodash/_isIndex.js create mode 100644 node_modules/lodash/_isIterateeCall.js create mode 100644 node_modules/lodash/_isKey.js create mode 100644 node_modules/lodash/_isKeyable.js create mode 100644 node_modules/lodash/_isLaziable.js create mode 100644 node_modules/lodash/_isMaskable.js create mode 100644 node_modules/lodash/_isMasked.js create mode 100644 node_modules/lodash/_isPrototype.js create mode 100644 node_modules/lodash/_isStrictComparable.js create mode 100644 node_modules/lodash/_iteratorToArray.js create mode 100644 node_modules/lodash/_lazyClone.js create mode 100644 node_modules/lodash/_lazyReverse.js create mode 100644 node_modules/lodash/_lazyValue.js create mode 100644 node_modules/lodash/_listCacheClear.js create mode 100644 node_modules/lodash/_listCacheDelete.js create mode 100644 node_modules/lodash/_listCacheGet.js create mode 100644 node_modules/lodash/_listCacheHas.js create mode 100644 node_modules/lodash/_listCacheSet.js create mode 100644 node_modules/lodash/_mapCacheClear.js create mode 100644 node_modules/lodash/_mapCacheDelete.js create mode 100644 node_modules/lodash/_mapCacheGet.js create mode 100644 node_modules/lodash/_mapCacheHas.js create mode 100644 node_modules/lodash/_mapCacheSet.js create mode 100644 node_modules/lodash/_mapToArray.js create mode 100644 node_modules/lodash/_matchesStrictComparable.js create mode 100644 node_modules/lodash/_memoizeCapped.js create mode 100644 node_modules/lodash/_mergeData.js create mode 100644 node_modules/lodash/_metaMap.js create mode 100644 node_modules/lodash/_nativeCreate.js create mode 100644 node_modules/lodash/_nativeKeys.js create mode 100644 node_modules/lodash/_nativeKeysIn.js create mode 100644 node_modules/lodash/_nodeUtil.js create mode 100644 node_modules/lodash/_objectToString.js create mode 100644 node_modules/lodash/_overArg.js create mode 100644 node_modules/lodash/_overRest.js create mode 100644 node_modules/lodash/_parent.js create mode 100644 node_modules/lodash/_reEscape.js create mode 100644 node_modules/lodash/_reEvaluate.js create mode 100644 node_modules/lodash/_reInterpolate.js create mode 100644 node_modules/lodash/_realNames.js create mode 100644 node_modules/lodash/_reorder.js create mode 100644 node_modules/lodash/_replaceHolders.js create mode 100644 node_modules/lodash/_root.js create mode 100644 node_modules/lodash/_safeGet.js create mode 100644 node_modules/lodash/_setCacheAdd.js create mode 100644 node_modules/lodash/_setCacheHas.js create mode 100644 node_modules/lodash/_setData.js create mode 100644 node_modules/lodash/_setToArray.js create mode 100644 node_modules/lodash/_setToPairs.js create mode 100644 node_modules/lodash/_setToString.js create mode 100644 node_modules/lodash/_setWrapToString.js create mode 100644 node_modules/lodash/_shortOut.js create mode 100644 node_modules/lodash/_shuffleSelf.js create mode 100644 node_modules/lodash/_stackClear.js create mode 100644 node_modules/lodash/_stackDelete.js create mode 100644 node_modules/lodash/_stackGet.js create mode 100644 node_modules/lodash/_stackHas.js create mode 100644 node_modules/lodash/_stackSet.js create mode 100644 node_modules/lodash/_strictIndexOf.js create mode 100644 node_modules/lodash/_strictLastIndexOf.js create mode 100644 node_modules/lodash/_stringSize.js create mode 100644 node_modules/lodash/_stringToArray.js create mode 100644 node_modules/lodash/_stringToPath.js create mode 100644 node_modules/lodash/_toKey.js create mode 100644 node_modules/lodash/_toSource.js create mode 100644 node_modules/lodash/_unescapeHtmlChar.js create mode 100644 node_modules/lodash/_unicodeSize.js create mode 100644 node_modules/lodash/_unicodeToArray.js create mode 100644 node_modules/lodash/_unicodeWords.js create mode 100644 node_modules/lodash/_updateWrapDetails.js create mode 100644 node_modules/lodash/_wrapperClone.js create mode 100644 node_modules/lodash/add.js create mode 100644 node_modules/lodash/after.js create mode 100644 node_modules/lodash/array.js create mode 100644 node_modules/lodash/ary.js create mode 100644 node_modules/lodash/assign.js create mode 100644 node_modules/lodash/assignIn.js create mode 100644 node_modules/lodash/assignInWith.js create mode 100644 node_modules/lodash/assignWith.js create mode 100644 node_modules/lodash/at.js create mode 100644 node_modules/lodash/attempt.js create mode 100644 node_modules/lodash/before.js create mode 100644 node_modules/lodash/bind.js create mode 100644 node_modules/lodash/bindAll.js create mode 100644 node_modules/lodash/bindKey.js create mode 100644 node_modules/lodash/camelCase.js create mode 100644 node_modules/lodash/capitalize.js create mode 100644 node_modules/lodash/castArray.js create mode 100644 node_modules/lodash/ceil.js create mode 100644 node_modules/lodash/chain.js create mode 100644 node_modules/lodash/chunk.js create mode 100644 node_modules/lodash/clamp.js create mode 100644 node_modules/lodash/clone.js create mode 100644 node_modules/lodash/cloneDeep.js create mode 100644 node_modules/lodash/cloneDeepWith.js create mode 100644 node_modules/lodash/cloneWith.js create mode 100644 node_modules/lodash/collection.js create mode 100644 node_modules/lodash/commit.js create mode 100644 node_modules/lodash/compact.js create mode 100644 node_modules/lodash/concat.js create mode 100644 node_modules/lodash/cond.js create mode 100644 node_modules/lodash/conforms.js create mode 100644 node_modules/lodash/conformsTo.js create mode 100644 node_modules/lodash/constant.js create mode 100644 node_modules/lodash/core.js create mode 100644 node_modules/lodash/core.min.js create mode 100644 node_modules/lodash/countBy.js create mode 100644 node_modules/lodash/create.js create mode 100644 node_modules/lodash/curry.js create mode 100644 node_modules/lodash/curryRight.js create mode 100644 node_modules/lodash/date.js create mode 100644 node_modules/lodash/debounce.js create mode 100644 node_modules/lodash/deburr.js create mode 100644 node_modules/lodash/defaultTo.js create mode 100644 node_modules/lodash/defaults.js create mode 100644 node_modules/lodash/defaultsDeep.js create mode 100644 node_modules/lodash/defer.js create mode 100644 node_modules/lodash/delay.js create mode 100644 node_modules/lodash/difference.js create mode 100644 node_modules/lodash/differenceBy.js create mode 100644 node_modules/lodash/differenceWith.js create mode 100644 node_modules/lodash/divide.js create mode 100644 node_modules/lodash/drop.js create mode 100644 node_modules/lodash/dropRight.js create mode 100644 node_modules/lodash/dropRightWhile.js create mode 100644 node_modules/lodash/dropWhile.js create mode 100644 node_modules/lodash/each.js create mode 100644 node_modules/lodash/eachRight.js create mode 100644 node_modules/lodash/endsWith.js create mode 100644 node_modules/lodash/entries.js create mode 100644 node_modules/lodash/entriesIn.js create mode 100644 node_modules/lodash/eq.js create mode 100644 node_modules/lodash/escape.js create mode 100644 node_modules/lodash/escapeRegExp.js create mode 100644 node_modules/lodash/every.js create mode 100644 node_modules/lodash/extend.js create mode 100644 node_modules/lodash/extendWith.js create mode 100644 node_modules/lodash/fill.js create mode 100644 node_modules/lodash/filter.js create mode 100644 node_modules/lodash/find.js create mode 100644 node_modules/lodash/findIndex.js create mode 100644 node_modules/lodash/findKey.js create mode 100644 node_modules/lodash/findLast.js create mode 100644 node_modules/lodash/findLastIndex.js create mode 100644 node_modules/lodash/findLastKey.js create mode 100644 node_modules/lodash/first.js create mode 100644 node_modules/lodash/flatMap.js create mode 100644 node_modules/lodash/flatMapDeep.js create mode 100644 node_modules/lodash/flatMapDepth.js create mode 100644 node_modules/lodash/flatten.js create mode 100644 node_modules/lodash/flattenDeep.js create mode 100644 node_modules/lodash/flattenDepth.js create mode 100644 node_modules/lodash/flip.js create mode 100644 node_modules/lodash/floor.js create mode 100644 node_modules/lodash/flow.js create mode 100644 node_modules/lodash/flowRight.js create mode 100644 node_modules/lodash/forEach.js create mode 100644 node_modules/lodash/forEachRight.js create mode 100644 node_modules/lodash/forIn.js create mode 100644 node_modules/lodash/forInRight.js create mode 100644 node_modules/lodash/forOwn.js create mode 100644 node_modules/lodash/forOwnRight.js create mode 100644 node_modules/lodash/fp.js create mode 100644 node_modules/lodash/fp/F.js create mode 100644 node_modules/lodash/fp/T.js create mode 100644 node_modules/lodash/fp/__.js create mode 100644 node_modules/lodash/fp/_baseConvert.js create mode 100644 node_modules/lodash/fp/_convertBrowser.js create mode 100644 node_modules/lodash/fp/_falseOptions.js create mode 100644 node_modules/lodash/fp/_mapping.js create mode 100644 node_modules/lodash/fp/_util.js create mode 100644 node_modules/lodash/fp/add.js create mode 100644 node_modules/lodash/fp/after.js create mode 100644 node_modules/lodash/fp/all.js create mode 100644 node_modules/lodash/fp/allPass.js create mode 100644 node_modules/lodash/fp/always.js create mode 100644 node_modules/lodash/fp/any.js create mode 100644 node_modules/lodash/fp/anyPass.js create mode 100644 node_modules/lodash/fp/apply.js create mode 100644 node_modules/lodash/fp/array.js create mode 100644 node_modules/lodash/fp/ary.js create mode 100644 node_modules/lodash/fp/assign.js create mode 100644 node_modules/lodash/fp/assignAll.js create mode 100644 node_modules/lodash/fp/assignAllWith.js create mode 100644 node_modules/lodash/fp/assignIn.js create mode 100644 node_modules/lodash/fp/assignInAll.js create mode 100644 node_modules/lodash/fp/assignInAllWith.js create mode 100644 node_modules/lodash/fp/assignInWith.js create mode 100644 node_modules/lodash/fp/assignWith.js create mode 100644 node_modules/lodash/fp/assoc.js create mode 100644 node_modules/lodash/fp/assocPath.js create mode 100644 node_modules/lodash/fp/at.js create mode 100644 node_modules/lodash/fp/attempt.js create mode 100644 node_modules/lodash/fp/before.js create mode 100644 node_modules/lodash/fp/bind.js create mode 100644 node_modules/lodash/fp/bindAll.js create mode 100644 node_modules/lodash/fp/bindKey.js create mode 100644 node_modules/lodash/fp/camelCase.js create mode 100644 node_modules/lodash/fp/capitalize.js create mode 100644 node_modules/lodash/fp/castArray.js create mode 100644 node_modules/lodash/fp/ceil.js create mode 100644 node_modules/lodash/fp/chain.js create mode 100644 node_modules/lodash/fp/chunk.js create mode 100644 node_modules/lodash/fp/clamp.js create mode 100644 node_modules/lodash/fp/clone.js create mode 100644 node_modules/lodash/fp/cloneDeep.js create mode 100644 node_modules/lodash/fp/cloneDeepWith.js create mode 100644 node_modules/lodash/fp/cloneWith.js create mode 100644 node_modules/lodash/fp/collection.js create mode 100644 node_modules/lodash/fp/commit.js create mode 100644 node_modules/lodash/fp/compact.js create mode 100644 node_modules/lodash/fp/complement.js create mode 100644 node_modules/lodash/fp/compose.js create mode 100644 node_modules/lodash/fp/concat.js create mode 100644 node_modules/lodash/fp/cond.js create mode 100644 node_modules/lodash/fp/conforms.js create mode 100644 node_modules/lodash/fp/conformsTo.js create mode 100644 node_modules/lodash/fp/constant.js create mode 100644 node_modules/lodash/fp/contains.js create mode 100644 node_modules/lodash/fp/convert.js create mode 100644 node_modules/lodash/fp/countBy.js create mode 100644 node_modules/lodash/fp/create.js create mode 100644 node_modules/lodash/fp/curry.js create mode 100644 node_modules/lodash/fp/curryN.js create mode 100644 node_modules/lodash/fp/curryRight.js create mode 100644 node_modules/lodash/fp/curryRightN.js create mode 100644 node_modules/lodash/fp/date.js create mode 100644 node_modules/lodash/fp/debounce.js create mode 100644 node_modules/lodash/fp/deburr.js create mode 100644 node_modules/lodash/fp/defaultTo.js create mode 100644 node_modules/lodash/fp/defaults.js create mode 100644 node_modules/lodash/fp/defaultsAll.js create mode 100644 node_modules/lodash/fp/defaultsDeep.js create mode 100644 node_modules/lodash/fp/defaultsDeepAll.js create mode 100644 node_modules/lodash/fp/defer.js create mode 100644 node_modules/lodash/fp/delay.js create mode 100644 node_modules/lodash/fp/difference.js create mode 100644 node_modules/lodash/fp/differenceBy.js create mode 100644 node_modules/lodash/fp/differenceWith.js create mode 100644 node_modules/lodash/fp/dissoc.js create mode 100644 node_modules/lodash/fp/dissocPath.js create mode 100644 node_modules/lodash/fp/divide.js create mode 100644 node_modules/lodash/fp/drop.js create mode 100644 node_modules/lodash/fp/dropLast.js create mode 100644 node_modules/lodash/fp/dropLastWhile.js create mode 100644 node_modules/lodash/fp/dropRight.js create mode 100644 node_modules/lodash/fp/dropRightWhile.js create mode 100644 node_modules/lodash/fp/dropWhile.js create mode 100644 node_modules/lodash/fp/each.js create mode 100644 node_modules/lodash/fp/eachRight.js create mode 100644 node_modules/lodash/fp/endsWith.js create mode 100644 node_modules/lodash/fp/entries.js create mode 100644 node_modules/lodash/fp/entriesIn.js create mode 100644 node_modules/lodash/fp/eq.js create mode 100644 node_modules/lodash/fp/equals.js create mode 100644 node_modules/lodash/fp/escape.js create mode 100644 node_modules/lodash/fp/escapeRegExp.js create mode 100644 node_modules/lodash/fp/every.js create mode 100644 node_modules/lodash/fp/extend.js create mode 100644 node_modules/lodash/fp/extendAll.js create mode 100644 node_modules/lodash/fp/extendAllWith.js create mode 100644 node_modules/lodash/fp/extendWith.js create mode 100644 node_modules/lodash/fp/fill.js create mode 100644 node_modules/lodash/fp/filter.js create mode 100644 node_modules/lodash/fp/find.js create mode 100644 node_modules/lodash/fp/findFrom.js create mode 100644 node_modules/lodash/fp/findIndex.js create mode 100644 node_modules/lodash/fp/findIndexFrom.js create mode 100644 node_modules/lodash/fp/findKey.js create mode 100644 node_modules/lodash/fp/findLast.js create mode 100644 node_modules/lodash/fp/findLastFrom.js create mode 100644 node_modules/lodash/fp/findLastIndex.js create mode 100644 node_modules/lodash/fp/findLastIndexFrom.js create mode 100644 node_modules/lodash/fp/findLastKey.js create mode 100644 node_modules/lodash/fp/first.js create mode 100644 node_modules/lodash/fp/flatMap.js create mode 100644 node_modules/lodash/fp/flatMapDeep.js create mode 100644 node_modules/lodash/fp/flatMapDepth.js create mode 100644 node_modules/lodash/fp/flatten.js create mode 100644 node_modules/lodash/fp/flattenDeep.js create mode 100644 node_modules/lodash/fp/flattenDepth.js create mode 100644 node_modules/lodash/fp/flip.js create mode 100644 node_modules/lodash/fp/floor.js create mode 100644 node_modules/lodash/fp/flow.js create mode 100644 node_modules/lodash/fp/flowRight.js create mode 100644 node_modules/lodash/fp/forEach.js create mode 100644 node_modules/lodash/fp/forEachRight.js create mode 100644 node_modules/lodash/fp/forIn.js create mode 100644 node_modules/lodash/fp/forInRight.js create mode 100644 node_modules/lodash/fp/forOwn.js create mode 100644 node_modules/lodash/fp/forOwnRight.js create mode 100644 node_modules/lodash/fp/fromPairs.js create mode 100644 node_modules/lodash/fp/function.js create mode 100644 node_modules/lodash/fp/functions.js create mode 100644 node_modules/lodash/fp/functionsIn.js create mode 100644 node_modules/lodash/fp/get.js create mode 100644 node_modules/lodash/fp/getOr.js create mode 100644 node_modules/lodash/fp/groupBy.js create mode 100644 node_modules/lodash/fp/gt.js create mode 100644 node_modules/lodash/fp/gte.js create mode 100644 node_modules/lodash/fp/has.js create mode 100644 node_modules/lodash/fp/hasIn.js create mode 100644 node_modules/lodash/fp/head.js create mode 100644 node_modules/lodash/fp/identical.js create mode 100644 node_modules/lodash/fp/identity.js create mode 100644 node_modules/lodash/fp/inRange.js create mode 100644 node_modules/lodash/fp/includes.js create mode 100644 node_modules/lodash/fp/includesFrom.js create mode 100644 node_modules/lodash/fp/indexBy.js create mode 100644 node_modules/lodash/fp/indexOf.js create mode 100644 node_modules/lodash/fp/indexOfFrom.js create mode 100644 node_modules/lodash/fp/init.js create mode 100644 node_modules/lodash/fp/initial.js create mode 100644 node_modules/lodash/fp/intersection.js create mode 100644 node_modules/lodash/fp/intersectionBy.js create mode 100644 node_modules/lodash/fp/intersectionWith.js create mode 100644 node_modules/lodash/fp/invert.js create mode 100644 node_modules/lodash/fp/invertBy.js create mode 100644 node_modules/lodash/fp/invertObj.js create mode 100644 node_modules/lodash/fp/invoke.js create mode 100644 node_modules/lodash/fp/invokeArgs.js create mode 100644 node_modules/lodash/fp/invokeArgsMap.js create mode 100644 node_modules/lodash/fp/invokeMap.js create mode 100644 node_modules/lodash/fp/isArguments.js create mode 100644 node_modules/lodash/fp/isArray.js create mode 100644 node_modules/lodash/fp/isArrayBuffer.js create mode 100644 node_modules/lodash/fp/isArrayLike.js create mode 100644 node_modules/lodash/fp/isArrayLikeObject.js create mode 100644 node_modules/lodash/fp/isBoolean.js create mode 100644 node_modules/lodash/fp/isBuffer.js create mode 100644 node_modules/lodash/fp/isDate.js create mode 100644 node_modules/lodash/fp/isElement.js create mode 100644 node_modules/lodash/fp/isEmpty.js create mode 100644 node_modules/lodash/fp/isEqual.js create mode 100644 node_modules/lodash/fp/isEqualWith.js create mode 100644 node_modules/lodash/fp/isError.js create mode 100644 node_modules/lodash/fp/isFinite.js create mode 100644 node_modules/lodash/fp/isFunction.js create mode 100644 node_modules/lodash/fp/isInteger.js create mode 100644 node_modules/lodash/fp/isLength.js create mode 100644 node_modules/lodash/fp/isMap.js create mode 100644 node_modules/lodash/fp/isMatch.js create mode 100644 node_modules/lodash/fp/isMatchWith.js create mode 100644 node_modules/lodash/fp/isNaN.js create mode 100644 node_modules/lodash/fp/isNative.js create mode 100644 node_modules/lodash/fp/isNil.js create mode 100644 node_modules/lodash/fp/isNull.js create mode 100644 node_modules/lodash/fp/isNumber.js create mode 100644 node_modules/lodash/fp/isObject.js create mode 100644 node_modules/lodash/fp/isObjectLike.js create mode 100644 node_modules/lodash/fp/isPlainObject.js create mode 100644 node_modules/lodash/fp/isRegExp.js create mode 100644 node_modules/lodash/fp/isSafeInteger.js create mode 100644 node_modules/lodash/fp/isSet.js create mode 100644 node_modules/lodash/fp/isString.js create mode 100644 node_modules/lodash/fp/isSymbol.js create mode 100644 node_modules/lodash/fp/isTypedArray.js create mode 100644 node_modules/lodash/fp/isUndefined.js create mode 100644 node_modules/lodash/fp/isWeakMap.js create mode 100644 node_modules/lodash/fp/isWeakSet.js create mode 100644 node_modules/lodash/fp/iteratee.js create mode 100644 node_modules/lodash/fp/join.js create mode 100644 node_modules/lodash/fp/juxt.js create mode 100644 node_modules/lodash/fp/kebabCase.js create mode 100644 node_modules/lodash/fp/keyBy.js create mode 100644 node_modules/lodash/fp/keys.js create mode 100644 node_modules/lodash/fp/keysIn.js create mode 100644 node_modules/lodash/fp/lang.js create mode 100644 node_modules/lodash/fp/last.js create mode 100644 node_modules/lodash/fp/lastIndexOf.js create mode 100644 node_modules/lodash/fp/lastIndexOfFrom.js create mode 100644 node_modules/lodash/fp/lowerCase.js create mode 100644 node_modules/lodash/fp/lowerFirst.js create mode 100644 node_modules/lodash/fp/lt.js create mode 100644 node_modules/lodash/fp/lte.js create mode 100644 node_modules/lodash/fp/map.js create mode 100644 node_modules/lodash/fp/mapKeys.js create mode 100644 node_modules/lodash/fp/mapValues.js create mode 100644 node_modules/lodash/fp/matches.js create mode 100644 node_modules/lodash/fp/matchesProperty.js create mode 100644 node_modules/lodash/fp/math.js create mode 100644 node_modules/lodash/fp/max.js create mode 100644 node_modules/lodash/fp/maxBy.js create mode 100644 node_modules/lodash/fp/mean.js create mode 100644 node_modules/lodash/fp/meanBy.js create mode 100644 node_modules/lodash/fp/memoize.js create mode 100644 node_modules/lodash/fp/merge.js create mode 100644 node_modules/lodash/fp/mergeAll.js create mode 100644 node_modules/lodash/fp/mergeAllWith.js create mode 100644 node_modules/lodash/fp/mergeWith.js create mode 100644 node_modules/lodash/fp/method.js create mode 100644 node_modules/lodash/fp/methodOf.js create mode 100644 node_modules/lodash/fp/min.js create mode 100644 node_modules/lodash/fp/minBy.js create mode 100644 node_modules/lodash/fp/mixin.js create mode 100644 node_modules/lodash/fp/multiply.js create mode 100644 node_modules/lodash/fp/nAry.js create mode 100644 node_modules/lodash/fp/negate.js create mode 100644 node_modules/lodash/fp/next.js create mode 100644 node_modules/lodash/fp/noop.js create mode 100644 node_modules/lodash/fp/now.js create mode 100644 node_modules/lodash/fp/nth.js create mode 100644 node_modules/lodash/fp/nthArg.js create mode 100644 node_modules/lodash/fp/number.js create mode 100644 node_modules/lodash/fp/object.js create mode 100644 node_modules/lodash/fp/omit.js create mode 100644 node_modules/lodash/fp/omitAll.js create mode 100644 node_modules/lodash/fp/omitBy.js create mode 100644 node_modules/lodash/fp/once.js create mode 100644 node_modules/lodash/fp/orderBy.js create mode 100644 node_modules/lodash/fp/over.js create mode 100644 node_modules/lodash/fp/overArgs.js create mode 100644 node_modules/lodash/fp/overEvery.js create mode 100644 node_modules/lodash/fp/overSome.js create mode 100644 node_modules/lodash/fp/pad.js create mode 100644 node_modules/lodash/fp/padChars.js create mode 100644 node_modules/lodash/fp/padCharsEnd.js create mode 100644 node_modules/lodash/fp/padCharsStart.js create mode 100644 node_modules/lodash/fp/padEnd.js create mode 100644 node_modules/lodash/fp/padStart.js create mode 100644 node_modules/lodash/fp/parseInt.js create mode 100644 node_modules/lodash/fp/partial.js create mode 100644 node_modules/lodash/fp/partialRight.js create mode 100644 node_modules/lodash/fp/partition.js create mode 100644 node_modules/lodash/fp/path.js create mode 100644 node_modules/lodash/fp/pathEq.js create mode 100644 node_modules/lodash/fp/pathOr.js create mode 100644 node_modules/lodash/fp/paths.js create mode 100644 node_modules/lodash/fp/pick.js create mode 100644 node_modules/lodash/fp/pickAll.js create mode 100644 node_modules/lodash/fp/pickBy.js create mode 100644 node_modules/lodash/fp/pipe.js create mode 100644 node_modules/lodash/fp/placeholder.js create mode 100644 node_modules/lodash/fp/plant.js create mode 100644 node_modules/lodash/fp/pluck.js create mode 100644 node_modules/lodash/fp/prop.js create mode 100644 node_modules/lodash/fp/propEq.js create mode 100644 node_modules/lodash/fp/propOr.js create mode 100644 node_modules/lodash/fp/property.js create mode 100644 node_modules/lodash/fp/propertyOf.js create mode 100644 node_modules/lodash/fp/props.js create mode 100644 node_modules/lodash/fp/pull.js create mode 100644 node_modules/lodash/fp/pullAll.js create mode 100644 node_modules/lodash/fp/pullAllBy.js create mode 100644 node_modules/lodash/fp/pullAllWith.js create mode 100644 node_modules/lodash/fp/pullAt.js create mode 100644 node_modules/lodash/fp/random.js create mode 100644 node_modules/lodash/fp/range.js create mode 100644 node_modules/lodash/fp/rangeRight.js create mode 100644 node_modules/lodash/fp/rangeStep.js create mode 100644 node_modules/lodash/fp/rangeStepRight.js create mode 100644 node_modules/lodash/fp/rearg.js create mode 100644 node_modules/lodash/fp/reduce.js create mode 100644 node_modules/lodash/fp/reduceRight.js create mode 100644 node_modules/lodash/fp/reject.js create mode 100644 node_modules/lodash/fp/remove.js create mode 100644 node_modules/lodash/fp/repeat.js create mode 100644 node_modules/lodash/fp/replace.js create mode 100644 node_modules/lodash/fp/rest.js create mode 100644 node_modules/lodash/fp/restFrom.js create mode 100644 node_modules/lodash/fp/result.js create mode 100644 node_modules/lodash/fp/reverse.js create mode 100644 node_modules/lodash/fp/round.js create mode 100644 node_modules/lodash/fp/sample.js create mode 100644 node_modules/lodash/fp/sampleSize.js create mode 100644 node_modules/lodash/fp/seq.js create mode 100644 node_modules/lodash/fp/set.js create mode 100644 node_modules/lodash/fp/setWith.js create mode 100644 node_modules/lodash/fp/shuffle.js create mode 100644 node_modules/lodash/fp/size.js create mode 100644 node_modules/lodash/fp/slice.js create mode 100644 node_modules/lodash/fp/snakeCase.js create mode 100644 node_modules/lodash/fp/some.js create mode 100644 node_modules/lodash/fp/sortBy.js create mode 100644 node_modules/lodash/fp/sortedIndex.js create mode 100644 node_modules/lodash/fp/sortedIndexBy.js create mode 100644 node_modules/lodash/fp/sortedIndexOf.js create mode 100644 node_modules/lodash/fp/sortedLastIndex.js create mode 100644 node_modules/lodash/fp/sortedLastIndexBy.js create mode 100644 node_modules/lodash/fp/sortedLastIndexOf.js create mode 100644 node_modules/lodash/fp/sortedUniq.js create mode 100644 node_modules/lodash/fp/sortedUniqBy.js create mode 100644 node_modules/lodash/fp/split.js create mode 100644 node_modules/lodash/fp/spread.js create mode 100644 node_modules/lodash/fp/spreadFrom.js create mode 100644 node_modules/lodash/fp/startCase.js create mode 100644 node_modules/lodash/fp/startsWith.js create mode 100644 node_modules/lodash/fp/string.js create mode 100644 node_modules/lodash/fp/stubArray.js create mode 100644 node_modules/lodash/fp/stubFalse.js create mode 100644 node_modules/lodash/fp/stubObject.js create mode 100644 node_modules/lodash/fp/stubString.js create mode 100644 node_modules/lodash/fp/stubTrue.js create mode 100644 node_modules/lodash/fp/subtract.js create mode 100644 node_modules/lodash/fp/sum.js create mode 100644 node_modules/lodash/fp/sumBy.js create mode 100644 node_modules/lodash/fp/symmetricDifference.js create mode 100644 node_modules/lodash/fp/symmetricDifferenceBy.js create mode 100644 node_modules/lodash/fp/symmetricDifferenceWith.js create mode 100644 node_modules/lodash/fp/tail.js create mode 100644 node_modules/lodash/fp/take.js create mode 100644 node_modules/lodash/fp/takeLast.js create mode 100644 node_modules/lodash/fp/takeLastWhile.js create mode 100644 node_modules/lodash/fp/takeRight.js create mode 100644 node_modules/lodash/fp/takeRightWhile.js create mode 100644 node_modules/lodash/fp/takeWhile.js create mode 100644 node_modules/lodash/fp/tap.js create mode 100644 node_modules/lodash/fp/template.js create mode 100644 node_modules/lodash/fp/templateSettings.js create mode 100644 node_modules/lodash/fp/throttle.js create mode 100644 node_modules/lodash/fp/thru.js create mode 100644 node_modules/lodash/fp/times.js create mode 100644 node_modules/lodash/fp/toArray.js create mode 100644 node_modules/lodash/fp/toFinite.js create mode 100644 node_modules/lodash/fp/toInteger.js create mode 100644 node_modules/lodash/fp/toIterator.js create mode 100644 node_modules/lodash/fp/toJSON.js create mode 100644 node_modules/lodash/fp/toLength.js create mode 100644 node_modules/lodash/fp/toLower.js create mode 100644 node_modules/lodash/fp/toNumber.js create mode 100644 node_modules/lodash/fp/toPairs.js create mode 100644 node_modules/lodash/fp/toPairsIn.js create mode 100644 node_modules/lodash/fp/toPath.js create mode 100644 node_modules/lodash/fp/toPlainObject.js create mode 100644 node_modules/lodash/fp/toSafeInteger.js create mode 100644 node_modules/lodash/fp/toString.js create mode 100644 node_modules/lodash/fp/toUpper.js create mode 100644 node_modules/lodash/fp/transform.js create mode 100644 node_modules/lodash/fp/trim.js create mode 100644 node_modules/lodash/fp/trimChars.js create mode 100644 node_modules/lodash/fp/trimCharsEnd.js create mode 100644 node_modules/lodash/fp/trimCharsStart.js create mode 100644 node_modules/lodash/fp/trimEnd.js create mode 100644 node_modules/lodash/fp/trimStart.js create mode 100644 node_modules/lodash/fp/truncate.js create mode 100644 node_modules/lodash/fp/unapply.js create mode 100644 node_modules/lodash/fp/unary.js create mode 100644 node_modules/lodash/fp/unescape.js create mode 100644 node_modules/lodash/fp/union.js create mode 100644 node_modules/lodash/fp/unionBy.js create mode 100644 node_modules/lodash/fp/unionWith.js create mode 100644 node_modules/lodash/fp/uniq.js create mode 100644 node_modules/lodash/fp/uniqBy.js create mode 100644 node_modules/lodash/fp/uniqWith.js create mode 100644 node_modules/lodash/fp/uniqueId.js create mode 100644 node_modules/lodash/fp/unnest.js create mode 100644 node_modules/lodash/fp/unset.js create mode 100644 node_modules/lodash/fp/unzip.js create mode 100644 node_modules/lodash/fp/unzipWith.js create mode 100644 node_modules/lodash/fp/update.js create mode 100644 node_modules/lodash/fp/updateWith.js create mode 100644 node_modules/lodash/fp/upperCase.js create mode 100644 node_modules/lodash/fp/upperFirst.js create mode 100644 node_modules/lodash/fp/useWith.js create mode 100644 node_modules/lodash/fp/util.js create mode 100644 node_modules/lodash/fp/value.js create mode 100644 node_modules/lodash/fp/valueOf.js create mode 100644 node_modules/lodash/fp/values.js create mode 100644 node_modules/lodash/fp/valuesIn.js create mode 100644 node_modules/lodash/fp/where.js create mode 100644 node_modules/lodash/fp/whereEq.js create mode 100644 node_modules/lodash/fp/without.js create mode 100644 node_modules/lodash/fp/words.js create mode 100644 node_modules/lodash/fp/wrap.js create mode 100644 node_modules/lodash/fp/wrapperAt.js create mode 100644 node_modules/lodash/fp/wrapperChain.js create mode 100644 node_modules/lodash/fp/wrapperLodash.js create mode 100644 node_modules/lodash/fp/wrapperReverse.js create mode 100644 node_modules/lodash/fp/wrapperValue.js create mode 100644 node_modules/lodash/fp/xor.js create mode 100644 node_modules/lodash/fp/xorBy.js create mode 100644 node_modules/lodash/fp/xorWith.js create mode 100644 node_modules/lodash/fp/zip.js create mode 100644 node_modules/lodash/fp/zipAll.js create mode 100644 node_modules/lodash/fp/zipObj.js create mode 100644 node_modules/lodash/fp/zipObject.js create mode 100644 node_modules/lodash/fp/zipObjectDeep.js create mode 100644 node_modules/lodash/fp/zipWith.js create mode 100644 node_modules/lodash/fromPairs.js create mode 100644 node_modules/lodash/function.js create mode 100644 node_modules/lodash/functions.js create mode 100644 node_modules/lodash/functionsIn.js create mode 100644 node_modules/lodash/get.js create mode 100644 node_modules/lodash/groupBy.js create mode 100644 node_modules/lodash/gt.js create mode 100644 node_modules/lodash/gte.js create mode 100644 node_modules/lodash/has.js create mode 100644 node_modules/lodash/hasIn.js create mode 100644 node_modules/lodash/head.js create mode 100644 node_modules/lodash/identity.js create mode 100644 node_modules/lodash/inRange.js create mode 100644 node_modules/lodash/includes.js create mode 100644 node_modules/lodash/index.js create mode 100644 node_modules/lodash/indexOf.js create mode 100644 node_modules/lodash/initial.js create mode 100644 node_modules/lodash/intersection.js create mode 100644 node_modules/lodash/intersectionBy.js create mode 100644 node_modules/lodash/intersectionWith.js create mode 100644 node_modules/lodash/invert.js create mode 100644 node_modules/lodash/invertBy.js create mode 100644 node_modules/lodash/invoke.js create mode 100644 node_modules/lodash/invokeMap.js create mode 100644 node_modules/lodash/isArguments.js create mode 100644 node_modules/lodash/isArray.js create mode 100644 node_modules/lodash/isArrayBuffer.js create mode 100644 node_modules/lodash/isArrayLike.js create mode 100644 node_modules/lodash/isArrayLikeObject.js create mode 100644 node_modules/lodash/isBoolean.js create mode 100644 node_modules/lodash/isBuffer.js create mode 100644 node_modules/lodash/isDate.js create mode 100644 node_modules/lodash/isElement.js create mode 100644 node_modules/lodash/isEmpty.js create mode 100644 node_modules/lodash/isEqual.js create mode 100644 node_modules/lodash/isEqualWith.js create mode 100644 node_modules/lodash/isError.js create mode 100644 node_modules/lodash/isFinite.js create mode 100644 node_modules/lodash/isFunction.js create mode 100644 node_modules/lodash/isInteger.js create mode 100644 node_modules/lodash/isLength.js create mode 100644 node_modules/lodash/isMap.js create mode 100644 node_modules/lodash/isMatch.js create mode 100644 node_modules/lodash/isMatchWith.js create mode 100644 node_modules/lodash/isNaN.js create mode 100644 node_modules/lodash/isNative.js create mode 100644 node_modules/lodash/isNil.js create mode 100644 node_modules/lodash/isNull.js create mode 100644 node_modules/lodash/isNumber.js create mode 100644 node_modules/lodash/isObject.js create mode 100644 node_modules/lodash/isObjectLike.js create mode 100644 node_modules/lodash/isPlainObject.js create mode 100644 node_modules/lodash/isRegExp.js create mode 100644 node_modules/lodash/isSafeInteger.js create mode 100644 node_modules/lodash/isSet.js create mode 100644 node_modules/lodash/isString.js create mode 100644 node_modules/lodash/isSymbol.js create mode 100644 node_modules/lodash/isTypedArray.js create mode 100644 node_modules/lodash/isUndefined.js create mode 100644 node_modules/lodash/isWeakMap.js create mode 100644 node_modules/lodash/isWeakSet.js create mode 100644 node_modules/lodash/iteratee.js create mode 100644 node_modules/lodash/join.js create mode 100644 node_modules/lodash/kebabCase.js create mode 100644 node_modules/lodash/keyBy.js create mode 100644 node_modules/lodash/keys.js create mode 100644 node_modules/lodash/keysIn.js create mode 100644 node_modules/lodash/lang.js create mode 100644 node_modules/lodash/last.js create mode 100644 node_modules/lodash/lastIndexOf.js create mode 100644 node_modules/lodash/lodash.js create mode 100644 node_modules/lodash/lodash.min.js create mode 100644 node_modules/lodash/lowerCase.js create mode 100644 node_modules/lodash/lowerFirst.js create mode 100644 node_modules/lodash/lt.js create mode 100644 node_modules/lodash/lte.js create mode 100644 node_modules/lodash/map.js create mode 100644 node_modules/lodash/mapKeys.js create mode 100644 node_modules/lodash/mapValues.js create mode 100644 node_modules/lodash/matches.js create mode 100644 node_modules/lodash/matchesProperty.js create mode 100644 node_modules/lodash/math.js create mode 100644 node_modules/lodash/max.js create mode 100644 node_modules/lodash/maxBy.js create mode 100644 node_modules/lodash/mean.js create mode 100644 node_modules/lodash/meanBy.js create mode 100644 node_modules/lodash/memoize.js create mode 100644 node_modules/lodash/merge.js create mode 100644 node_modules/lodash/mergeWith.js create mode 100644 node_modules/lodash/method.js create mode 100644 node_modules/lodash/methodOf.js create mode 100644 node_modules/lodash/min.js create mode 100644 node_modules/lodash/minBy.js create mode 100644 node_modules/lodash/mixin.js create mode 100644 node_modules/lodash/multiply.js create mode 100644 node_modules/lodash/negate.js create mode 100644 node_modules/lodash/next.js create mode 100644 node_modules/lodash/noop.js create mode 100644 node_modules/lodash/now.js create mode 100644 node_modules/lodash/nth.js create mode 100644 node_modules/lodash/nthArg.js create mode 100644 node_modules/lodash/number.js create mode 100644 node_modules/lodash/object.js create mode 100644 node_modules/lodash/omit.js create mode 100644 node_modules/lodash/omitBy.js create mode 100644 node_modules/lodash/once.js create mode 100644 node_modules/lodash/orderBy.js create mode 100644 node_modules/lodash/over.js create mode 100644 node_modules/lodash/overArgs.js create mode 100644 node_modules/lodash/overEvery.js create mode 100644 node_modules/lodash/overSome.js create mode 100644 node_modules/lodash/package.json create mode 100644 node_modules/lodash/pad.js create mode 100644 node_modules/lodash/padEnd.js create mode 100644 node_modules/lodash/padStart.js create mode 100644 node_modules/lodash/parseInt.js create mode 100644 node_modules/lodash/partial.js create mode 100644 node_modules/lodash/partialRight.js create mode 100644 node_modules/lodash/partition.js create mode 100644 node_modules/lodash/pick.js create mode 100644 node_modules/lodash/pickBy.js create mode 100644 node_modules/lodash/plant.js create mode 100644 node_modules/lodash/property.js create mode 100644 node_modules/lodash/propertyOf.js create mode 100644 node_modules/lodash/pull.js create mode 100644 node_modules/lodash/pullAll.js create mode 100644 node_modules/lodash/pullAllBy.js create mode 100644 node_modules/lodash/pullAllWith.js create mode 100644 node_modules/lodash/pullAt.js create mode 100644 node_modules/lodash/random.js create mode 100644 node_modules/lodash/range.js create mode 100644 node_modules/lodash/rangeRight.js create mode 100644 node_modules/lodash/rearg.js create mode 100644 node_modules/lodash/reduce.js create mode 100644 node_modules/lodash/reduceRight.js create mode 100644 node_modules/lodash/reject.js create mode 100644 node_modules/lodash/remove.js create mode 100644 node_modules/lodash/repeat.js create mode 100644 node_modules/lodash/replace.js create mode 100644 node_modules/lodash/rest.js create mode 100644 node_modules/lodash/result.js create mode 100644 node_modules/lodash/reverse.js create mode 100644 node_modules/lodash/round.js create mode 100644 node_modules/lodash/sample.js create mode 100644 node_modules/lodash/sampleSize.js create mode 100644 node_modules/lodash/seq.js create mode 100644 node_modules/lodash/set.js create mode 100644 node_modules/lodash/setWith.js create mode 100644 node_modules/lodash/shuffle.js create mode 100644 node_modules/lodash/size.js create mode 100644 node_modules/lodash/slice.js create mode 100644 node_modules/lodash/snakeCase.js create mode 100644 node_modules/lodash/some.js create mode 100644 node_modules/lodash/sortBy.js create mode 100644 node_modules/lodash/sortedIndex.js create mode 100644 node_modules/lodash/sortedIndexBy.js create mode 100644 node_modules/lodash/sortedIndexOf.js create mode 100644 node_modules/lodash/sortedLastIndex.js create mode 100644 node_modules/lodash/sortedLastIndexBy.js create mode 100644 node_modules/lodash/sortedLastIndexOf.js create mode 100644 node_modules/lodash/sortedUniq.js create mode 100644 node_modules/lodash/sortedUniqBy.js create mode 100644 node_modules/lodash/split.js create mode 100644 node_modules/lodash/spread.js create mode 100644 node_modules/lodash/startCase.js create mode 100644 node_modules/lodash/startsWith.js create mode 100644 node_modules/lodash/string.js create mode 100644 node_modules/lodash/stubArray.js create mode 100644 node_modules/lodash/stubFalse.js create mode 100644 node_modules/lodash/stubObject.js create mode 100644 node_modules/lodash/stubString.js create mode 100644 node_modules/lodash/stubTrue.js create mode 100644 node_modules/lodash/subtract.js create mode 100644 node_modules/lodash/sum.js create mode 100644 node_modules/lodash/sumBy.js create mode 100644 node_modules/lodash/tail.js create mode 100644 node_modules/lodash/take.js create mode 100644 node_modules/lodash/takeRight.js create mode 100644 node_modules/lodash/takeRightWhile.js create mode 100644 node_modules/lodash/takeWhile.js create mode 100644 node_modules/lodash/tap.js create mode 100644 node_modules/lodash/template.js create mode 100644 node_modules/lodash/templateSettings.js create mode 100644 node_modules/lodash/throttle.js create mode 100644 node_modules/lodash/thru.js create mode 100644 node_modules/lodash/times.js create mode 100644 node_modules/lodash/toArray.js create mode 100644 node_modules/lodash/toFinite.js create mode 100644 node_modules/lodash/toInteger.js create mode 100644 node_modules/lodash/toIterator.js create mode 100644 node_modules/lodash/toJSON.js create mode 100644 node_modules/lodash/toLength.js create mode 100644 node_modules/lodash/toLower.js create mode 100644 node_modules/lodash/toNumber.js create mode 100644 node_modules/lodash/toPairs.js create mode 100644 node_modules/lodash/toPairsIn.js create mode 100644 node_modules/lodash/toPath.js create mode 100644 node_modules/lodash/toPlainObject.js create mode 100644 node_modules/lodash/toSafeInteger.js create mode 100644 node_modules/lodash/toString.js create mode 100644 node_modules/lodash/toUpper.js create mode 100644 node_modules/lodash/transform.js create mode 100644 node_modules/lodash/trim.js create mode 100644 node_modules/lodash/trimEnd.js create mode 100644 node_modules/lodash/trimStart.js create mode 100644 node_modules/lodash/truncate.js create mode 100644 node_modules/lodash/unary.js create mode 100644 node_modules/lodash/unescape.js create mode 100644 node_modules/lodash/union.js create mode 100644 node_modules/lodash/unionBy.js create mode 100644 node_modules/lodash/unionWith.js create mode 100644 node_modules/lodash/uniq.js create mode 100644 node_modules/lodash/uniqBy.js create mode 100644 node_modules/lodash/uniqWith.js create mode 100644 node_modules/lodash/uniqueId.js create mode 100644 node_modules/lodash/unset.js create mode 100644 node_modules/lodash/unzip.js create mode 100644 node_modules/lodash/unzipWith.js create mode 100644 node_modules/lodash/update.js create mode 100644 node_modules/lodash/updateWith.js create mode 100644 node_modules/lodash/upperCase.js create mode 100644 node_modules/lodash/upperFirst.js create mode 100644 node_modules/lodash/util.js create mode 100644 node_modules/lodash/value.js create mode 100644 node_modules/lodash/valueOf.js create mode 100644 node_modules/lodash/values.js create mode 100644 node_modules/lodash/valuesIn.js create mode 100644 node_modules/lodash/without.js create mode 100644 node_modules/lodash/words.js create mode 100644 node_modules/lodash/wrap.js create mode 100644 node_modules/lodash/wrapperAt.js create mode 100644 node_modules/lodash/wrapperChain.js create mode 100644 node_modules/lodash/wrapperLodash.js create mode 100644 node_modules/lodash/wrapperReverse.js create mode 100644 node_modules/lodash/wrapperValue.js create mode 100644 node_modules/lodash/xor.js create mode 100644 node_modules/lodash/xorBy.js create mode 100644 node_modules/lodash/xorWith.js create mode 100644 node_modules/lodash/zip.js create mode 100644 node_modules/lodash/zipObject.js create mode 100644 node_modules/lodash/zipObjectDeep.js create mode 100644 node_modules/lodash/zipWith.js create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/minimist/.travis.yml create mode 100644 node_modules/minimist/LICENSE create mode 100644 node_modules/minimist/example/parse.js create mode 100644 node_modules/minimist/index.js create mode 100644 node_modules/minimist/package.json create mode 100644 node_modules/minimist/readme.markdown create mode 100644 node_modules/minimist/test/all_bool.js create mode 100644 node_modules/minimist/test/bool.js create mode 100644 node_modules/minimist/test/dash.js create mode 100644 node_modules/minimist/test/default_bool.js create mode 100644 node_modules/minimist/test/dotted.js create mode 100644 node_modules/minimist/test/kv_short.js create mode 100644 node_modules/minimist/test/long.js create mode 100644 node_modules/minimist/test/num.js create mode 100644 node_modules/minimist/test/parse.js create mode 100644 node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/minimist/test/proto.js create mode 100644 node_modules/minimist/test/short.js create mode 100644 node_modules/minimist/test/stop_early.js create mode 100644 node_modules/minimist/test/unknown.js create mode 100644 node_modules/minimist/test/whitespace.js create mode 100644 node_modules/mkdirp/LICENSE create mode 100755 node_modules/mkdirp/bin/cmd.js create mode 100644 node_modules/mkdirp/bin/usage.txt create mode 100644 node_modules/mkdirp/index.js create mode 100644 node_modules/mkdirp/package.json create mode 100644 node_modules/mkdirp/readme.markdown create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/natural-compare/README.md create mode 100644 node_modules/natural-compare/index.js create mode 100644 node_modules/natural-compare/package.json create mode 100644 node_modules/normalize-package-data/AUTHORS create mode 100644 node_modules/normalize-package-data/LICENSE create mode 100644 node_modules/normalize-package-data/README.md create mode 100644 node_modules/normalize-package-data/lib/extract_description.js create mode 100644 node_modules/normalize-package-data/lib/fixer.js create mode 100644 node_modules/normalize-package-data/lib/make_warning.js create mode 100644 node_modules/normalize-package-data/lib/normalize.js create mode 100644 node_modules/normalize-package-data/lib/safe_format.js create mode 100644 node_modules/normalize-package-data/lib/typos.json create mode 100644 node_modules/normalize-package-data/lib/warning_messages.json create mode 120000 node_modules/normalize-package-data/node_modules/.bin/semver create mode 100644 node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md create mode 100644 node_modules/normalize-package-data/node_modules/semver/LICENSE create mode 100644 node_modules/normalize-package-data/node_modules/semver/README.md create mode 100755 node_modules/normalize-package-data/node_modules/semver/bin/semver create mode 100644 node_modules/normalize-package-data/node_modules/semver/package.json create mode 100644 node_modules/normalize-package-data/node_modules/semver/range.bnf create mode 100644 node_modules/normalize-package-data/node_modules/semver/semver.js create mode 100644 node_modules/normalize-package-data/package.json create mode 100644 node_modules/object-inspect/.eslintignore create mode 100644 node_modules/object-inspect/.eslintrc create mode 100644 node_modules/object-inspect/.github/workflows/rebase.yml create mode 100644 node_modules/object-inspect/.nycrc create mode 100644 node_modules/object-inspect/.travis.yml create mode 100644 node_modules/object-inspect/LICENSE create mode 100644 node_modules/object-inspect/example/all.js create mode 100644 node_modules/object-inspect/example/circular.js create mode 100644 node_modules/object-inspect/example/fn.js create mode 100644 node_modules/object-inspect/example/inspect.js create mode 100644 node_modules/object-inspect/index.js create mode 100644 node_modules/object-inspect/package.json create mode 100644 node_modules/object-inspect/readme.markdown create mode 100644 node_modules/object-inspect/test-core-js.js create mode 100644 node_modules/object-inspect/test/bigint.js create mode 100644 node_modules/object-inspect/test/browser/dom.js create mode 100644 node_modules/object-inspect/test/circular.js create mode 100644 node_modules/object-inspect/test/deep.js create mode 100644 node_modules/object-inspect/test/element.js create mode 100644 node_modules/object-inspect/test/err.js create mode 100644 node_modules/object-inspect/test/fn.js create mode 100644 node_modules/object-inspect/test/has.js create mode 100644 node_modules/object-inspect/test/holes.js create mode 100644 node_modules/object-inspect/test/indent-option.js create mode 100644 node_modules/object-inspect/test/inspect.js create mode 100644 node_modules/object-inspect/test/lowbyte.js create mode 100644 node_modules/object-inspect/test/number.js create mode 100644 node_modules/object-inspect/test/quoteStyle.js create mode 100644 node_modules/object-inspect/test/undef.js create mode 100644 node_modules/object-inspect/test/values.js create mode 100644 node_modules/object-inspect/util.inspect.js create mode 100644 node_modules/object-keys/.editorconfig create mode 100644 node_modules/object-keys/.eslintrc create mode 100644 node_modules/object-keys/.travis.yml create mode 100644 node_modules/object-keys/CHANGELOG.md create mode 100644 node_modules/object-keys/LICENSE create mode 100644 node_modules/object-keys/README.md create mode 100644 node_modules/object-keys/implementation.js create mode 100644 node_modules/object-keys/index.js create mode 100644 node_modules/object-keys/isArguments.js create mode 100644 node_modules/object-keys/package.json create mode 100644 node_modules/object-keys/test/index.js create mode 100644 node_modules/object.assign/.editorconfig create mode 100644 node_modules/object.assign/.eslintignore create mode 100644 node_modules/object.assign/.eslintrc create mode 100644 node_modules/object.assign/.github/FUNDING.yml create mode 100644 node_modules/object.assign/.github/workflows/rebase.yml create mode 100644 node_modules/object.assign/.github/workflows/require-allow-edits.yml create mode 100644 node_modules/object.assign/CHANGELOG.md create mode 100644 node_modules/object.assign/LICENSE create mode 100644 node_modules/object.assign/README.md create mode 100644 node_modules/object.assign/auto.js create mode 100644 node_modules/object.assign/dist/browser.js create mode 100644 node_modules/object.assign/hasSymbols.js create mode 100644 node_modules/object.assign/implementation.js create mode 100644 node_modules/object.assign/index.js create mode 100644 node_modules/object.assign/package.json create mode 100644 node_modules/object.assign/polyfill.js create mode 100644 node_modules/object.assign/shim.js create mode 100644 node_modules/object.assign/test/index.js create mode 100644 node_modules/object.assign/test/native.js create mode 100644 node_modules/object.assign/test/ses-compat.js create mode 100644 node_modules/object.assign/test/shimmed.js create mode 100644 node_modules/object.assign/test/tests.js create mode 100644 node_modules/object.entries/.editorconfig create mode 100644 node_modules/object.entries/.eslintrc create mode 100644 node_modules/object.entries/.github/workflows/rebase.yml create mode 100644 node_modules/object.entries/.travis.yml create mode 100644 node_modules/object.entries/CHANGELOG.md create mode 100644 node_modules/object.entries/LICENSE create mode 100644 node_modules/object.entries/README.md create mode 100644 node_modules/object.entries/auto.js create mode 100644 node_modules/object.entries/implementation.js create mode 100644 node_modules/object.entries/index.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/object.entries/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/object.entries/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/object.entries/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/object.entries/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/object.entries/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/object.entries/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/object.entries/node_modules/es-abstract/.nycrc create mode 100644 node_modules/object.entries/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/LICENSE create mode 100644 node_modules/object.entries/node_modules/es-abstract/README.md create mode 100644 node_modules/object.entries/node_modules/es-abstract/es2015.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es2016.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es2017.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es2018.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es2019.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es5.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es6.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/es7.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/index.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/object.entries/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/package.json create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/index.js create mode 100644 node_modules/object.entries/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/object.entries/package.json create mode 100644 node_modules/object.entries/polyfill.js create mode 100644 node_modules/object.entries/shim.js create mode 100644 node_modules/object.entries/test/.eslintrc create mode 100644 node_modules/object.entries/test/index.js create mode 100644 node_modules/object.entries/test/shimmed.js create mode 100644 node_modules/object.entries/test/tests.js create mode 100644 node_modules/object.values/.eslintrc create mode 100644 node_modules/object.values/.github/workflows/rebase.yml create mode 100644 node_modules/object.values/.travis.yml create mode 100644 node_modules/object.values/CHANGELOG.md create mode 100644 node_modules/object.values/LICENSE create mode 100644 node_modules/object.values/README.md create mode 100644 node_modules/object.values/auto.js create mode 100644 node_modules/object.values/implementation.js create mode 100644 node_modules/object.values/index.js create mode 100644 node_modules/object.values/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/object.values/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/object.values/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/object.values/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/object.values/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/object.values/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/object.values/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/object.values/node_modules/es-abstract/.nycrc create mode 100644 node_modules/object.values/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/object.values/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/object.values/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/object.values/node_modules/es-abstract/LICENSE create mode 100644 node_modules/object.values/node_modules/es-abstract/README.md create mode 100644 node_modules/object.values/node_modules/es-abstract/es2015.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es2016.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es2017.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es2018.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es2019.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es5.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es6.js create mode 100644 node_modules/object.values/node_modules/es-abstract/es7.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/object.values/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/object.values/node_modules/es-abstract/index.js create mode 100644 node_modules/object.values/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/object.values/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/object.values/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/object.values/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/object.values/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/object.values/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/object.values/node_modules/es-abstract/package.json create mode 100644 node_modules/object.values/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/index.js create mode 100644 node_modules/object.values/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/object.values/package.json create mode 100644 node_modules/object.values/polyfill.js create mode 100644 node_modules/object.values/shim.js create mode 100644 node_modules/object.values/test/.eslintrc create mode 100644 node_modules/object.values/test/index.js create mode 100644 node_modules/object.values/test/shimmed.js create mode 100644 node_modules/object.values/test/tests.js create mode 100644 node_modules/optionator/CHANGELOG.md create mode 100644 node_modules/optionator/LICENSE create mode 100644 node_modules/optionator/README.md create mode 100644 node_modules/optionator/lib/help.js create mode 100644 node_modules/optionator/lib/index.js create mode 100644 node_modules/optionator/lib/util.js create mode 100644 node_modules/optionator/package.json create mode 100644 node_modules/p-limit/index.js create mode 100644 node_modules/p-limit/license create mode 100644 node_modules/p-limit/package.json create mode 100644 node_modules/p-limit/readme.md create mode 100644 node_modules/p-locate/index.js create mode 100644 node_modules/p-locate/license create mode 100644 node_modules/p-locate/package.json create mode 100644 node_modules/p-locate/readme.md create mode 100644 node_modules/p-try/index.js create mode 100644 node_modules/p-try/license create mode 100644 node_modules/p-try/package.json create mode 100644 node_modules/p-try/readme.md create mode 100644 node_modules/parent-module/index.js create mode 100644 node_modules/parent-module/license create mode 100644 node_modules/parent-module/package.json create mode 100644 node_modules/parent-module/readme.md create mode 100644 node_modules/parse-json/index.js create mode 100644 node_modules/parse-json/license create mode 100644 node_modules/parse-json/package.json create mode 100644 node_modules/parse-json/readme.md create mode 100644 node_modules/parse-json/vendor/parse.js create mode 100644 node_modules/parse-json/vendor/unicode.js create mode 100644 node_modules/path-exists/index.js create mode 100644 node_modules/path-exists/license create mode 100644 node_modules/path-exists/package.json create mode 100644 node_modules/path-exists/readme.md create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-key/index.d.ts create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-parse/.travis.yml create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-parse/test.js create mode 100644 node_modules/path-type/index.js create mode 100644 node_modules/path-type/license create mode 100644 node_modules/path-type/package.json create mode 100644 node_modules/path-type/readme.md create mode 100644 node_modules/pify/index.js create mode 100644 node_modules/pify/license create mode 100644 node_modules/pify/package.json create mode 100644 node_modules/pify/readme.md create mode 100644 node_modules/pkg-dir/index.js create mode 100644 node_modules/pkg-dir/license create mode 100644 node_modules/pkg-dir/package.json create mode 100644 node_modules/pkg-dir/readme.md create mode 100644 node_modules/prelude-ls/CHANGELOG.md create mode 100644 node_modules/prelude-ls/LICENSE create mode 100644 node_modules/prelude-ls/README.md create mode 100644 node_modules/prelude-ls/lib/Func.js create mode 100644 node_modules/prelude-ls/lib/List.js create mode 100644 node_modules/prelude-ls/lib/Num.js create mode 100644 node_modules/prelude-ls/lib/Obj.js create mode 100644 node_modules/prelude-ls/lib/Str.js create mode 100644 node_modules/prelude-ls/lib/index.js create mode 100644 node_modules/prelude-ls/package.json create mode 100644 node_modules/progress/CHANGELOG.md create mode 100644 node_modules/progress/LICENSE create mode 100644 node_modules/progress/Makefile create mode 100644 node_modules/progress/Readme.md create mode 100644 node_modules/progress/index.js create mode 100644 node_modules/progress/lib/node-progress.js create mode 100644 node_modules/progress/package.json create mode 100644 node_modules/read-pkg-up/index.js create mode 100644 node_modules/read-pkg-up/license create mode 100644 node_modules/read-pkg-up/package.json create mode 100644 node_modules/read-pkg-up/readme.md create mode 100644 node_modules/read-pkg/index.js create mode 100644 node_modules/read-pkg/license create mode 100644 node_modules/read-pkg/package.json create mode 100644 node_modules/read-pkg/readme.md create mode 100644 node_modules/regexpp/LICENSE create mode 100644 node_modules/regexpp/README.md create mode 100644 node_modules/regexpp/index.d.ts create mode 100644 node_modules/regexpp/index.js create mode 100644 node_modules/regexpp/index.js.map create mode 100644 node_modules/regexpp/index.mjs create mode 100644 node_modules/regexpp/index.mjs.map create mode 100644 node_modules/regexpp/package.json create mode 100644 node_modules/resolve-from/index.js create mode 100644 node_modules/resolve-from/license create mode 100644 node_modules/resolve-from/package.json create mode 100644 node_modules/resolve-from/readme.md create mode 100644 node_modules/resolve/.editorconfig create mode 100644 node_modules/resolve/.eslintignore create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.travis.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/appveyor.yml create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/core.js create mode 100644 node_modules/resolve/lib/core.json create mode 100644 node_modules/resolve/lib/is-core.js create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/test/.eslintrc create mode 100644 node_modules/resolve/test/core.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/rimraf/LICENSE create mode 100644 node_modules/rimraf/README.md create mode 100755 node_modules/rimraf/bin.js create mode 100644 node_modules/rimraf/package.json create mode 100644 node_modules/rimraf/rimraf.js create mode 100644 node_modules/semver/CHANGELOG.md create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100755 node_modules/semver/bin/semver.js create mode 100644 node_modules/semver/classes/comparator.js create mode 100644 node_modules/semver/classes/index.js create mode 100644 node_modules/semver/classes/range.js create mode 100644 node_modules/semver/classes/semver.js create mode 100644 node_modules/semver/functions/clean.js create mode 100644 node_modules/semver/functions/cmp.js create mode 100644 node_modules/semver/functions/coerce.js create mode 100644 node_modules/semver/functions/compare-build.js create mode 100644 node_modules/semver/functions/compare-loose.js create mode 100644 node_modules/semver/functions/compare.js create mode 100644 node_modules/semver/functions/diff.js create mode 100644 node_modules/semver/functions/eq.js create mode 100644 node_modules/semver/functions/gt.js create mode 100644 node_modules/semver/functions/gte.js create mode 100644 node_modules/semver/functions/inc.js create mode 100644 node_modules/semver/functions/lt.js create mode 100644 node_modules/semver/functions/lte.js create mode 100644 node_modules/semver/functions/major.js create mode 100644 node_modules/semver/functions/minor.js create mode 100644 node_modules/semver/functions/neq.js create mode 100644 node_modules/semver/functions/parse.js create mode 100644 node_modules/semver/functions/patch.js create mode 100644 node_modules/semver/functions/prerelease.js create mode 100644 node_modules/semver/functions/rcompare.js create mode 100644 node_modules/semver/functions/rsort.js create mode 100644 node_modules/semver/functions/satisfies.js create mode 100644 node_modules/semver/functions/sort.js create mode 100644 node_modules/semver/functions/valid.js create mode 100644 node_modules/semver/index.js create mode 100644 node_modules/semver/internal/constants.js create mode 100644 node_modules/semver/internal/debug.js create mode 100644 node_modules/semver/internal/identifiers.js create mode 100644 node_modules/semver/internal/re.js create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/preload.js create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/ranges/gtr.js create mode 100644 node_modules/semver/ranges/intersects.js create mode 100644 node_modules/semver/ranges/ltr.js create mode 100644 node_modules/semver/ranges/max-satisfying.js create mode 100644 node_modules/semver/ranges/min-satisfying.js create mode 100644 node_modules/semver/ranges/min-version.js create mode 100644 node_modules/semver/ranges/outside.js create mode 100644 node_modules/semver/ranges/simplify.js create mode 100644 node_modules/semver/ranges/subset.js create mode 100644 node_modules/semver/ranges/to-comparators.js create mode 100644 node_modules/semver/ranges/valid.js create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.d.ts create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100755 node_modules/slice-ansi/index.js create mode 100644 node_modules/slice-ansi/license create mode 100644 node_modules/slice-ansi/package.json create mode 100644 node_modules/slice-ansi/readme.md create mode 100644 node_modules/spdx-correct/LICENSE create mode 100644 node_modules/spdx-correct/README.md create mode 100644 node_modules/spdx-correct/index.js create mode 100644 node_modules/spdx-correct/package.json create mode 100644 node_modules/spdx-exceptions/README.md create mode 100644 node_modules/spdx-exceptions/index.json create mode 100644 node_modules/spdx-exceptions/package.json create mode 100644 node_modules/spdx-expression-parse/AUTHORS create mode 100644 node_modules/spdx-expression-parse/LICENSE create mode 100644 node_modules/spdx-expression-parse/README.md create mode 100644 node_modules/spdx-expression-parse/index.js create mode 100644 node_modules/spdx-expression-parse/package.json create mode 100644 node_modules/spdx-expression-parse/parse.js create mode 100644 node_modules/spdx-expression-parse/scan.js create mode 100644 node_modules/spdx-license-ids/README.md create mode 100644 node_modules/spdx-license-ids/deprecated.json create mode 100644 node_modules/spdx-license-ids/index.json create mode 100644 node_modules/spdx-license-ids/package.json create mode 100644 node_modules/sprintf-js/.npmignore create mode 100644 node_modules/sprintf-js/LICENSE create mode 100644 node_modules/sprintf-js/README.md create mode 100644 node_modules/sprintf-js/bower.json create mode 100644 node_modules/sprintf-js/demo/angular.html create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js.map create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.map create mode 100644 node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 node_modules/sprintf-js/dist/sprintf.min.js.map create mode 100644 node_modules/sprintf-js/dist/sprintf.min.map create mode 100644 node_modules/sprintf-js/gruntfile.js create mode 100644 node_modules/sprintf-js/package.json create mode 100644 node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 node_modules/sprintf-js/src/sprintf.js create mode 100644 node_modules/sprintf-js/test/test.js create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/node_modules/ansi-regex/index.js create mode 100644 node_modules/string-width/node_modules/ansi-regex/license create mode 100644 node_modules/string-width/node_modules/ansi-regex/package.json create mode 100644 node_modules/string-width/node_modules/ansi-regex/readme.md create mode 100644 node_modules/string-width/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/string-width/node_modules/strip-ansi/index.js create mode 100644 node_modules/string-width/node_modules/strip-ansi/license create mode 100644 node_modules/string-width/node_modules/strip-ansi/package.json create mode 100644 node_modules/string-width/node_modules/strip-ansi/readme.md create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/string.prototype.trimend/.editorconfig create mode 100644 node_modules/string.prototype.trimend/.eslintrc create mode 100644 node_modules/string.prototype.trimend/.github/workflows/rebase.yml create mode 100644 node_modules/string.prototype.trimend/.travis.yml create mode 100644 node_modules/string.prototype.trimend/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimend/LICENSE create mode 100644 node_modules/string.prototype.trimend/README.md create mode 100644 node_modules/string.prototype.trimend/auto.js create mode 100644 node_modules/string.prototype.trimend/implementation.js create mode 100644 node_modules/string.prototype.trimend/index.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.nycrc create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/LICENSE create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/README.md create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es2015.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es2016.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es2017.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es2018.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es2019.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es5.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es6.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/es7.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/index.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/package.json create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/index.js create mode 100644 node_modules/string.prototype.trimend/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/string.prototype.trimend/package.json create mode 100644 node_modules/string.prototype.trimend/polyfill.js create mode 100644 node_modules/string.prototype.trimend/shim.js create mode 100644 node_modules/string.prototype.trimend/test/index.js create mode 100644 node_modules/string.prototype.trimend/test/shimmed.js create mode 100644 node_modules/string.prototype.trimend/test/tests.js create mode 100644 node_modules/string.prototype.trimstart/.editorconfig create mode 100644 node_modules/string.prototype.trimstart/.eslintrc create mode 100644 node_modules/string.prototype.trimstart/.github/workflows/rebase.yml create mode 100644 node_modules/string.prototype.trimstart/.travis.yml create mode 100644 node_modules/string.prototype.trimstart/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimstart/LICENSE create mode 100644 node_modules/string.prototype.trimstart/README.md create mode 100644 node_modules/string.prototype.trimstart/auto.js create mode 100644 node_modules/string.prototype.trimstart/implementation.js create mode 100644 node_modules/string.prototype.trimstart/index.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.nycrc create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/LICENSE create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/README.md create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es2015.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es2016.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es2017.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es2018.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es2019.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es5.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es6.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/es7.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/index.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/package.json create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/index.js create mode 100644 node_modules/string.prototype.trimstart/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/string.prototype.trimstart/package.json create mode 100644 node_modules/string.prototype.trimstart/polyfill.js create mode 100644 node_modules/string.prototype.trimstart/shim.js create mode 100644 node_modules/string.prototype.trimstart/test/index.js create mode 100644 node_modules/string.prototype.trimstart/test/shimmed.js create mode 100644 node_modules/string.prototype.trimstart/test/tests.js create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-bom/index.js create mode 100644 node_modules/strip-bom/license create mode 100644 node_modules/strip-bom/package.json create mode 100644 node_modules/strip-bom/readme.md create mode 100644 node_modules/strip-json-comments/index.d.ts create mode 100644 node_modules/strip-json-comments/index.js create mode 100644 node_modules/strip-json-comments/license create mode 100644 node_modules/strip-json-comments/package.json create mode 100644 node_modules/strip-json-comments/readme.md create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/table/LICENSE create mode 100644 node_modules/table/README.md create mode 100644 node_modules/table/dist/alignString.js create mode 100644 node_modules/table/dist/alignString.js.flow create mode 100644 node_modules/table/dist/alignString.js.map create mode 100644 node_modules/table/dist/alignTableData.js create mode 100644 node_modules/table/dist/alignTableData.js.flow create mode 100644 node_modules/table/dist/alignTableData.js.map create mode 100644 node_modules/table/dist/calculateCellHeight.js create mode 100644 node_modules/table/dist/calculateCellHeight.js.flow create mode 100644 node_modules/table/dist/calculateCellHeight.js.map create mode 100644 node_modules/table/dist/calculateCellWidthIndex.js create mode 100644 node_modules/table/dist/calculateCellWidthIndex.js.flow create mode 100644 node_modules/table/dist/calculateCellWidthIndex.js.map create mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js create mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow create mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map create mode 100644 node_modules/table/dist/calculateRowHeightIndex.js create mode 100644 node_modules/table/dist/calculateRowHeightIndex.js.flow create mode 100644 node_modules/table/dist/calculateRowHeightIndex.js.map create mode 100644 node_modules/table/dist/createStream.js create mode 100644 node_modules/table/dist/createStream.js.flow create mode 100644 node_modules/table/dist/createStream.js.map create mode 100644 node_modules/table/dist/drawBorder.js create mode 100644 node_modules/table/dist/drawBorder.js.flow create mode 100644 node_modules/table/dist/drawBorder.js.map create mode 100644 node_modules/table/dist/drawRow.js create mode 100644 node_modules/table/dist/drawRow.js.flow create mode 100644 node_modules/table/dist/drawRow.js.map create mode 100644 node_modules/table/dist/drawTable.js create mode 100644 node_modules/table/dist/drawTable.js.flow create mode 100644 node_modules/table/dist/drawTable.js.map create mode 100644 node_modules/table/dist/getBorderCharacters.js create mode 100644 node_modules/table/dist/getBorderCharacters.js.flow create mode 100644 node_modules/table/dist/getBorderCharacters.js.map create mode 100644 node_modules/table/dist/index.js create mode 100644 node_modules/table/dist/index.js.flow create mode 100644 node_modules/table/dist/index.js.map create mode 100644 node_modules/table/dist/makeConfig.js create mode 100644 node_modules/table/dist/makeConfig.js.flow create mode 100644 node_modules/table/dist/makeConfig.js.map create mode 100644 node_modules/table/dist/makeStreamConfig.js create mode 100644 node_modules/table/dist/makeStreamConfig.js.flow create mode 100644 node_modules/table/dist/makeStreamConfig.js.map create mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js create mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow create mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js.map create mode 100644 node_modules/table/dist/padTableData.js create mode 100644 node_modules/table/dist/padTableData.js.flow create mode 100644 node_modules/table/dist/padTableData.js.map create mode 100644 node_modules/table/dist/schemas/config.json create mode 100644 node_modules/table/dist/schemas/streamConfig.json create mode 100644 node_modules/table/dist/stringifyTableData.js create mode 100644 node_modules/table/dist/stringifyTableData.js.flow create mode 100644 node_modules/table/dist/stringifyTableData.js.map create mode 100644 node_modules/table/dist/table.js create mode 100644 node_modules/table/dist/table.js.flow create mode 100644 node_modules/table/dist/table.js.map create mode 100644 node_modules/table/dist/truncateTableData.js create mode 100644 node_modules/table/dist/truncateTableData.js.flow create mode 100644 node_modules/table/dist/truncateTableData.js.map create mode 100644 node_modules/table/dist/validateConfig.js create mode 100644 node_modules/table/dist/validateConfig.js.flow create mode 100644 node_modules/table/dist/validateConfig.js.map create mode 100644 node_modules/table/dist/validateStreamConfig.js create mode 100644 node_modules/table/dist/validateTableData.js create mode 100644 node_modules/table/dist/validateTableData.js.flow create mode 100644 node_modules/table/dist/validateTableData.js.map create mode 100644 node_modules/table/dist/wrapCell.js create mode 100644 node_modules/table/dist/wrapCell.js.flow create mode 100644 node_modules/table/dist/wrapCell.js.map create mode 100644 node_modules/table/dist/wrapString.js create mode 100644 node_modules/table/dist/wrapString.js.flow create mode 100644 node_modules/table/dist/wrapString.js.map create mode 100644 node_modules/table/dist/wrapWord.js create mode 100644 node_modules/table/dist/wrapWord.js.flow create mode 100644 node_modules/table/dist/wrapWord.js.map create mode 100644 node_modules/table/package.json create mode 100644 node_modules/text-table/.travis.yml create mode 100644 node_modules/text-table/LICENSE create mode 100644 node_modules/text-table/example/align.js create mode 100644 node_modules/text-table/example/center.js create mode 100644 node_modules/text-table/example/dotalign.js create mode 100644 node_modules/text-table/example/doubledot.js create mode 100644 node_modules/text-table/example/table.js create mode 100644 node_modules/text-table/index.js create mode 100644 node_modules/text-table/package.json create mode 100644 node_modules/text-table/readme.markdown create mode 100644 node_modules/text-table/test/align.js create mode 100644 node_modules/text-table/test/ansi-colors.js create mode 100644 node_modules/text-table/test/center.js create mode 100644 node_modules/text-table/test/dotalign.js create mode 100644 node_modules/text-table/test/doubledot.js create mode 100644 node_modules/text-table/test/table.js create mode 100644 node_modules/tsconfig-paths/.nycrc.json create mode 100644 node_modules/tsconfig-paths/CHANGELOG.md create mode 100644 node_modules/tsconfig-paths/LICENSE create mode 100644 node_modules/tsconfig-paths/README.md create mode 100644 node_modules/tsconfig-paths/lib/config-loader.d.ts create mode 100644 node_modules/tsconfig-paths/lib/config-loader.js create mode 100644 node_modules/tsconfig-paths/lib/filesystem.d.ts create mode 100644 node_modules/tsconfig-paths/lib/filesystem.js create mode 100644 node_modules/tsconfig-paths/lib/index.d.ts create mode 100644 node_modules/tsconfig-paths/lib/index.js create mode 100644 node_modules/tsconfig-paths/lib/mapping-entry.d.ts create mode 100644 node_modules/tsconfig-paths/lib/mapping-entry.js create mode 100644 node_modules/tsconfig-paths/lib/match-path-async.d.ts create mode 100644 node_modules/tsconfig-paths/lib/match-path-async.js create mode 100644 node_modules/tsconfig-paths/lib/match-path-sync.d.ts create mode 100644 node_modules/tsconfig-paths/lib/match-path-sync.js create mode 100644 node_modules/tsconfig-paths/lib/options.d.ts create mode 100644 node_modules/tsconfig-paths/lib/options.js create mode 100644 node_modules/tsconfig-paths/lib/register.d.ts create mode 100644 node_modules/tsconfig-paths/lib/register.js create mode 100644 node_modules/tsconfig-paths/lib/try-path.d.ts create mode 100644 node_modules/tsconfig-paths/lib/try-path.js create mode 100644 node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts create mode 100644 node_modules/tsconfig-paths/lib/tsconfig-loader.js create mode 100644 node_modules/tsconfig-paths/package.json create mode 100644 node_modules/tsconfig-paths/register.js create mode 100644 node_modules/tsconfig-paths/test/config-loader-tests.ts create mode 100644 node_modules/tsconfig-paths/test/data/match-path-data.ts create mode 100644 node_modules/tsconfig-paths/test/filesystem-tests.ts create mode 100644 node_modules/tsconfig-paths/test/mapping-entry-test.ts create mode 100644 node_modules/tsconfig-paths/test/match-path-async-tests.ts create mode 100644 node_modules/tsconfig-paths/test/match-path-sync-tests.ts create mode 100644 node_modules/tsconfig-paths/test/mocha.opts create mode 100644 node_modules/tsconfig-paths/test/try-path-tests.ts create mode 100644 node_modules/tsconfig-paths/test/tsconfig-loader-tests.ts create mode 100644 node_modules/tsconfig-paths/test/tsconfig-named.json create mode 100644 node_modules/tsconfig-paths/test/tsconfig.json create mode 100644 node_modules/tsconfig-paths/tslint.json create mode 100644 node_modules/type-check/LICENSE create mode 100644 node_modules/type-check/README.md create mode 100644 node_modules/type-check/lib/check.js create mode 100644 node_modules/type-check/lib/index.js create mode 100644 node_modules/type-check/lib/parse-type.js create mode 100644 node_modules/type-check/package.json create mode 100644 node_modules/type-fest/index.d.ts create mode 100644 node_modules/type-fest/license create mode 100644 node_modules/type-fest/package.json create mode 100644 node_modules/type-fest/readme.md create mode 100644 node_modules/type-fest/source/basic.d.ts create mode 100644 node_modules/type-fest/source/except.d.ts create mode 100644 node_modules/type-fest/source/literal-union.d.ts create mode 100644 node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 node_modules/type-fest/source/merge.d.ts create mode 100644 node_modules/type-fest/source/mutable.d.ts create mode 100644 node_modules/type-fest/source/opaque.d.ts create mode 100644 node_modules/type-fest/source/package-json.d.ts create mode 100644 node_modules/type-fest/source/partial-deep.d.ts create mode 100644 node_modules/type-fest/source/promisable.d.ts create mode 100644 node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 node_modules/type-fest/source/set-optional.d.ts create mode 100644 node_modules/type-fest/source/set-required.d.ts create mode 100644 node_modules/v8-compile-cache/CHANGELOG.md create mode 100644 node_modules/v8-compile-cache/LICENSE create mode 100644 node_modules/v8-compile-cache/README.md create mode 100644 node_modules/v8-compile-cache/package.json create mode 100644 node_modules/v8-compile-cache/v8-compile-cache.js create mode 100644 node_modules/validate-npm-package-license/LICENSE create mode 100644 node_modules/validate-npm-package-license/README.md create mode 100644 node_modules/validate-npm-package-license/index.js create mode 100644 node_modules/validate-npm-package-license/package.json create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100755 node_modules/which/bin/node-which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/word-wrap/LICENSE create mode 100644 node_modules/word-wrap/README.md create mode 100644 node_modules/word-wrap/index.d.ts create mode 100644 node_modules/word-wrap/index.js create mode 100644 node_modules/word-wrap/package.json create mode 100644 node_modules/write/LICENSE create mode 100644 node_modules/write/README.md create mode 100644 node_modules/write/index.js create mode 100644 node_modules/write/package.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..2483744 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,19 @@ +{ + "env": { + "browser": true, + "commonjs": true, + "es6": true + }, + "extends": [ + "airbnb-base" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + } +} \ No newline at end of file diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 0000000..cf76760 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/eslint b/node_modules/.bin/eslint new file mode 120000 index 0000000..810e4bc --- /dev/null +++ b/node_modules/.bin/eslint @@ -0,0 +1 @@ +../eslint/bin/eslint.js \ No newline at end of file diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 120000 index 0000000..7423b18 --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 120000 index 0000000..16069ef --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 120000 index 0000000..9dbd010 --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 0000000..217f379 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 0000000..017896c --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 120000 index 0000000..6f8415e --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 0000000..4cd49a4 --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 0000000..5aaadf4 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/code-frame/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/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md new file mode 100644 index 0000000..185f93d --- /dev/null +++ b/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 0000000..28d86f7 --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,167 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.codeFrameColumns = codeFrameColumns; +exports.default = _default; + +var _highlight = _interopRequireWildcard(require("@babel/highlight")); + +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; } + +let deprecationWarningShown = false; + +function getDefs(chalk) { + return { + gutter: chalk.grey, + marker: chalk.red.bold, + message: chalk.red.bold + }; +} + +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + + if (startLine === -1) { + start = 0; + } + + if (endLine === -1) { + end = source.length; + } + + const lineDiff = endLine - startLine; + const markerLines = {}; + + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + + return { + start, + end, + markerLines + }; +} + +function codeFrameColumns(rawLines, loc, 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) => { + return highlighted ? chalkFn(string) : string; + }; + + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = 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; + let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} | `; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + + if (hasMarker) { + let markerLine = ""; + + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } + + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; + } + }).join("\n"); + + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } +} + +function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} \ No newline at end of file diff --git a/node_modules/@babel/code-frame/package.json b/node_modules/@babel/code-frame/package.json new file mode 100644 index 0000000..c06bb08 --- /dev/null +++ b/node_modules/@babel/code-frame/package.json @@ -0,0 +1,57 @@ +{ + "_from": "@babel/code-frame@^7.0.0", + "_id": "@babel/code-frame@7.10.4", + "_inBundle": false, + "_integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "_location": "/@babel/code-frame", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@babel/code-frame@^7.0.0", + "name": "@babel/code-frame", + "escapedName": "@babel%2fcode-frame", + "scope": "@babel", + "rawSpec": "^7.0.0", + "saveSpec": null, + "fetchSpec": "^7.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "_shasum": "168da1a36e90da68ae8d49c0f1b48c7c6249213a", + "_spec": "@babel/code-frame@^7.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/highlight": "^7.10.4" + }, + "deprecated": false, + "description": "Generate errors that contain a code frame that point to source locations.", + "devDependencies": { + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "name": "@babel/code-frame", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babel/babel.git", + "directory": "packages/babel-code-frame" + }, + "version": "7.10.4" +} diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/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/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 0000000..ab2dad1 --- /dev/null +++ b/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/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 0000000..51ec763 --- /dev/null +++ b/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/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 0000000..7b623c9 --- /dev/null +++ b/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/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 0000000..110cee4 --- /dev/null +++ b/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/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 0000000..ad1c2e7 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,51 @@ +{ + "_from": "@babel/helper-validator-identifier@^7.10.4", + "_id": "@babel/helper-validator-identifier@7.10.4", + "_inBundle": false, + "_integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "_location": "/@babel/helper-validator-identifier", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@babel/helper-validator-identifier@^7.10.4", + "name": "@babel/helper-validator-identifier", + "escapedName": "@babel%2fhelper-validator-identifier", + "scope": "@babel", + "rawSpec": "^7.10.4", + "saveSpec": null, + "fetchSpec": "^7.10.4" + }, + "_requiredBy": [ + "/@babel/highlight" + ], + "_resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "_shasum": "a78c7a7251e01f616512d31b10adcf52ada5e0d2", + "_spec": "@babel/helper-validator-identifier@^7.10.4", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/@babel/highlight", + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Validate identifier/keywords name", + "devDependencies": { + "charcodes": "^0.2.0", + "unicode-13.0.0": "^0.8.0" + }, + "exports": "./lib/index.js", + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "homepage": "https://github.com/babel/babel#readme", + "license": "MIT", + "main": "./lib/index.js", + "name": "@babel/helper-validator-identifier", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "version": "7.10.4" +} diff --git a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js new file mode 100644 index 0000000..70b3715 --- /dev/null +++ b/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/node_modules/@babel/highlight/LICENSE b/node_modules/@babel/highlight/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/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/node_modules/@babel/highlight/README.md b/node_modules/@babel/highlight/README.md new file mode 100644 index 0000000..72dae60 --- /dev/null +++ b/node_modules/@babel/highlight/README.md @@ -0,0 +1,19 @@ +# @babel/highlight + +> Syntax highlight JavaScript strings for output in terminals. + +See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/highlight +``` + +or using yarn: + +```sh +yarn add @babel/highlight --dev +``` diff --git a/node_modules/@babel/highlight/lib/index.js b/node_modules/@babel/highlight/lib/index.js new file mode 100644 index 0000000..b0d1be7 --- /dev/null +++ b/node_modules/@babel/highlight/lib/index.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shouldHighlight = shouldHighlight; +exports.getChalk = getChalk; +exports.default = highlight; + +var _jsTokens = _interopRequireWildcard(require("js-tokens")); + +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); + +var _chalk = _interopRequireDefault(require("chalk")); + +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 getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsx_tag: chalk.yellow, + punctuator: chalk.yellow, + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold + }; +} + +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +const JSX_TAG = /^[a-z][\w-]*$/i; +const BRACKET = /^[()[\]{}]$/; + +function getTokenType(match) { + const [offset, text] = match.slice(-2); + const token = (0, _jsTokens.matchToToken)(match); + + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) { + return "keyword"; + } + + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); + } else { + return args[0]; + } + }); +} + +function shouldHighlight(options) { + return _chalk.default.supportsColor || options.forceColor; +} + +function getChalk(options) { + let chalk = _chalk.default; + + if (options.forceColor) { + chalk = new _chalk.default.constructor({ + enabled: true, + level: 1 + }); + } + + return chalk; +} + +function highlight(code, options = {}) { + if (shouldHighlight(options)) { + const chalk = getChalk(options); + const defs = getDefs(chalk); + return highlightTokens(defs, code); + } else { + return code; + } +} \ No newline at end of file diff --git a/node_modules/@babel/highlight/node_modules/chalk/index.js b/node_modules/@babel/highlight/node_modules/chalk/index.js new file mode 100644 index 0000000..1cc5fa8 --- /dev/null +++ b/node_modules/@babel/highlight/node_modules/chalk/index.js @@ -0,0 +1,228 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const stdoutColor = require('supports-color').stdout; + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} + +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder._empty = _empty; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports.default = module.exports; // For TypeScript diff --git a/node_modules/@babel/highlight/node_modules/chalk/index.js.flow b/node_modules/@babel/highlight/node_modules/chalk/index.js.flow new file mode 100644 index 0000000..622caaa --- /dev/null +++ b/node_modules/@babel/highlight/node_modules/chalk/index.js.flow @@ -0,0 +1,93 @@ +// @flow strict + +type TemplateStringsArray = $ReadOnlyArray; + +export type Level = $Values<{ + None: 0, + Basic: 1, + Ansi256: 2, + TrueColor: 3 +}>; + +export type ChalkOptions = {| + enabled?: boolean, + level?: Level +|}; + +export type ColorSupport = {| + level: Level, + hasBasic: boolean, + has256: boolean, + has16m: boolean +|}; + +export interface Chalk { + (...text: string[]): string, + (text: TemplateStringsArray, ...placeholders: string[]): string, + constructor(options?: ChalkOptions): Chalk, + enabled: boolean, + level: Level, + rgb(r: number, g: number, b: number): Chalk, + hsl(h: number, s: number, l: number): Chalk, + hsv(h: number, s: number, v: number): Chalk, + hwb(h: number, w: number, b: number): Chalk, + bgHex(color: string): Chalk, + bgKeyword(color: string): Chalk, + bgRgb(r: number, g: number, b: number): Chalk, + bgHsl(h: number, s: number, l: number): Chalk, + bgHsv(h: number, s: number, v: number): Chalk, + bgHwb(h: number, w: number, b: number): Chalk, + hex(color: string): Chalk, + keyword(color: string): Chalk, + + +reset: Chalk, + +bold: Chalk, + +dim: Chalk, + +italic: Chalk, + +underline: Chalk, + +inverse: Chalk, + +hidden: Chalk, + +strikethrough: Chalk, + + +visible: Chalk, + + +black: Chalk, + +red: Chalk, + +green: Chalk, + +yellow: Chalk, + +blue: Chalk, + +magenta: Chalk, + +cyan: Chalk, + +white: Chalk, + +gray: Chalk, + +grey: Chalk, + +blackBright: Chalk, + +redBright: Chalk, + +greenBright: Chalk, + +yellowBright: Chalk, + +blueBright: Chalk, + +magentaBright: Chalk, + +cyanBright: Chalk, + +whiteBright: Chalk, + + +bgBlack: Chalk, + +bgRed: Chalk, + +bgGreen: Chalk, + +bgYellow: Chalk, + +bgBlue: Chalk, + +bgMagenta: Chalk, + +bgCyan: Chalk, + +bgWhite: Chalk, + +bgBlackBright: Chalk, + +bgRedBright: Chalk, + +bgGreenBright: Chalk, + +bgYellowBright: Chalk, + +bgBlueBright: Chalk, + +bgMagentaBright: Chalk, + +bgCyanBright: Chalk, + +bgWhiteBrigh: Chalk, + + supportsColor: ColorSupport +}; + +declare module.exports: Chalk; diff --git a/node_modules/@babel/highlight/node_modules/chalk/license b/node_modules/@babel/highlight/node_modules/chalk/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/@babel/highlight/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/highlight/node_modules/chalk/package.json b/node_modules/@babel/highlight/node_modules/chalk/package.json new file mode 100644 index 0000000..fe8ba01 --- /dev/null +++ b/node_modules/@babel/highlight/node_modules/chalk/package.json @@ -0,0 +1,103 @@ +{ + "_from": "chalk@^2.0.0", + "_id": "chalk@2.4.2", + "_inBundle": false, + "_integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "_location": "/@babel/highlight/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chalk@^2.0.0", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/@babel/highlight" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "_shasum": "cd42541677a54333cf541a49108c1432b44c9424", + "_spec": "chalk@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/@babel/highlight", + "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" + ] + } +} diff --git a/node_modules/@babel/highlight/node_modules/chalk/readme.md b/node_modules/@babel/highlight/node_modules/chalk/readme.md new file mode 100644 index 0000000..d298e2c --- /dev/null +++ b/node_modules/@babel/highlight/node_modules/chalk/readme.md @@ -0,0 +1,314 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 + + +## Install + +```console +$ npm install chalk +``` + + + + + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.` + + +
+

ESLint Report

+
+ <%= reportSummary %> - Generated on <%= date %> +
+
+ + + <%= results %> + +
+ + + diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html new file mode 100644 index 0000000..f4a5593 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html @@ -0,0 +1,6 @@ + + + [+] <%- filePath %> + <%- summary %> + + diff --git a/node_modules/eslint/lib/cli-engine/formatters/html.js b/node_modules/eslint/lib/cli-engine/formatters/html.js new file mode 100644 index 0000000..69f7395 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -0,0 +1,140 @@ +/** + * @fileoverview HTML reporter + * @author Julian Laval + */ +"use strict"; + +const lodash = require("lodash"); +const fs = require("fs"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const pageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-page.html"), "utf-8")); +const messageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-message.html"), "utf-8")); +const resultTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-result.html"), "utf-8")); + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Renders text along the template of x problems (x errors, x warnings) + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {string} The formatted string, pluralized where necessary + */ +function renderSummary(totalErrors, totalWarnings) { + const totalProblems = totalErrors + totalWarnings; + let renderedText = `${totalProblems} ${pluralize("problem", totalProblems)}`; + + if (totalProblems !== 0) { + renderedText += ` (${totalErrors} ${pluralize("error", totalErrors)}, ${totalWarnings} ${pluralize("warning", totalWarnings)})`; + } + return renderedText; +} + +/** + * Get the color based on whether there are errors/warnings... + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {int} The color code (0 = green, 1 = yellow, 2 = red) + */ +function renderColor(totalErrors, totalWarnings) { + if (totalErrors !== 0) { + return 2; + } + if (totalWarnings !== 0) { + return 1; + } + return 0; +} + +/** + * Get HTML (table rows) describing the messages. + * @param {Array} messages Messages. + * @param {int} parentIndex Index of the parent HTML row. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML (table rows) describing the messages. + */ +function renderMessages(messages, parentIndex, rulesMeta) { + + /** + * Get HTML (table row) describing a message. + * @param {Object} message Message. + * @returns {string} HTML (table row) describing a message. + */ + return lodash.map(messages, message => { + const lineNumber = message.line || 0; + const columnNumber = message.column || 0; + let ruleUrl; + + if (rulesMeta) { + const meta = rulesMeta[message.ruleId]; + + ruleUrl = lodash.get(meta, "docs.url", null); + } + + return messageTemplate({ + parentIndex, + lineNumber, + columnNumber, + severityNumber: message.severity, + severityName: message.severity === 1 ? "Warning" : "Error", + message: message.message, + ruleId: message.ruleId, + ruleUrl + }); + }).join("\n"); +} + +// eslint-disable-next-line jsdoc/require-description +/** + * @param {Array} results Test results. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML string describing the results. + */ +function renderResults(results, rulesMeta) { + return lodash.map(results, (result, index) => resultTemplate({ + index, + color: renderColor(result.errorCount, result.warningCount), + filePath: result.filePath, + summary: renderSummary(result.errorCount, result.warningCount) + + }) + renderMessages(result.messages, index, rulesMeta)).join("\n"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + let totalErrors, + totalWarnings; + + const metaData = data ? data.rulesMeta : {}; + + totalErrors = 0; + totalWarnings = 0; + + // Iterate over results to get totals + results.forEach(result => { + totalErrors += result.errorCount; + totalWarnings += result.warningCount; + }); + + return pageTemplate({ + date: new Date(), + reportColor: renderColor(totalErrors, totalWarnings), + reportSummary: renderSummary(totalErrors, totalWarnings), + results: renderResults(results, metaData) + }); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js b/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js new file mode 100644 index 0000000..0ca1cba --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js @@ -0,0 +1,41 @@ +/** + * @fileoverview JSLint XML reporter + * @author Ian Christian Myers + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += ""; + output += ""; + + results.forEach(result => { + const messages = result.messages; + + output += ``; + + messages.forEach(message => { + output += [ + `` + ].join(" "); + }); + + output += ""; + + }); + + output += ""; + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js b/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js new file mode 100644 index 0000000..6899471 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js @@ -0,0 +1,16 @@ +/** + * @fileoverview JSON reporter, including rules metadata + * @author Chris Meyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + return JSON.stringify({ + results, + metadata: data + }); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/json.js b/node_modules/eslint/lib/cli-engine/formatters/json.js new file mode 100644 index 0000000..82138af --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/json.js @@ -0,0 +1,13 @@ +/** + * @fileoverview JSON reporter + * @author Burak Yigit Kaya aka BYK + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + return JSON.stringify(results); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/junit.js b/node_modules/eslint/lib/cli-engine/formatters/junit.js new file mode 100644 index 0000000..a994b4b --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/junit.js @@ -0,0 +1,82 @@ +/** + * @fileoverview jUnit Reporter + * @author Jamund Ferguson + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + +/** + * Returns a full file path without extension + * @param {string} filePath input file path + * @returns {string} file path without extension + * @private + */ +function pathWithoutExt(filePath) { + return path.join(path.dirname(filePath), path.basename(filePath, path.extname(filePath))); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += "\n"; + output += "\n"; + + results.forEach(result => { + + const messages = result.messages; + const classname = pathWithoutExt(result.filePath); + + if (messages.length > 0) { + output += `\n`; + messages.forEach(message => { + const type = message.fatal ? "error" : "failure"; + + output += ``; + output += `<${type} message="${xmlEscape(message.message || "")}">`; + output += ""; + output += ``; + output += "\n"; + }); + output += "\n"; + } else { + output += `\n`; + output += `\n`; + output += "\n"; + } + + }); + + output += "\n"; + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/stylish.js b/node_modules/eslint/lib/cli-engine/formatters/stylish.js new file mode 100644 index 0000000..a808448 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/stylish.js @@ -0,0 +1,101 @@ +/** + * @fileoverview Stylish reporter + * @author Sindre Sorhus + */ +"use strict"; + +const chalk = require("chalk"), + stripAnsi = require("strip-ansi"), + table = require("text-table"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "\n", + errorCount = 0, + warningCount = 0, + fixableErrorCount = 0, + fixableWarningCount = 0, + summaryColor = "yellow"; + + results.forEach(result => { + const messages = result.messages; + + if (messages.length === 0) { + return; + } + + errorCount += result.errorCount; + warningCount += result.warningCount; + fixableErrorCount += result.fixableErrorCount; + fixableWarningCount += result.fixableWarningCount; + + output += `${chalk.underline(result.filePath)}\n`; + + output += `${table( + messages.map(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + summaryColor = "red"; + } else { + messageType = chalk.yellow("warning"); + } + + return [ + "", + message.line || 0, + message.column || 0, + messageType, + message.message.replace(/([^ ])\.$/u, "$1"), + chalk.dim(message.ruleId || "") + ]; + }), + { + align: ["", "r", "l"], + stringLength(str) { + return stripAnsi(str).length; + } + } + ).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`; + }); + + const total = errorCount + warningCount; + + if (total > 0) { + output += chalk[summaryColor].bold([ + "\u2716 ", total, pluralize(" problem", total), + " (", errorCount, pluralize(" error", errorCount), ", ", + warningCount, pluralize(" warning", warningCount), ")\n" + ].join("")); + + if (fixableErrorCount > 0 || fixableWarningCount > 0) { + output += chalk[summaryColor].bold([ + " ", fixableErrorCount, pluralize(" error", fixableErrorCount), " and ", + fixableWarningCount, pluralize(" warning", fixableWarningCount), + " potentially fixable with the `--fix` option.\n" + ].join("")); + } + } + + // Resets output color, for prevent change on top level + return total > 0 ? chalk.reset(output) : ""; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/table.js b/node_modules/eslint/lib/cli-engine/formatters/table.js new file mode 100644 index 0000000..a74cce0 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/table.js @@ -0,0 +1,159 @@ +/** + * @fileoverview "table reporter. + * @author Gajus Kuizinas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const chalk = require("chalk"), + table = require("table").table; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an "s" if count is not one. + * @param {string} word A word. + * @param {number} count Quantity. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Draws text table. + * @param {Array} messages Error messages relating to a specific file. + * @returns {string} A text table. + */ +function drawTable(messages) { + const rows = []; + + if (messages.length === 0) { + return ""; + } + + rows.push([ + chalk.bold("Line"), + chalk.bold("Column"), + chalk.bold("Type"), + chalk.bold("Message"), + chalk.bold("Rule ID") + ]); + + messages.forEach(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + } else { + messageType = chalk.yellow("warning"); + } + + rows.push([ + message.line || 0, + message.column || 0, + messageType, + message.message, + message.ruleId || "" + ]); + }); + + return table(rows, { + columns: { + 0: { + width: 8, + wrapWord: true + }, + 1: { + width: 8, + wrapWord: true + }, + 2: { + width: 8, + wrapWord: true + }, + 3: { + paddingRight: 5, + width: 50, + wrapWord: true + }, + 4: { + width: 20, + wrapWord: true + } + }, + drawHorizontalLine(index) { + return index === 1; + } + }); +} + +/** + * Draws a report (multiple tables). + * @param {Array} results Report results for every file. + * @returns {string} A column of text tables. + */ +function drawReport(results) { + let files; + + files = results.map(result => { + if (!result.messages.length) { + return ""; + } + + return `\n${result.filePath}\n\n${drawTable(result.messages)}`; + }); + + files = files.filter(content => content.trim()); + + return files.join(""); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(report) { + let result, + errorCount, + warningCount; + + result = ""; + errorCount = 0; + warningCount = 0; + + report.forEach(fileReport => { + errorCount += fileReport.errorCount; + warningCount += fileReport.warningCount; + }); + + if (errorCount || warningCount) { + result = drawReport(report); + } + + result += `\n${table([ + [ + chalk.red(pluralize(`${errorCount} Error`, errorCount)) + ], + [ + chalk.yellow(pluralize(`${warningCount} Warning`, warningCount)) + ] + ], { + columns: { + 0: { + width: 110, + wrapWord: true + } + }, + drawHorizontalLine() { + return true; + } + })}`; + + return result; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/tap.js b/node_modules/eslint/lib/cli-engine/formatters/tap.js new file mode 100644 index 0000000..354872a --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/tap.js @@ -0,0 +1,95 @@ +/** + * @fileoverview TAP reporter + * @author Jonathan Kingston + */ +"use strict"; + +const yaml = require("js-yaml"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {Object} message Individual error message provided by eslint + * @returns {string} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; +} + +/** + * Takes in a JavaScript object and outputs a TAP diagnostics string + * @param {Object} diagnostic JavaScript object to be embedded as YAML into output. + * @returns {string} diagnostics string with YAML embedded - TAP version 13 compliant + */ +function outputDiagnostics(diagnostic) { + const prefix = " "; + let output = `${prefix}---\n`; + + output += prefix + yaml.safeDump(diagnostic).split("\n").join(`\n${prefix}`); + output += "...\n"; + return output; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + let output = `TAP version 13\n1..${results.length}\n`; + + results.forEach((result, id) => { + const messages = result.messages; + let testResult = "ok"; + let diagnostics = {}; + + if (messages.length > 0) { + messages.forEach(message => { + const severity = getMessageType(message); + const diagnostic = { + message: message.message, + severity, + data: { + line: message.line || 0, + column: message.column || 0, + ruleId: message.ruleId || "" + } + }; + + // This ensures a warning message is not flagged as error + if (severity === "error") { + testResult = "not ok"; + } + + /* + * If we have multiple messages place them under a messages key + * The first error will be logged as message key + * This is to adhere to TAP 13 loosely defined specification of having a message key + */ + if ("message" in diagnostics) { + if (typeof diagnostics.messages === "undefined") { + diagnostics.messages = []; + } + diagnostics.messages.push(diagnostic); + } else { + diagnostics = diagnostic; + } + }); + } + + output += `${testResult} ${id + 1} - ${result.filePath}\n`; + + // If we have an error include diagnostics + if (messages.length > 0) { + output += outputDiagnostics(diagnostics); + } + + }); + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/unix.js b/node_modules/eslint/lib/cli-engine/formatters/unix.js new file mode 100644 index 0000000..c6c4ebb --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/unix.js @@ -0,0 +1,58 @@ +/** + * @fileoverview unix-style formatter. + * @author oshi-shinobu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {Object} message Individual error message provided by eslint + * @returns {string} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += `${result.filePath}:`; + output += `${message.line || 0}:`; + output += `${message.column || 0}:`; + output += ` ${message.message} `; + output += `[${getMessageType(message)}${message.ruleId ? `/${message.ruleId}` : ""}]`; + output += "\n"; + + }); + + }); + + if (total > 0) { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js b/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js new file mode 100644 index 0000000..0d49431 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Visual Studio compatible formatter + * @author Ronald Pijnacker + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += result.filePath; + output += `(${message.line || 0}`; + output += message.column ? `,${message.column}` : ""; + output += `): ${getMessageType(message)}`; + output += message.ruleId ? ` ${message.ruleId}` : ""; + output += ` : ${message.message}`; + output += "\n"; + + }); + + }); + + if (total === 0) { + output += "no problems"; + } else { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/hash.js b/node_modules/eslint/lib/cli-engine/hash.js new file mode 100644 index 0000000..6d7ef8b --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/hash.js @@ -0,0 +1,35 @@ +/** + * @fileoverview Defining the hashing function in one place. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const murmur = require("imurmurhash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * hash the given string + * @param {string} str the string to hash + * @returns {string} the hash + */ +function hash(str) { + return murmur(str).result().toString(36); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = hash; diff --git a/node_modules/eslint/lib/cli-engine/index.js b/node_modules/eslint/lib/cli-engine/index.js new file mode 100644 index 0000000..52e45a6 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { CLIEngine } = require("./cli-engine"); + +module.exports = { + CLIEngine +}; diff --git a/node_modules/eslint/lib/cli-engine/lint-result-cache.js b/node_modules/eslint/lib/cli-engine/lint-result-cache.js new file mode 100644 index 0000000..23a1420 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/lint-result-cache.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Utility for caching lint results. + * @author Kevin Partington + */ +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("assert"); +const fs = require("fs"); +const fileEntryCache = require("file-entry-cache"); +const stringify = require("json-stable-stringify-without-jsonify"); +const pkg = require("../../package.json"); +const hash = require("./hash"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const configHashCache = new WeakMap(); +const nodeVersion = process && process.version; + +/** + * Calculates the hash of the config + * @param {ConfigArray} config The config. + * @returns {string} The hash of the config + */ +function hashOfConfigFor(config) { + if (!configHashCache.has(config)) { + configHashCache.set(config, hash(`${pkg.version}_${nodeVersion}_${stringify(config)}`)); + } + + return configHashCache.get(config); +} + +//----------------------------------------------------------------------------- +// Public Interface +//----------------------------------------------------------------------------- + +/** + * Lint result cache. This wraps around the file-entry-cache module, + * transparently removing properties that are difficult or expensive to + * serialize and adding them back in on retrieval. + */ +class LintResultCache { + + /** + * Creates a new LintResultCache instance. + * @param {string} cacheFileLocation The cache file location. + * configuration lookup by file path). + */ + constructor(cacheFileLocation) { + assert(cacheFileLocation, "Cache file location is required"); + + this.fileEntryCache = fileEntryCache.create(cacheFileLocation); + } + + /** + * Retrieve cached lint results for a given file path, if present in the + * cache. If the file is present and has not been changed, rebuild any + * missing result information. + * @param {string} filePath The file for which to retrieve lint results. + * @param {ConfigArray} config The config of the file. + * @returns {Object|null} The rebuilt lint results, or null if the file is + * changed or not in the filesystem. + */ + getCachedLintResults(filePath, config) { + + /* + * Cached lint results are valid if and only if: + * 1. The file is present in the filesystem + * 2. The file has not changed since the time it was previously linted + * 3. The ESLint configuration has not changed since the time the file + * was previously linted + * If any of these are not true, we will not reuse the lint results. + */ + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + const hashOfConfig = hashOfConfigFor(config); + const changed = fileDescriptor.changed || fileDescriptor.meta.hashOfConfig !== hashOfConfig; + + if (fileDescriptor.notFound || changed) { + return null; + } + + // If source is present but null, need to reread the file from the filesystem. + if (fileDescriptor.meta.results && fileDescriptor.meta.results.source === null) { + fileDescriptor.meta.results.source = fs.readFileSync(filePath, "utf-8"); + } + + return fileDescriptor.meta.results; + } + + /** + * Set the cached lint results for a given file path, after removing any + * information that will be both unnecessary and difficult to serialize. + * Avoids caching results with an "output" property (meaning fixes were + * applied), to prevent potentially incorrect results if fixes are not + * written to disk. + * @param {string} filePath The file for which to set lint results. + * @param {ConfigArray} config The config of the file. + * @param {Object} result The lint result to be set for the file. + * @returns {void} + */ + setCachedLintResults(filePath, config, result) { + if (result && Object.prototype.hasOwnProperty.call(result, "output")) { + return; + } + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + + if (fileDescriptor && !fileDescriptor.notFound) { + + // Serialize the result, except that we want to remove the file source if present. + const resultToSerialize = Object.assign({}, result); + + /* + * Set result.source to null. + * In `getCachedLintResults`, if source is explicitly null, we will + * read the file from the filesystem to set the value again. + */ + if (Object.prototype.hasOwnProperty.call(resultToSerialize, "source")) { + resultToSerialize.source = null; + } + + fileDescriptor.meta.results = resultToSerialize; + fileDescriptor.meta.hashOfConfig = hashOfConfigFor(config); + } + } + + /** + * Persists the in-memory cache to disk. + * @returns {void} + */ + reconcile() { + this.fileEntryCache.reconcile(); + } +} + +module.exports = LintResultCache; diff --git a/node_modules/eslint/lib/cli-engine/load-rules.js b/node_modules/eslint/lib/cli-engine/load-rules.js new file mode 100644 index 0000000..81bab63 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/load-rules.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Module for loading rules from files and directories. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"); + +const rulesDirCache = {}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Load all rule modules from specified directory. + * @param {string} relativeRulesDir Path to rules directory, may be relative. + * @param {string} cwd Current working directory + * @returns {Object} Loaded rule modules. + */ +module.exports = function(relativeRulesDir, cwd) { + const rulesDir = path.resolve(cwd, relativeRulesDir); + + // cache will help performance as IO operation are expensive + if (rulesDirCache[rulesDir]) { + return rulesDirCache[rulesDir]; + } + + const rules = Object.create(null); + + fs.readdirSync(rulesDir).forEach(file => { + if (path.extname(file) !== ".js") { + return; + } + rules[file.slice(0, -3)] = require(path.join(rulesDir, file)); + }); + rulesDirCache[rulesDir] = rules; + + return rules; +}; diff --git a/node_modules/eslint/lib/cli-engine/xml-escape.js b/node_modules/eslint/lib/cli-engine/xml-escape.js new file mode 100644 index 0000000..175c2c0 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/xml-escape.js @@ -0,0 +1,34 @@ +/** + * @fileoverview XML character escaper + * @author George Chung + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Returns the escaped value for a character + * @param {string} s string to examine + * @returns {string} severity level + * @private + */ +module.exports = function(s) { + return (`${s}`).replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, c => { // eslint-disable-line no-control-regex + switch (c) { + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + case "\"": + return """; + case "'": + return "'"; + default: + return `&#${c.charCodeAt(0)};`; + } + }); +}; diff --git a/node_modules/eslint/lib/cli.js b/node_modules/eslint/lib/cli.js new file mode 100644 index 0000000..ce11878 --- /dev/null +++ b/node_modules/eslint/lib/cli.js @@ -0,0 +1,326 @@ +/** + * @fileoverview Main CLI object. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * The CLI object should *not* call process.exit() directly. It should only return + * exit codes. This allows other programs to use the CLI object and still control + * when the program exits. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"), + { promisify } = require("util"), + { ESLint } = require("./eslint"), + CLIOptions = require("./options"), + log = require("./shared/logging"), + RuntimeInfo = require("./shared/runtime-info"); + +const debug = require("debug")("eslint:cli"); + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */ +/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */ +/** @typedef {import("./eslint/eslint").LintResult} LintResult */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const mkdir = promisify(fs.mkdir); +const stat = promisify(fs.stat); +const writeFile = promisify(fs.writeFile); + +/** + * Predicate function for whether or not to apply fixes in quiet mode. + * If a message is a warning, do not apply a fix. + * @param {LintMessage} message The lint result. + * @returns {boolean} True if the lint message is an error (and thus should be + * autofixed), false otherwise. + */ +function quietFixPredicate(message) { + return message.severity === 2; +} + +/** + * Translates the CLI options into the options expected by the CLIEngine. + * @param {Object} cliOptions The CLI options to translate. + * @returns {ESLintOptions} The options object for the CLIEngine. + * @private + */ +function translateOptions({ + cache, + cacheFile, + cacheLocation, + config, + env, + errorOnUnmatchedPattern, + eslintrc, + ext, + fix, + fixDryRun, + fixType, + global, + ignore, + ignorePath, + ignorePattern, + inlineConfig, + parser, + parserOptions, + plugin, + quiet, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rule, + rulesdir +}) { + return { + allowInlineConfig: inlineConfig, + cache, + cacheLocation: cacheLocation || cacheFile, + errorOnUnmatchedPattern, + extensions: ext, + fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), + fixTypes: fixType, + ignore, + ignorePath, + overrideConfig: { + env: env && env.reduce((obj, name) => { + obj[name] = true; + return obj; + }, {}), + globals: global && global.reduce((obj, name) => { + if (name.endsWith(":true")) { + obj[name.slice(0, -5)] = "writable"; + } else { + obj[name] = "readonly"; + } + return obj; + }, {}), + ignorePatterns: ignorePattern, + parser, + parserOptions, + plugins: plugin, + rules: rule + }, + overrideConfigFile: config, + reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0, + resolvePluginsRelativeTo, + rulePaths: rulesdir, + useEslintrc: eslintrc + }; +} + +/** + * Count error messages. + * @param {LintResult[]} results The lint results. + * @returns {{errorCount:number;warningCount:number}} The number of error messages. + */ +function countErrors(results) { + let errorCount = 0; + let warningCount = 0; + + for (const result of results) { + errorCount += result.errorCount; + warningCount += result.warningCount; + } + + return { errorCount, warningCount }; +} + +/** + * Check if a given file path is a directory or not. + * @param {string} filePath The path to a file to check. + * @returns {Promise} `true` if the given path is a directory. + */ +async function isDirectory(filePath) { + try { + return (await stat(filePath)).isDirectory(); + } catch (error) { + if (error.code === "ENOENT" || error.code === "ENOTDIR") { + return false; + } + throw error; + } +} + +/** + * Outputs the results of the linting. + * @param {ESLint} engine The ESLint instance to use. + * @param {LintResult[]} results The results to print. + * @param {string} format The name of the formatter to use or the path to the formatter. + * @param {string} outputFile The path for the output file. + * @returns {Promise} True if the printing succeeds, false if not. + * @private + */ +async function printResults(engine, results, format, outputFile) { + let formatter; + + try { + formatter = await engine.loadFormatter(format); + } catch (e) { + log.error(e.message); + return false; + } + + const output = formatter.format(results); + + if (output) { + if (outputFile) { + const filePath = path.resolve(process.cwd(), outputFile); + + if (await isDirectory(filePath)) { + log.error("Cannot write to output file path, it is a directory: %s", outputFile); + return false; + } + + try { + await mkdir(path.dirname(filePath), { recursive: true }); + await writeFile(filePath, output); + } catch (ex) { + log.error("There was a problem writing the output file:\n%s", ex); + return false; + } + } else { + log.info(output); + } + } + + return true; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as + * for other Node.js programs to effectively run the CLI. + */ +const cli = { + + /** + * Executes the CLI based on an array of arguments that is passed in. + * @param {string|Array|Object} args The arguments to process. + * @param {string} [text] The text to lint (used for TTY). + * @returns {Promise} The exit code for the operation. + */ + async execute(args, text) { + if (Array.isArray(args)) { + debug("CLI args: %o", args.slice(2)); + } + let options; + + try { + options = CLIOptions.parse(args); + } catch (error) { + log.error(error.message); + return 2; + } + + const files = options._; + const useStdin = typeof text === "string"; + + if (options.help) { + log.info(CLIOptions.generateHelp()); + return 0; + } + if (options.version) { + log.info(RuntimeInfo.version()); + return 0; + } + if (options.envInfo) { + try { + log.info(RuntimeInfo.environment()); + return 0; + } catch (err) { + log.error(err.message); + return 2; + } + } + + if (options.printConfig) { + if (files.length) { + log.error("The --print-config option must be used with exactly one file name."); + return 2; + } + if (useStdin) { + log.error("The --print-config option is not available for piped-in code."); + return 2; + } + + const engine = new ESLint(translateOptions(options)); + const fileConfig = + await engine.calculateConfigForFile(options.printConfig); + + log.info(JSON.stringify(fileConfig, null, " ")); + return 0; + } + + debug(`Running on ${useStdin ? "text" : "files"}`); + + if (options.fix && options.fixDryRun) { + log.error("The --fix option and the --fix-dry-run option cannot be used together."); + return 2; + } + if (useStdin && options.fix) { + log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead."); + return 2; + } + if (options.fixType && !options.fix && !options.fixDryRun) { + log.error("The --fix-type option requires either --fix or --fix-dry-run."); + return 2; + } + + const engine = new ESLint(translateOptions(options)); + let results; + + if (useStdin) { + results = await engine.lintText(text, { + filePath: options.stdinFilename, + warnIgnored: true + }); + } else { + results = await engine.lintFiles(files); + } + + if (options.fix) { + debug("Fix mode enabled - applying fixes"); + await ESLint.outputFixes(results); + } + + if (options.quiet) { + debug("Quiet mode enabled - filtering out warnings"); + results = ESLint.getErrorResults(results); + } + + if (await printResults(engine, results, options.format, options.outputFile)) { + const { errorCount, warningCount } = countErrors(results); + const tooManyWarnings = + options.maxWarnings >= 0 && warningCount > options.maxWarnings; + + if (!errorCount && tooManyWarnings) { + log.error( + "ESLint found too many warnings (maximum: %s).", + options.maxWarnings + ); + } + + return (errorCount || tooManyWarnings) ? 1 : 0; + } + + return 2; + } +}; + +module.exports = cli; diff --git a/node_modules/eslint/lib/eslint/eslint.js b/node_modules/eslint/lib/eslint/eslint.js new file mode 100644 index 0000000..a51ffbf --- /dev/null +++ b/node_modules/eslint/lib/eslint/eslint.js @@ -0,0 +1,662 @@ +/** + * @fileoverview Main API Class + * @author Kai Cataldo + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const fs = require("fs"); +const { promisify } = require("util"); +const { CLIEngine, getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); +const BuiltinRules = require("../rules"); +const { + Legacy: { + ConfigOps: { + getRuleSeverity + } + } +} = require("@eslint/eslintrc"); +const { version } = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../cli-engine/cli-engine").LintReport} CLIEngineLintReport */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {import("./load-formatter").Formatter} Formatter */ + +/** + * The options with which to configure the ESLint instance. + * @typedef {Object} ESLintOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {string} [cwd] The value to use for the current working directory. + * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. + * @property {string[]} [extensions] An array of file extensions to check. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] False disables use of .eslintignore. + * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. + * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance + * @property {string} [overrideConfigFile] The configuration file to use. + * @property {Record} [plugins] An array of plugin implementations. + * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. + * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD. + * @property {string[]} [rulePaths] An array of directories to load custom rules from. + * @property {boolean} [useEslintrc] False disables looking for .eslintrc.* files. + */ + +/** + * A rules metadata object. + * @typedef {Object} RulesMeta + * @property {string} id The plugin ID. + * @property {Object} definition The plugin definition. + */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Private members for the `ESLint` instance. + * @typedef {Object} ESLintPrivateMembers + * @property {CLIEngine} cliEngine The wrapped CLIEngine instance. + * @property {ESLintOptions} options The options used to instantiate the ESLint instance. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const writeFile = promisify(fs.writeFile); + +/** + * The map with which to store private class members. + * @type {WeakMap} + */ +const privateMembersMap = new WeakMap(); + +/** + * Check if a given value is a non-empty string or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is a non-empty string. + */ +function isNonEmptyString(x) { + return typeof x === "string" && x.trim() !== ""; +} + +/** + * Check if a given value is an array of non-empty stringss or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of non-empty stringss. + */ +function isArrayOfNonEmptyString(x) { + return Array.isArray(x) && x.every(isNonEmptyString); +} + +/** + * Check if a given value is a valid fix type or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is valid fix type. + */ +function isFixType(x) { + return x === "problem" || x === "suggestion" || x === "layout"; +} + +/** + * Check if a given value is an array of fix types or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of fix types. + */ +function isFixTypeArray(x) { + return Array.isArray(x) && x.every(isFixType); +} + +/** + * The error for invalid options. + */ +class ESLintInvalidOptionsError extends Error { + constructor(messages) { + super(`Invalid Options:\n- ${messages.join("\n- ")}`); + this.code = "ESLINT_INVALID_OPTIONS"; + Error.captureStackTrace(this, ESLintInvalidOptionsError); + } +} + +/** + * Validates and normalizes options for the wrapped CLIEngine instance. + * @param {ESLintOptions} options The options to process. + * @returns {ESLintOptions} The normalized options. + */ +function processOptions({ + allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. + baseConfig = null, + cache = false, + cacheLocation = ".eslintcache", + cwd = process.cwd(), + errorOnUnmatchedPattern = true, + extensions = null, // ← should be null by default because if it's an array then it suppresses RFC20 feature. + fix = false, + fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property. + globInputPaths = true, + ignore = true, + ignorePath = null, // ← should be null by default because if it's a string then it may throw ENOENT. + overrideConfig = null, + overrideConfigFile = null, + plugins = {}, + reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that. + resolvePluginsRelativeTo = null, // ← should be null by default because if it's a string then it suppresses RFC47 feature. + rulePaths = [], + useEslintrc = true, + ...unknownOptions +}) { + const errors = []; + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length >= 1) { + errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`); + if (unknownOptionKeys.includes("cacheFile")) { + errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead."); + } + if (unknownOptionKeys.includes("configFile")) { + errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead."); + } + if (unknownOptionKeys.includes("envs")) { + errors.push("'envs' has been removed. Please use the 'overrideConfig.env' option instead."); + } + if (unknownOptionKeys.includes("globals")) { + errors.push("'globals' has been removed. Please use the 'overrideConfig.globals' option instead."); + } + if (unknownOptionKeys.includes("ignorePattern")) { + errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead."); + } + if (unknownOptionKeys.includes("parser")) { + errors.push("'parser' has been removed. Please use the 'overrideConfig.parser' option instead."); + } + if (unknownOptionKeys.includes("parserOptions")) { + errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead."); + } + if (unknownOptionKeys.includes("rules")) { + errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); + } + } + if (typeof allowInlineConfig !== "boolean") { + errors.push("'allowInlineConfig' must be a boolean."); + } + if (typeof baseConfig !== "object") { + errors.push("'baseConfig' must be an object or null."); + } + if (typeof cache !== "boolean") { + errors.push("'cache' must be a boolean."); + } + if (!isNonEmptyString(cacheLocation)) { + errors.push("'cacheLocation' must be a non-empty string."); + } + if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) { + errors.push("'cwd' must be an absolute path."); + } + if (typeof errorOnUnmatchedPattern !== "boolean") { + errors.push("'errorOnUnmatchedPattern' must be a boolean."); + } + if (!isArrayOfNonEmptyString(extensions) && extensions !== null) { + errors.push("'extensions' must be an array of non-empty strings or null."); + } + if (typeof fix !== "boolean" && typeof fix !== "function") { + errors.push("'fix' must be a boolean or a function."); + } + if (fixTypes !== null && !isFixTypeArray(fixTypes)) { + errors.push("'fixTypes' must be an array of any of \"problem\", \"suggestion\", and \"layout\"."); + } + if (typeof globInputPaths !== "boolean") { + errors.push("'globInputPaths' must be a boolean."); + } + if (typeof ignore !== "boolean") { + errors.push("'ignore' must be a boolean."); + } + if (!isNonEmptyString(ignorePath) && ignorePath !== null) { + errors.push("'ignorePath' must be a non-empty string or null."); + } + if (typeof overrideConfig !== "object") { + errors.push("'overrideConfig' must be an object or null."); + } + if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null) { + errors.push("'overrideConfigFile' must be a non-empty string or null."); + } + if (typeof plugins !== "object") { + errors.push("'plugins' must be an object or null."); + } else if (plugins !== null && Object.keys(plugins).includes("")) { + errors.push("'plugins' must not include an empty string."); + } + if (Array.isArray(plugins)) { + errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead."); + } + if ( + reportUnusedDisableDirectives !== "error" && + reportUnusedDisableDirectives !== "warn" && + reportUnusedDisableDirectives !== "off" && + reportUnusedDisableDirectives !== null + ) { + errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null."); + } + if ( + !isNonEmptyString(resolvePluginsRelativeTo) && + resolvePluginsRelativeTo !== null + ) { + errors.push("'resolvePluginsRelativeTo' must be a non-empty string or null."); + } + if (!isArrayOfNonEmptyString(rulePaths)) { + errors.push("'rulePaths' must be an array of non-empty strings."); + } + if (typeof useEslintrc !== "boolean") { + errors.push("'useElintrc' must be a boolean."); + } + + if (errors.length > 0) { + throw new ESLintInvalidOptionsError(errors); + } + + return { + allowInlineConfig, + baseConfig, + cache, + cacheLocation, + configFile: overrideConfigFile, + cwd, + errorOnUnmatchedPattern, + extensions, + fix, + fixTypes, + globInputPaths, + ignore, + ignorePath, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rulePaths, + useEslintrc + }; +} + +/** + * Check if a value has one or more properties and that value is not undefined. + * @param {any} obj The value to check. + * @returns {boolean} `true` if `obj` has one or more properties that that value is not undefined. + */ +function hasDefinedProperty(obj) { + if (typeof obj === "object" && obj !== null) { + for (const key in obj) { + if (typeof obj[key] !== "undefined") { + return true; + } + } + } + return false; +} + +/** + * Create rulesMeta object. + * @param {Map} rules a map of rules from which to generate the object. + * @returns {Object} metadata for all enabled rules. + */ +function createRulesMeta(rules) { + return Array.from(rules).reduce((retVal, [id, rule]) => { + retVal[id] = rule.meta; + return retVal; + }, {}); +} + +/** @type {WeakMap} */ +const usedDeprecatedRulesCache = new WeakMap(); + +/** + * Create used deprecated rule list. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {string} maybeFilePath The absolute path to a lint target file or `""`. + * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. + */ +function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { + const { + configArrayFactory, + options: { cwd } + } = getCLIEngineInternalSlots(cliEngine); + const filePath = path.isAbsolute(maybeFilePath) + ? maybeFilePath + : path.join(cwd, "__placeholder__.js"); + const configArray = configArrayFactory.getConfigArrayForFile(filePath); + const config = configArray.extractConfig(filePath); + + // Most files use the same config, so cache it. + if (!usedDeprecatedRulesCache.has(config)) { + const pluginRules = configArray.pluginRules; + const retv = []; + + for (const [ruleId, ruleConf] of Object.entries(config.rules)) { + if (getRuleSeverity(ruleConf) === 0) { + continue; + } + const rule = pluginRules.get(ruleId) || BuiltinRules.get(ruleId); + const meta = rule && rule.meta; + + if (meta && meta.deprecated) { + retv.push({ ruleId, replacedBy: meta.replacedBy || [] }); + } + } + + usedDeprecatedRulesCache.set(config, Object.freeze(retv)); + } + + return usedDeprecatedRulesCache.get(config); +} + +/** + * Processes the linting results generated by a CLIEngine linting report to + * match the ESLint class's API. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {CLIEngineLintReport} report The CLIEngine linting report to process. + * @returns {LintResult[]} The processed linting results. + */ +function processCLIEngineLintReport(cliEngine, { results }) { + const descriptor = { + configurable: true, + enumerable: true, + get() { + return getOrFindUsedDeprecatedRules(cliEngine, this.filePath); + } + }; + + for (const result of results) { + Object.defineProperty(result, "usedDeprecatedRules", descriptor); + } + + return results; +} + +/** + * An Array.prototype.sort() compatible compare function to order results by their file path. + * @param {LintResult} a The first lint result. + * @param {LintResult} b The second lint result. + * @returns {number} An integer representing the order in which the two results should occur. + */ +function compareResultsByFilePath(a, b) { + if (a.filePath < b.filePath) { + return -1; + } + + if (a.filePath > b.filePath) { + return 1; + } + + return 0; +} + +class ESLint { + + /** + * Creates a new instance of the main ESLint API. + * @param {ESLintOptions} options The options for this instance. + */ + constructor(options = {}) { + const processedOptions = processOptions(options); + const cliEngine = new CLIEngine(processedOptions); + const { + additionalPluginPool, + configArrayFactory, + lastConfigArrays + } = getCLIEngineInternalSlots(cliEngine); + let updated = false; + + /* + * Address `plugins` to add plugin implementations. + * Operate the `additionalPluginPool` internal slot directly to avoid + * using `addPlugin(id, plugin)` method that resets cache everytime. + */ + if (options.plugins) { + for (const [id, plugin] of Object.entries(options.plugins)) { + additionalPluginPool.set(id, plugin); + updated = true; + } + } + + /* + * Address `overrideConfig` to set override config. + * Operate the `configArrayFactory` internal slot directly because this + * functionality doesn't exist as the public API of CLIEngine. + */ + if (hasDefinedProperty(options.overrideConfig)) { + configArrayFactory.setOverrideConfig(options.overrideConfig); + updated = true; + } + + // Update caches. + if (updated) { + configArrayFactory.clearCache(); + lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); + } + + // Initialize private properties. + privateMembersMap.set(this, { + cliEngine, + options: processedOptions + }); + } + + /** + * The version text. + * @type {string} + */ + static get version() { + return version; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintResult[]} results The lint results. + * @returns {Promise} Returns a promise that is used to track side effects. + */ + static async outputFixes(results) { + if (!Array.isArray(results)) { + throw new Error("'results' must be an array"); + } + + await Promise.all( + results + .filter(result => { + if (typeof result !== "object" || result === null) { + throw new Error("'results' must include only objects"); + } + return ( + typeof result.output === "string" && + path.isAbsolute(result.filePath) + ); + }) + .map(r => writeFile(r.filePath, r.output)) + ); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + return CLIEngine.getErrorResults(results); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string[]} patterns An array of file and directory names. + * @returns {Promise} The results of linting the file patterns given. + */ + async lintFiles(patterns) { + if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) { + throw new Error("'patterns' must be a non-empty string or an array of non-empty strings"); + } + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnFiles(patterns) + ); + } + + /** + * Executes the current configuration on text. + * @param {string} code A string of JavaScript code to lint. + * @param {Object} [options] The options. + * @param {string} [options.filePath] The path to the file of the source code. + * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path. + * @returns {Promise} The results of linting the string of code given. + */ + async lintText(code, options = {}) { + if (typeof code !== "string") { + throw new Error("'code' must be a string"); + } + if (typeof options !== "object") { + throw new Error("'options' must be an object, null, or undefined"); + } + const { + filePath, + warnIgnored = false, + ...unknownOptions + } = options || {}; + + for (const key of Object.keys(unknownOptions)) { + throw new Error(`'options' must not include the unknown option '${key}'`); + } + if (filePath !== void 0 && !isNonEmptyString(filePath)) { + throw new Error("'options.filePath' must be a non-empty string or undefined"); + } + if (typeof warnIgnored !== "boolean") { + throw new Error("'options.warnIgnored' must be a boolean or undefined"); + } + + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnText(code, filePath, warnIgnored) + ); + } + + /** + * Returns the formatter representing the given formatter name. + * @param {string} [name] The name of the formattter to load. + * The following values are allowed: + * - `undefined` ... Load `stylish` builtin formatter. + * - A builtin formatter name ... Load the builtin formatter. + * - A thirdparty formatter name: + * - `foo` → `eslint-formatter-foo` + * - `@foo` → `@foo/eslint-formatter` + * - `@foo/bar` → `@foo/eslint-formatter-bar` + * - A file path ... Load the file. + * @returns {Promise} A promise resolving to the formatter object. + * This promise will be rejected if the given formatter was not found or not + * a function. + */ + async loadFormatter(name = "stylish") { + if (typeof name !== "string") { + throw new Error("'name' must be a string"); + } + + const { cliEngine } = privateMembersMap.get(this); + const formatter = cliEngine.getFormatter(name); + + if (typeof formatter !== "function") { + throw new Error(`Formatter must be a function, but got a ${typeof formatter}.`); + } + + return { + + /** + * The main formatter method. + * @param {LintResults[]} results The lint results to format. + * @returns {string} The formatted lint results. + */ + format(results) { + let rulesMeta = null; + + results.sort(compareResultsByFilePath); + + return formatter(results, { + get rulesMeta() { + if (!rulesMeta) { + rulesMeta = createRulesMeta(cliEngine.getRules()); + } + + return rulesMeta; + } + }); + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {Promise} A configuration object for the file. + */ + async calculateConfigForFile(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.getConfigForFile(filePath); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {Promise} Whether or not the given path is ignored. + */ + async isPathIgnored(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.isPathIgnored(filePath); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + ESLint, + + /** + * Get the private class members of a given ESLint instance for tests. + * @param {ESLint} instance The ESLint instance to get. + * @returns {ESLintPrivateMembers} The instance's private class members. + */ + getESLintPrivateMembers(instance) { + return privateMembersMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/eslint/index.js b/node_modules/eslint/lib/eslint/index.js new file mode 100644 index 0000000..c9185ee --- /dev/null +++ b/node_modules/eslint/lib/eslint/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { ESLint } = require("./eslint"); + +module.exports = { + ESLint +}; diff --git a/node_modules/eslint/lib/init/autoconfig.js b/node_modules/eslint/lib/init/autoconfig.js new file mode 100644 index 0000000..0ace177 --- /dev/null +++ b/node_modules/eslint/lib/init/autoconfig.js @@ -0,0 +1,348 @@ +/** + * @fileoverview Used for creating a suggested configuration based on project code. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"), + recConfig = require("../../conf/eslint-recommended"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + { Linter } = require("../linter"), + configRule = require("./config-rule"); + +const debug = require("debug")("eslint:autoconfig"); +const linter = new Linter(); + +//------------------------------------------------------------------------------ +// Data +//------------------------------------------------------------------------------ + +const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only + RECOMMENDED_CONFIG_NAME = "eslint:recommended"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Information about a rule configuration, in the context of a Registry. + * @typedef {Object} registryItem + * @param {ruleConfig} config A valid configuration for the rule + * @param {number} specificity The number of elements in the ruleConfig array + * @param {number} errorCount The number of errors encountered when linting with the config + */ + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Create registryItems for rules + * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items + * @returns {Object} registryItems for each rule in provided rulesConfig + */ +function makeRegistryItems(rulesConfig) { + return Object.keys(rulesConfig).reduce((accumulator, ruleId) => { + accumulator[ruleId] = rulesConfig[ruleId].map(config => ({ + config, + specificity: config.length || 1, + errorCount: void 0 + })); + return accumulator; + }, {}); +} + +/** + * Creates an object in which to store rule configs and error counts + * + * Unless a rulesConfig is provided at construction, the registry will not contain + * any rules, only methods. This will be useful for building up registries manually. + * + * Registry class + */ +class Registry { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations + */ + constructor(rulesConfig) { + this.rules = (rulesConfig) ? makeRegistryItems(rulesConfig) : {}; + } + + /** + * Populate the registry with core rule configs. + * + * It will set the registry's `rule` property to an object having rule names + * as keys and an array of registryItems as values. + * @returns {void} + */ + populateFromCoreRules() { + const rulesConfig = configRule.createCoreRuleConfigs(); + + this.rules = makeRegistryItems(rulesConfig); + } + + /** + * Creates sets of rule configurations which can be used for linting + * and initializes registry errors to zero for those configurations (side effect). + * + * This combines as many rules together as possible, such that the first sets + * in the array will have the highest number of rules configured, and later sets + * will have fewer and fewer, as not all rules have the same number of possible + * configurations. + * + * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. + * @returns {Object[]} "rules" configurations to use for linting + */ + buildRuleSets() { + let idx = 0; + const ruleIds = Object.keys(this.rules), + ruleSets = []; + + /** + * Add a rule configuration from the registry to the ruleSets + * + * This is broken out into its own function so that it doesn't need to be + * created inside of the while loop. + * @param {string} rule The ruleId to add. + * @returns {void} + */ + const addRuleToRuleSet = function(rule) { + + /* + * This check ensures that there is a rule configuration and that + * it has fewer than the max combinations allowed. + * If it has too many configs, we will only use the most basic of + * the possible configurations. + */ + const hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS); + + if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) { + + /* + * If the rule has too many possible combinations, only take + * simple ones, avoiding objects. + */ + if (!hasFewCombos && typeof this.rules[rule][idx].config[1] === "object") { + return; + } + + ruleSets[idx] = ruleSets[idx] || {}; + ruleSets[idx][rule] = this.rules[rule][idx].config; + + /* + * Initialize errorCount to zero, since this is a config which + * will be linted. + */ + this.rules[rule][idx].errorCount = 0; + } + }.bind(this); + + while (ruleSets.length === idx) { + ruleIds.forEach(addRuleToRuleSet); + idx += 1; + } + + return ruleSets; + } + + /** + * Remove all items from the registry with a non-zero number of errors + * + * Note: this also removes rule configurations which were not linted + * (meaning, they have an undefined errorCount). + * @returns {void} + */ + stripFailingConfigs() { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + const errorFreeItems = newRegistry.rules[ruleId].filter(registryItem => (registryItem.errorCount === 0)); + + if (errorFreeItems.length > 0) { + newRegistry.rules[ruleId] = errorFreeItems; + } else { + delete newRegistry.rules[ruleId]; + } + }); + + return newRegistry; + } + + /** + * Removes rule configurations which were not included in a ruleSet + * @returns {void} + */ + stripExtraConfigs() { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + newRegistry.rules[ruleId] = newRegistry.rules[ruleId].filter(registryItem => (typeof registryItem.errorCount !== "undefined")); + }); + + return newRegistry; + } + + /** + * Creates a registry of rules which had no error-free configs. + * The new registry is intended to be analyzed to determine whether its rules + * should be disabled or set to warning. + * @returns {Registry} A registry of failing rules. + */ + getFailingRulesRegistry() { + const ruleIds = Object.keys(this.rules), + failingRegistry = new Registry(); + + ruleIds.forEach(ruleId => { + const failingConfigs = this.rules[ruleId].filter(registryItem => (registryItem.errorCount > 0)); + + if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) { + failingRegistry.rules[ruleId] = failingConfigs; + } + }); + + return failingRegistry; + } + + /** + * Create an eslint config for any rules which only have one configuration + * in the registry. + * @returns {Object} An eslint config with rules section populated + */ + createConfig() { + const ruleIds = Object.keys(this.rules), + config = { rules: {} }; + + ruleIds.forEach(ruleId => { + if (this.rules[ruleId].length === 1) { + config.rules[ruleId] = this.rules[ruleId][0].config; + } + }); + + return config; + } + + /** + * Return a cloned registry containing only configs with a desired specificity + * @param {number} specificity Only keep configs with this specificity + * @returns {Registry} A registry of rules + */ + filterBySpecificity(specificity) { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + newRegistry.rules[ruleId] = this.rules[ruleId].filter(registryItem => (registryItem.specificity === specificity)); + }); + + return newRegistry; + } + + /** + * Lint SourceCodes against all configurations in the registry, and record results + * @param {Object[]} sourceCodes SourceCode objects for each filename + * @param {Object} config ESLint config object + * @param {progressCallback} [cb] Optional callback for reporting execution status + * @returns {Registry} New registry with errorCount populated + */ + lintSourceCode(sourceCodes, config, cb) { + let lintedRegistry = new Registry(); + + lintedRegistry.rules = Object.assign({}, this.rules); + + const ruleSets = lintedRegistry.buildRuleSets(); + + lintedRegistry = lintedRegistry.stripExtraConfigs(); + + debug("Linting with all possible rule combinations"); + + const filenames = Object.keys(sourceCodes); + const totalFilesLinting = filenames.length * ruleSets.length; + + filenames.forEach(filename => { + debug(`Linting file: ${filename}`); + + let ruleSetIdx = 0; + + ruleSets.forEach(ruleSet => { + const lintConfig = Object.assign({}, config, { rules: ruleSet }); + const lintResults = linter.verify(sourceCodes[filename], lintConfig); + + lintResults.forEach(result => { + + /* + * It is possible that the error is from a configuration comment + * in a linted file, in which case there may not be a config + * set in this ruleSetIdx. + * (https://github.com/eslint/eslint/issues/5992) + * (https://github.com/eslint/eslint/issues/7860) + */ + if ( + lintedRegistry.rules[result.ruleId] && + lintedRegistry.rules[result.ruleId][ruleSetIdx] + ) { + lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1; + } + }); + + ruleSetIdx += 1; + + if (cb) { + cb(totalFilesLinting); // eslint-disable-line node/callback-return + } + }); + + // Deallocate for GC + sourceCodes[filename] = null; + }); + + return lintedRegistry; + } +} + +/** + * Extract rule configuration into eslint:recommended where possible. + * + * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and + * only the rules which have configurations different from the recommended config. + * @param {Object} config config object + * @returns {Object} config object using `"extends": ["eslint:recommended"]` + */ +function extendFromRecommended(config) { + const newConfig = Object.assign({}, config); + + ConfigOps.normalizeToStrings(newConfig); + + const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); + + recRules.forEach(ruleId => { + if (lodash.isEqual(recConfig.rules[ruleId], newConfig.rules[ruleId])) { + delete newConfig.rules[ruleId]; + } + }); + newConfig.extends.unshift(RECOMMENDED_CONFIG_NAME); + return newConfig; +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + Registry, + extendFromRecommended +}; diff --git a/node_modules/eslint/lib/init/config-file.js b/node_modules/eslint/lib/init/config-file.js new file mode 100644 index 0000000..fc62b81 --- /dev/null +++ b/node_modules/eslint/lib/init/config-file.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Helper to locate and load configuration files. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"), + stringify = require("json-stable-stringify-without-jsonify"); + +const debug = require("debug")("eslint:config-file"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines sort order for object keys for json-stable-stringify + * + * see: https://github.com/samn/json-stable-stringify#cmp + * @param {Object} a The first comparison object ({key: akey, value: avalue}) + * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) + * @returns {number} 1 or -1, used in stringify cmp method + */ +function sortByKey(a, b) { + return a.key > b.key ? 1 : -1; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Writes a configuration file in JSON format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @private + */ +function writeJSONConfigFile(config, filePath) { + debug(`Writing JSON config file: ${filePath}`); + + const content = `${stringify(config, { cmp: sortByKey, space: 4 })}\n`; + + fs.writeFileSync(filePath, content, "utf8"); +} + +/** + * Writes a configuration file in YAML format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @private + */ +function writeYAMLConfigFile(config, filePath) { + debug(`Writing YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + const content = yaml.safeDump(config, { sortKeys: true }); + + fs.writeFileSync(filePath, content, "utf8"); +} + +/** + * Writes a configuration file in JavaScript format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @throws {Error} If an error occurs linting the config file contents. + * @returns {void} + * @private + */ +function writeJSConfigFile(config, filePath) { + debug(`Writing JS config file: ${filePath}`); + + let contentToWrite; + const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};\n`; + + try { + const { CLIEngine } = require("../cli-engine"); + const linter = new CLIEngine({ + baseConfig: config, + fix: true, + useEslintrc: false + }); + const report = linter.executeOnText(stringifiedContent); + + contentToWrite = report.results[0].output || stringifiedContent; + } catch (e) { + debug("Error linting JavaScript config file, writing unlinted version"); + const errorMessage = e.message; + + contentToWrite = stringifiedContent; + e.message = "An error occurred while generating your JavaScript config file. "; + e.message += "A config file was still generated, but the config file itself may not follow your linting rules."; + e.message += `\nError: ${errorMessage}`; + throw e; + } finally { + fs.writeFileSync(filePath, contentToWrite, "utf8"); + } +} + +/** + * Writes a configuration file. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @throws {Error} When an unknown file type is specified. + * @private + */ +function write(config, filePath) { + switch (path.extname(filePath)) { + case ".js": + writeJSConfigFile(config, filePath); + break; + + case ".json": + writeJSONConfigFile(config, filePath); + break; + + case ".yaml": + case ".yml": + writeYAMLConfigFile(config, filePath); + break; + + default: + throw new Error("Can't write to unknown file type."); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + write +}; diff --git a/node_modules/eslint/lib/init/config-initializer.js b/node_modules/eslint/lib/init/config-initializer.js new file mode 100644 index 0000000..f7d4cc7 --- /dev/null +++ b/node_modules/eslint/lib/init/config-initializer.js @@ -0,0 +1,690 @@ +/** + * @fileoverview Config initialization wizard. + * @author Ilya Volodin + */ + + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const util = require("util"), + path = require("path"), + enquirer = require("enquirer"), + ProgressBar = require("progress"), + semver = require("semver"), + espree = require("espree"), + recConfig = require("../../conf/eslint-recommended"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + log = require("../shared/logging"), + naming = require("@eslint/eslintrc/lib/shared/naming"), + ModuleResolver = require("../shared/relative-module-resolver"), + autoconfig = require("./autoconfig.js"), + ConfigFile = require("./config-file"), + npmUtils = require("./npm-utils"), + { getSourceCodeOfFiles } = require("./source-code-utils"); + +const debug = require("debug")("eslint:config-initializer"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/* istanbul ignore next: hard to test fs function */ +/** + * Create .eslintrc file in the current working directory + * @param {Object} config object that contains user's answers + * @param {string} format The file format to write to. + * @returns {void} + */ +function writeFile(config, format) { + + // default is .js + let extname = ".js"; + + if (format === "YAML") { + extname = ".yml"; + } else if (format === "JSON") { + extname = ".json"; + } + + const installedESLint = config.installedESLint; + + delete config.installedESLint; + + ConfigFile.write(config, `./.eslintrc${extname}`); + log.info(`Successfully created .eslintrc${extname} file in ${process.cwd()}`); + + if (installedESLint) { + log.info("ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy."); + } +} + +/** + * Get the peer dependencies of the given module. + * This adds the gotten value to cache at the first time, then reuses it. + * In a process, this function is called twice, but `npmUtils.fetchPeerDependencies` needs to access network which is relatively slow. + * @param {string} moduleName The module name to get. + * @returns {Object} The peer dependencies of the given module. + * This object is the object of `peerDependencies` field of `package.json`. + * Returns null if npm was not found. + */ +function getPeerDependencies(moduleName) { + let result = getPeerDependencies.cache.get(moduleName); + + if (!result) { + log.info(`Checking peerDependencies of ${moduleName}`); + + result = npmUtils.fetchPeerDependencies(moduleName); + getPeerDependencies.cache.set(moduleName, result); + } + + return result; +} +getPeerDependencies.cache = new Map(); + +/** + * Return necessary plugins, configs, parsers, etc. based on the config + * @param {Object} config config object + * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint. + * @returns {string[]} An array of modules to be installed. + */ +function getModulesList(config, installESLint) { + const modules = {}; + + // Create a list of modules which should be installed based on config + if (config.plugins) { + for (const plugin of config.plugins) { + const moduleName = naming.normalizePackageName(plugin, "eslint-plugin"); + + modules[moduleName] = "latest"; + } + } + if (config.extends) { + const extendList = Array.isArray(config.extends) ? config.extends : [config.extends]; + + for (const extend of extendList) { + if (extend.startsWith("eslint:") || extend.startsWith("plugin:")) { + continue; + } + const moduleName = naming.normalizePackageName(extend, "eslint-config"); + + modules[moduleName] = "latest"; + Object.assign( + modules, + getPeerDependencies(`${moduleName}@latest`) + ); + } + } + + const parser = config.parser || (config.parserOptions && config.parserOptions.parser); + + if (parser) { + modules[parser] = "latest"; + } + + if (installESLint === false) { + delete modules.eslint; + } else { + const installStatus = npmUtils.checkDevDeps(["eslint"]); + + // Mark to show messages if it's new installation of eslint. + if (installStatus.eslint === false) { + log.info("Local ESLint installation not found."); + modules.eslint = modules.eslint || "latest"; + config.installedESLint = true; + } + } + + return Object.keys(modules).map(name => `${name}@${modules[name]}`); +} + +/** + * Set the `rules` of a config by examining a user's source code + * + * Note: This clones the config object and returns a new config to avoid mutating + * the original config parameter. + * @param {Object} answers answers received from enquirer + * @param {Object} config config object + * @returns {Object} config object with configured rules + */ +function configureRules(answers, config) { + const BAR_TOTAL = 20, + BAR_SOURCE_CODE_TOTAL = 4, + newConfig = Object.assign({}, config), + disabledConfigs = {}; + let sourceCodes, + registry; + + // Set up a progress bar, as this process can take a long time + const bar = new ProgressBar("Determining Config: :percent [:bar] :elapseds elapsed, eta :etas ", { + width: 30, + total: BAR_TOTAL + }); + + bar.tick(0); // Shows the progress bar + + // Get the SourceCode of all chosen files + const patterns = answers.patterns.split(/[\s]+/u); + + try { + sourceCodes = getSourceCodeOfFiles(patterns, { baseConfig: newConfig, useEslintrc: false }, total => { + bar.tick((BAR_SOURCE_CODE_TOTAL / total)); + }); + } catch (e) { + log.info("\n"); + throw e; + } + const fileQty = Object.keys(sourceCodes).length; + + if (fileQty === 0) { + log.info("\n"); + throw new Error("Automatic Configuration failed. No files were able to be parsed."); + } + + // Create a registry of rule configs + registry = new autoconfig.Registry(); + registry.populateFromCoreRules(); + + // Lint all files with each rule config in the registry + registry = registry.lintSourceCode(sourceCodes, newConfig, total => { + bar.tick((BAR_TOTAL - BAR_SOURCE_CODE_TOTAL) / total); // Subtract out ticks used at beginning + }); + debug(`\nRegistry: ${util.inspect(registry.rules, { depth: null })}`); + + // Create a list of recommended rules, because we don't want to disable them + const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); + + // Find and disable rules which had no error-free configuration + const failingRegistry = registry.getFailingRulesRegistry(); + + Object.keys(failingRegistry.rules).forEach(ruleId => { + + // If the rule is recommended, set it to error, otherwise disable it + disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0; + }); + + // Now that we know which rules to disable, strip out configs with errors + registry = registry.stripFailingConfigs(); + + /* + * If there is only one config that results in no errors for a rule, we should use it. + * createConfig will only add rules that have one configuration in the registry. + */ + const singleConfigs = registry.createConfig().rules; + + /* + * The "sweet spot" for number of options in a config seems to be two (severity plus one option). + * Very often, a third option (usually an object) is available to address + * edge cases, exceptions, or unique situations. We will prefer to use a config with + * specificity of two. + */ + const specTwoConfigs = registry.filterBySpecificity(2).createConfig().rules; + + // Maybe a specific combination using all three options works + const specThreeConfigs = registry.filterBySpecificity(3).createConfig().rules; + + // If all else fails, try to use the default (severity only) + const defaultConfigs = registry.filterBySpecificity(1).createConfig().rules; + + // Combine configs in reverse priority order (later take precedence) + newConfig.rules = Object.assign({}, disabledConfigs, defaultConfigs, specThreeConfigs, specTwoConfigs, singleConfigs); + + // Make sure progress bar has finished (floating point rounding) + bar.update(BAR_TOTAL); + + // Log out some stats to let the user know what happened + const finalRuleIds = Object.keys(newConfig.rules); + const totalRules = finalRuleIds.length; + const enabledRules = finalRuleIds.filter(ruleId => (newConfig.rules[ruleId] !== 0)).length; + const resultMessage = [ + `\nEnabled ${enabledRules} out of ${totalRules}`, + `rules based on ${fileQty}`, + `file${(fileQty === 1) ? "." : "s."}` + ].join(" "); + + log.info(resultMessage); + + ConfigOps.normalizeToStrings(newConfig); + return newConfig; +} + +/** + * process user's answers and create config object + * @param {Object} answers answers received from enquirer + * @returns {Object} config object + */ +function processAnswers(answers) { + let config = { + rules: {}, + env: {}, + parserOptions: {}, + extends: [] + }; + + config.parserOptions.ecmaVersion = espree.latestEcmaVersion; + config.env.es2021 = true; + + // set the module type + if (answers.moduleType === "esm") { + config.parserOptions.sourceType = "module"; + } else if (answers.moduleType === "commonjs") { + config.env.commonjs = true; + } + + // add in browser and node environments if necessary + answers.env.forEach(env => { + config.env[env] = true; + }); + + // add in library information + if (answers.framework === "react") { + config.parserOptions.ecmaFeatures = { + jsx: true + }; + config.plugins = ["react"]; + config.extends.push("plugin:react/recommended"); + } else if (answers.framework === "vue") { + config.plugins = ["vue"]; + config.extends.push("plugin:vue/essential"); + } + + if (answers.typescript) { + if (answers.framework === "vue") { + config.parserOptions.parser = "@typescript-eslint/parser"; + } else { + config.parser = "@typescript-eslint/parser"; + } + + if (Array.isArray(config.plugins)) { + config.plugins.push("@typescript-eslint"); + } else { + config.plugins = ["@typescript-eslint"]; + } + } + + // setup rules based on problems/style enforcement preferences + if (answers.purpose === "problems") { + config.extends.unshift("eslint:recommended"); + } else if (answers.purpose === "style") { + if (answers.source === "prompt") { + config.extends.unshift("eslint:recommended"); + config.rules.indent = ["error", answers.indent]; + config.rules.quotes = ["error", answers.quotes]; + config.rules["linebreak-style"] = ["error", answers.linebreak]; + config.rules.semi = ["error", answers.semi ? "always" : "never"]; + } else if (answers.source === "auto") { + config = configureRules(answers, config); + config = autoconfig.extendFromRecommended(config); + } + } + if (answers.typescript && config.extends.includes("eslint:recommended")) { + config.extends.push("plugin:@typescript-eslint/recommended"); + } + + // normalize extends + if (config.extends.length === 0) { + delete config.extends; + } else if (config.extends.length === 1) { + config.extends = config.extends[0]; + } + + ConfigOps.normalizeToStrings(config); + return config; +} + +/** + * Get the version of the local ESLint. + * @returns {string|null} The version. If the local ESLint was not found, returns null. + */ +function getLocalESLintVersion() { + try { + const eslintPath = ModuleResolver.resolve("eslint", path.join(process.cwd(), "__placeholder__.js")); + const eslint = require(eslintPath); + + return eslint.linter.version || null; + } catch { + return null; + } +} + +/** + * Get the shareable config name of the chosen style guide. + * @param {Object} answers The answers object. + * @returns {string} The shareable config name. + */ +function getStyleGuideName(answers) { + if (answers.styleguide === "airbnb" && answers.framework !== "react") { + return "airbnb-base"; + } + return answers.styleguide; +} + +/** + * Check whether the local ESLint version conflicts with the required version of the chosen shareable config. + * @param {Object} answers The answers object. + * @returns {boolean} `true` if the local ESLint is found then it conflicts with the required version of the chosen shareable config. + */ +function hasESLintVersionConflict(answers) { + + // Get the local ESLint version. + const localESLintVersion = getLocalESLintVersion(); + + if (!localESLintVersion) { + return false; + } + + // Get the required range of ESLint version. + const configName = getStyleGuideName(answers); + const moduleName = `eslint-config-${configName}@latest`; + const peerDependencies = getPeerDependencies(moduleName) || {}; + const requiredESLintVersionRange = peerDependencies.eslint; + + if (!requiredESLintVersionRange) { + return false; + } + + answers.localESLintVersion = localESLintVersion; + answers.requiredESLintVersionRange = requiredESLintVersionRange; + + // Check the version. + if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) { + answers.installESLint = false; + return false; + } + + return true; +} + +/** + * Install modules. + * @param {string[]} modules Modules to be installed. + * @returns {void} + */ +function installModules(modules) { + log.info(`Installing ${modules.join(", ")}`); + npmUtils.installSyncSaveDev(modules); +} + +/* istanbul ignore next: no need to test enquirer */ +/** + * Ask user to install modules. + * @param {string[]} modules Array of modules to be installed. + * @param {boolean} packageJsonExists Indicates if package.json is existed. + * @returns {Promise} Answer that indicates if user wants to install. + */ +function askInstallModules(modules, packageJsonExists) { + + // If no modules, do nothing. + if (modules.length === 0) { + return Promise.resolve(); + } + + log.info("The config that you've selected requires the following dependencies:\n"); + log.info(modules.join(" ")); + return enquirer.prompt([ + { + type: "toggle", + name: "executeInstallation", + message: "Would you like to install them now with npm?", + enabled: "Yes", + disabled: "No", + initial: 1, + skip() { + return !(modules.length && packageJsonExists); + }, + result(input) { + return this.skipped ? null : input; + } + } + ]).then(({ executeInstallation }) => { + if (executeInstallation) { + installModules(modules); + } + }); +} + +/* istanbul ignore next: no need to test enquirer */ +/** + * Ask use a few questions on command prompt + * @returns {Promise} The promise with the result of the prompt + */ +function promptUser() { + + return enquirer.prompt([ + { + type: "select", + name: "purpose", + message: "How would you like to use ESLint?", + + // The returned number matches the name value of nth in the choices array. + initial: 1, + choices: [ + { message: "To check syntax only", name: "syntax" }, + { message: "To check syntax and find problems", name: "problems" }, + { message: "To check syntax, find problems, and enforce code style", name: "style" } + ] + }, + { + type: "select", + name: "moduleType", + message: "What type of modules does your project use?", + initial: 0, + choices: [ + { message: "JavaScript modules (import/export)", name: "esm" }, + { message: "CommonJS (require/exports)", name: "commonjs" }, + { message: "None of these", name: "none" } + ] + }, + { + type: "select", + name: "framework", + message: "Which framework does your project use?", + initial: 0, + choices: [ + { message: "React", name: "react" }, + { message: "Vue.js", name: "vue" }, + { message: "None of these", name: "none" } + ] + }, + { + type: "toggle", + name: "typescript", + message: "Does your project use TypeScript?", + enabled: "Yes", + disabled: "No", + initial: 0 + }, + { + type: "multiselect", + name: "env", + message: "Where does your code run?", + hint: "(Press to select, to toggle all, to invert selection)", + initial: 0, + choices: [ + { message: "Browser", name: "browser" }, + { message: "Node", name: "node" } + ] + }, + { + type: "select", + name: "source", + message: "How would you like to define a style for your project?", + choices: [ + { message: "Use a popular style guide", name: "guide" }, + { message: "Answer questions about your style", name: "prompt" }, + { message: "Inspect your JavaScript file(s)", name: "auto" } + ], + skip() { + return this.state.answers.purpose !== "style"; + }, + result(input) { + return this.skipped ? null : input; + } + }, + { + type: "select", + name: "styleguide", + message: "Which style guide do you want to follow?", + choices: [ + { message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" }, + { message: "Standard: https://github.com/standard/standard", name: "standard" }, + { message: "Google: https://github.com/google/eslint-config-google", name: "google" } + ], + skip() { + this.state.answers.packageJsonExists = npmUtils.checkPackageJson(); + return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists); + }, + result(input) { + return this.skipped ? null : input; + } + }, + { + type: "input", + name: "patterns", + message: "Which file(s), path(s), or glob(s) should be examined?", + skip() { + return this.state.answers.source !== "auto"; + }, + validate(input) { + if (!this.skipped && input.trim().length === 0 && input.trim() !== ",") { + return "You must tell us what code to examine. Try again."; + } + return true; + } + }, + { + type: "select", + name: "format", + message: "What format do you want your config file to be in?", + initial: 0, + choices: ["JavaScript", "YAML", "JSON"] + }, + { + type: "toggle", + name: "installESLint", + message(answers) { + const verb = semver.ltr(answers.localESLintVersion, answers.requiredESLintVersionRange) + ? "upgrade" + : "downgrade"; + + return `The style guide "${answers.styleguide}" requires eslint@${answers.requiredESLintVersionRange}. You are currently using eslint@${answers.localESLintVersion}.\n Do you want to ${verb}?`; + }, + enabled: "Yes", + disabled: "No", + initial: 1, + skip() { + return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists && hasESLintVersionConflict(this.state.answers)); + }, + result(input) { + return this.skipped ? null : input; + } + } + ]).then(earlyAnswers => { + + // early exit if no style guide is necessary + if (earlyAnswers.purpose !== "style") { + const config = processAnswers(earlyAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + } + + // early exit if you are using a style guide + if (earlyAnswers.source === "guide") { + if (!earlyAnswers.packageJsonExists) { + log.info("A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again."); + return void 0; + } + if (earlyAnswers.installESLint === false && !semver.satisfies(earlyAnswers.localESLintVersion, earlyAnswers.requiredESLintVersionRange)) { + log.info(`Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`); + } + if (earlyAnswers.styleguide === "airbnb" && earlyAnswers.framework !== "react") { + earlyAnswers.styleguide = "airbnb-base"; + } + + const config = processAnswers(earlyAnswers); + + if (Array.isArray(config.extends)) { + config.extends.push(earlyAnswers.styleguide); + } else if (config.extends) { + config.extends = [config.extends, earlyAnswers.styleguide]; + } else { + config.extends = [earlyAnswers.styleguide]; + } + + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + + } + + if (earlyAnswers.source === "auto") { + const combinedAnswers = Object.assign({}, earlyAnswers); + const config = processAnswers(combinedAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + } + + // continue with the style questions otherwise... + return enquirer.prompt([ + { + type: "select", + name: "indent", + message: "What style of indentation do you use?", + initial: 0, + choices: [{ message: "Tabs", name: "tab" }, { message: "Spaces", name: 4 }] + }, + { + type: "select", + name: "quotes", + message: "What quotes do you use for strings?", + initial: 0, + choices: [{ message: "Double", name: "double" }, { message: "Single", name: "single" }] + }, + { + type: "select", + name: "linebreak", + message: "What line endings do you use?", + initial: 0, + choices: [{ message: "Unix", name: "unix" }, { message: "Windows", name: "windows" }] + }, + { + type: "toggle", + name: "semi", + message: "Do you require semicolons?", + enabled: "Yes", + disabled: "No", + initial: 1 + } + ]).then(answers => { + const totalAnswers = Object.assign({}, earlyAnswers, answers); + + const config = processAnswers(totalAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + }); + }); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const init = { + getModulesList, + hasESLintVersionConflict, + installModules, + processAnswers, + /* istanbul ignore next */initializeConfig() { + return promptUser(); + } +}; + +module.exports = init; diff --git a/node_modules/eslint/lib/init/config-rule.js b/node_modules/eslint/lib/init/config-rule.js new file mode 100644 index 0000000..7aec89c --- /dev/null +++ b/node_modules/eslint/lib/init/config-rule.js @@ -0,0 +1,317 @@ +/** + * @fileoverview Create configurations for a rule + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Wrap all of the elements of an array into arrays. + * @param {*[]} xs Any array. + * @returns {Array[]} An array of arrays. + */ +function explodeArray(xs) { + return xs.reduce((accumulator, x) => { + accumulator.push([x]); + return accumulator; + }, []); +} + +/** + * Mix two arrays such that each element of the second array is concatenated + * onto each element of the first array. + * + * For example: + * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] + * @param {Array} arr1 The first array to combine. + * @param {Array} arr2 The second array to combine. + * @returns {Array} A mixture of the elements of the first and second arrays. + */ +function combineArrays(arr1, arr2) { + const res = []; + + if (arr1.length === 0) { + return explodeArray(arr2); + } + if (arr2.length === 0) { + return explodeArray(arr1); + } + arr1.forEach(x1 => { + arr2.forEach(x2 => { + res.push([].concat(x1, x2)); + }); + }); + return res; +} + +/** + * Group together valid rule configurations based on object properties + * + * e.g.: + * groupByProperty([ + * {before: true}, + * {before: false}, + * {after: true}, + * {after: false} + * ]); + * + * will return: + * [ + * [{before: true}, {before: false}], + * [{after: true}, {after: false}] + * ] + * @param {Object[]} objects Array of objects, each with one property/value pair + * @returns {Array[]} Array of arrays of objects grouped by property + */ +function groupByProperty(objects) { + const groupedObj = objects.reduce((accumulator, obj) => { + const prop = Object.keys(obj)[0]; + + accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj]; + return accumulator; + }, {}); + + return Object.keys(groupedObj).map(prop => groupedObj[prop]); +} + + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Configuration settings for a rule. + * + * A configuration can be a single number (severity), or an array where the first + * element in the array is the severity, and is the only required element. + * Configs may also have one or more additional elements to specify rule + * configuration or options. + * @typedef {Array|number} ruleConfig + * @param {number} 0 The rule's severity (0, 1, 2). + */ + +/** + * Object whose keys are rule names and values are arrays of valid ruleConfig items + * which should be linted against the target source code to determine error counts. + * (a ruleConfigSet.ruleConfigs). + * + * e.g. rulesConfig = { + * "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]], + * "no-console": [2] + * } + * @typedef rulesConfig + */ + + +/** + * Create valid rule configurations by combining two arrays, + * with each array containing multiple objects each with a + * single property/value pair and matching properties. + * + * e.g.: + * combinePropertyObjects( + * [{before: true}, {before: false}], + * [{after: true}, {after: false}] + * ); + * + * will return: + * [ + * {before: true, after: true}, + * {before: true, after: false}, + * {before: false, after: true}, + * {before: false, after: false} + * ] + * @param {Object[]} objArr1 Single key/value objects, all with the same key + * @param {Object[]} objArr2 Single key/value objects, all with another key + * @returns {Object[]} Combined objects for each combination of input properties and values + */ +function combinePropertyObjects(objArr1, objArr2) { + const res = []; + + if (objArr1.length === 0) { + return objArr2; + } + if (objArr2.length === 0) { + return objArr1; + } + objArr1.forEach(obj1 => { + objArr2.forEach(obj2 => { + const combinedObj = {}; + const obj1Props = Object.keys(obj1); + const obj2Props = Object.keys(obj2); + + obj1Props.forEach(prop1 => { + combinedObj[prop1] = obj1[prop1]; + }); + obj2Props.forEach(prop2 => { + combinedObj[prop2] = obj2[prop2]; + }); + res.push(combinedObj); + }); + }); + return res; +} + +/** + * Creates a new instance of a rule configuration set + * + * A rule configuration set is an array of configurations that are valid for a + * given rule. For example, the configuration set for the "semi" rule could be: + * + * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]] + * + * Rule configuration set class + */ +class RuleConfigSet { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ruleConfig[]} configs Valid rule configurations + */ + constructor(configs) { + + /** + * Stored valid rule configurations for this instance + * @type {Array} + */ + this.ruleConfigs = configs || []; + } + + /** + * Add a severity level to the front of all configs in the instance. + * This should only be called after all configs have been added to the instance. + * @returns {void} + */ + addErrorSeverity() { + const severity = 2; + + this.ruleConfigs = this.ruleConfigs.map(config => { + config.unshift(severity); + return config; + }); + + // Add a single config at the beginning consisting of only the severity + this.ruleConfigs.unshift(severity); + } + + /** + * Add rule configs from an array of strings (schema enums) + * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"]) + * @returns {void} + */ + addEnums(enums) { + this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums)); + } + + /** + * Add rule configurations from a schema object + * @param {Object} obj Schema item with type === "object" + * @returns {boolean} true if at least one schema for the object could be generated, false otherwise + */ + addObject(obj) { + const objectConfigSet = { + objectConfigs: [], + add(property, values) { + for (let idx = 0; idx < values.length; idx++) { + const optionObj = {}; + + optionObj[property] = values[idx]; + this.objectConfigs.push(optionObj); + } + }, + + combine() { + this.objectConfigs = groupByProperty(this.objectConfigs).reduce((accumulator, objArr) => combinePropertyObjects(accumulator, objArr), []); + } + }; + + /* + * The object schema could have multiple independent properties. + * If any contain enums or booleans, they can be added and then combined + */ + Object.keys(obj.properties).forEach(prop => { + if (obj.properties[prop].enum) { + objectConfigSet.add(prop, obj.properties[prop].enum); + } + if (obj.properties[prop].type && obj.properties[prop].type === "boolean") { + objectConfigSet.add(prop, [true, false]); + } + }); + objectConfigSet.combine(); + + if (objectConfigSet.objectConfigs.length > 0) { + this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs)); + return true; + } + + return false; + } +} + +/** + * Generate valid rule configurations based on a schema object + * @param {Object} schema A rule's schema object + * @returns {Array[]} Valid rule configurations + */ +function generateConfigsFromSchema(schema) { + const configSet = new RuleConfigSet(); + + if (Array.isArray(schema)) { + for (const opt of schema) { + if (opt.enum) { + configSet.addEnums(opt.enum); + } else if (opt.type && opt.type === "object") { + if (!configSet.addObject(opt)) { + break; + } + + // TODO (IanVS): support oneOf + } else { + + // If we don't know how to fill in this option, don't fill in any of the following options. + break; + } + } + } + configSet.addErrorSeverity(); + return configSet.ruleConfigs; +} + +/** + * Generate possible rule configurations for all of the core rules + * @param {boolean} noDeprecated Indicates whether ignores deprecated rules or not. + * @returns {rulesConfig} Hash of rule names and arrays of possible configurations + */ +function createCoreRuleConfigs(noDeprecated = false) { + return Array.from(builtInRules).reduce((accumulator, [id, rule]) => { + const schema = (typeof rule === "function") ? rule.schema : rule.meta.schema; + const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated; + + if (noDeprecated && isDeprecated) { + return accumulator; + } + + accumulator[id] = generateConfigsFromSchema(schema); + return accumulator; + }, {}); +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + generateConfigsFromSchema, + createCoreRuleConfigs +}; diff --git a/node_modules/eslint/lib/init/npm-utils.js b/node_modules/eslint/lib/init/npm-utils.js new file mode 100644 index 0000000..555ea2b --- /dev/null +++ b/node_modules/eslint/lib/init/npm-utils.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Utility for executing npm commands. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + spawn = require("cross-spawn"), + path = require("path"), + log = require("../shared/logging"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Find the closest package.json file, starting at process.cwd (by default), + * and working up to root. + * @param {string} [startDir=process.cwd()] Starting directory + * @returns {string} Absolute path to closest package.json file + */ +function findPackageJson(startDir) { + let dir = path.resolve(startDir || process.cwd()); + + do { + const pkgFile = path.join(dir, "package.json"); + + if (!fs.existsSync(pkgFile) || !fs.statSync(pkgFile).isFile()) { + dir = path.join(dir, ".."); + continue; + } + return pkgFile; + } while (dir !== path.resolve(dir, "..")); + return null; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Install node modules synchronously and save to devDependencies in package.json + * @param {string|string[]} packages Node module or modules to install + * @returns {void} + */ +function installSyncSaveDev(packages) { + const packageList = Array.isArray(packages) ? packages : [packages]; + const npmProcess = spawn.sync("npm", ["i", "--save-dev"].concat(packageList), + { stdio: "inherit" }); + const error = npmProcess.error; + + if (error && error.code === "ENOENT") { + const pluralS = packageList.length > 1 ? "s" : ""; + + log.error(`Could not execute npm. Please install the following package${pluralS} with a package manager of your choice: ${packageList.join(", ")}`); + } +} + +/** + * Fetch `peerDependencies` of the given package by `npm show` command. + * @param {string} packageName The package name to fetch peerDependencies. + * @returns {Object} Gotten peerDependencies. Returns null if npm was not found. + */ +function fetchPeerDependencies(packageName) { + const npmProcess = spawn.sync( + "npm", + ["show", "--json", packageName, "peerDependencies"], + { encoding: "utf8" } + ); + + const error = npmProcess.error; + + if (error && error.code === "ENOENT") { + return null; + } + const fetchedText = npmProcess.stdout.trim(); + + return JSON.parse(fetchedText || "{}"); + + +} + +/** + * Check whether node modules are include in a project's package.json. + * @param {string[]} packages Array of node module names + * @param {Object} opt Options Object + * @param {boolean} opt.dependencies Set to true to check for direct dependencies + * @param {boolean} opt.devDependencies Set to true to check for development dependencies + * @param {boolean} opt.startdir Directory to begin searching from + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function check(packages, opt) { + const deps = new Set(); + const pkgJson = (opt) ? findPackageJson(opt.startDir) : findPackageJson(); + let fileJson; + + if (!pkgJson) { + throw new Error("Could not find a package.json file. Run 'npm init' to create one."); + } + + try { + fileJson = JSON.parse(fs.readFileSync(pkgJson, "utf8")); + } catch (e) { + const error = new Error(e); + + error.messageTemplate = "failed-to-read-json"; + error.messageData = { + path: pkgJson, + message: e.message + }; + throw error; + } + + ["dependencies", "devDependencies"].forEach(key => { + if (opt[key] && typeof fileJson[key] === "object") { + Object.keys(fileJson[key]).forEach(dep => deps.add(dep)); + } + }); + + return packages.reduce((status, pkg) => { + status[pkg] = deps.has(pkg); + return status; + }, {}); +} + +/** + * Check whether node modules are included in the dependencies of a project's + * package.json. + * + * Convenience wrapper around check(). + * @param {string[]} packages Array of node modules to check. + * @param {string} rootDir The directory containing a package.json + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDeps(packages, rootDir) { + return check(packages, { dependencies: true, startDir: rootDir }); +} + +/** + * Check whether node modules are included in the devDependencies of a project's + * package.json. + * + * Convenience wrapper around check(). + * @param {string[]} packages Array of node modules to check. + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDevDeps(packages) { + return check(packages, { devDependencies: true }); +} + +/** + * Check whether package.json is found in current path. + * @param {string} [startDir] Starting directory + * @returns {boolean} Whether a package.json is found in current path. + */ +function checkPackageJson(startDir) { + return !!findPackageJson(startDir); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + installSyncSaveDev, + fetchPeerDependencies, + checkDeps, + checkDevDeps, + checkPackageJson +}; diff --git a/node_modules/eslint/lib/init/source-code-utils.js b/node_modules/eslint/lib/init/source-code-utils.js new file mode 100644 index 0000000..dca6541 --- /dev/null +++ b/node_modules/eslint/lib/init/source-code-utils.js @@ -0,0 +1,109 @@ +/** + * @fileoverview Tools for obtaining SourceCode objects. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CLIEngine } = require("../cli-engine"); + +/* + * This is used for: + * + * 1. Enumerate target file because we have not expose such a API on `CLIEngine` + * (https://github.com/eslint/eslint/issues/11222). + * 2. Create `SourceCode` instances. Because we don't have any function which + * instantiate `SourceCode` so it needs to take the created `SourceCode` + * instance out after linting. + * + * TODO1: Expose the API that enumerates target files. + * TODO2: Extract the creation logic of `SourceCode` from `Linter` class. + */ +const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require + +const debug = require("debug")("eslint:source-code-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the SourceCode object for a single file + * @param {string} filename The fully resolved filename to get SourceCode from. + * @param {Object} engine A CLIEngine. + * @returns {Array} Array of the SourceCode object representing the file + * and fatal error message. + */ +function getSourceCodeOfFile(filename, engine) { + debug("getting sourceCode of", filename); + const results = engine.executeOnFiles([filename]); + + if (results && results.results[0] && results.results[0].messages[0] && results.results[0].messages[0].fatal) { + const msg = results.results[0].messages[0]; + + throw new Error(`(${filename}:${msg.line}:${msg.column}) ${msg.message}`); + } + + // TODO: extract the logic that creates source code objects to `SourceCode#parse(text, options)` or something like. + const { linter } = getCLIEngineInternalSlots(engine); + const sourceCode = linter.getSourceCode(); + + return sourceCode; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Gets the SourceCode of a single file, or set of files. + * @param {string[]|string} patterns A filename, directory name, or glob, or an array of them + * @param {Object} options A CLIEngine options object. If not provided, the default cli options will be used. + * @param {progressCallback} callback Callback for reporting execution status + * @returns {Object} The SourceCode of all processed files. + */ +function getSourceCodeOfFiles(patterns, options, callback) { + const sourceCodes = {}; + const globPatternsList = typeof patterns === "string" ? [patterns] : patterns; + const engine = new CLIEngine({ ...options, rules: {} }); + + // TODO: make file iteration as a public API and use it. + const { fileEnumerator } = getCLIEngineInternalSlots(engine); + const filenames = + Array.from(fileEnumerator.iterateFiles(globPatternsList)) + .filter(entry => !entry.ignored) + .map(entry => entry.filePath); + + if (filenames.length === 0) { + debug(`Did not find any files matching pattern(s): ${globPatternsList}`); + } + + filenames.forEach(filename => { + const sourceCode = getSourceCodeOfFile(filename, engine); + + if (sourceCode) { + debug("got sourceCode of", filename); + sourceCodes[filename] = sourceCode; + } + if (callback) { + callback(filenames.length); // eslint-disable-line node/callback-return + } + }); + + return sourceCodes; +} + +module.exports = { + getSourceCodeOfFiles +}; diff --git a/node_modules/eslint/lib/linter/apply-disable-directives.js b/node_modules/eslint/lib/linter/apply-disable-directives.js new file mode 100644 index 0000000..41d6934 --- /dev/null +++ b/node_modules/eslint/lib/linter/apply-disable-directives.js @@ -0,0 +1,167 @@ +/** + * @fileoverview A module that filters reported problems based on `eslint-disable` and `eslint-enable` comments + * @author Teddy Katz + */ + +"use strict"; + +const lodash = require("lodash"); + +/** + * Compares the locations of two objects in a source file + * @param {{line: number, column: number}} itemA The first object + * @param {{line: number, column: number}} itemB The second object + * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if + * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location. + */ +function compareLocations(itemA, itemB) { + return itemA.line - itemB.line || itemA.column - itemB.column; +} + +/** + * This is the same as the exported function, except that it + * doesn't handle disable-line and disable-next-line directives, and it always reports unused + * disable directives. + * @param {Object} options options for applying directives. This is the same as the options + * for the exported function, except that `reportUnusedDisableDirectives` is not supported + * (this function always reports unused disable directives). + * @returns {{problems: Problem[], unusedDisableDirectives: Problem[]}} An object with a list + * of filtered problems and unused eslint-disable directives + */ +function applyDirectives(options) { + const problems = []; + let nextDirectiveIndex = 0; + let currentGlobalDisableDirective = null; + const disabledRuleMap = new Map(); + + // enabledRules is only used when there is a current global disable directive. + const enabledRules = new Set(); + const usedDisableDirectives = new Set(); + + for (const problem of options.problems) { + while ( + nextDirectiveIndex < options.directives.length && + compareLocations(options.directives[nextDirectiveIndex], problem) <= 0 + ) { + const directive = options.directives[nextDirectiveIndex++]; + + switch (directive.type) { + case "disable": + if (directive.ruleId === null) { + currentGlobalDisableDirective = directive; + disabledRuleMap.clear(); + enabledRules.clear(); + } else if (currentGlobalDisableDirective) { + enabledRules.delete(directive.ruleId); + disabledRuleMap.set(directive.ruleId, directive); + } else { + disabledRuleMap.set(directive.ruleId, directive); + } + break; + + case "enable": + if (directive.ruleId === null) { + currentGlobalDisableDirective = null; + disabledRuleMap.clear(); + } else if (currentGlobalDisableDirective) { + enabledRules.add(directive.ruleId); + disabledRuleMap.delete(directive.ruleId); + } else { + disabledRuleMap.delete(directive.ruleId); + } + break; + + // no default + } + } + + if (disabledRuleMap.has(problem.ruleId)) { + usedDisableDirectives.add(disabledRuleMap.get(problem.ruleId)); + } else if (currentGlobalDisableDirective && !enabledRules.has(problem.ruleId)) { + usedDisableDirectives.add(currentGlobalDisableDirective); + } else { + problems.push(problem); + } + } + + const unusedDisableDirectives = options.directives + .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)) + .map(directive => ({ + ruleId: null, + message: directive.ruleId + ? `Unused eslint-disable directive (no problems were reported from '${directive.ruleId}').` + : "Unused eslint-disable directive (no problems were reported).", + line: directive.unprocessedDirective.line, + column: directive.unprocessedDirective.column, + severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2, + nodeType: null + })); + + return { problems, unusedDisableDirectives }; +} + +/** + * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list + * of reported problems, determines which problems should be reported. + * @param {Object} options Information about directives and problems + * @param {{ + * type: ("disable"|"enable"|"disable-line"|"disable-next-line"), + * ruleId: (string|null), + * line: number, + * column: number + * }} options.directives Directive comments found in the file, with one-based columns. + * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable + * comment for two different rules is represented as two directives). + * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems + * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns. + * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives + * @returns {{ruleId: (string|null), line: number, column: number}[]} + * A list of reported problems that were not disabled by the directive comments. + */ +module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off" }) => { + const blockDirectives = directives + .filter(directive => directive.type === "disable" || directive.type === "enable") + .map(directive => Object.assign({}, directive, { unprocessedDirective: directive })) + .sort(compareLocations); + + const lineDirectives = lodash.flatMap(directives, directive => { + switch (directive.type) { + case "disable": + case "enable": + return []; + + case "disable-line": + return [ + { type: "disable", line: directive.line, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 1, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + case "disable-next-line": + return [ + { type: "disable", line: directive.line + 1, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 2, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + default: + throw new TypeError(`Unrecognized directive type '${directive.type}'`); + } + }).sort(compareLocations); + + const blockDirectivesResult = applyDirectives({ + problems, + directives: blockDirectives, + reportUnusedDisableDirectives + }); + const lineDirectivesResult = applyDirectives({ + problems: blockDirectivesResult.problems, + directives: lineDirectives, + reportUnusedDisableDirectives + }); + + return reportUnusedDisableDirectives !== "off" + ? lineDirectivesResult.problems + .concat(blockDirectivesResult.unusedDisableDirectives) + .concat(lineDirectivesResult.unusedDisableDirectives) + .sort(compareLocations) + : lineDirectivesResult.problems; +}; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js new file mode 100644 index 0000000..47427c1 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js @@ -0,0 +1,760 @@ +/** + * @fileoverview A class of the code path analyzer. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"), + { breakableTypePattern } = require("../../shared/ast-utils"), + CodePath = require("./code-path"), + CodePathSegment = require("./code-path-segment"), + IdGenerator = require("./id-generator"), + debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a `case` node (not `default` node). + * @param {ASTNode} node A `SwitchCase` node to check. + * @returns {boolean} `true` if the node is a `case` node (not `default` node). + */ +function isCaseNode(node) { + return Boolean(node.test); +} + +/** + * Checks whether the given logical operator is taken into account for the code + * path analysis. + * @param {string} operator The operator found in the LogicalExpression node + * @returns {boolean} `true` if the operator is "&&" or "||" or "??" + */ +function isHandledLogicalOperator(operator) { + return operator === "&&" || operator === "||" || operator === "??"; +} + +/** + * Checks whether the given assignment operator is a logical assignment operator. + * Logical assignments are taken into account for the code path analysis + * because of their short-circuiting semantics. + * @param {string} operator The operator found in the AssignmentExpression node + * @returns {boolean} `true` if the operator is "&&=" or "||=" or "??=" + */ +function isLogicalAssignmentOperator(operator) { + return operator === "&&=" || operator === "||=" || operator === "??="; +} + +/** + * Gets the label if the parent node of a given node is a LabeledStatement. + * @param {ASTNode} node A node to get. + * @returns {string|null} The label or `null`. + */ +function getLabel(node) { + if (node.parent.type === "LabeledStatement") { + return node.parent.label.name; + } + return null; +} + +/** + * Checks whether or not a given logical expression node goes different path + * between the `true` case and the `false` case. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a test of a choice statement. + */ +function isForkingByTrueOrFalse(node) { + const parent = node.parent; + + switch (parent.type) { + case "ConditionalExpression": + case "IfStatement": + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + return parent.test === node; + + case "LogicalExpression": + return isHandledLogicalOperator(parent.operator); + + case "AssignmentExpression": + return isLogicalAssignmentOperator(parent.operator); + + default: + return false; + } +} + +/** + * Gets the boolean value of a given literal node. + * + * This is used to detect infinity loops (e.g. `while (true) {}`). + * Statements preceded by an infinity loop are unreachable if the loop didn't + * have any `break` statement. + * @param {ASTNode} node A node to get. + * @returns {boolean|undefined} a boolean value if the node is a Literal node, + * otherwise `undefined`. + */ +function getBooleanValueIfSimpleConstant(node) { + if (node.type === "Literal") { + return Boolean(node.value); + } + return void 0; +} + +/** + * Checks that a given identifier node is a reference or not. + * + * This is used to detect the first throwable node in a `try` block. + * @param {ASTNode} node An Identifier node to check. + * @returns {boolean} `true` if the node is a reference. + */ +function isIdentifierReference(node) { + const parent = node.parent; + + switch (parent.type) { + case "LabeledStatement": + case "BreakStatement": + case "ContinueStatement": + case "ArrayPattern": + case "RestElement": + case "ImportSpecifier": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "CatchClause": + return false; + + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ClassDeclaration": + case "ClassExpression": + case "VariableDeclarator": + return parent.id !== node; + + case "Property": + case "MethodDefinition": + return ( + parent.key !== node || + parent.computed || + parent.shorthand + ); + + case "AssignmentPattern": + return parent.key !== node; + + default: + return true; + } +} + +/** + * Updates the current segment with the head segment. + * This is similar to local branches and tracking branches of git. + * + * To separate the current and the head is in order to not make useless segments. + * + * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd" + * events are fired. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function forwardCurrentToHead(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const currentSegments = state.currentSegments; + const headSegments = state.headSegments; + const end = Math.max(currentSegments.length, headSegments.length); + let i, currentSegment, headSegment; + + // Fires leaving events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && currentSegment) { + debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); + + if (currentSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentEnd", + currentSegment, + node + ); + } + } + } + + // Update state. + state.currentSegments = headSegments; + + // Fires entering events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && headSegment) { + debug.dump(`onCodePathSegmentStart ${headSegment.id}`); + + CodePathSegment.markUsed(headSegment); + if (headSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentStart", + headSegment, + node + ); + } + } + } + +} + +/** + * Updates the current segment with empty. + * This is called at the last of functions or the program. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function leaveFromCurrentSegment(analyzer, node) { + const state = CodePath.getState(analyzer.codePath); + const currentSegments = state.currentSegments; + + for (let i = 0; i < currentSegments.length; ++i) { + const currentSegment = currentSegments[i]; + + debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); + if (currentSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentEnd", + currentSegment, + node + ); + } + } + + state.currentSegments = []; +} + +/** + * Updates the code path due to the position of a given node in the parent node + * thereof. + * + * For example, if the node is `parent.consequent`, this creates a fork from the + * current path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function preprocess(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const parent = node.parent; + + switch (parent.type) { + + // The `arguments.length == 0` case is in `postprocess` function. + case "CallExpression": + if (parent.optional === true && parent.arguments.length >= 1 && parent.arguments[0] === node) { + state.makeOptionalRight(); + } + break; + case "MemberExpression": + if (parent.optional === true && parent.property === node) { + state.makeOptionalRight(); + } + break; + + case "LogicalExpression": + if ( + parent.right === node && + isHandledLogicalOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "AssignmentExpression": + if ( + parent.right === node && + isLogicalAssignmentOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "ConditionalExpression": + case "IfStatement": + + /* + * Fork if this node is at `consequent`/`alternate`. + * `popForkContext()` exists at `IfStatement:exit` and + * `ConditionalExpression:exit`. + */ + if (parent.consequent === node) { + state.makeIfConsequent(); + } else if (parent.alternate === node) { + state.makeIfAlternate(); + } + break; + + case "SwitchCase": + if (parent.consequent[0] === node) { + state.makeSwitchCaseBody(false, !parent.test); + } + break; + + case "TryStatement": + if (parent.handler === node) { + state.makeCatchBlock(); + } else if (parent.finalizer === node) { + state.makeFinallyBlock(); + } + break; + + case "WhileStatement": + if (parent.test === node) { + state.makeWhileTest(getBooleanValueIfSimpleConstant(node)); + } else { + assert(parent.body === node); + state.makeWhileBody(); + } + break; + + case "DoWhileStatement": + if (parent.body === node) { + state.makeDoWhileBody(); + } else { + assert(parent.test === node); + state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node)); + } + break; + + case "ForStatement": + if (parent.test === node) { + state.makeForTest(getBooleanValueIfSimpleConstant(node)); + } else if (parent.update === node) { + state.makeForUpdate(); + } else if (parent.body === node) { + state.makeForBody(); + } + break; + + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + state.makeForInOfLeft(); + } else if (parent.right === node) { + state.makeForInOfRight(); + } else { + assert(parent.body === node); + state.makeForInOfBody(); + } + break; + + case "AssignmentPattern": + + /* + * Fork if this node is at `right`. + * `left` is executed always, so it uses the current path. + * `popForkContext()` exists at `AssignmentPattern:exit`. + */ + if (parent.right === node) { + state.pushForkContext(); + state.forkBypassPath(); + state.forkPath(); + } + break; + + default: + break; + } +} + +/** + * Updates the code path due to the type of a given node in entering. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToEnter(analyzer, node) { + let codePath = analyzer.codePath; + let state = codePath && CodePath.getState(codePath); + const parent = node.parent; + + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + if (codePath) { + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); + } + + // Create the code path of this scope. + codePath = analyzer.codePath = new CodePath( + analyzer.idGenerator.next(), + codePath, + analyzer.onLooped + ); + state = CodePath.getState(codePath); + + // Emits onCodePathStart events. + debug.dump(`onCodePathStart ${codePath.id}`); + analyzer.emitter.emit("onCodePathStart", codePath, node); + break; + + case "ChainExpression": + state.pushChainContext(); + break; + case "CallExpression": + if (node.optional === true) { + state.makeOptionalNode(); + } + break; + case "MemberExpression": + if (node.optional === true) { + state.makeOptionalNode(); + } + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.pushChoiceContext( + node.operator, + isForkingByTrueOrFalse(node) + ); + } + break; + + case "AssignmentExpression": + if (isLogicalAssignmentOperator(node.operator)) { + state.pushChoiceContext( + node.operator.slice(0, -1), // removes `=` from the end + isForkingByTrueOrFalse(node) + ); + } + break; + + case "ConditionalExpression": + case "IfStatement": + state.pushChoiceContext("test", false); + break; + + case "SwitchStatement": + state.pushSwitchContext( + node.cases.some(isCaseNode), + getLabel(node) + ); + break; + + case "TryStatement": + state.pushTryContext(Boolean(node.finalizer)); + break; + + case "SwitchCase": + + /* + * Fork if this node is after the 2st node in `cases`. + * It's similar to `else` blocks. + * The next `test` node is processed in this path. + */ + if (parent.discriminant !== node && parent.cases[0] !== node) { + state.forkPath(); + } + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.pushLoopContext(node.type, getLabel(node)); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.pushBreakContext(false, node.label.name); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); +} + +/** + * Updates the code path due to the type of a given node in leaving. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToExit(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + let dontForward = false; + + switch (node.type) { + case "ChainExpression": + state.popChainContext(); + break; + + case "IfStatement": + case "ConditionalExpression": + state.popChoiceContext(); + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "AssignmentExpression": + if (isLogicalAssignmentOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "SwitchStatement": + state.popSwitchContext(); + break; + + case "SwitchCase": + + /* + * This is the same as the process at the 1st `consequent` node in + * `preprocess` function. + * Must do if this `consequent` is empty. + */ + if (node.consequent.length === 0) { + state.makeSwitchCaseBody(true, !node.test); + } + if (state.forkContext.reachable) { + dontForward = true; + } + break; + + case "TryStatement": + state.popTryContext(); + break; + + case "BreakStatement": + forwardCurrentToHead(analyzer, node); + state.makeBreak(node.label && node.label.name); + dontForward = true; + break; + + case "ContinueStatement": + forwardCurrentToHead(analyzer, node); + state.makeContinue(node.label && node.label.name); + dontForward = true; + break; + + case "ReturnStatement": + forwardCurrentToHead(analyzer, node); + state.makeReturn(); + dontForward = true; + break; + + case "ThrowStatement": + forwardCurrentToHead(analyzer, node); + state.makeThrow(); + dontForward = true; + break; + + case "Identifier": + if (isIdentifierReference(node)) { + state.makeFirstThrowablePathInTryBlock(); + dontForward = true; + } + break; + + case "CallExpression": + case "ImportExpression": + case "MemberExpression": + case "NewExpression": + case "YieldExpression": + state.makeFirstThrowablePathInTryBlock(); + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.popLoopContext(); + break; + + case "AssignmentPattern": + state.popForkContext(); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.popBreakContext(); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + if (!dontForward) { + forwardCurrentToHead(analyzer, node); + } + debug.dumpState(node, state, true); +} + +/** + * Updates the code path to finalize the current code path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function postprocess(analyzer, node) { + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": { + let codePath = analyzer.codePath; + + // Mark the current path as the final node. + CodePath.getState(codePath).makeFinal(); + + // Emits onCodePathSegmentEnd event of the current segments. + leaveFromCurrentSegment(analyzer, node); + + // Emits onCodePathEnd event of this code path. + debug.dump(`onCodePathEnd ${codePath.id}`); + analyzer.emitter.emit("onCodePathEnd", codePath, node); + debug.dumpDot(codePath); + + codePath = analyzer.codePath = analyzer.codePath.upper; + if (codePath) { + debug.dumpState(node, CodePath.getState(codePath), true); + } + break; + } + + // The `arguments.length >= 1` case is in `preprocess` function. + case "CallExpression": + if (node.optional === true && node.arguments.length === 0) { + CodePath.getState(analyzer.codePath).makeOptionalRight(); + } + break; + + default: + break; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The class to analyze code paths. + * This class implements the EventGenerator interface. + */ +class CodePathAnalyzer { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {EventGenerator} eventGenerator An event generator to wrap. + */ + constructor(eventGenerator) { + this.original = eventGenerator; + this.emitter = eventGenerator.emitter; + this.codePath = null; + this.idGenerator = new IdGenerator("s"); + this.currentNode = null; + this.onLooped = this.onLooped.bind(this); + } + + /** + * Does the process to enter a given AST node. + * This updates state of analysis and calls `enterNode` of the wrapped. + * @param {ASTNode} node A node which is entering. + * @returns {void} + */ + enterNode(node) { + this.currentNode = node; + + // Updates the code path due to node's position in its parent node. + if (node.parent) { + preprocess(this, node); + } + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToEnter(this, node); + + // Emits node events. + this.original.enterNode(node); + + this.currentNode = null; + } + + /** + * Does the process to leave a given AST node. + * This updates state of analysis and calls `leaveNode` of the wrapped. + * @param {ASTNode} node A node which is leaving. + * @returns {void} + */ + leaveNode(node) { + this.currentNode = node; + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToExit(this, node); + + // Emits node events. + this.original.leaveNode(node); + + // Emits the last onCodePathStart/onCodePathSegmentStart events. + postprocess(this, node); + + this.currentNode = null; + } + + /** + * This is called on a code path looped. + * Then this raises a looped event. + * @param {CodePathSegment} fromSegment A segment of prev. + * @param {CodePathSegment} toSegment A segment of next. + * @returns {void} + */ + onLooped(fromSegment, toSegment) { + if (fromSegment.reachable && toSegment.reachable) { + debug.dump(`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`); + this.emitter.emit( + "onCodePathSegmentLoop", + fromSegment, + toSegment, + this.currentNode + ); + } + } +} + +module.exports = CodePathAnalyzer; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js new file mode 100644 index 0000000..ca96ad3 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js @@ -0,0 +1,236 @@ +/** + * @fileoverview A class of the code path segment. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path segment. + */ +class CodePathSegment { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * This array includes unreachable segments. + * @param {boolean} reachable A flag which shows this is reachable. + */ + constructor(id, allPrevSegments, reachable) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * An array of the next segments. + * @type {CodePathSegment[]} + */ + this.nextSegments = []; + + /** + * An array of the previous segments. + * @type {CodePathSegment[]} + */ + this.prevSegments = allPrevSegments.filter(isReachable); + + /** + * An array of the next segments. + * This array includes unreachable segments. + * @type {CodePathSegment[]} + */ + this.allNextSegments = []; + + /** + * An array of the previous segments. + * This array includes unreachable segments. + * @type {CodePathSegment[]} + */ + this.allPrevSegments = allPrevSegments; + + /** + * A flag which shows this is reachable. + * @type {boolean} + */ + this.reachable = reachable; + + // Internal data. + Object.defineProperty(this, "internal", { + value: { + used: false, + loopedPrevSegments: [] + } + }); + + /* istanbul ignore if */ + if (debug.enabled) { + this.internal.nodes = []; + } + } + + /** + * Checks a given previous segment is coming from the end of a loop. + * @param {CodePathSegment} segment A previous segment to check. + * @returns {boolean} `true` if the segment is coming from the end of a loop. + */ + isLoopedPrevSegment(segment) { + return this.internal.loopedPrevSegments.indexOf(segment) !== -1; + } + + /** + * Creates the root segment. + * @param {string} id An identifier. + * @returns {CodePathSegment} The created segment. + */ + static newRoot(id) { + return new CodePathSegment(id, [], true); + } + + /** + * Creates a segment that follows given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newNext(id, allPrevSegments) { + return new CodePathSegment( + id, + CodePathSegment.flattenUnusedSegments(allPrevSegments), + allPrevSegments.some(isReachable) + ); + } + + /** + * Creates an unreachable segment that follows given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newUnreachable(id, allPrevSegments) { + const segment = new CodePathSegment(id, CodePathSegment.flattenUnusedSegments(allPrevSegments), false); + + /* + * In `if (a) return a; foo();` case, the unreachable segment preceded by + * the return statement is not used but must not be remove. + */ + CodePathSegment.markUsed(segment); + + return segment; + } + + /** + * Creates a segment that follows given segments. + * This factory method does not connect with `allPrevSegments`. + * But this inherits `reachable` flag. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newDisconnected(id, allPrevSegments) { + return new CodePathSegment(id, [], allPrevSegments.some(isReachable)); + } + + /** + * Makes a given segment being used. + * + * And this function registers the segment into the previous segments as a next. + * @param {CodePathSegment} segment A segment to mark. + * @returns {void} + */ + static markUsed(segment) { + if (segment.internal.used) { + return; + } + segment.internal.used = true; + + let i; + + if (segment.reachable) { + for (i = 0; i < segment.allPrevSegments.length; ++i) { + const prevSegment = segment.allPrevSegments[i]; + + prevSegment.allNextSegments.push(segment); + prevSegment.nextSegments.push(segment); + } + } else { + for (i = 0; i < segment.allPrevSegments.length; ++i) { + segment.allPrevSegments[i].allNextSegments.push(segment); + } + } + } + + /** + * Marks a previous segment as looped. + * @param {CodePathSegment} segment A segment. + * @param {CodePathSegment} prevSegment A previous segment to mark. + * @returns {void} + */ + static markPrevSegmentAsLooped(segment, prevSegment) { + segment.internal.loopedPrevSegments.push(prevSegment); + } + + /** + * Replaces unused segments with the previous segments of each unused segment. + * @param {CodePathSegment[]} segments An array of segments to replace. + * @returns {CodePathSegment[]} The replaced array. + */ + static flattenUnusedSegments(segments) { + const done = Object.create(null); + const retv = []; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + // Ignores duplicated. + if (done[segment.id]) { + continue; + } + + // Use previous segments if unused. + if (!segment.internal.used) { + for (let j = 0; j < segment.allPrevSegments.length; ++j) { + const prevSegment = segment.allPrevSegments[j]; + + if (!done[prevSegment.id]) { + done[prevSegment.id] = true; + retv.push(prevSegment); + } + } + } else { + done[segment.id] = true; + retv.push(segment); + } + } + + return retv; + } +} + +module.exports = CodePathSegment; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js new file mode 100644 index 0000000..f75e60e --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js @@ -0,0 +1,1480 @@ +/** + * @fileoverview A class to manage state of generating a code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathSegment = require("./code-path-segment"), + ForkContext = require("./fork-context"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Adds given segments into the `dest` array. + * If the `others` array does not includes the given segments, adds to the `all` + * array as well. + * + * This adds only reachable and used segments. + * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} all The unified destination array (`finalSegments`). + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ +function addToReturnedOrThrown(dest, others, all, segments) { + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + dest.push(segment); + if (others.indexOf(segment) === -1) { + all.push(segment); + } + } +} + +/** + * Gets a loop-context for a `continue` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `continue` statement. + * @returns {LoopContext} A loop-context for a `continue` statement. + */ +function getContinueContext(state, label) { + if (!label) { + return state.loopContext; + } + + let context = state.loopContext; + + while (context) { + if (context.label === label) { + return context; + } + context = context.upper; + } + + /* istanbul ignore next: foolproof (syntax error) */ + return null; +} + +/** + * Gets a context for a `break` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `break` statement. + * @returns {LoopContext|SwitchContext} A context for a `break` statement. + */ +function getBreakContext(state, label) { + let context = state.breakContext; + + while (context) { + if (label ? context.label === label : context.breakable) { + return context; + } + context = context.upper; + } + + /* istanbul ignore next: foolproof (syntax error) */ + return null; +} + +/** + * Gets a context for a `return` statement. + * @param {CodePathState} state A state to get. + * @returns {TryContext|CodePathState} A context for a `return` statement. + */ +function getReturnContext(state) { + let context = state.tryContext; + + while (context) { + if (context.hasFinalizer && context.position !== "finally") { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Gets a context for a `throw` statement. + * @param {CodePathState} state A state to get. + * @returns {TryContext|CodePathState} A context for a `throw` statement. + */ +function getThrowContext(state) { + let context = state.tryContext; + + while (context) { + if (context.position === "try" || + (context.hasFinalizer && context.position === "catch") + ) { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Removes a given element from a given array. + * @param {any[]} xs An array to remove the specific element. + * @param {any} x An element to be removed. + * @returns {void} + */ +function remove(xs, x) { + xs.splice(xs.indexOf(x), 1); +} + +/** + * Disconnect given segments. + * + * This is used in a process for switch statements. + * If there is the "default" chunk before other cases, the order is different + * between node's and running's. + * @param {CodePathSegment[]} prevSegments Forward segments to disconnect. + * @param {CodePathSegment[]} nextSegments Backward segments to disconnect. + * @returns {void} + */ +function removeConnection(prevSegments, nextSegments) { + for (let i = 0; i < prevSegments.length; ++i) { + const prevSegment = prevSegments[i]; + const nextSegment = nextSegments[i]; + + remove(prevSegment.nextSegments, nextSegment); + remove(prevSegment.allNextSegments, nextSegment); + remove(nextSegment.prevSegments, prevSegment); + remove(nextSegment.allPrevSegments, prevSegment); + } +} + +/** + * Creates looping path. + * @param {CodePathState} state The instance. + * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source. + * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination. + * @returns {void} + */ +function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { + const fromSegments = CodePathSegment.flattenUnusedSegments(unflattenedFromSegments); + const toSegments = CodePathSegment.flattenUnusedSegments(unflattenedToSegments); + + const end = Math.min(fromSegments.length, toSegments.length); + + for (let i = 0; i < end; ++i) { + const fromSegment = fromSegments[i]; + const toSegment = toSegments[i]; + + if (toSegment.reachable) { + fromSegment.nextSegments.push(toSegment); + } + if (fromSegment.reachable) { + toSegment.prevSegments.push(fromSegment); + } + fromSegment.allNextSegments.push(toSegment); + toSegment.allPrevSegments.push(fromSegment); + + if (toSegment.allPrevSegments.length >= 2) { + CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment); + } + + state.notifyLooped(fromSegment, toSegment); + } +} + +/** + * Finalizes segments of `test` chunk of a ForStatement. + * + * - Adds `false` paths to paths which are leaving from the loop. + * - Sets `true` paths to paths which go to the body. + * @param {LoopContext} context A loop context to modify. + * @param {ChoiceContext} choiceContext A choice context of this loop. + * @param {CodePathSegment[]} head The current head paths. + * @returns {void} + */ +function finalizeTestSegmentsOfFor(context, choiceContext, head) { + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(head); + choiceContext.falseForkContext.add(head); + choiceContext.qqForkContext.add(head); + } + + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class which manages state to analyze code paths. + */ +class CodePathState { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {IdGenerator} idGenerator An id generator to generate id for code + * path segments. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(idGenerator, onLooped) { + this.idGenerator = idGenerator; + this.notifyLooped = onLooped; + this.forkContext = ForkContext.newRoot(idGenerator); + this.choiceContext = null; + this.switchContext = null; + this.tryContext = null; + this.loopContext = null; + this.breakContext = null; + this.chainContext = null; + + this.currentSegments = []; + this.initialSegment = this.forkContext.head[0]; + + // returnedSegments and thrownSegments push elements into finalSegments also. + const final = this.finalSegments = []; + const returned = this.returnedForkContext = []; + const thrown = this.thrownForkContext = []; + + returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final); + thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final); + } + + /** + * The head segments. + * @type {CodePathSegment[]} + */ + get headSegments() { + return this.forkContext.head; + } + + /** + * The parent forking context. + * This is used for the root of new forks. + * @type {ForkContext} + */ + get parentForkContext() { + const current = this.forkContext; + + return current && current.upper; + } + + /** + * Creates and stacks new forking context. + * @param {boolean} forkLeavingPath A flag which shows being in a + * "finally" block. + * @returns {ForkContext} The created context. + */ + pushForkContext(forkLeavingPath) { + this.forkContext = ForkContext.newEmpty( + this.forkContext, + forkLeavingPath + ); + + return this.forkContext; + } + + /** + * Pops and merges the last forking context. + * @returns {ForkContext} The last context. + */ + popForkContext() { + const lastContext = this.forkContext; + + this.forkContext = lastContext.upper; + this.forkContext.replaceHead(lastContext.makeNext(0, -1)); + + return lastContext; + } + + /** + * Creates a new path. + * @returns {void} + */ + forkPath() { + this.forkContext.add(this.parentForkContext.makeNext(-1, -1)); + } + + /** + * Creates a bypass path. + * This is used for such as IfStatement which does not have "else" chunk. + * @returns {void} + */ + forkBypassPath() { + this.forkContext.add(this.parentForkContext.head); + } + + //-------------------------------------------------------------------------- + // ConditionalExpression, LogicalExpression, IfStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context for ConditionalExpression, LogicalExpression, AssignmentExpression (logical assignments only), + * IfStatement, WhileStatement, DoWhileStatement, or ForStatement. + * + * LogicalExpressions have cases that it goes different paths between the + * `true` case and the `false` case. + * + * For Example: + * + * if (a || b) { + * foo(); + * } else { + * bar(); + * } + * + * In this case, `b` is evaluated always in the code path of the `else` + * block, but it's not so in the code path of the `if` block. + * So there are 3 paths. + * + * a -> foo(); + * a -> b -> foo(); + * a -> b -> bar(); + * @param {string} kind A kind string. + * If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`. + * If it's IfStatement's or ConditionalExpression's, this is `"test"`. + * Otherwise, this is `"loop"`. + * @param {boolean} isForkingAsResult A flag that shows that goes different + * paths between `true` and `false`. + * @returns {void} + */ + pushChoiceContext(kind, isForkingAsResult) { + this.choiceContext = { + upper: this.choiceContext, + kind, + isForkingAsResult, + trueForkContext: ForkContext.newEmpty(this.forkContext), + falseForkContext: ForkContext.newEmpty(this.forkContext), + qqForkContext: ForkContext.newEmpty(this.forkContext), + processed: false + }; + } + + /** + * Pops the last choice context and finalizes it. + * @returns {ChoiceContext} The popped context. + */ + popChoiceContext() { + const context = this.choiceContext; + + this.choiceContext = context.upper; + + const forkContext = this.forkContext; + const headSegments = forkContext.head; + + switch (context.kind) { + case "&&": + case "||": + case "??": + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the right-hand operand. + */ + if (!context.processed) { + context.trueForkContext.add(headSegments); + context.falseForkContext.add(headSegments); + context.qqForkContext.add(headSegments); + } + + /* + * Transfers results to upper context if this context is in + * test chunk. + */ + if (context.isForkingAsResult) { + const parentContext = this.choiceContext; + + parentContext.trueForkContext.addAll(context.trueForkContext); + parentContext.falseForkContext.addAll(context.falseForkContext); + parentContext.qqForkContext.addAll(context.qqForkContext); + parentContext.processed = true; + + return context; + } + + break; + + case "test": + if (!context.processed) { + + /* + * The head segments are the path of the `if` block here. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(headSegments); + } else { + + /* + * The head segments are the path of the `else` block here. + * Updates the `false` path with the end of the `else` + * block. + */ + context.falseForkContext.clear(); + context.falseForkContext.add(headSegments); + } + + break; + + case "loop": + + /* + * Loops are addressed in popLoopContext(). + * This is called from popLoopContext(). + */ + return context; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + + // Merges all paths. + const prevForkContext = context.trueForkContext; + + prevForkContext.addAll(context.falseForkContext); + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + + return context; + } + + /** + * Makes a code path segment of the right-hand operand of a logical + * expression. + * @returns {void} + */ + makeLogicalRight() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + if (context.processed) { + + /* + * This got segments already from the child choice context. + * Creates the next path from own true/false fork context. + */ + let prevForkContext; + + switch (context.kind) { + case "&&": // if true then go to the right-hand side. + prevForkContext = context.trueForkContext; + break; + case "||": // if false then go to the right-hand side. + prevForkContext = context.falseForkContext; + break; + case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's qqForkContext. + prevForkContext = context.qqForkContext; + break; + default: + throw new Error("unreachable"); + } + + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + prevForkContext.clear(); + context.processed = false; + } else { + + /* + * This did not get segments from the child choice context. + * So addresses the head segments. + * The head segments are the path of the left-hand operand. + */ + switch (context.kind) { + case "&&": // the false path can short-circuit. + context.falseForkContext.add(forkContext.head); + break; + case "||": // the true path can short-circuit. + context.trueForkContext.add(forkContext.head); + break; + case "??": // both can short-circuit. + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + break; + default: + throw new Error("unreachable"); + } + + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + } + + /** + * Makes a code path segment of the `if` block. + * @returns {void} + */ + makeIfConsequent() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the test expression. + */ + if (!context.processed) { + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + context.qqForkContext.add(forkContext.head); + } + + context.processed = false; + + // Creates new path from the `true` case. + forkContext.replaceHead( + context.trueForkContext.makeNext(0, -1) + ); + } + + /** + * Makes a code path segment of the `else` block. + * @returns {void} + */ + makeIfAlternate() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * The head segments are the path of the `if` block. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(forkContext.head); + context.processed = true; + + // Creates new path from the `false` case. + forkContext.replaceHead( + context.falseForkContext.makeNext(0, -1) + ); + } + + //-------------------------------------------------------------------------- + // ChainExpression + //-------------------------------------------------------------------------- + + /** + * Push a new `ChainExpression` context to the stack. + * This method is called on entering to each `ChainExpression` node. + * This context is used to count forking in the optional chain then merge them on the exiting from the `ChainExpression` node. + * @returns {void} + */ + pushChainContext() { + this.chainContext = { + upper: this.chainContext, + countChoiceContexts: 0 + }; + } + + /** + * Pop a `ChainExpression` context from the stack. + * This method is called on exiting from each `ChainExpression` node. + * This merges all forks of the last optional chaining. + * @returns {void} + */ + popChainContext() { + const context = this.chainContext; + + this.chainContext = context.upper; + + // pop all choice contexts of this. + for (let i = context.countChoiceContexts; i > 0; --i) { + this.popChoiceContext(); + } + } + + /** + * Create a choice context for optional access. + * This method is called on entering to each `(Call|Member)Expression[optional=true]` node. + * This creates a choice context as similar to `LogicalExpression[operator="??"]` node. + * @returns {void} + */ + makeOptionalNode() { + if (this.chainContext) { + this.chainContext.countChoiceContexts += 1; + this.pushChoiceContext("??", false); + } + } + + /** + * Create a fork. + * This method is called on entering to the `arguments|property` property of each `(Call|Member)Expression` node. + * @returns {void} + */ + makeOptionalRight() { + if (this.chainContext) { + this.makeLogicalRight(); + } + } + + //-------------------------------------------------------------------------- + // SwitchStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of SwitchStatement and stacks it. + * @param {boolean} hasCase `true` if the switch statement has one or more + * case parts. + * @param {string|null} label The label text. + * @returns {void} + */ + pushSwitchContext(hasCase, label) { + this.switchContext = { + upper: this.switchContext, + hasCase, + defaultSegments: null, + defaultBodySegments: null, + foundDefault: false, + lastIsDefault: false, + countForks: 0 + }; + + this.pushBreakContext(true, label); + } + + /** + * Pops the last context of SwitchStatement and finalizes it. + * + * - Disposes all forking stack for `case` and `default`. + * - Creates the next code path segment from `context.brokenForkContext`. + * - If the last `SwitchCase` node is not a `default` part, creates a path + * to the `default` body. + * @returns {void} + */ + popSwitchContext() { + const context = this.switchContext; + + this.switchContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + if (context.countForks === 0) { + + /* + * When there is only one `default` chunk and there is one or more + * `break` statements, even if forks are nothing, it needs to merge + * those. + */ + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.makeNext(-1, -1)); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + return; + } + + const lastSegments = forkContext.head; + + this.forkBypassPath(); + const lastCaseSegments = forkContext.head; + + /* + * `brokenForkContext` is used to make the next segment. + * It must add the last segment into `brokenForkContext`. + */ + brokenForkContext.add(lastSegments); + + /* + * A path which is failed in all case test should be connected to path + * of `default` chunk. + */ + if (!context.lastIsDefault) { + if (context.defaultBodySegments) { + + /* + * Remove a link from `default` label to its chunk. + * It's false route. + */ + removeConnection(context.defaultSegments, context.defaultBodySegments); + makeLooped(this, lastCaseSegments, context.defaultBodySegments); + } else { + + /* + * It handles the last case body as broken if `default` chunk + * does not exist. + */ + brokenForkContext.add(lastCaseSegments); + } + } + + // Pops the segment context stack until the entry segment. + for (let i = 0; i < context.countForks; ++i) { + this.forkContext = this.forkContext.upper; + } + + /* + * Creates a path from all brokenForkContext paths. + * This is a path after switch statement. + */ + this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for a `SwitchCase` node. + * @param {boolean} isEmpty `true` if the body is empty. + * @param {boolean} isDefault `true` if the body is the default case. + * @returns {void} + */ + makeSwitchCaseBody(isEmpty, isDefault) { + const context = this.switchContext; + + if (!context.hasCase) { + return; + } + + /* + * Merge forks. + * The parent fork context has two segments. + * Those are from the current case and the body of the previous case. + */ + const parentForkContext = this.forkContext; + const forkContext = this.pushForkContext(); + + forkContext.add(parentForkContext.makeNext(0, -1)); + + /* + * Save `default` chunk info. + * If the `default` label is not at the last, we must make a path from + * the last `case` to the `default` chunk. + */ + if (isDefault) { + context.defaultSegments = parentForkContext.head; + if (isEmpty) { + context.foundDefault = true; + } else { + context.defaultBodySegments = forkContext.head; + } + } else { + if (!isEmpty && context.foundDefault) { + context.foundDefault = false; + context.defaultBodySegments = forkContext.head; + } + } + + context.lastIsDefault = isDefault; + context.countForks += 1; + } + + //-------------------------------------------------------------------------- + // TryStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of TryStatement and stacks it. + * @param {boolean} hasFinalizer `true` if the try statement has a + * `finally` block. + * @returns {void} + */ + pushTryContext(hasFinalizer) { + this.tryContext = { + upper: this.tryContext, + position: "try", + hasFinalizer, + + returnedForkContext: hasFinalizer + ? ForkContext.newEmpty(this.forkContext) + : null, + + thrownForkContext: ForkContext.newEmpty(this.forkContext), + lastOfTryIsReachable: false, + lastOfCatchIsReachable: false + }; + } + + /** + * Pops the last context of TryStatement and finalizes it. + * @returns {void} + */ + popTryContext() { + const context = this.tryContext; + + this.tryContext = context.upper; + + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block merely. + this.popForkContext(); + return; + } + + /* + * The following process is executed only when there is the `finally` + * block. + */ + + const returned = context.returnedForkContext; + const thrown = context.thrownForkContext; + + if (returned.empty && thrown.empty) { + return; + } + + // Separate head to normal paths and leaving paths. + const headSegments = this.forkContext.head; + + this.forkContext = this.forkContext.upper; + const normalSegments = headSegments.slice(0, headSegments.length / 2 | 0); + const leavingSegments = headSegments.slice(headSegments.length / 2 | 0); + + // Forwards the leaving path to upper contexts. + if (!returned.empty) { + getReturnContext(this).returnedForkContext.add(leavingSegments); + } + if (!thrown.empty) { + getThrowContext(this).thrownForkContext.add(leavingSegments); + } + + // Sets the normal path as the next. + this.forkContext.replaceHead(normalSegments); + + /* + * If both paths of the `try` block and the `catch` block are + * unreachable, the next path becomes unreachable as well. + */ + if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) { + this.forkContext.makeUnreachable(); + } + } + + /** + * Makes a code path segment for a `catch` block. + * @returns {void} + */ + makeCatchBlock() { + const context = this.tryContext; + const forkContext = this.forkContext; + const thrown = context.thrownForkContext; + + // Update state. + context.position = "catch"; + context.thrownForkContext = ForkContext.newEmpty(forkContext); + context.lastOfTryIsReachable = forkContext.reachable; + + // Merge thrown paths. + thrown.add(forkContext.head); + const thrownSegments = thrown.makeNext(0, -1); + + // Fork to a bypass and the merged thrown path. + this.pushForkContext(); + this.forkBypassPath(); + this.forkContext.add(thrownSegments); + } + + /** + * Makes a code path segment for a `finally` block. + * + * In the `finally` block, parallel paths are created. The parallel paths + * are used as leaving-paths. The leaving-paths are paths from `return` + * statements and `throw` statements in a `try` block or a `catch` block. + * @returns {void} + */ + makeFinallyBlock() { + const context = this.tryContext; + let forkContext = this.forkContext; + const returned = context.returnedForkContext; + const thrown = context.thrownForkContext; + const headOfLeavingSegments = forkContext.head; + + // Update state. + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block. + this.popForkContext(); + forkContext = this.forkContext; + + context.lastOfCatchIsReachable = forkContext.reachable; + } else { + context.lastOfTryIsReachable = forkContext.reachable; + } + context.position = "finally"; + + if (returned.empty && thrown.empty) { + + // This path does not leave. + return; + } + + /* + * Create a parallel segment from merging returned and thrown. + * This segment will leave at the end of this finally block. + */ + const segments = forkContext.makeNext(-1, -1); + + for (let i = 0; i < forkContext.count; ++i) { + const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]]; + + for (let j = 0; j < returned.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(returned.segmentsList[j][i]); + } + for (let j = 0; j < thrown.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(thrown.segmentsList[j][i]); + } + + segments.push( + CodePathSegment.newNext( + this.idGenerator.next(), + prevSegsOfLeavingSegment + ) + ); + } + + this.pushForkContext(true); + this.forkContext.add(segments); + } + + /** + * Makes a code path segment from the first throwable node to the `catch` + * block or the `finally` block. + * @returns {void} + */ + makeFirstThrowablePathInTryBlock() { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getThrowContext(this); + + if (context === this || + context.position !== "try" || + !context.thrownForkContext.empty + ) { + return; + } + + context.thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + + //-------------------------------------------------------------------------- + // Loop Statements + //-------------------------------------------------------------------------- + + /** + * Creates a context object of a loop statement and stacks it. + * @param {string} type The type of the node which was triggered. One of + * `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`, + * and `ForStatement`. + * @param {string|null} label A label of the node which was triggered. + * @returns {void} + */ + pushLoopContext(type, label) { + const forkContext = this.forkContext; + const breakContext = this.pushBreakContext(true, label); + + switch (type) { + case "WhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "DoWhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + entrySegments: null, + continueForkContext: ForkContext.newEmpty(forkContext), + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "ForStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + endOfInitSegments: null, + testSegments: null, + endOfTestSegments: null, + updateSegments: null, + endOfUpdateSegments: null, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "ForInStatement": + case "ForOfStatement": + this.loopContext = { + upper: this.loopContext, + type, + label, + prevSegments: null, + leftSegments: null, + endOfLeftSegments: null, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + /* istanbul ignore next */ + default: + throw new Error(`unknown type: "${type}"`); + } + } + + /** + * Pops the last context of a loop statement and finalizes it. + * @returns {void} + */ + popLoopContext() { + const context = this.loopContext; + + this.loopContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + // Creates a looped path. + switch (context.type) { + case "WhileStatement": + case "ForStatement": + this.popChoiceContext(); + makeLooped( + this, + forkContext.head, + context.continueDestSegments + ); + break; + + case "DoWhileStatement": { + const choiceContext = this.popChoiceContext(); + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + if (context.test !== true) { + brokenForkContext.addAll(choiceContext.falseForkContext); + } + + // `true` paths go to looping. + const segmentsList = choiceContext.trueForkContext.segmentsList; + + for (let i = 0; i < segmentsList.length; ++i) { + makeLooped( + this, + segmentsList[i], + context.entrySegments + ); + } + break; + } + + case "ForInStatement": + case "ForOfStatement": + brokenForkContext.add(forkContext.head); + makeLooped( + this, + forkContext.head, + context.leftSegments + ); + break; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + + // Go next. + if (brokenForkContext.empty) { + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } else { + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + /** + * Makes a code path segment for the test part of a WhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const testSegments = forkContext.makeNext(0, -1); + + // Update state. + context.test = test; + context.continueDestSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the body part of a WhileStatement. + * @returns {void} + */ + makeWhileBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + + // Update state. + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for the body part of a DoWhileStatement. + * @returns {void} + */ + makeDoWhileBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const bodySegments = forkContext.makeNext(-1, -1); + + // Update state. + context.entrySegments = bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the test part of a DoWhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeDoWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + + context.test = test; + + // Creates paths of `continue` statements. + if (!context.continueForkContext.empty) { + context.continueForkContext.add(forkContext.head); + const testSegments = context.continueForkContext.makeNext(0, -1); + + forkContext.replaceHead(testSegments); + } + } + + /** + * Makes a code path segment for the test part of a ForStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeForTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const endOfInitSegments = forkContext.head; + const testSegments = forkContext.makeNext(-1, -1); + + // Update state. + context.test = test; + context.endOfInitSegments = endOfInitSegments; + context.continueDestSegments = context.testSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the update part of a ForStatement. + * @returns {void} + */ + makeForUpdate() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Make the next paths of the test. + if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + // Update state. + const updateSegments = forkContext.makeDisconnected(-1, -1); + + context.continueDestSegments = context.updateSegments = updateSegments; + forkContext.replaceHead(updateSegments); + } + + /** + * Makes a code path segment for the body part of a ForStatement. + * @returns {void} + */ + makeForBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Update state. + if (context.updateSegments) { + context.endOfUpdateSegments = forkContext.head; + + // `update` -> `test` + if (context.testSegments) { + makeLooped( + this, + context.endOfUpdateSegments, + context.testSegments + ); + } + } else if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + let bodySegments = context.endOfTestSegments; + + if (!bodySegments) { + + /* + * If there is not the `test` part, the `body` path comes from the + * `init` part and the `update` part. + */ + const prevForkContext = ForkContext.newEmpty(forkContext); + + prevForkContext.add(context.endOfInitSegments); + if (context.endOfUpdateSegments) { + prevForkContext.add(context.endOfUpdateSegments); + } + + bodySegments = prevForkContext.makeNext(0, -1); + } + context.continueDestSegments = context.continueDestSegments || bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the left part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfLeft() { + const context = this.loopContext; + const forkContext = this.forkContext; + const leftSegments = forkContext.makeDisconnected(-1, -1); + + // Update state. + context.prevSegments = forkContext.head; + context.leftSegments = context.continueDestSegments = leftSegments; + forkContext.replaceHead(leftSegments); + } + + /** + * Makes a code path segment for the right part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfRight() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.prevSegments); + const rightSegments = temp.makeNext(-1, -1); + + // Update state. + context.endOfLeftSegments = forkContext.head; + forkContext.replaceHead(rightSegments); + } + + /** + * Makes a code path segment for the body part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.endOfLeftSegments); + const bodySegments = temp.makeNext(-1, -1); + + // Make a path: `right` -> `left`. + makeLooped(this, forkContext.head, context.leftSegments); + + // Update state. + context.brokenForkContext.add(forkContext.head); + forkContext.replaceHead(bodySegments); + } + + //-------------------------------------------------------------------------- + // Control Statements + //-------------------------------------------------------------------------- + + /** + * Creates new context for BreakStatement. + * @param {boolean} breakable The flag to indicate it can break by + * an unlabeled BreakStatement. + * @param {string|null} label The label of this context. + * @returns {Object} The new context. + */ + pushBreakContext(breakable, label) { + this.breakContext = { + upper: this.breakContext, + breakable, + label, + brokenForkContext: ForkContext.newEmpty(this.forkContext) + }; + return this.breakContext; + } + + /** + * Removes the top item of the break context stack. + * @returns {Object} The removed context. + */ + popBreakContext() { + const context = this.breakContext; + const forkContext = this.forkContext; + + this.breakContext = context.upper; + + // Process this context here for other than switches and loops. + if (!context.breakable) { + const brokenForkContext = context.brokenForkContext; + + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.head); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + return context; + } + + /** + * Makes a path for a `break` statement. + * + * It registers the head segment to a context of `break`. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string} label A label of the break statement. + * @returns {void} + */ + makeBreak(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getBreakContext(this, label); + + /* istanbul ignore else: foolproof (syntax error) */ + if (context) { + context.brokenForkContext.add(forkContext.head); + } + + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `continue` statement. + * + * It makes a looping path. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string} label A label of the continue statement. + * @returns {void} + */ + makeContinue(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getContinueContext(this, label); + + /* istanbul ignore else: foolproof (syntax error) */ + if (context) { + if (context.continueDestSegments) { + makeLooped(this, forkContext.head, context.continueDestSegments); + + // If the context is a for-in/of loop, this effects a break also. + if (context.type === "ForInStatement" || + context.type === "ForOfStatement" + ) { + context.brokenForkContext.add(forkContext.head); + } + } else { + context.continueForkContext.add(forkContext.head); + } + } + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `return` statement. + * + * It registers the head segment to a context of `return`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeReturn() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getReturnContext(this).returnedForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes a path for a `throw` statement. + * + * It registers the head segment to a context of `throw`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeThrow() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getThrowContext(this).thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes the final path. + * @returns {void} + */ + makeFinal() { + const segments = this.currentSegments; + + if (segments.length > 0 && segments[0].reachable) { + this.returnedForkContext.add(segments); + } + } +} + +module.exports = CodePathState; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js new file mode 100644 index 0000000..49b37c6 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js @@ -0,0 +1,238 @@ +/** + * @fileoverview A class of the code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathState = require("./code-path-state"); +const IdGenerator = require("./id-generator"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path. + */ +class CodePath { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} id An identifier. + * @param {CodePath|null} upper The code path of the upper function scope. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(id, upper, onLooped) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * The code path of the upper function scope. + * @type {CodePath|null} + */ + this.upper = upper; + + /** + * The code paths of nested function scopes. + * @type {CodePath[]} + */ + this.childCodePaths = []; + + // Initializes internal state. + Object.defineProperty( + this, + "internal", + { value: new CodePathState(new IdGenerator(`${id}_`), onLooped) } + ); + + // Adds this into `childCodePaths` of `upper`. + if (upper) { + upper.childCodePaths.push(this); + } + } + + /** + * Gets the state of a given code path. + * @param {CodePath} codePath A code path to get. + * @returns {CodePathState} The state of the code path. + */ + static getState(codePath) { + return codePath.internal; + } + + /** + * The initial code path segment. + * @type {CodePathSegment} + */ + get initialSegment() { + return this.internal.initialSegment; + } + + /** + * Final code path segments. + * This array is a mix of `returnedSegments` and `thrownSegments`. + * @type {CodePathSegment[]} + */ + get finalSegments() { + return this.internal.finalSegments; + } + + /** + * Final code path segments which is with `return` statements. + * This array contains the last path segment if it's reachable. + * Since the reachable last path returns `undefined`. + * @type {CodePathSegment[]} + */ + get returnedSegments() { + return this.internal.returnedForkContext; + } + + /** + * Final code path segments which is with `throw` statements. + * @type {CodePathSegment[]} + */ + get thrownSegments() { + return this.internal.thrownForkContext; + } + + /** + * Current code path segments. + * @type {CodePathSegment[]} + */ + get currentSegments() { + return this.internal.currentSegments; + } + + /** + * Traverses all segments in this code path. + * + * codePath.traverseSegments(function(segment, controller) { + * // do something. + * }); + * + * This method enumerates segments in order from the head. + * + * The `controller` object has two methods. + * + * - `controller.skip()` - Skip the following segments in this branch. + * - `controller.break()` - Skip all following segments. + * @param {Object} [options] Omittable. + * @param {CodePathSegment} [options.first] The first segment to traverse. + * @param {CodePathSegment} [options.last] The last segment to traverse. + * @param {Function} callback A callback function. + * @returns {void} + */ + traverseSegments(options, callback) { + let resolvedOptions; + let resolvedCallback; + + if (typeof options === "function") { + resolvedCallback = options; + resolvedOptions = {}; + } else { + resolvedOptions = options || {}; + resolvedCallback = callback; + } + + const startSegment = resolvedOptions.first || this.internal.initialSegment; + const lastSegment = resolvedOptions.last; + + let item = null; + let index = 0; + let end = 0; + let segment = null; + const visited = Object.create(null); + const stack = [[startSegment, 0]]; + let skippedSegment = null; + let broken = false; + const controller = { + skip() { + if (stack.length <= 1) { + broken = true; + } else { + skippedSegment = stack[stack.length - 2][0]; + } + }, + break() { + broken = true; + } + }; + + /** + * Checks a given previous segment has been visited. + * @param {CodePathSegment} prevSegment A previous segment to check. + * @returns {boolean} `true` if the segment has been visited. + */ + function isVisited(prevSegment) { + return ( + visited[prevSegment.id] || + segment.isLoopedPrevSegment(prevSegment) + ); + } + + while (stack.length > 0) { + item = stack[stack.length - 1]; + segment = item[0]; + index = item[1]; + + if (index === 0) { + + // Skip if this segment has been visited already. + if (visited[segment.id]) { + stack.pop(); + continue; + } + + // Skip if all previous segments have not been visited. + if (segment !== startSegment && + segment.prevSegments.length > 0 && + !segment.prevSegments.every(isVisited) + ) { + stack.pop(); + continue; + } + + // Reset the flag of skipping if all branches have been skipped. + if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) { + skippedSegment = null; + } + visited[segment.id] = true; + + // Call the callback when the first time. + if (!skippedSegment) { + resolvedCallback.call(this, segment, controller); + if (segment === lastSegment) { + controller.skip(); + } + if (broken) { + break; + } + } + } + + // Update the stack. + end = segment.nextSegments.length - 1; + if (index < end) { + item[1] += 1; + stack.push([segment.nextSegments[index], 0]); + } else if (index === end) { + item[0] = segment.nextSegments[index]; + item[1] = 0; + } else { + stack.pop(); + } + } + } +} + +module.exports = CodePath; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js new file mode 100644 index 0000000..a4cb99a --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js @@ -0,0 +1,203 @@ +/** + * @fileoverview Helpers to debug for code path analysis. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:code-path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets id of a given segment. + * @param {CodePathSegment} segment A segment to get. + * @returns {string} Id of the segment. + */ +/* istanbul ignore next */ +function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc + return segment.id + (segment.reachable ? "" : "!"); +} + +/** + * Get string for the given node and operation. + * @param {ASTNode} node The node to convert. + * @param {"enter" | "exit" | undefined} label The operation label. + * @returns {string} The string representation. + */ +function nodeToString(node, label) { + const suffix = label ? `:${label}` : ""; + + switch (node.type) { + case "Identifier": return `${node.type}${suffix} (${node.name})`; + case "Literal": return `${node.type}${suffix} (${node.value})`; + default: return `${node.type}${suffix}`; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * A flag that debug dumping is enabled or not. + * @type {boolean} + */ + enabled: debug.enabled, + + /** + * Dumps given objects. + * @param {...any} args objects to dump. + * @returns {void} + */ + dump: debug, + + /** + * Dumps the current analyzing state. + * @param {ASTNode} node A node to dump. + * @param {CodePathState} state A state to dump. + * @param {boolean} leaving A flag whether or not it's leaving + * @returns {void} + */ + dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) { + for (let i = 0; i < state.currentSegments.length; ++i) { + const segInternal = state.currentSegments[i].internal; + + if (leaving) { + const last = segInternal.nodes.length - 1; + + if (last >= 0 && segInternal.nodes[last] === nodeToString(node, "enter")) { + segInternal.nodes[last] = nodeToString(node, void 0); + } else { + segInternal.nodes.push(nodeToString(node, "exit")); + } + } else { + segInternal.nodes.push(nodeToString(node, "enter")); + } + } + + debug([ + `${state.currentSegments.map(getId).join(",")})`, + `${node.type}${leaving ? ":exit" : ""}` + ].join(" ")); + }, + + /** + * Dumps a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to dump. + * @returns {void} + * @see http://www.graphviz.org + * @see http://www.webgraphviz.com + */ + dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) { + let text = + "\n" + + "digraph {\n" + + "node[shape=box,style=\"rounded,filled\",fillcolor=white];\n" + + "initial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + + if (codePath.returnedSegments.length > 0) { + text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + } + if (codePath.thrownSegments.length > 0) { + text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize];\n"; + } + + const traceMap = Object.create(null); + const arrows = this.makeDotArrows(codePath, traceMap); + + for (const id in traceMap) { // eslint-disable-line guard-for-in + const segment = traceMap[id]; + + text += `${id}[`; + + if (segment.reachable) { + text += "label=\""; + } else { + text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<>\\n"; + } + + if (segment.internal.nodes.length > 0) { + text += segment.internal.nodes.join("\\n"); + } else { + text += "????"; + } + + text += "\"];\n"; + } + + text += `${arrows}\n`; + text += "}"; + debug("DOT", text); + }, + + /** + * Makes a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to make DOT. + * @param {Object} traceMap Optional. A map to check whether or not segments had been done. + * @returns {string} A DOT code of the code path. + */ + makeDotArrows(codePath, traceMap) { + const stack = [[codePath.initialSegment, 0]]; + const done = traceMap || Object.create(null); + let lastId = codePath.initialSegment.id; + let text = `initial->${codePath.initialSegment.id}`; + + while (stack.length > 0) { + const item = stack.pop(); + const segment = item[0]; + const index = item[1]; + + if (done[segment.id] && index === 0) { + continue; + } + done[segment.id] = segment; + + const nextSegment = segment.allNextSegments[index]; + + if (!nextSegment) { + continue; + } + + if (lastId === segment.id) { + text += `->${nextSegment.id}`; + } else { + text += `;\n${segment.id}->${nextSegment.id}`; + } + lastId = nextSegment.id; + + stack.unshift([segment, 1 + index]); + stack.push([nextSegment, 0]); + } + + codePath.returnedSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->final"; + } else { + text += `;\n${finalSegment.id}->final`; + } + lastId = null; + }); + + codePath.thrownSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->thrown"; + } else { + text += `;\n${finalSegment.id}->thrown`; + } + lastId = null; + }); + + return `${text};`; + } +}; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js new file mode 100644 index 0000000..2e872b5 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js @@ -0,0 +1,249 @@ +/** + * @fileoverview A class to operate forking. + * + * This is state of forking. + * This has a fork list and manages it. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"), + CodePathSegment = require("./code-path-segment"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to get. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Creates new segments from the specific range of `context.segmentsList`. + * + * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and + * `end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`. + * This `h` is from `b`, `d`, and `f`. + * @param {ForkContext} context An instance. + * @param {number} begin The first index of the previous segments. + * @param {number} end The last index of the previous segments. + * @param {Function} create A factory function of new segments. + * @returns {CodePathSegment[]} New segments. + */ +function makeSegments(context, begin, end, create) { + const list = context.segmentsList; + + const normalizedBegin = begin >= 0 ? begin : list.length + begin; + const normalizedEnd = end >= 0 ? end : list.length + end; + + const segments = []; + + for (let i = 0; i < context.count; ++i) { + const allPrevSegments = []; + + for (let j = normalizedBegin; j <= normalizedEnd; ++j) { + allPrevSegments.push(list[j][i]); + } + + segments.push(create(context.idGenerator.next(), allPrevSegments)); + } + + return segments; +} + +/** + * `segments` becomes doubly in a `finally` block. Then if a code path exits by a + * control statement (such as `break`, `continue`) from the `finally` block, the + * destination's segments may be half of the source segments. In that case, this + * merges segments. + * @param {ForkContext} context An instance. + * @param {CodePathSegment[]} segments Segments to merge. + * @returns {CodePathSegment[]} The merged segments. + */ +function mergeExtraSegments(context, segments) { + let currentSegments = segments; + + while (currentSegments.length > context.count) { + const merged = []; + + for (let i = 0, length = currentSegments.length / 2 | 0; i < length; ++i) { + merged.push(CodePathSegment.newNext( + context.idGenerator.next(), + [currentSegments[i], currentSegments[i + length]] + )); + } + currentSegments = merged; + } + return currentSegments; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class to manage forking. + */ +class ForkContext { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @param {ForkContext|null} upper An upper fork context. + * @param {number} count A number of parallel segments. + */ + constructor(idGenerator, upper, count) { + this.idGenerator = idGenerator; + this.upper = upper; + this.count = count; + this.segmentsList = []; + } + + /** + * The head segments. + * @type {CodePathSegment[]} + */ + get head() { + const list = this.segmentsList; + + return list.length === 0 ? [] : list[list.length - 1]; + } + + /** + * A flag which shows empty. + * @type {boolean} + */ + get empty() { + return this.segmentsList.length === 0; + } + + /** + * A flag which shows reachable. + * @type {boolean} + */ + get reachable() { + const segments = this.head; + + return segments.length > 0 && segments.some(isReachable); + } + + /** + * Creates new segments from this context. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeNext(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newNext); + } + + /** + * Creates new segments from this context. + * The new segments is always unreachable. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeUnreachable(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newUnreachable); + } + + /** + * Creates new segments from this context. + * The new segments don't have connections for previous segments. + * But these inherit the reachable flag from this context. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeDisconnected(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newDisconnected); + } + + /** + * Adds segments into this context. + * The added segments become the head. + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ + add(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + + this.segmentsList.push(mergeExtraSegments(this, segments)); + } + + /** + * Replaces the head segments with given segments. + * The current head segments are removed. + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ + replaceHead(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + + this.segmentsList.splice(-1, 1, mergeExtraSegments(this, segments)); + } + + /** + * Adds all segments of a given fork context into this context. + * @param {ForkContext} context A fork context to add. + * @returns {void} + */ + addAll(context) { + assert(context.count === this.count); + + const source = context.segmentsList; + + for (let i = 0; i < source.length; ++i) { + this.segmentsList.push(source[i]); + } + } + + /** + * Clears all segments in this context. + * @returns {void} + */ + clear() { + this.segmentsList = []; + } + + /** + * Creates the root fork context. + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @returns {ForkContext} New fork context. + */ + static newRoot(idGenerator) { + const context = new ForkContext(idGenerator, null, 1); + + context.add([CodePathSegment.newRoot(idGenerator.next())]); + + return context; + } + + /** + * Creates an empty fork context preceded by a given context. + * @param {ForkContext} parentContext The parent fork context. + * @param {boolean} forkLeavingPath A flag which shows inside of `finally` block. + * @returns {ForkContext} New fork context. + */ + static newEmpty(parentContext, forkLeavingPath) { + return new ForkContext( + parentContext.idGenerator, + parentContext, + (forkLeavingPath ? 2 : 1) * parentContext.count + ); + } +} + +module.exports = ForkContext; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js new file mode 100644 index 0000000..4cb2e0e --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js @@ -0,0 +1,46 @@ +/** + * @fileoverview A class of identifiers generator for code path segments. + * + * Each rule uses the identifier of code path segments to store additional + * information of the code path. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A generator for unique ids. + */ +class IdGenerator { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} prefix Optional. A prefix of generated ids. + */ + constructor(prefix) { + this.prefix = String(prefix); + this.n = 0; + } + + /** + * Generates id. + * @returns {string} A generated id. + */ + next() { + this.n = 1 + this.n | 0; + + /* istanbul ignore if */ + if (this.n < 0) { + this.n = 1; + } + + return this.prefix + this.n; + } +} + +module.exports = IdGenerator; diff --git a/node_modules/eslint/lib/linter/config-comment-parser.js b/node_modules/eslint/lib/linter/config-comment-parser.js new file mode 100644 index 0000000..07bbead --- /dev/null +++ b/node_modules/eslint/lib/linter/config-comment-parser.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Config Comment Parser + * @author Nicholas C. Zakas + */ + +/* eslint-disable class-methods-use-this*/ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const levn = require("levn"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"); + +const debug = require("debug")("eslint:config-comment-parser"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object to parse ESLint configuration comments inside JavaScript files. + * @name ConfigCommentParser + */ +module.exports = class ConfigCommentParser { + + /** + * Parses a list of "name:string_value" or/and "name" options divided by comma or + * whitespace. Used for "global" and "exported" comments. + * @param {string} string The string to parse. + * @param {Comment} comment The comment node which has the string. + * @returns {Object} Result map object of names and string values, or null values if no value was provided + */ + parseStringConfig(string, comment) { + debug("Parsing String config"); + + const items = {}; + + // Collapse whitespace around `:` and `,` to make parsing easier + const trimmedString = string.replace(/\s*([:,])\s*/gu, "$1"); + + trimmedString.split(/\s|,+/u).forEach(name => { + if (!name) { + return; + } + + // value defaults to null (if not provided), e.g: "foo" => ["foo", null] + const [key, value = null] = name.split(":"); + + items[key] = { value, comment }; + }); + return items; + } + + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @param {Object} location Start line and column of comments for potential error message. + * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object + */ + parseJsonConfig(string, location) { + debug("Parsing JSON config"); + + let items = {}; + + // Parses a JSON-like comment by the same way as parsing CLI option. + try { + items = levn.parse("Object", string) || {}; + + // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`. + // Also, commaless notations have invalid severity: + // "no-alert: 2 no-console: 2" --> {"no-alert": "2 no-console: 2"} + // Should ignore that case as well. + if (ConfigOps.isEverySeverityValid(items)) { + return { + success: true, + config: items + }; + } + } catch { + + debug("Levn parsing failed; falling back to manual parsing."); + + // ignore to parse the string by a fallback. + } + + /* + * Optionator cannot parse commaless notations. + * But we are supporting that. So this is a fallback for that. + */ + items = {}; + const normalizedString = string.replace(/([-a-zA-Z0-9/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,"); + + try { + items = JSON.parse(`{${normalizedString}}`); + } catch (ex) { + debug("Manual parsing failed."); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, + line: location.start.line, + column: location.start.column + 1 + } + }; + + } + + return { + success: true, + config: items + }; + } + + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {Object} Result map of values and true values + */ + parseListConfig(string) { + debug("Parsing list config"); + + const items = {}; + + // Collapse whitespace around commas + string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => { + const trimmedName = name.trim(); + + if (trimmedName) { + items[trimmedName] = true; + } + }); + return items; + } + +}; diff --git a/node_modules/eslint/lib/linter/index.js b/node_modules/eslint/lib/linter/index.js new file mode 100644 index 0000000..25fd769 --- /dev/null +++ b/node_modules/eslint/lib/linter/index.js @@ -0,0 +1,13 @@ +"use strict"; + +const { Linter } = require("./linter"); +const interpolate = require("./interpolate"); +const SourceCodeFixer = require("./source-code-fixer"); + +module.exports = { + Linter, + + // For testers. + SourceCodeFixer, + interpolate +}; diff --git a/node_modules/eslint/lib/linter/interpolate.js b/node_modules/eslint/lib/linter/interpolate.js new file mode 100644 index 0000000..87e06a0 --- /dev/null +++ b/node_modules/eslint/lib/linter/interpolate.js @@ -0,0 +1,28 @@ +/** + * @fileoverview Interpolate keys from an object into a string with {{ }} markers. + * @author Jed Fox + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (text, data) => { + if (!data) { + return text; + } + + // Substitution content for any {{ }} markers. + return text.replace(/\{\{([^{}]+?)\}\}/gu, (fullMatch, termWithWhitespace) => { + const term = termWithWhitespace.trim(); + + if (term in data) { + return data[term]; + } + + // Preserve old behavior: If parameter name not provided, don't replace it. + return fullMatch; + }); +}; diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js new file mode 100644 index 0000000..5c1a8d7 --- /dev/null +++ b/node_modules/eslint/lib/linter/linter.js @@ -0,0 +1,1467 @@ +/** + * @fileoverview Main Linter Class + * @author Gyandeep Singh + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + path = require("path"), + eslintScope = require("eslint-scope"), + evk = require("eslint-visitor-keys"), + espree = require("espree"), + lodash = require("lodash"), + BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), + pkg = require("../../package.json"), + astUtils = require("../shared/ast-utils"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + ConfigValidator = require("@eslint/eslintrc/lib/shared/config-validator"), + Traverser = require("../shared/traverser"), + { SourceCode } = require("../source-code"), + CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"), + applyDisableDirectives = require("./apply-disable-directives"), + ConfigCommentParser = require("./config-comment-parser"), + NodeEventGenerator = require("./node-event-generator"), + createReportTranslator = require("./report-translator"), + Rules = require("./rules"), + createEmitter = require("./safe-emitter"), + SourceCodeFixer = require("./source-code-fixer"), + timing = require("./timing"), + ruleReplacements = require("../../conf/replacements.json"); + +const debug = require("debug")("eslint:linter"); +const MAX_AUTOFIX_PASSES = 10; +const DEFAULT_PARSER_NAME = "espree"; +const commentParser = new ConfigCommentParser(); +const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } }; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {InstanceType} ConfigArray */ +/** @typedef {InstanceType} ExtractedConfig */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").Environment} Environment */ +/** @typedef {import("../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Processor} Processor */ +/** @typedef {import("../shared/types").Rule} Rule */ + +/** + * @template T + * @typedef {{ [P in keyof T]-?: T[P] }} Required + */ + +/** + * @typedef {Object} DisableDirective + * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type + * @property {number} line + * @property {number} column + * @property {(string|null)} ruleId + */ + +/** + * The private data for `Linter` instance. + * @typedef {Object} LinterInternalSlots + * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used. + * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used. + * @property {Map} parserMap The loaded parsers. + * @property {Rules} ruleMap The loaded rules. + */ + +/** + * @typedef {Object} VerifyOptions + * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability + * to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix` + * properties into the lint result. + * @property {string} [filename] the filename of the source code. + * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for + * unused `eslint-disable` directives. + */ + +/** + * @typedef {Object} ProcessorOptions + * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the + * predicate function that selects adopt code blocks. + * @property {Processor["postprocess"]} [postprocess] postprocessor for report + * messages. If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + * @property {Processor["preprocess"]} [preprocess] preprocessor for source text. + * If provided, this should accept a string of source text, and return an + * array of code blocks to lint. + */ + +/** + * @typedef {Object} FixOptions + * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines + * whether fixes should be applied. + */ + +/** + * @typedef {Object} InternalOptions + * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments. + * @property {"off" | "warn" | "error"} reportUnusedDisableDirectives (boolean values were normalized) + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Ensures that variables representing built-in properties of the Global Object, + * and any globals declared by special block comments, are present in the global + * scope. + * @param {Scope} globalScope The global scope. + * @param {Object} configGlobals The globals declared in configuration + * @param {{exportedVariables: Object, enabledGlobals: Object}} commentDirectives Directives from comment configuration + * @returns {void} + */ +function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, enabledGlobals }) { + + // Define configured global variables. + for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) { + + /* + * `ConfigOps.normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would + * typically be caught when validating a config anyway (validity for inline global comments is checked separately). + */ + const configValue = configGlobals[id] === void 0 ? void 0 : ConfigOps.normalizeConfigGlobal(configGlobals[id]); + const commentValue = enabledGlobals[id] && enabledGlobals[id].value; + const value = commentValue || configValue; + const sourceComments = enabledGlobals[id] && enabledGlobals[id].comments; + + if (value === "off") { + continue; + } + + let variable = globalScope.set.get(id); + + if (!variable) { + variable = new eslintScope.Variable(id, globalScope); + + globalScope.variables.push(variable); + globalScope.set.set(id, variable); + } + + variable.eslintImplicitGlobalSetting = configValue; + variable.eslintExplicitGlobal = sourceComments !== void 0; + variable.eslintExplicitGlobalComments = sourceComments; + variable.writeable = (value === "writable"); + } + + // mark all exported variables as such + Object.keys(exportedVariables).forEach(name => { + const variable = globalScope.set.get(name); + + if (variable) { + variable.eslintUsed = true; + } + }); + + /* + * "through" contains all references which definitions cannot be found. + * Since we augment the global scope using configuration, we need to update + * references and remove the ones that were added by configuration. + */ + globalScope.through = globalScope.through.filter(reference => { + const name = reference.identifier.name; + const variable = globalScope.set.get(name); + + if (variable) { + + /* + * Links the variable and the reference. + * And this reference is removed from `Scope#through`. + */ + reference.resolved = variable; + variable.references.push(reference); + + return false; + } + + return true; + }); +} + +/** + * creates a missing-rule message. + * @param {string} ruleId the ruleId to create + * @returns {string} created error message + * @private + */ +function createMissingRuleMessage(ruleId) { + return Object.prototype.hasOwnProperty.call(ruleReplacements.rules, ruleId) + ? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}` + : `Definition for rule '${ruleId}' was not found.`; +} + +/** + * creates a linting problem + * @param {Object} options to create linting error + * @param {string} [options.ruleId] the ruleId to report + * @param {Object} [options.loc] the loc to report + * @param {string} [options.message] the error message to report + * @param {string} [options.severity] the error message to report + * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId. + * @private + */ +function createLintingProblem(options) { + const { + ruleId = null, + loc = DEFAULT_ERROR_LOC, + message = createMissingRuleMessage(options.ruleId), + severity = 2 + } = options; + + return { + ruleId, + message, + line: loc.start.line, + column: loc.start.column + 1, + endLine: loc.end.line, + endColumn: loc.end.column + 1, + severity, + nodeType: null + }; +} + +/** + * Creates a collection of disable directives from a comment + * @param {Object} options to create disable directives + * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment + * @param {{line: number, column: number}} options.loc The 0-based location of the comment token + * @param {string} options.value The value after the directive in the comment + * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`) + * @param {function(string): {create: Function}} options.ruleMapper A map from rule IDs to defined rules + * @returns {Object} Directives and problems from the comment + */ +function createDisableDirectives(options) { + const { type, loc, value, ruleMapper } = options; + const ruleIds = Object.keys(commentParser.parseListConfig(value)); + const directiveRules = ruleIds.length ? ruleIds : [null]; + const result = { + directives: [], // valid disable directives + directiveProblems: [] // problems in directives + }; + + for (const ruleId of directiveRules) { + + // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/) + if (ruleId === null || ruleMapper(ruleId) !== null) { + result.directives.push({ type, line: loc.start.line, column: loc.start.column + 1, ruleId }); + } else { + result.directiveProblems.push(createLintingProblem({ ruleId, loc })); + } + } + return result; +} + +/** + * Remove the ignored part from a given directive comment and trim it. + * @param {string} value The comment text to strip. + * @returns {string} The stripped text. + */ +function stripDirectiveComment(value) { + return value.split(/\s-{2,}\s/u)[0].trim(); +} + +/** + * Parses comments in file to extract file-specific config of rules, globals + * and environments and merges them with global config; also code blocks + * where reporting is disabled or enabled and merges them with reporting config. + * @param {string} filename The file being checked. + * @param {ASTNode} ast The top node of the AST. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from. + * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}} + * A collection of the directive comments that were found, along with any problems that occurred when parsing + */ +function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { + const configuredRules = {}; + const enabledGlobals = Object.create(null); + const exportedVariables = {}; + const problems = []; + const disableDirectives = []; + const validator = new ConfigValidator({ + builtInRules: Rules + }); + + ast.comments.filter(token => token.type !== "Shebang").forEach(comment => { + const trimmedCommentText = stripDirectiveComment(comment.value); + const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText); + + if (!match) { + return; + } + const directiveText = match[1]; + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(directiveText); + + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + if (warnInlineConfig) { + const kind = comment.type === "Block" ? `/*${directiveText}*/` : `//${directiveText}`; + + problems.push(createLintingProblem({ + ruleId: null, + message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`, + loc: comment.loc, + severity: 1 + })); + return; + } + + if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) { + const message = `${directiveText} comment should not span multiple lines.`; + + problems.push(createLintingProblem({ + ruleId: null, + message, + loc: comment.loc + })); + return; + } + + const directiveValue = trimmedCommentText.slice(match.index + directiveText.length); + + switch (directiveText) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = directiveText.slice("eslint-".length); + const options = { type: directiveType, loc: comment.loc, value: directiveValue, ruleMapper }; + const { directives, directiveProblems } = createDisableDirectives(options); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + break; + } + + case "exported": + Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment)); + break; + + case "globals": + case "global": + for (const [id, { value }] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) { + let normalizedValue; + + try { + normalizedValue = ConfigOps.normalizeConfigGlobal(value); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: null, + loc: comment.loc, + message: err.message + })); + continue; + } + + if (enabledGlobals[id]) { + enabledGlobals[id].comments.push(comment); + enabledGlobals[id].value = normalizedValue; + } else { + enabledGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); + + if (parseResult.success) { + Object.keys(parseResult.config).forEach(name => { + const rule = ruleMapper(name); + const ruleValue = parseResult.config[name]; + + if (rule === null) { + problems.push(createLintingProblem({ ruleId: name, loc: comment.loc })); + return; + } + + try { + validator.validateRuleOptions(rule, name, ruleValue); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: name, + message: err.message, + loc: comment.loc + })); + + // do not apply the config, if found invalid options. + return; + } + + configuredRules[name] = ruleValue; + }); + } else { + problems.push(parseResult.error); + } + + break; + } + + // no default + } + }); + + return { + configuredRules, + enabledGlobals, + exportedVariables, + problems, + disableDirectives + }; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {number} ecmaVersion ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion) { + + /* + * Calculate ECMAScript edition number from official year version starting with + * ES2015, which corresponds with ES6 (or a difference of 2009). + */ + return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion; +} + +const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gu; + +/** + * Checks whether or not there is a comment which has "eslint-env *" in a given text. + * @param {string} text A source code text to check. + * @returns {Object|null} A result of parseListConfig() with "eslint-env *" comment. + */ +function findEslintEnv(text) { + let match, retv; + + eslintEnvPattern.lastIndex = 0; + + while ((match = eslintEnvPattern.exec(text)) !== null) { + retv = Object.assign( + retv || {}, + commentParser.parseListConfig(stripDirectiveComment(match[1])) + ); + } + + return retv; +} + +/** + * Convert "/path/to/" to "". + * `CLIEngine#executeOnText()` method gives "/path/to/" if the filename + * was omitted because `configArray.extractConfig()` requires an absolute path. + * But the linter should pass `` to `RuleContext#getFilename()` in that + * case. + * Also, code blocks can have their virtual filename. If the parent filename was + * ``, the virtual filename is `/0_foo.js` or something like (i.e., + * it's not an absolute path). + * @param {string} filename The filename to normalize. + * @returns {string} The normalized filename. + */ +function normalizeFilename(filename) { + const parts = filename.split(path.sep); + const index = parts.lastIndexOf(""); + + return index === -1 ? filename : parts.slice(index).join(path.sep); +} + +/** + * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a + * consistent shape. + * @param {VerifyOptions} providedOptions Options + * @param {ConfigData} config Config. + * @returns {Required & InternalOptions} Normalized options + */ +function normalizeVerifyOptions(providedOptions, config) { + const disableInlineConfig = config.noInlineConfig === true; + const ignoreInlineConfig = providedOptions.allowInlineConfig === false; + const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig + ? ` (${config.configNameOfNoInlineConfig})` + : ""; + + let reportUnusedDisableDirectives = providedOptions.reportUnusedDisableDirectives; + + if (typeof reportUnusedDisableDirectives === "boolean") { + reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off"; + } + if (typeof reportUnusedDisableDirectives !== "string") { + reportUnusedDisableDirectives = config.reportUnusedDisableDirectives ? "warn" : "off"; + } + + return { + filename: normalizeFilename(providedOptions.filename || ""), + allowInlineConfig: !ignoreInlineConfig, + warnInlineConfig: disableInlineConfig && !ignoreInlineConfig + ? `your config${configNameOfNoInlineConfig}` + : null, + reportUnusedDisableDirectives, + disableFixes: Boolean(providedOptions.disableFixes) + }; +} + +/** + * Combines the provided parserOptions with the options from environments + * @param {string} parserName The parser name which uses this options. + * @param {ParserOptions} providedOptions The provided 'parserOptions' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {ParserOptions} Resulting parser options after merge + */ +function resolveParserOptions(parserName, providedOptions, enabledEnvironments) { + const parserOptionsFromEnv = enabledEnvironments + .filter(env => env.parserOptions) + .reduce((parserOptions, env) => lodash.merge(parserOptions, env.parserOptions), {}); + const mergedParserOptions = lodash.merge(parserOptionsFromEnv, providedOptions || {}); + const isModule = mergedParserOptions.sourceType === "module"; + + if (isModule) { + + /* + * can't have global return inside of modules + * TODO: espree validate parserOptions.globalReturn when sourceType is setting to module.(@aladdin-add) + */ + mergedParserOptions.ecmaFeatures = Object.assign({}, mergedParserOptions.ecmaFeatures, { globalReturn: false }); + } + + /* + * TODO: @aladdin-add + * 1. for a 3rd-party parser, do not normalize parserOptions + * 2. for espree, no need to do this (espree will do it) + */ + mergedParserOptions.ecmaVersion = normalizeEcmaVersion(mergedParserOptions.ecmaVersion); + + return mergedParserOptions; +} + +/** + * Combines the provided globals object with the globals from environments + * @param {Record} providedGlobals The 'globals' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {Record} The resolved globals object + */ +function resolveGlobals(providedGlobals, enabledEnvironments) { + return Object.assign( + {}, + ...enabledEnvironments.filter(env => env.globals).map(env => env.globals), + providedGlobals + ); +} + +/** + * Strips Unicode BOM from a given text. + * @param {string} text A text to strip. + * @returns {string} The stripped text. + */ +function stripUnicodeBOM(text) { + + /* + * Check Unicode BOM. + * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF. + * http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters + */ + if (text.charCodeAt(0) === 0xFEFF) { + return text.slice(1); + } + return text; +} + +/** + * Get the options for a rule (not including severity), if any + * @param {Array|number} ruleConfig rule configuration + * @returns {Array} of rule options, empty Array if none + */ +function getRuleOptions(ruleConfig) { + if (Array.isArray(ruleConfig)) { + return ruleConfig.slice(1); + } + return []; + +} + +/** + * Analyze scope of the given AST. + * @param {ASTNode} ast The `Program` node to analyze. + * @param {ParserOptions} parserOptions The parser options. + * @param {Record} visitorKeys The visitor keys. + * @returns {ScopeManager} The analysis result. + */ +function analyzeScope(ast, parserOptions, visitorKeys) { + const ecmaFeatures = parserOptions.ecmaFeatures || {}; + const ecmaVersion = parserOptions.ecmaVersion || 5; + + return eslintScope.analyze(ast, { + ignoreEval: true, + nodejsScope: ecmaFeatures.globalReturn, + impliedStrict: ecmaFeatures.impliedStrict, + ecmaVersion, + sourceType: parserOptions.sourceType || "script", + childVisitorKeys: visitorKeys || evk.KEYS, + fallback: Traverser.getKeys + }); +} + +/** + * Parses text into an AST. Moved out here because the try-catch prevents + * optimization of functions, so it's best to keep the try-catch as isolated + * as possible + * @param {string} text The text to parse. + * @param {Parser} parser The parser to parse. + * @param {ParserOptions} providedParserOptions Options to pass to the parser + * @param {string} filePath The path to the file being parsed. + * @returns {{success: false, error: Problem}|{success: true, sourceCode: SourceCode}} + * An object containing the AST and parser services if parsing was successful, or the error if parsing failed + * @private + */ +function parse(text, parser, providedParserOptions, filePath) { + const textToParse = stripUnicodeBOM(text).replace(astUtils.shebangPattern, (match, captured) => `//${captured}`); + const parserOptions = Object.assign({}, providedParserOptions, { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + eslintVisitorKeys: true, + eslintScopeManager: true, + filePath + }); + + /* + * Check for parsing errors first. If there's a parsing error, nothing + * else can happen. However, a parsing error does not throw an error + * from this method - it's just considered a fatal error message, a + * problem that ESLint identified just like any other. + */ + try { + const parseResult = (typeof parser.parseForESLint === "function") + ? parser.parseForESLint(textToParse, parserOptions) + : { ast: parser.parse(textToParse, parserOptions) }; + const ast = parseResult.ast; + const parserServices = parseResult.services || {}; + const visitorKeys = parseResult.visitorKeys || evk.KEYS; + const scopeManager = parseResult.scopeManager || analyzeScope(ast, parserOptions, visitorKeys); + + return { + success: true, + + /* + * Save all values that `parseForESLint()` returned. + * If a `SourceCode` object is given as the first parameter instead of source code text, + * linter skips the parsing process and reuses the source code object. + * In that case, linter needs all the values that `parseForESLint()` returned. + */ + sourceCode: new SourceCode({ + text, + ast, + parserServices, + scopeManager, + visitorKeys + }) + }; + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + + debug("%s\n%s", message, ex.stack); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message, + line: ex.lineNumber, + column: ex.column + } + }; + } +} + +/** + * Gets the scope for the current node + * @param {ScopeManager} scopeManager The scope manager for this AST + * @param {ASTNode} currentNode The node to get the scope of + * @returns {eslint-scope.Scope} The scope information for this node + */ +function getScope(scopeManager, currentNode) { + + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== "Program"; + + for (let node = currentNode; node; node = node.parent) { + const scope = scopeManager.acquire(node, inner); + + if (scope) { + if (scope.type === "function-expression-name") { + return scope.childScopes[0]; + } + return scope; + } + } + + return scopeManager.scopes[0]; +} + +/** + * Marks a variable as used in the current scope + * @param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function. + * @param {ASTNode} currentNode The node currently being traversed + * @param {Object} parserOptions The options used to parse this text + * @param {string} name The name of the variable that should be marked as used. + * @returns {boolean} True if the variable was found and marked as used, false if not. + */ +function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) { + const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn; + const specialScope = hasGlobalReturn || parserOptions.sourceType === "module"; + const currentScope = getScope(scopeManager, currentNode); + + // Special Node.js scope means we need to start one level deeper + const initialScope = currentScope.type === "global" && specialScope ? currentScope.childScopes[0] : currentScope; + + for (let scope = initialScope; scope; scope = scope.upper) { + const variable = scope.variables.find(scopeVar => scopeVar.name === name); + + if (variable) { + variable.eslintUsed = true; + return true; + } + } + + return false; +} + +/** + * Runs a rule, and gets its listeners + * @param {Rule} rule A normalized rule with a `create` method + * @param {Context} ruleContext The context that should be passed to the rule + * @returns {Object} A map of selector listeners provided by the rule + */ +function createRuleListeners(rule, ruleContext) { + try { + return rule.create(ruleContext); + } catch (ex) { + ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`; + throw ex; + } +} + +/** + * Gets all the ancestors of a given node + * @param {ASTNode} node The node + * @returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node and going inwards to the parent node. + */ +function getAncestors(node) { + const ancestorsStartingAtParent = []; + + for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); +} + +// methods that exist on SourceCode object +const DEPRECATED_SOURCECODE_PASSTHROUGHS = { + getSource: "getText", + getSourceLines: "getLines", + getAllComments: "getAllComments", + getNodeByRangeIndex: "getNodeByRangeIndex", + getComments: "getComments", + getCommentsBefore: "getCommentsBefore", + getCommentsAfter: "getCommentsAfter", + getCommentsInside: "getCommentsInside", + getJSDocComment: "getJSDocComment", + getFirstToken: "getFirstToken", + getFirstTokens: "getFirstTokens", + getLastToken: "getLastToken", + getLastTokens: "getLastTokens", + getTokenAfter: "getTokenAfter", + getTokenBefore: "getTokenBefore", + getTokenByRangeStart: "getTokenByRangeStart", + getTokens: "getTokens", + getTokensAfter: "getTokensAfter", + getTokensBefore: "getTokensBefore", + getTokensBetween: "getTokensBetween" +}; + +const BASE_TRAVERSAL_CONTEXT = Object.freeze( + Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).reduce( + (contextInfo, methodName) => + Object.assign(contextInfo, { + [methodName](...args) { + return this.getSourceCode()[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...args); + } + }), + {} + ) +); + +/** + * Runs the given rules on the given SourceCode object + * @param {SourceCode} sourceCode A SourceCode object for the given text + * @param {Object} configuredRules The rules configuration + * @param {function(string): Rule} ruleMapper A mapper function from rule names to rules + * @param {Object} parserOptions The options that were passed to the parser + * @param {string} parserName The name of the parser in the config + * @param {Object} settings The settings that were enabled in the config + * @param {string} filename The reported filename of the code + * @param {boolean} disableFixes If true, it doesn't make `fix` properties. + * @param {string | undefined} cwd cwd of the cli + * @returns {Problem[]} An array of reported problems + */ +function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd) { + const emitter = createEmitter(); + const nodeQueue = []; + let currentNode = sourceCode.ast; + + Traverser.traverse(sourceCode.ast, { + enter(node, parent) { + node.parent = parent; + nodeQueue.push({ isEntering: true, node }); + }, + leave(node) { + nodeQueue.push({ isEntering: false, node }); + }, + visitorKeys: sourceCode.visitorKeys + }); + + /* + * Create a frozen object with the ruleContext properties and methods that are shared by all rules. + * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the + * properties once for each rule. + */ + const sharedTraversalContext = Object.freeze( + Object.assign( + Object.create(BASE_TRAVERSAL_CONTEXT), + { + getAncestors: () => getAncestors(currentNode), + getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager), + getCwd: () => cwd, + getFilename: () => filename, + getScope: () => getScope(sourceCode.scopeManager, currentNode), + getSourceCode: () => sourceCode, + markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, parserOptions, name), + parserOptions, + parserPath: parserName, + parserServices: sourceCode.parserServices, + settings + } + ) + ); + + + const lintingProblems = []; + + Object.keys(configuredRules).forEach(ruleId => { + const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); + + // not load disabled rules + if (severity === 0) { + return; + } + + const rule = ruleMapper(ruleId); + + if (rule === null) { + lintingProblems.push(createLintingProblem({ ruleId })); + return; + } + + const messageIds = rule.meta && rule.meta.messages; + let reportTranslator = null; + const ruleContext = Object.freeze( + Object.assign( + Object.create(sharedTraversalContext), + { + id: ruleId, + options: getRuleOptions(configuredRules[ruleId]), + report(...args) { + + /* + * Create a report translator lazily. + * In a vast majority of cases, any given rule reports zero errors on a given + * piece of code. Creating a translator lazily avoids the performance cost of + * creating a new translator function for each rule that usually doesn't get + * called. + * + * Using lazy report translators improves end-to-end performance by about 3% + * with Node 8.4.0. + */ + if (reportTranslator === null) { + reportTranslator = createReportTranslator({ + ruleId, + severity, + sourceCode, + messageIds, + disableFixes + }); + } + const problem = reportTranslator(...args); + + if (problem.fix && rule.meta && !rule.meta.fixable) { + throw new Error("Fixable rules should export a `meta.fixable` property."); + } + lintingProblems.push(problem); + } + } + ) + ); + + const ruleListeners = createRuleListeners(rule, ruleContext); + + // add all the selectors from the rule as listeners + Object.keys(ruleListeners).forEach(selector => { + emitter.on( + selector, + timing.enabled + ? timing.time(ruleId, ruleListeners[selector]) + : ruleListeners[selector] + ); + }); + }); + + // only run code path analyzer if the top level node is "Program", skip otherwise + const eventGenerator = nodeQueue[0].node.type === "Program" ? new CodePathAnalyzer(new NodeEventGenerator(emitter)) : new NodeEventGenerator(emitter); + + nodeQueue.forEach(traversalInfo => { + currentNode = traversalInfo.node; + + try { + if (traversalInfo.isEntering) { + eventGenerator.enterNode(currentNode); + } else { + eventGenerator.leaveNode(currentNode); + } + } catch (err) { + err.currentNode = currentNode; + throw err; + } + }); + + return lintingProblems; +} + +/** + * Ensure the source code to be a string. + * @param {string|SourceCode} textOrSourceCode The text or source code object. + * @returns {string} The source code text. + */ +function ensureText(textOrSourceCode) { + if (typeof textOrSourceCode === "object") { + const { hasBOM, text } = textOrSourceCode; + const bom = hasBOM ? "\uFEFF" : ""; + + return bom + text; + } + + return String(textOrSourceCode); +} + +/** + * Get an environment. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} envId The environment ID to get. + * @returns {Environment|null} The environment. + */ +function getEnv(slots, envId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginEnvironments.get(envId)) || + BuiltInEnvironments.get(envId) || + null + ); +} + +/** + * Get a rule. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|null} The rule. + */ +function getRule(slots, ruleId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginRules.get(ruleId)) || + slots.ruleMap.get(ruleId) + ); +} + +/** + * Normalize the value of the cwd + * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined. + * @returns {string | undefined} normalized cwd + */ +function normalizeCwd(cwd) { + if (cwd) { + return cwd; + } + if (typeof process === "object") { + return process.cwd(); + } + + // It's more explicit to assign the undefined + // eslint-disable-next-line no-undefined + return undefined; +} + +/** + * The map to store private data. + * @type {WeakMap} + */ +const internalSlotsMap = new WeakMap(); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object that is responsible for verifying JavaScript text + * @name eslint + */ +class Linter { + + /** + * Initialize the Linter. + * @param {Object} [config] the config object + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + */ + constructor({ cwd } = {}) { + internalSlotsMap.set(this, { + cwd: normalizeCwd(cwd), + lastConfigArray: null, + lastSourceCode: null, + parserMap: new Map([["espree", espree]]), + ruleMap: new Rules() + }); + + this.version = pkg.version; + } + + /** + * Getter for package version. + * @static + * @returns {string} The version from package.json. + */ + static get version() { + return pkg.version; + } + + /** + * Same as linter.verify, except without support for processors. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { + const slots = internalSlotsMap.get(this); + const config = providedConfig || {}; + const options = normalizeVerifyOptions(providedOptions, config); + let text; + + // evaluate arguments + if (typeof textOrSourceCode === "string") { + slots.lastSourceCode = null; + text = textOrSourceCode; + } else { + slots.lastSourceCode = textOrSourceCode; + text = textOrSourceCode.text; + } + + // Resolve parser. + let parserName = DEFAULT_PARSER_NAME; + let parser = espree; + + if (typeof config.parser === "object" && config.parser !== null) { + parserName = config.parser.filePath; + parser = config.parser.definition; + } else if (typeof config.parser === "string") { + if (!slots.parserMap.has(config.parser)) { + return [{ + ruleId: null, + fatal: true, + severity: 2, + message: `Configured parser '${config.parser}' was not found.`, + line: 0, + column: 0 + }]; + } + parserName = config.parser; + parser = slots.parserMap.get(config.parser); + } + + // search and apply "eslint-env *". + const envInFile = options.allowInlineConfig && !options.warnInlineConfig + ? findEslintEnv(text) + : {}; + const resolvedEnvConfig = Object.assign({ builtin: true }, config.env, envInFile); + const enabledEnvs = Object.keys(resolvedEnvConfig) + .filter(envName => resolvedEnvConfig[envName]) + .map(envName => getEnv(slots, envName)) + .filter(env => env); + + const parserOptions = resolveParserOptions(parserName, config.parserOptions || {}, enabledEnvs); + const configuredGlobals = resolveGlobals(config.globals || {}, enabledEnvs); + const settings = config.settings || {}; + + if (!slots.lastSourceCode) { + const parseResult = parse( + text, + parser, + parserOptions, + options.filename + ); + + if (!parseResult.success) { + return [parseResult.error]; + } + + slots.lastSourceCode = parseResult.sourceCode; + } else { + + /* + * If the given source code object as the first argument does not have scopeManager, analyze the scope. + * This is for backward compatibility (SourceCode is frozen so it cannot rebind). + */ + if (!slots.lastSourceCode.scopeManager) { + slots.lastSourceCode = new SourceCode({ + text: slots.lastSourceCode.text, + ast: slots.lastSourceCode.ast, + parserServices: slots.lastSourceCode.parserServices, + visitorKeys: slots.lastSourceCode.visitorKeys, + scopeManager: analyzeScope(slots.lastSourceCode.ast, parserOptions) + }); + } + } + + const sourceCode = slots.lastSourceCode; + const commentDirectives = options.allowInlineConfig + ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) + : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; + + // augment global scope with declared global variables + addDeclaredGlobals( + sourceCode.scopeManager.scopes[0], + configuredGlobals, + { exportedVariables: commentDirectives.exportedVariables, enabledGlobals: commentDirectives.enabledGlobals } + ); + + const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules); + + let lintingProblems; + + try { + lintingProblems = runRules( + sourceCode, + configuredRules, + ruleId => getRule(slots, ruleId), + parserOptions, + parserName, + settings, + options.filename, + options.disableFixes, + slots.cwd + ); + } catch (err) { + err.message += `\nOccurred while linting ${options.filename}`; + debug("An error occurred while traversing"); + debug("Filename:", options.filename); + if (err.currentNode) { + const { line } = err.currentNode.loc.start; + + debug("Line:", line); + err.message += `:${line}`; + } + debug("Parser Options:", parserOptions); + debug("Parser Path:", parserName); + debug("Settings:", settings); + throw err; + } + + return applyDisableDirectives({ + directives: commentDirectives.disableDirectives, + problems: lintingProblems + .concat(commentDirectives.problems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives + }); + } + + /** + * Verifies the text against the rules specified by the second argument. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData|ConfigArray} config An ESLintConfig instance to configure everything. + * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. If + * an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode, config, filenameOrOptions) { + debug("Verify"); + const options = typeof filenameOrOptions === "string" + ? { filename: filenameOrOptions } + : filenameOrOptions || {}; + + // CLIEngine passes a `ConfigArray` object. + if (config && typeof config.extractConfig === "function") { + return this._verifyWithConfigArray(textOrSourceCode, config, options); + } + + /* + * `Linter` doesn't support `overrides` property in configuration. + * So we cannot apply multiple processors. + */ + if (options.preprocess || options.postprocess) { + return this._verifyWithProcessor(textOrSourceCode, config, options); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify a given code with `ConfigArray`. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigArray} configArray The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @returns {LintMessage[]} The found problems. + */ + _verifyWithConfigArray(textOrSourceCode, configArray, options) { + debug("With ConfigArray: %s", options.filename); + + // Store the config array in order to get plugin envs and rules later. + internalSlotsMap.get(this).lastConfigArray = configArray; + + // Extract the final config for this file. + const config = configArray.extractConfig(options.filename); + const processor = + config.processor && + configArray.pluginProcessors.get(config.processor); + + // Verify. + if (processor) { + debug("Apply the processor: %o", config.processor); + const { preprocess, postprocess, supportsAutofix } = processor; + const disableFixes = options.disableFixes || !supportsAutofix; + + return this._verifyWithProcessor( + textOrSourceCode, + config, + { ...options, disableFixes, postprocess, preprocess }, + configArray + ); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify with a processor. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigData|ExtractedConfig} config The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. + * @returns {LintMessage[]} The found problems. + */ + _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) { + const filename = options.filename || ""; + const filenameToExpose = normalizeFilename(filename); + const text = ensureText(textOrSourceCode); + const preprocess = options.preprocess || (rawText => [rawText]); + const postprocess = options.postprocess || lodash.flatten; + const filterCodeBlock = + options.filterCodeBlock || + (blockFilename => blockFilename.endsWith(".js")); + const originalExtname = path.extname(filename); + const messageLists = preprocess(text, filenameToExpose).map((block, i) => { + debug("A code block was found: %o", block.filename || "(unnamed)"); + + // Keep the legacy behavior. + if (typeof block === "string") { + return this._verifyWithoutProcessors(block, config, options); + } + + const blockText = block.text; + const blockName = path.join(filename, `${i}_${block.filename}`); + + // Skip this block if filtered. + if (!filterCodeBlock(blockName, blockText)) { + debug("This code block was skipped."); + return []; + } + + // Resolve configuration again if the file extension was changed. + if (configForRecursive && path.extname(blockName) !== originalExtname) { + debug("Resolving configuration again because the file extension was changed."); + return this._verifyWithConfigArray( + blockText, + configForRecursive, + { ...options, filename: blockName } + ); + } + + // Does lint. + return this._verifyWithoutProcessors( + blockText, + config, + { ...options, filename: blockName } + ); + }); + + return postprocess(messageLists, filenameToExpose); + } + + /** + * Gets the SourceCode object representing the parsed source. + * @returns {SourceCode} The SourceCode object. + */ + getSourceCode() { + return internalSlotsMap.get(this).lastSourceCode; + } + + /** + * Defines a new linting rule. + * @param {string} ruleId A unique rule identifier + * @param {Function | Rule} ruleModule Function from context to object mapping AST node types to event handlers + * @returns {void} + */ + defineRule(ruleId, ruleModule) { + internalSlotsMap.get(this).ruleMap.define(ruleId, ruleModule); + } + + /** + * Defines many new linting rules. + * @param {Record} rulesToDefine map from unique rule identifier to rule + * @returns {void} + */ + defineRules(rulesToDefine) { + Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { + this.defineRule(ruleId, rulesToDefine[ruleId]); + }); + } + + /** + * Gets an object with all loaded rules. + * @returns {Map} All loaded rules + */ + getRules() { + const { lastConfigArray, ruleMap } = internalSlotsMap.get(this); + + return new Map(function *() { + yield* ruleMap; + + if (lastConfigArray) { + yield* lastConfigArray.pluginRules; + } + }()); + } + + /** + * Define a new parser module + * @param {string} parserId Name of the parser + * @param {Parser} parserModule The parser object + * @returns {void} + */ + defineParser(parserId, parserModule) { + internalSlotsMap.get(this).parserMap.set(parserId, parserModule); + } + + /** + * Performs multiple autofix passes over the text until as many fixes as possible + * have been applied. + * @param {string} text The source text to apply fixes to. + * @param {ConfigData|ConfigArray} config The ESLint config object to use. + * @param {VerifyOptions&ProcessorOptions&FixOptions} options The ESLint options object to use. + * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the + * SourceCodeFixer. + */ + verifyAndFix(text, config, options) { + let messages = [], + fixedResult, + fixed = false, + passNumber = 0, + currentText = text; + const debugTextDescription = options && options.filename || `${text.slice(0, 10)}...`; + const shouldFix = options && typeof options.fix !== "undefined" ? options.fix : true; + + /** + * This loop continues until one of the following is true: + * + * 1. No more fixes have been applied. + * 2. Ten passes have been made. + * + * That means anytime a fix is successfully applied, there will be another pass. + * Essentially, guaranteeing a minimum of two passes. + */ + do { + passNumber++; + + debug(`Linting code for ${debugTextDescription} (pass ${passNumber})`); + messages = this.verify(currentText, config, options); + + debug(`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`); + fixedResult = SourceCodeFixer.applyFixes(currentText, messages, shouldFix); + + /* + * stop if there are any syntax errors. + * 'fixedResult.output' is a empty string. + */ + if (messages.length === 1 && messages[0].fatal) { + break; + } + + // keep track if any fixes were ever applied - important for return value + fixed = fixed || fixedResult.fixed; + + // update to use the fixed output instead of the original text + currentText = fixedResult.output; + + } while ( + fixedResult.fixed && + passNumber < MAX_AUTOFIX_PASSES + ); + + /* + * If the last result had fixes, we need to lint again to be sure we have + * the most up-to-date information. + */ + if (fixedResult.fixed) { + fixedResult.messages = this.verify(currentText, config, options); + } + + // ensure the last result properly reflects if fixes were done + fixedResult.fixed = fixed; + fixedResult.output = currentText; + + return fixedResult; + } +} + +module.exports = { + Linter, + + /** + * Get the internal slots of a given Linter instance for tests. + * @param {Linter} instance The Linter instance to get. + * @returns {LinterInternalSlots} The internal slots. + */ + getLinterInternalSlots(instance) { + return internalSlotsMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/linter/node-event-generator.js b/node_modules/eslint/lib/linter/node-event-generator.js new file mode 100644 index 0000000..6f3b251 --- /dev/null +++ b/node_modules/eslint/lib/linter/node-event-generator.js @@ -0,0 +1,311 @@ +/** + * @fileoverview The event generator for AST nodes. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esquery = require("esquery"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An object describing an AST selector + * @typedef {Object} ASTSelector + * @property {string} rawSelector The string that was parsed into this selector + * @property {boolean} isExit `true` if this should be emitted when exiting the node rather than when entering + * @property {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @property {string[]|null} listenerTypes A list of node types that could possibly cause the selector to match, + * or `null` if all node types could cause a match + * @property {number} attributeCount The total number of classes, pseudo-classes, and attribute queries in this selector + * @property {number} identifierCount The total number of identifier queries in this selector + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the possible types of a selector + * @param {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it + */ +function getPossibleTypes(parsedSelector) { + switch (parsedSelector.type) { + case "identifier": + return [parsedSelector.value]; + + case "matches": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes); + + if (typesForComponents.every(Boolean)) { + return lodash.union(...typesForComponents); + } + return null; + } + + case "compound": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes).filter(typesForComponent => typesForComponent); + + // If all of the components could match any type, then the compound could also match any type. + if (!typesForComponents.length) { + return null; + } + + /* + * If at least one of the components could only match a particular type, the compound could only match + * the intersection of those types. + */ + return lodash.intersection(...typesForComponents); + } + + case "child": + case "descendant": + case "sibling": + case "adjacent": + return getPossibleTypes(parsedSelector.right); + + default: + return null; + + } +} + +/** + * Counts the number of class, pseudo-class, and attribute queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of class, pseudo-class, and attribute queries in this selector + */ +function countClassAttributes(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countClassAttributes(parsedSelector.left) + countClassAttributes(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countClassAttributes(childSelector), 0); + + case "attribute": + case "field": + case "nth-child": + case "nth-last-child": + return 1; + + default: + return 0; + } +} + +/** + * Counts the number of identifier queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of identifier queries + */ +function countIdentifiers(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countIdentifiers(childSelector), 0); + + case "identifier": + return 1; + + default: + return 0; + } +} + +/** + * Compares the specificity of two selector objects, with CSS-like rules. + * @param {ASTSelector} selectorA An AST selector descriptor + * @param {ASTSelector} selectorB Another AST selector descriptor + * @returns {number} + * a value less than 0 if selectorA is less specific than selectorB + * a value greater than 0 if selectorA is more specific than selectorB + * a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically + * a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically + */ +function compareSpecificity(selectorA, selectorB) { + return selectorA.attributeCount - selectorB.attributeCount || + selectorA.identifierCount - selectorB.identifierCount || + (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1); +} + +/** + * Parses a raw selector string, and throws a useful error if parsing fails. + * @param {string} rawSelector A raw AST selector + * @returns {Object} An object (from esquery) describing the matching behavior of this selector + * @throws {Error} An error if the selector is invalid + */ +function tryParseSelector(rawSelector) { + try { + return esquery.parse(rawSelector.replace(/:exit$/u, "")); + } catch (err) { + if (err.location && err.location.start && typeof err.location.start.offset === "number") { + throw new SyntaxError(`Syntax error in selector "${rawSelector}" at position ${err.location.start.offset}: ${err.message}`); + } + throw err; + } +} + +/** + * Parses a raw selector string, and returns the parsed selector along with specificity and type information. + * @param {string} rawSelector A raw AST selector + * @returns {ASTSelector} A selector descriptor + */ +const parseSelector = lodash.memoize(rawSelector => { + const parsedSelector = tryParseSelector(rawSelector); + + return { + rawSelector, + isExit: rawSelector.endsWith(":exit"), + parsedSelector, + listenerTypes: getPossibleTypes(parsedSelector), + attributeCount: countClassAttributes(parsedSelector), + identifierCount: countIdentifiers(parsedSelector) + }; +}); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The event generator for AST nodes. + * This implements below interface. + * + * ```ts + * interface EventGenerator { + * emitter: SafeEmitter; + * enterNode(node: ASTNode): void; + * leaveNode(node: ASTNode): void; + * } + * ``` + */ +class NodeEventGenerator { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {SafeEmitter} emitter + * An SafeEmitter which is the destination of events. This emitter must already + * have registered listeners for all of the events that it needs to listen for. + * (See lib/linter/safe-emitter.js for more details on `SafeEmitter`.) + * @returns {NodeEventGenerator} new instance + */ + constructor(emitter) { + this.emitter = emitter; + this.currentAncestry = []; + this.enterSelectorsByNodeType = new Map(); + this.exitSelectorsByNodeType = new Map(); + this.anyTypeEnterSelectors = []; + this.anyTypeExitSelectors = []; + + emitter.eventNames().forEach(rawSelector => { + const selector = parseSelector(rawSelector); + + if (selector.listenerTypes) { + const typeMap = selector.isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType; + + selector.listenerTypes.forEach(nodeType => { + if (!typeMap.has(nodeType)) { + typeMap.set(nodeType, []); + } + typeMap.get(nodeType).push(selector); + }); + return; + } + const selectors = selector.isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + selectors.push(selector); + }); + + this.anyTypeEnterSelectors.sort(compareSpecificity); + this.anyTypeExitSelectors.sort(compareSpecificity); + this.enterSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + this.exitSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + } + + /** + * Checks a selector against a node, and emits it if it matches + * @param {ASTNode} node The node to check + * @param {ASTSelector} selector An AST selector descriptor + * @returns {void} + */ + applySelector(node, selector) { + if (esquery.matches(node, selector.parsedSelector, this.currentAncestry)) { + this.emitter.emit(selector.rawSelector, node); + } + } + + /** + * Applies all appropriate selectors to a node, in specificity order + * @param {ASTNode} node The node to check + * @param {boolean} isExit `false` if the node is currently being entered, `true` if it's currently being exited + * @returns {void} + */ + applySelectors(node, isExit) { + const selectorsByNodeType = (isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType).get(node.type) || []; + const anyTypeSelectors = isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + /* + * selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor. + * Iterate through each of them, applying selectors in the right order. + */ + let selectorsByTypeIndex = 0; + let anyTypeSelectorsIndex = 0; + + while (selectorsByTypeIndex < selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length) { + if ( + selectorsByTypeIndex >= selectorsByNodeType.length || + anyTypeSelectorsIndex < anyTypeSelectors.length && + compareSpecificity(anyTypeSelectors[anyTypeSelectorsIndex], selectorsByNodeType[selectorsByTypeIndex]) < 0 + ) { + this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]); + } else { + this.applySelector(node, selectorsByNodeType[selectorsByTypeIndex++]); + } + } + } + + /** + * Emits an event of entering AST node. + * @param {ASTNode} node A node which was entered. + * @returns {void} + */ + enterNode(node) { + if (node.parent) { + this.currentAncestry.unshift(node.parent); + } + this.applySelectors(node, false); + } + + /** + * Emits an event of leaving AST node. + * @param {ASTNode} node A node which was left. + * @returns {void} + */ + leaveNode(node) { + this.applySelectors(node, true); + this.currentAncestry.shift(); + } +} + +module.exports = NodeEventGenerator; diff --git a/node_modules/eslint/lib/linter/report-translator.js b/node_modules/eslint/lib/linter/report-translator.js new file mode 100644 index 0000000..eef5165 --- /dev/null +++ b/node_modules/eslint/lib/linter/report-translator.js @@ -0,0 +1,347 @@ +/** + * @fileoverview A helper that translates context.report() calls from the rule API into generic problem objects + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const ruleFixer = require("./rule-fixer"); +const interpolate = require("./interpolate"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An error message description + * @typedef {Object} MessageDescriptor + * @property {ASTNode} [node] The reported node + * @property {Location} loc The location of the problem. + * @property {string} message The problem message. + * @property {Object} [data] Optional data to use to fill in placeholders in the + * message. + * @property {Function} [fix] The function to call that creates a fix command. + * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes. + */ + +/** + * Information about the report + * @typedef {Object} ReportInfo + * @property {string} ruleId + * @property {(0|1|2)} severity + * @property {(string|undefined)} message + * @property {(string|undefined)} [messageId] + * @property {number} line + * @property {number} column + * @property {(number|undefined)} [endLine] + * @property {(number|undefined)} [endColumn] + * @property {(string|null)} nodeType + * @property {string} source + * @property {({text: string, range: (number[]|null)}|null)} [fix] + * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] + */ + +//------------------------------------------------------------------------------ +// Module Definition +//------------------------------------------------------------------------------ + + +/** + * Translates a multi-argument context.report() call into a single object argument call + * @param {...*} args A list of arguments passed to `context.report` + * @returns {MessageDescriptor} A normalized object containing report information + */ +function normalizeMultiArgReportCall(...args) { + + // If there is one argument, it is considered to be a new-style call already. + if (args.length === 1) { + + // Shallow clone the object to avoid surprises if reusing the descriptor + return Object.assign({}, args[0]); + } + + // If the second argument is a string, the arguments are interpreted as [node, message, data, fix]. + if (typeof args[1] === "string") { + return { + node: args[0], + message: args[1], + data: args[2], + fix: args[3] + }; + } + + // Otherwise, the arguments are interpreted as [node, loc, message, data, fix]. + return { + node: args[0], + loc: args[1], + message: args[2], + data: args[3], + fix: args[4] + }; +} + +/** + * Asserts that either a loc or a node was provided, and the node is valid if it was provided. + * @param {MessageDescriptor} descriptor A descriptor to validate + * @returns {void} + * @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object + */ +function assertValidNodeInfo(descriptor) { + if (descriptor.node) { + assert(typeof descriptor.node === "object", "Node must be an object"); + } else { + assert(descriptor.loc, "Node must be provided when reporting error if location is not provided"); + } +} + +/** + * Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties + * @param {MessageDescriptor} descriptor A descriptor for the report from a rule. + * @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties + * from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor. + */ +function normalizeReportLoc(descriptor) { + if (descriptor.loc) { + if (descriptor.loc.start) { + return descriptor.loc; + } + return { start: descriptor.loc, end: null }; + } + return descriptor.node.loc; +} + +/** + * Compares items in a fixes array by range. + * @param {Fix} a The first message. + * @param {Fix} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareFixesByRange(a, b) { + return a.range[0] - b.range[0] || a.range[1] - b.range[1]; +} + +/** + * Merges the given fixes array into one. + * @param {Fix[]} fixes The fixes to merge. + * @param {SourceCode} sourceCode The source code object to get the text between fixes. + * @returns {{text: string, range: number[]}} The merged fixes + */ +function mergeFixes(fixes, sourceCode) { + if (fixes.length === 0) { + return null; + } + if (fixes.length === 1) { + return fixes[0]; + } + + fixes.sort(compareFixesByRange); + + const originalText = sourceCode.text; + const start = fixes[0].range[0]; + const end = fixes[fixes.length - 1].range[1]; + let text = ""; + let lastPos = Number.MIN_SAFE_INTEGER; + + for (const fix of fixes) { + assert(fix.range[0] >= lastPos, "Fix objects must not be overlapped in a report."); + + if (fix.range[0] >= 0) { + text += originalText.slice(Math.max(0, start, lastPos), fix.range[0]); + } + text += fix.text; + lastPos = fix.range[1]; + } + text += originalText.slice(Math.max(0, start, lastPos), end); + + return { range: [start, end], text }; +} + +/** + * Gets one fix object from the given descriptor. + * If the descriptor retrieves multiple fixes, this merges those to one. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @returns {({text: string, range: number[]}|null)} The fix for the descriptor + */ +function normalizeFixes(descriptor, sourceCode) { + if (typeof descriptor.fix !== "function") { + return null; + } + + // @type {null | Fix | Fix[] | IterableIterator} + const fix = descriptor.fix(ruleFixer); + + // Merge to one. + if (fix && Symbol.iterator in fix) { + return mergeFixes(Array.from(fix), sourceCode); + } + return fix; +} + +/** + * Gets an array of suggestion objects from the given descriptor. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @param {Object} messages Object of meta messages for the rule. + * @returns {Array} The suggestions for the descriptor + */ +function mapSuggestions(descriptor, sourceCode, messages) { + if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) { + return []; + } + + return descriptor.suggest.map(suggestInfo => { + const computedDesc = suggestInfo.desc || messages[suggestInfo.messageId]; + + return { + ...suggestInfo, + desc: interpolate(computedDesc, suggestInfo.data), + fix: normalizeFixes(suggestInfo, sourceCode) + }; + }); +} + +/** + * Creates information about the report from a descriptor + * @param {Object} options Information about the problem + * @param {string} options.ruleId Rule ID + * @param {(0|1|2)} options.severity Rule severity + * @param {(ASTNode|null)} options.node Node + * @param {string} options.message Error message + * @param {string} [options.messageId] The error message ID. + * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location + * @param {{text: string, range: (number[]|null)}} options.fix The fix object + * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects + * @returns {function(...args): ReportInfo} Function that returns information about the report + */ +function createProblem(options) { + const problem = { + ruleId: options.ruleId, + severity: options.severity, + message: options.message, + line: options.loc.start.line, + column: options.loc.start.column + 1, + nodeType: options.node && options.node.type || null + }; + + /* + * If this isn’t in the conditional, some of the tests fail + * because `messageId` is present in the problem object + */ + if (options.messageId) { + problem.messageId = options.messageId; + } + + if (options.loc.end) { + problem.endLine = options.loc.end.line; + problem.endColumn = options.loc.end.column + 1; + } + + if (options.fix) { + problem.fix = options.fix; + } + + if (options.suggestions && options.suggestions.length > 0) { + problem.suggestions = options.suggestions; + } + + return problem; +} + +/** + * Validates that suggestions are properly defined. Throws if an error is detected. + * @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data. + * @param {Object} messages Object of meta messages for the rule. + * @returns {void} + */ +function validateSuggestions(suggest, messages) { + if (suggest && Array.isArray(suggest)) { + suggest.forEach(suggestion => { + if (suggestion.messageId) { + const { messageId } = suggestion; + + if (!messages) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`); + } + + if (!messages[messageId]) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + + if (suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one."); + } + } else if (!suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that doesn't have either a `desc` or `messageId`"); + } + + if (typeof suggestion.fix !== "function") { + throw new TypeError(`context.report() called with a suggest option without a fix function. See: ${suggestion}`); + } + }); + } +} + +/** + * Returns a function that converts the arguments of a `context.report` call from a rule into a reported + * problem for the Node.js API. + * @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object, disableFixes: boolean}} metadata Metadata for the reported problem + * @param {SourceCode} sourceCode The `SourceCode` instance for the text being linted + * @returns {function(...args): ReportInfo} Function that returns information about the report + */ + +module.exports = function createReportTranslator(metadata) { + + /* + * `createReportTranslator` gets called once per enabled rule per file. It needs to be very performant. + * The report translator itself (i.e. the function that `createReportTranslator` returns) gets + * called every time a rule reports a problem, which happens much less frequently (usually, the vast + * majority of rules don't report any problems for a given file). + */ + return (...args) => { + const descriptor = normalizeMultiArgReportCall(...args); + const messages = metadata.messageIds; + + assertValidNodeInfo(descriptor); + + let computedMessage; + + if (descriptor.messageId) { + if (!messages) { + throw new TypeError("context.report() called with a messageId, but no messages were present in the rule metadata."); + } + const id = descriptor.messageId; + + if (descriptor.message) { + throw new TypeError("context.report() called with a message and a messageId. Please only pass one."); + } + if (!messages || !Object.prototype.hasOwnProperty.call(messages, id)) { + throw new TypeError(`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + computedMessage = messages[id]; + } else if (descriptor.message) { + computedMessage = descriptor.message; + } else { + throw new TypeError("Missing `message` property in report() call; add a message that describes the linting problem."); + } + + validateSuggestions(descriptor.suggest, messages); + + return createProblem({ + ruleId: metadata.ruleId, + severity: metadata.severity, + node: descriptor.node, + message: interpolate(computedMessage, descriptor.data), + messageId: descriptor.messageId, + loc: normalizeReportLoc(descriptor), + fix: metadata.disableFixes ? null : normalizeFixes(descriptor, metadata.sourceCode), + suggestions: metadata.disableFixes ? [] : mapSuggestions(descriptor, metadata.sourceCode, messages) + }); + }; +}; diff --git a/node_modules/eslint/lib/linter/rule-fixer.js b/node_modules/eslint/lib/linter/rule-fixer.js new file mode 100644 index 0000000..bdd80d1 --- /dev/null +++ b/node_modules/eslint/lib/linter/rule-fixer.js @@ -0,0 +1,140 @@ +/** + * @fileoverview An object that creates fix commands for rules. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates a fix command that inserts text at the specified index in the source text. + * @param {int} index The 0-based index at which to insert the new text. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + * @private + */ +function insertTextAt(index, text) { + return { + range: [index, index], + text + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Creates code fixing commands for rules. + */ + +const ruleFixer = Object.freeze({ + + /** + * Creates a fix command that inserts text after the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert after. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfter(nodeOrToken, text) { + return this.insertTextAfterRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text after the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfterRange(range, text) { + return insertTextAt(range[1], text); + }, + + /** + * Creates a fix command that inserts text before the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert before. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBefore(nodeOrToken, text) { + return this.insertTextBeforeRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text before the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBeforeRange(range, text) { + return insertTextAt(range[0], text); + }, + + /** + * Creates a fix command that replaces text at the node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceText(nodeOrToken, text) { + return this.replaceTextRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that replaces text at the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + return { + range, + text + }; + }, + + /** + * Creates a fix command that removes the node or token from the source. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.removeRange(nodeOrToken.range); + }, + + /** + * Creates a fix command that removes the specified range of text from the source. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to remove, first item is start of range, second + * is end of range. + * @returns {Object} The fix command. + */ + removeRange(range) { + return { + range, + text: "" + }; + } + +}); + + +module.exports = ruleFixer; diff --git a/node_modules/eslint/lib/linter/rules.js b/node_modules/eslint/lib/linter/rules.js new file mode 100644 index 0000000..a153266 --- /dev/null +++ b/node_modules/eslint/lib/linter/rules.js @@ -0,0 +1,77 @@ +/** + * @fileoverview Defines a storage for rules. + * @author Nicholas C. Zakas + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Normalizes a rule module to the new-style API + * @param {(Function|{create: Function})} rule A rule object, which can either be a function + * ("old-style") or an object with a `create` method ("new-style") + * @returns {{create: Function}} A new-style rule. + */ +function normalizeRule(rule) { + return typeof rule === "function" ? Object.assign({ create: rule }, rule) : rule; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class Rules { + constructor() { + this._rules = Object.create(null); + } + + /** + * Registers a rule module for rule id in storage. + * @param {string} ruleId Rule id (file name). + * @param {Function} ruleModule Rule handler. + * @returns {void} + */ + define(ruleId, ruleModule) { + this._rules[ruleId] = normalizeRule(ruleModule); + } + + /** + * Access rule handler by id (file name). + * @param {string} ruleId Rule id (file name). + * @returns {{create: Function, schema: JsonSchema[]}} + * A rule. This is normalized to always have the new-style shape with a `create` method. + */ + get(ruleId) { + if (typeof this._rules[ruleId] === "string") { + this.define(ruleId, require(this._rules[ruleId])); + } + if (this._rules[ruleId]) { + return this._rules[ruleId]; + } + if (builtInRules.has(ruleId)) { + return builtInRules.get(ruleId); + } + + return null; + } + + *[Symbol.iterator]() { + yield* builtInRules; + + for (const ruleId of Object.keys(this._rules)) { + yield [ruleId, this.get(ruleId)]; + } + } +} + +module.exports = Rules; diff --git a/node_modules/eslint/lib/linter/safe-emitter.js b/node_modules/eslint/lib/linter/safe-emitter.js new file mode 100644 index 0000000..ab21223 --- /dev/null +++ b/node_modules/eslint/lib/linter/safe-emitter.js @@ -0,0 +1,52 @@ +/** + * @fileoverview A variant of EventEmitter which does not give listeners information about each other + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An event emitter + * @typedef {Object} SafeEmitter + * @property {function(eventName: string, listenerFunc: Function): void} on Adds a listener for a given event name + * @property {function(eventName: string, arg1?: any, arg2?: any, arg3?: any)} emit Emits an event with a given name. + * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments. + * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners. + */ + +/** + * Creates an object which can listen for and emit events. + * This is similar to the EventEmitter API in Node's standard library, but it has a few differences. + * The goal is to allow multiple modules to attach arbitrary listeners to the same emitter, without + * letting the modules know about each other at all. + * 1. It has no special keys like `error` and `newListener`, which would allow modules to detect when + * another module throws an error or registers a listener. + * 2. It calls listener functions without any `this` value. (`EventEmitter` calls listeners with a + * `this` value of the emitter instance, which would give listeners access to other listeners.) + * @returns {SafeEmitter} An emitter + */ +module.exports = () => { + const listeners = Object.create(null); + + return Object.freeze({ + on(eventName, listener) { + if (eventName in listeners) { + listeners[eventName].push(listener); + } else { + listeners[eventName] = [listener]; + } + }, + emit(eventName, ...args) { + if (eventName in listeners) { + listeners[eventName].forEach(listener => listener(...args)); + } + }, + eventNames() { + return Object.keys(listeners); + } + }); +}; diff --git a/node_modules/eslint/lib/linter/source-code-fixer.js b/node_modules/eslint/lib/linter/source-code-fixer.js new file mode 100644 index 0000000..53dc1dc --- /dev/null +++ b/node_modules/eslint/lib/linter/source-code-fixer.js @@ -0,0 +1,152 @@ +/** + * @fileoverview An object that caches and applies source code fixes. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:source-code-fixer"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const BOM = "\uFEFF"; + +/** + * Compares items in a messages array by range. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByFixRange(a, b) { + return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1]; +} + +/** + * Compares items in a messages array by line and column. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByLocation(a, b) { + return a.line - b.line || a.column - b.column; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Utility for apply fixes to source code. + * @constructor + */ +function SourceCodeFixer() { + Object.freeze(this); +} + +/** + * Applies the fixes specified by the messages to the given text. Tries to be + * smart about the fixes and won't apply fixes over the same area in the text. + * @param {string} sourceText The text to apply the changes to. + * @param {Message[]} messages The array of messages reported by ESLint. + * @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed + * @returns {Object} An object containing the fixed text and any unfixed messages. + */ +SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) { + debug("Applying fixes"); + + if (shouldFix === false) { + debug("shouldFix parameter was false, not attempting fixes"); + return { + fixed: false, + messages, + output: sourceText + }; + } + + // clone the array + const remainingMessages = [], + fixes = [], + bom = sourceText.startsWith(BOM) ? BOM : "", + text = bom ? sourceText.slice(1) : sourceText; + let lastPos = Number.NEGATIVE_INFINITY, + output = bom; + + /** + * Try to use the 'fix' from a problem. + * @param {Message} problem The message object to apply fixes from + * @returns {boolean} Whether fix was successfully applied + */ + function attemptFix(problem) { + const fix = problem.fix; + const start = fix.range[0]; + const end = fix.range[1]; + + // Remain it as a problem if it's overlapped or it's a negative range + if (lastPos >= start || start > end) { + remainingMessages.push(problem); + return false; + } + + // Remove BOM. + if ((start < 0 && end >= 0) || (start === 0 && fix.text.startsWith(BOM))) { + output = ""; + } + + // Make output to this fix. + output += text.slice(Math.max(0, lastPos), Math.max(0, start)); + output += fix.text; + lastPos = end; + return true; + } + + messages.forEach(problem => { + if (Object.prototype.hasOwnProperty.call(problem, "fix")) { + fixes.push(problem); + } else { + remainingMessages.push(problem); + } + }); + + if (fixes.length) { + debug("Found fixes to apply"); + let fixesWereApplied = false; + + for (const problem of fixes.sort(compareMessagesByFixRange)) { + if (typeof shouldFix !== "function" || shouldFix(problem)) { + attemptFix(problem); + + /* + * The only time attemptFix will fail is if a previous fix was + * applied which conflicts with it. So we can mark this as true. + */ + fixesWereApplied = true; + } else { + remainingMessages.push(problem); + } + } + output += text.slice(Math.max(0, lastPos)); + + return { + fixed: fixesWereApplied, + messages: remainingMessages.sort(compareMessagesByLocation), + output + }; + } + + debug("No fixes to apply"); + return { + fixed: false, + messages, + output: bom + text + }; + +}; + +module.exports = SourceCodeFixer; diff --git a/node_modules/eslint/lib/linter/timing.js b/node_modules/eslint/lib/linter/timing.js new file mode 100644 index 0000000..8396d92 --- /dev/null +++ b/node_modules/eslint/lib/linter/timing.js @@ -0,0 +1,139 @@ +/** + * @fileoverview Tracks performance of individual rules. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* istanbul ignore next */ +/** + * Align the string to left + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignLeft(str, len, ch) { + return str + new Array(len - str.length + 1).join(ch || " "); +} + +/* istanbul ignore next */ +/** + * Align the string to right + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignRight(str, len, ch) { + return new Array(len - str.length + 1).join(ch || " ") + str; +} + +//------------------------------------------------------------------------------ +// Module definition +//------------------------------------------------------------------------------ + +const enabled = !!process.env.TIMING; + +const HEADERS = ["Rule", "Time (ms)", "Relative"]; +const ALIGN = [alignLeft, alignRight, alignRight]; + +/* istanbul ignore next */ +/** + * display the data + * @param {Object} data Data object to be displayed + * @returns {void} prints modified string with console.log + * @private + */ +function display(data) { + let total = 0; + const rows = Object.keys(data) + .map(key => { + const time = data[key]; + + total += time; + return [key, time]; + }) + .sort((a, b) => b[1] - a[1]) + .slice(0, 10); + + rows.forEach(row => { + row.push(`${(row[1] * 100 / total).toFixed(1)}%`); + row[1] = row[1].toFixed(3); + }); + + rows.unshift(HEADERS); + + const widths = []; + + rows.forEach(row => { + const len = row.length; + + for (let i = 0; i < len; i++) { + const n = row[i].length; + + if (!widths[i] || n > widths[i]) { + widths[i] = n; + } + } + }); + + const table = rows.map(row => ( + row + .map((cell, index) => ALIGN[index](cell, widths[index])) + .join(" | ") + )); + + table.splice(1, 0, widths.map((width, index) => { + const extraAlignment = index !== 0 && index !== widths.length - 1 ? 2 : 1; + + return ALIGN[index](":", width + extraAlignment, "-"); + }).join("|")); + + console.log(table.join("\n")); // eslint-disable-line no-console +} + +/* istanbul ignore next */ +module.exports = (function() { + + const data = Object.create(null); + + /** + * Time the run + * @param {*} key key from the data object + * @param {Function} fn function to be called + * @returns {Function} function to be executed + * @private + */ + function time(key, fn) { + if (typeof data[key] === "undefined") { + data[key] = 0; + } + + return function(...args) { + let t = process.hrtime(); + + fn(...args); + t = process.hrtime(t); + data[key] += t[0] * 1e3 + t[1] / 1e6; + }; + } + + if (enabled) { + process.on("exit", () => { + display(data); + }); + } + + return { + time, + enabled + }; + +}()); diff --git a/node_modules/eslint/lib/options.js b/node_modules/eslint/lib/options.js new file mode 100644 index 0000000..1681f1d --- /dev/null +++ b/node_modules/eslint/lib/options.js @@ -0,0 +1,262 @@ +/** + * @fileoverview Options configuration for optionator. + * @author George Zahariev + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const optionator = require("optionator"); + +//------------------------------------------------------------------------------ +// Initialization and Public Interface +//------------------------------------------------------------------------------ + +// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" +module.exports = optionator({ + prepend: "eslint [options] file.js [file.js] [dir]", + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true + }, + options: [ + { + heading: "Basic configuration" + }, + { + option: "eslintrc", + type: "Boolean", + default: "true", + description: "Disable use of configuration from .eslintrc.*" + }, + { + option: "config", + alias: "c", + type: "path::String", + description: "Use this configuration, overriding .eslintrc.* config options if present" + }, + { + option: "env", + type: "[String]", + description: "Specify environments" + }, + { + option: "ext", + type: "[String]", + description: "Specify JavaScript file extensions" + }, + { + option: "global", + type: "[String]", + description: "Define global variables" + }, + { + option: "parser", + type: "String", + description: "Specify the parser to be used" + }, + { + option: "parser-options", + type: "Object", + description: "Specify parser options" + }, + { + option: "resolve-plugins-relative-to", + type: "path::String", + description: "A folder where plugins should be resolved from, CWD by default" + }, + { + heading: "Specifying rules and plugins" + }, + { + option: "rulesdir", + type: "[path::String]", + description: "Use additional rules from this directory" + }, + { + option: "plugin", + type: "[String]", + description: "Specify plugins" + }, + { + option: "rule", + type: "Object", + description: "Specify rules" + }, + { + heading: "Fixing problems" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "fix-dry-run", + type: "Boolean", + default: false, + description: "Automatically fix problems without saving the changes to the file system" + }, + { + option: "fix-type", + type: "Array", + description: "Specify the types of fixes to apply (problem, suggestion, layout)" + }, + { + heading: "Ignoring files" + }, + { + option: "ignore-path", + type: "path::String", + description: "Specify path of ignore file" + }, + { + option: "ignore", + type: "Boolean", + default: "true", + description: "Disable use of ignore files and patterns" + }, + { + option: "ignore-pattern", + type: "[String]", + description: "Pattern of files to ignore (in addition to those in .eslintignore)", + concatRepeatedArrays: [true, { + oneValuePerFlag: true + }] + }, + { + heading: "Using stdin" + }, + { + option: "stdin", + type: "Boolean", + default: "false", + description: "Lint code provided on " + }, + { + option: "stdin-filename", + type: "String", + description: "Specify filename to process STDIN as" + }, + { + heading: "Handling warnings" + }, + { + option: "quiet", + type: "Boolean", + default: "false", + description: "Report errors only" + }, + { + option: "max-warnings", + type: "Int", + default: "-1", + description: "Number of warnings to trigger nonzero exit code" + }, + { + heading: "Output" + }, + { + option: "output-file", + alias: "o", + type: "path::String", + description: "Specify file to write report to" + }, + { + option: "format", + alias: "f", + type: "String", + default: "stylish", + description: "Use a specific output format" + }, + { + option: "color", + type: "Boolean", + alias: "no-color", + description: "Force enabling/disabling of color" + }, + { + heading: "Inline configuration comments" + }, + { + option: "inline-config", + type: "Boolean", + default: "true", + description: "Prevent comments from changing config or rules" + }, + { + option: "report-unused-disable-directives", + type: "Boolean", + default: void 0, + description: "Adds reported errors for unused eslint-disable directives" + }, + { + heading: "Caching" + }, + { + option: "cache", + type: "Boolean", + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" + }, + { + option: "env-info", + type: "Boolean", + default: "false", + description: "Output execution environment information" + }, + { + option: "error-on-unmatched-pattern", + type: "Boolean", + default: "true", + description: "Prevent errors when pattern is unmatched" + }, + { + option: "debug", + type: "Boolean", + default: false, + description: "Output debugging information" + }, + { + option: "help", + alias: "h", + type: "Boolean", + description: "Show help" + }, + { + option: "version", + alias: "v", + type: "Boolean", + description: "Output the version number" + }, + { + option: "print-config", + type: "path::String", + description: "Print the configuration for the given file" + } + ] +}); diff --git a/node_modules/eslint/lib/rule-tester/index.js b/node_modules/eslint/lib/rule-tester/index.js new file mode 100644 index 0000000..f52d140 --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + RuleTester: require("./rule-tester") +}; diff --git a/node_modules/eslint/lib/rule-tester/rule-tester.js b/node_modules/eslint/lib/rule-tester/rule-tester.js new file mode 100644 index 0000000..905f341 --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -0,0 +1,903 @@ +/** + * @fileoverview Mocha test wrapper + * @author Ilya Volodin + */ +"use strict"; + +/* global describe, it */ + +/* + * This is a wrapper around mocha to allow for DRY unittests for eslint + * Format: + * RuleTester.run("{ruleName}", { + * valid: [ + * "{code}", + * { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings} } + * ], + * invalid: [ + * { code: "{code}", errors: {numErrors} }, + * { code: "{code}", errors: ["{errorMessage}"] }, + * { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] } + * ] + * }); + * + * Variables: + * {code} - String that represents the code to be tested + * {options} - Arguments that are passed to the configurable rules. + * {globals} - An object representing a list of variables that are + * registered as globals + * {parser} - String representing the parser to use + * {settings} - An object representing global settings for all rules + * {numErrors} - If failing case doesn't need to check error message, + * this integer will specify how many errors should be + * received + * {errorMessage} - Message that is returned by the rule on failure + * {errorNodeType} - AST node type that is returned by they rule as + * a cause of the failure. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + assert = require("assert"), + path = require("path"), + util = require("util"), + lodash = require("lodash"), + Traverser = require("../../lib/shared/traverser"), + { getRuleOptionsSchema, validate } = require("../shared/config-validator"), + { Linter, SourceCodeFixer, interpolate } = require("../linter"); + +const ajv = require("../shared/ajv")({ strictDefaults: true }); + +const espreePath = require.resolve("espree"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Parser} Parser */ + +/** + * A test case that is expected to pass lint. + * @typedef {Object} ValidTestCase + * @property {string} code Code for the test case. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {string} [parser] The absolute path for the parser. + * @property {{ [name: string]: any }} [parserOptions] Options for the parser. + * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. + * @property {{ [name: string]: boolean }} [env] Environments for the test case. + */ + +/** + * A test case that is expected to fail lint. + * @typedef {Object} InvalidTestCase + * @property {string} code Code for the test case. + * @property {number | Array} errors Expected errors. + * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {string} [parser] The absolute path for the parser. + * @property {{ [name: string]: any }} [parserOptions] Options for the parser. + * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. + * @property {{ [name: string]: boolean }} [env] Environments for the test case. + */ + +/** + * A description of a reported error used in a rule tester test. + * @typedef {Object} TestCaseError + * @property {string | RegExp} [message] Message. + * @property {string} [messageId] Message ID. + * @property {string} [type] The type of the reported AST node. + * @property {{ [name: string]: string }} [data] The data used to fill the message template. + * @property {number} [line] The 1-based line number of the reported start location. + * @property {number} [column] The 1-based column number of the reported start location. + * @property {number} [endLine] The 1-based line number of the reported end location. + * @property {number} [endColumn] The 1-based column number of the reported end location. + */ + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +/* + * testerDefaultConfig must not be modified as it allows to reset the tester to + * the initial default configuration + */ +const testerDefaultConfig = { rules: {} }; +let defaultConfig = { rules: {} }; + +/* + * List every parameters possible on a test case that are not related to eslint + * configuration + */ +const RuleTesterParameters = [ + "code", + "filename", + "options", + "errors", + "output" +]; + +/* + * All allowed property names in error objects. + */ +const errorObjectParameters = new Set([ + "message", + "messageId", + "data", + "type", + "line", + "column", + "endLine", + "endColumn", + "suggestions" +]); +const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +/* + * All allowed property names in suggestion objects. + */ +const suggestionObjectParameters = new Set([ + "desc", + "messageId", + "data", + "output" +]); +const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); + +/** + * Clones a given value deeply. + * Note: This ignores `parent` property. + * @param {any} x A value to clone. + * @returns {any} A cloned value. + */ +function cloneDeeplyExcludesParent(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + return x.map(cloneDeeplyExcludesParent); + } + + const retv = {}; + + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + retv[key] = cloneDeeplyExcludesParent(x[key]); + } + } + + return retv; + } + + return x; +} + +/** + * Freezes a given value deeply. + * @param {any} x A value to freeze. + * @returns {void} + */ +function freezeDeeply(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + x.forEach(freezeDeeply); + } else { + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + freezeDeeply(x[key]); + } + } + } + Object.freeze(x); + } +} + +/** + * Replace control characters by `\u00xx` form. + * @param {string} text The text to sanitize. + * @returns {string} The sanitized text. + */ +function sanitize(text) { + return text.replace( + /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex + c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}` + ); +} + +/** + * Define `start`/`end` properties as throwing error. + * @param {string} objName Object name used for error messages. + * @param {ASTNode} node The node to define. + * @returns {void} + */ +function defineStartEndAsError(objName, node) { + Object.defineProperties(node, { + start: { + get() { + throw new Error(`Use ${objName}.range[0] instead of ${objName}.start`); + }, + configurable: true, + enumerable: false + }, + end: { + get() { + throw new Error(`Use ${objName}.range[1] instead of ${objName}.end`); + }, + configurable: true, + enumerable: false + } + }); +} + +/** + * Define `start`/`end` properties of all nodes of the given AST as throwing error. + * @param {ASTNode} ast The root node to errorize `start`/`end` properties. + * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast. + * @returns {void} + */ +function defineStartEndAsErrorInTree(ast, visitorKeys) { + Traverser.traverse(ast, { visitorKeys, enter: defineStartEndAsError.bind(null, "node") }); + ast.tokens.forEach(defineStartEndAsError.bind(null, "token")); + ast.comments.forEach(defineStartEndAsError.bind(null, "token")); +} + +/** + * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes. + * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties. + * @param {Parser} parser Parser object. + * @returns {Parser} Wrapped parser object. + */ +function wrapParser(parser) { + if (typeof parser.parseForESLint === "function") { + return { + parseForESLint(...args) { + const ret = parser.parseForESLint(...args); + + defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys); + return ret; + } + }; + } + return { + parse(...args) { + const ast = parser.parse(...args); + + defineStartEndAsErrorInTree(ast); + return ast; + } + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +// default separators for testing +const DESCRIBE = Symbol("describe"); +const IT = Symbol("it"); + +/** + * This is `it` default handler if `it` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function itDefaultHandler(text, method) { + try { + return method.call(this); + } catch (err) { + if (err instanceof assert.AssertionError) { + err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`; + } + throw err; + } +} + +/** + * This is `describe` default handler if `describe` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function describeDefaultHandler(text, method) { + return method.call(this); +} + +class RuleTester { + + /** + * Creates a new instance of RuleTester. + * @param {Object} [testerConfig] Optional, extra configuration for the tester + */ + constructor(testerConfig) { + + /** + * The configuration to use for this tester. Combination of the tester + * configuration and the default configuration. + * @type {Object} + */ + this.testerConfig = lodash.merge( + + // we have to clone because merge uses the first argument for recipient + lodash.cloneDeep(defaultConfig), + testerConfig, + { rules: { "rule-tester/validate-ast": "error" } } + ); + + /** + * Rule definitions to define before tests. + * @type {Object} + */ + this.rules = {}; + this.linter = new Linter(); + } + + /** + * Set the configuration to use for all future tests + * @param {Object} config the configuration to use. + * @returns {void} + */ + static setDefaultConfig(config) { + if (typeof config !== "object") { + throw new TypeError("RuleTester.setDefaultConfig: config must be an object"); + } + defaultConfig = config; + + // Make sure the rules object exists since it is assumed to exist later + defaultConfig.rules = defaultConfig.rules || {}; + } + + /** + * Get the current configuration used for all tests + * @returns {Object} the current configuration + */ + static getDefaultConfig() { + return defaultConfig; + } + + /** + * Reset the configuration to the initial configuration of the tester removing + * any changes made until now. + * @returns {void} + */ + static resetDefaultConfig() { + defaultConfig = lodash.cloneDeep(testerDefaultConfig); + } + + + /* + * If people use `mocha test.js --watch` command, `describe` and `it` function + * instances are different for each execution. So `describe` and `it` should get fresh instance + * always. + */ + static get describe() { + return ( + this[DESCRIBE] || + (typeof describe === "function" ? describe : describeDefaultHandler) + ); + } + + static set describe(value) { + this[DESCRIBE] = value; + } + + static get it() { + return ( + this[IT] || + (typeof it === "function" ? it : itDefaultHandler) + ); + } + + static set it(value) { + this[IT] = value; + } + + /** + * Define a rule for one particular run of tests. + * @param {string} name The name of the rule to define. + * @param {Function} rule The rule definition. + * @returns {void} + */ + defineRule(name, rule) { + this.rules[name] = rule; + } + + /** + * Adds a new rule test to execute. + * @param {string} ruleName The name of the rule to run. + * @param {Function} rule The rule to test. + * @param {{ + * valid: (ValidTestCase | string)[], + * invalid: InvalidTestCase[] + * }} test The collection of tests to run. + * @returns {void} + */ + run(ruleName, rule, test) { + + const testerConfig = this.testerConfig, + requiredScenarios = ["valid", "invalid"], + scenarioErrors = [], + linter = this.linter; + + if (lodash.isNil(test) || typeof test !== "object") { + throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`); + } + + requiredScenarios.forEach(scenarioType => { + if (lodash.isNil(test[scenarioType])) { + scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); + } + }); + + if (scenarioErrors.length > 0) { + throw new Error([ + `Test Scenarios for rule ${ruleName} is invalid:` + ].concat(scenarioErrors).join("\n")); + } + + + linter.defineRule(ruleName, Object.assign({}, rule, { + + // Create a wrapper rule that freezes the `context` properties. + create(context) { + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + return (typeof rule === "function" ? rule : rule.create)(context); + } + })); + + linter.defineRules(this.rules); + + /** + * Run the rule for the given item + * @param {string|Object} item Item to run the rule against + * @returns {Object} Eslint run result + * @private + */ + function runRuleForItem(item) { + let config = lodash.cloneDeep(testerConfig), + code, filename, output, beforeAST, afterAST; + + if (typeof item === "string") { + code = item; + } else { + code = item.code; + + /* + * Assumes everything on the item is a config except for the + * parameters used by this tester + */ + const itemConfig = lodash.omit(item, RuleTesterParameters); + + /* + * Create the config object from the tester config and this item + * specific configurations. + */ + config = lodash.merge( + config, + itemConfig + ); + } + + if (item.filename) { + filename = item.filename; + } + + if (hasOwnProperty(item, "options")) { + assert(Array.isArray(item.options), "options must be an array"); + config.rules[ruleName] = [1].concat(item.options); + } else { + config.rules[ruleName] = 1; + } + + const schema = getRuleOptionsSchema(rule); + + /* + * Setup AST getters. + * The goal is to check whether or not AST was modified when + * running the rule under test. + */ + linter.defineRule("rule-tester/validate-ast", () => ({ + Program(node) { + beforeAST = cloneDeeplyExcludesParent(node); + }, + "Program:exit"(node) { + afterAST = node; + } + })); + + if (typeof config.parser === "string") { + assert(path.isAbsolute(config.parser), "Parsers provided as strings to RuleTester must be absolute paths"); + } else { + config.parser = espreePath; + } + + linter.defineParser(config.parser, wrapParser(require(config.parser))); + + if (schema) { + ajv.validateSchema(schema); + + if (ajv.errors) { + const errors = ajv.errors.map(error => { + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `\t${field}: ${error.message}`; + }).join("\n"); + + throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]); + } + + /* + * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"), + * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling + * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result, + * the schema is compiled here separately from checking for `validateSchema` errors. + */ + try { + ajv.compile(schema); + } catch (err) { + throw new Error(`Schema for rule ${ruleName} is invalid: ${err.message}`); + } + } + + validate(config, "rule-tester", id => (id === ruleName ? rule : null)); + + // Verify the code. + const messages = linter.verify(code, config, filename); + const fatalErrorMessage = messages.find(m => m.fatal); + + assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); + + // Verify if autofix makes a syntax error or not. + if (messages.some(m => m.fix)) { + output = SourceCodeFixer.applyFixes(code, messages).output; + const errorMessageInFix = linter.verify(output, config, filename).find(m => m.fatal); + + assert(!errorMessageInFix, [ + "A fatal parsing error occurred in autofix.", + `Error: ${errorMessageInFix && errorMessageInFix.message}`, + "Autofix output:", + output + ].join("\n")); + } else { + output = code; + } + + return { + messages, + output, + beforeAST, + afterAST: cloneDeeplyExcludesParent(afterAST) + }; + } + + /** + * Check if the AST was changed + * @param {ASTNode} beforeAST AST node before running + * @param {ASTNode} afterAST AST node after running + * @returns {void} + * @private + */ + function assertASTDidntChange(beforeAST, afterAST) { + if (!lodash.isEqual(beforeAST, afterAST)) { + assert.fail("Rule should not modify AST."); + } + } + + /** + * Check if the template is valid or not + * all valid cases go through this + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testValidTemplate(item) { + const result = runRuleForItem(item); + const messages = result.messages; + + assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s", + messages.length, util.inspect(messages))); + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /** + * Asserts that the message matches its expected value. If the expected + * value is a regular expression, it is checked against the actual + * value. + * @param {string} actual Actual value + * @param {string|RegExp} expected Expected value + * @returns {void} + * @private + */ + function assertMessageMatches(actual, expected) { + if (expected instanceof RegExp) { + + // assert.js doesn't have a built-in RegExp match function + assert.ok( + expected.test(actual), + `Expected '${actual}' to match ${expected}` + ); + } else { + assert.strictEqual(actual, expected); + } + } + + /** + * Check if the template is invalid or not + * all invalid cases go through this. + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testInvalidTemplate(item) { + assert.ok(item.errors || item.errors === 0, + `Did not specify errors for an invalid test of ${ruleName}`); + + if (Array.isArray(item.errors) && item.errors.length === 0) { + assert.fail("Invalid cases must have at least one error"); + } + + const ruleHasMetaMessages = hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages"); + const friendlyIDList = ruleHasMetaMessages ? `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]` : null; + + const result = runRuleForItem(item); + const messages = result.messages; + + if (typeof item.errors === "number") { + + if (item.errors === 0) { + assert.fail("Invalid cases must have 'error' value greater than 0"); + } + + assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", + item.errors, item.errors === 1 ? "" : "s", messages.length, util.inspect(messages))); + } else { + assert.strictEqual( + messages.length, item.errors.length, + util.format( + "Should have %d error%s but had %d: %s", + item.errors.length, item.errors.length === 1 ? "" : "s", messages.length, util.inspect(messages) + ) + ); + + const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleName); + + for (let i = 0, l = item.errors.length; i < l; i++) { + const error = item.errors[i]; + const message = messages[i]; + + assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested"); + + if (typeof error === "string" || error instanceof RegExp) { + + // Just an error message. + assertMessageMatches(message.message, error); + } else if (typeof error === "object" && error !== null) { + + /* + * Error object. + * This may have a message, messageId, data, node type, line, and/or + * column. + */ + + Object.keys(error).forEach(propertyName => { + assert.ok( + errorObjectParameters.has(propertyName), + `Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.` + ); + }); + + if (hasOwnProperty(error, "message")) { + assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'."); + assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'."); + assertMessageMatches(message.message, error.message); + } else if (hasOwnProperty(error, "messageId")) { + assert.ok( + ruleHasMetaMessages, + "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'." + ); + if (!hasOwnProperty(rule.meta.messages, error.messageId)) { + assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`); + } + assert.strictEqual( + message.messageId, + error.messageId, + `messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.` + ); + if (hasOwnProperty(error, "data")) { + + /* + * if data was provided, then directly compare the returned message to a synthetic + * interpolated message using the same message ID and data provided in the test. + * See https://github.com/eslint/eslint/issues/9890 for context. + */ + const unformattedOriginalMessage = rule.meta.messages[error.messageId]; + const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data); + + assert.strictEqual( + message.message, + rehydratedMessage, + `Hydrated message "${rehydratedMessage}" does not match "${message.message}"` + ); + } + } + + assert.ok( + hasOwnProperty(error, "data") ? hasOwnProperty(error, "messageId") : true, + "Error must specify 'messageId' if 'data' is used." + ); + + if (error.type) { + assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`); + } + + if (hasOwnProperty(error, "line")) { + assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`); + } + + if (hasOwnProperty(error, "column")) { + assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`); + } + + if (hasOwnProperty(error, "endLine")) { + assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`); + } + + if (hasOwnProperty(error, "endColumn")) { + assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`); + } + + if (hasOwnProperty(error, "suggestions")) { + + // Support asserting there are no suggestions + if (!error.suggestions || (Array.isArray(error.suggestions) && error.suggestions.length === 0)) { + if (Array.isArray(message.suggestions) && message.suggestions.length > 0) { + assert.fail(`Error should have no suggestions on error with message: "${message.message}"`); + } + } else { + assert.strictEqual(Array.isArray(message.suggestions), true, `Error should have an array of suggestions. Instead received "${message.suggestions}" on error with message: "${message.message}"`); + assert.strictEqual(message.suggestions.length, error.suggestions.length, `Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`); + + error.suggestions.forEach((expectedSuggestion, index) => { + assert.ok( + typeof expectedSuggestion === "object" && expectedSuggestion !== null, + "Test suggestion in 'suggestions' array must be an object." + ); + Object.keys(expectedSuggestion).forEach(propertyName => { + assert.ok( + suggestionObjectParameters.has(propertyName), + `Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.` + ); + }); + + const actualSuggestion = message.suggestions[index]; + const suggestionPrefix = `Error Suggestion at index ${index} :`; + + if (hasOwnProperty(expectedSuggestion, "desc")) { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test should not specify both 'desc' and 'data'.` + ); + assert.strictEqual( + actualSuggestion.desc, + expectedSuggestion.desc, + `${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "messageId")) { + assert.ok( + ruleHasMetaMessages, + `${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.` + ); + assert.ok( + hasOwnProperty(rule.meta.messages, expectedSuggestion.messageId), + `${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.` + ); + assert.strictEqual( + actualSuggestion.messageId, + expectedSuggestion.messageId, + `${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.` + ); + if (hasOwnProperty(expectedSuggestion, "data")) { + const unformattedMetaMessage = rule.meta.messages[expectedSuggestion.messageId]; + const rehydratedDesc = interpolate(unformattedMetaMessage, expectedSuggestion.data); + + assert.strictEqual( + actualSuggestion.desc, + rehydratedDesc, + `${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".` + ); + } + } else { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test must specify 'messageId' if 'data' is used.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "output")) { + const codeWithAppliedSuggestion = SourceCodeFixer.applyFixes(item.code, [actualSuggestion]).output; + + assert.strictEqual(codeWithAppliedSuggestion, expectedSuggestion.output, `Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`); + } + }); + } + } + } else { + + // Message was an unexpected type + assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`); + } + } + } + + if (hasOwnProperty(item, "output")) { + if (item.output === null) { + assert.strictEqual( + result.output, + item.code, + "Expected no autofixes to be suggested" + ); + } else { + assert.strictEqual(result.output, item.output, "Output is incorrect."); + } + } else { + assert.strictEqual( + result.output, + item.code, + "The rule fixed the code. Please add 'output' property." + ); + } + + // Rules that produce fixes must have `meta.fixable` property. + if (result.output !== item.code) { + assert.ok( + hasOwnProperty(rule, "meta"), + "Fixable rules should export a `meta.fixable` property." + ); + + // Linter throws if a rule that produced a fix has `meta` but doesn't have `meta.fixable`. + } + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /* + * This creates a mocha test suite and pipes all supplied info through + * one of the templates above. + */ + RuleTester.describe(ruleName, () => { + RuleTester.describe("valid", () => { + test.valid.forEach(valid => { + RuleTester.it(sanitize(typeof valid === "object" ? valid.code : valid), () => { + testValidTemplate(valid); + }); + }); + }); + + RuleTester.describe("invalid", () => { + test.invalid.forEach(invalid => { + RuleTester.it(sanitize(invalid.code), () => { + testInvalidTemplate(invalid); + }); + }); + }); + }); + } +} + +RuleTester[DESCRIBE] = RuleTester[IT] = null; + +module.exports = RuleTester; diff --git a/node_modules/eslint/lib/rules/accessor-pairs.js b/node_modules/eslint/lib/rules/accessor-pairs.js new file mode 100644 index 0000000..0e0d07a --- /dev/null +++ b/node_modules/eslint/lib/rules/accessor-pairs.js @@ -0,0 +1,354 @@ +/** + * @fileoverview Rule to enforce getter and setter pairs in objects and classes. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +/** + * Checks whether or not a given node is an argument of a specified method call. + * @param {ASTNode} node A node to check. + * @param {number} index An expected index of the node in arguments. + * @param {string} object An expected name of the object of the method. + * @param {string} property An expected name of the method. + * @returns {boolean} `true` if the node is an argument of the specified method call. + */ +function isArgumentOfMethodCall(node, index, object, property) { + const parent = node.parent; + + return ( + parent.type === "CallExpression" && + astUtils.isSpecificMemberAccess(parent.callee, object, property) && + parent.arguments[index] === node + ); +} + +/** + * Checks whether or not a given node is a property descriptor. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node) { + + // Object.defineProperty(obj, "foo", {set: ...}) + if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") || + isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty") + ) { + return true; + } + + /* + * Object.defineProperties(obj, {foo: {set: ...}}) + * Object.create(proto, {foo: {set: ...}}) + */ + const grandparent = node.parent.parent; + + return grandparent.type === "ObjectExpression" && ( + isArgumentOfMethodCall(grandparent, 1, "Object", "create") || + isArgumentOfMethodCall(grandparent, 1, "Object", "defineProperties") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce getter and setter pairs in objects and classes", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/accessor-pairs" + }, + + schema: [{ + type: "object", + properties: { + getWithoutSet: { + type: "boolean", + default: false + }, + setWithoutGet: { + type: "boolean", + default: true + }, + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], + + messages: { + missingGetterInPropertyDescriptor: "Getter is not present in property descriptor.", + missingSetterInPropertyDescriptor: "Setter is not present in property descriptor.", + missingGetterInObjectLiteral: "Getter is not present for {{ name }}.", + missingSetterInObjectLiteral: "Setter is not present for {{ name }}.", + missingGetterInClass: "Getter is not present for class {{ name }}.", + missingSetterInClass: "Setter is not present for class {{ name }}." + } + }, + create(context) { + const config = context.options[0] || {}; + const checkGetWithoutSet = config.getWithoutSet === true; + const checkSetWithoutGet = config.setWithoutGet !== false; + const enforceForClassMembers = config.enforceForClassMembers !== false; + const sourceCode = context.getSourceCode(); + + /** + * Reports the given node. + * @param {ASTNode} node The node to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function report(node, messageKind) { + if (node.type === "Property") { + context.report({ + node, + messageId: `${messageKind}InObjectLiteral`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else if (node.type === "MethodDefinition") { + context.report({ + node, + messageId: `${messageKind}InClass`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else { + context.report({ + node, + messageId: `${messageKind}InPropertyDescriptor` + }); + } + } + + /** + * Reports each of the nodes in the given list using the same messageId. + * @param {ASTNode[]} nodes Nodes to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function reportList(nodes, messageKind) { + for (const node of nodes) { + report(node, messageKind); + } + } + + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } + + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); + + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } + + return accessors; + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @returns {void} + * @private + */ + function checkList(nodes) { + const accessors = nodes + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); + + for (const { getters, setters } of accessors) { + if (checkSetWithoutGet && setters.length && !getters.length) { + reportList(setters, "missingGetter"); + } + if (checkGetWithoutSet && getters.length && !setters.length) { + reportList(getters, "missingSetter"); + } + } + } + + /** + * Checks accessor pairs in an object literal. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectLiteral(node) { + checkList(node.properties.filter(p => p.type === "Property")); + } + + /** + * Checks accessor pairs in a property descriptor. + * @param {ASTNode} node Property descriptor `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkPropertyDescriptor(node) { + const namesToCheck = node.properties + .filter(p => p.type === "Property" && p.kind === "init" && !p.computed) + .map(({ key }) => key.name); + + const hasGetter = namesToCheck.includes("get"); + const hasSetter = namesToCheck.includes("set"); + + if (checkSetWithoutGet && hasSetter && !hasGetter) { + report(node, "missingGetter"); + } + if (checkGetWithoutSet && hasGetter && !hasSetter) { + report(node, "missingSetter"); + } + } + + /** + * Checks the given object expression as an object literal and as a possible property descriptor. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectExpression(node) { + checkObjectLiteral(node); + if (isPropertyDescriptor(node)) { + checkPropertyDescriptor(node); + } + } + + /** + * Checks the given class body. + * @param {ASTNode} node `ClassBody` node to check. + * @returns {void} + * @private + */ + function checkClassBody(node) { + const methodDefinitions = node.body.filter(m => m.type === "MethodDefinition"); + + checkList(methodDefinitions.filter(m => m.static)); + checkList(methodDefinitions.filter(m => !m.static)); + } + + const listeners = {}; + + if (checkSetWithoutGet || checkGetWithoutSet) { + listeners.ObjectExpression = checkObjectExpression; + if (enforceForClassMembers) { + listeners.ClassBody = checkClassBody; + } + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/array-bracket-newline.js b/node_modules/eslint/lib/rules/array-bracket-newline.js new file mode 100644 index 0000000..b4b4dd4 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -0,0 +1,258 @@ +/** + * @fileoverview Rule to enforce linebreaks after open and before close array brackets + * @author Jan Peer Stöcklmair + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce linebreaks after opening and before closing array brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-bracket-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedOpeningLinebreak: "There should be no linebreak after '['.", + unexpectedClosingLinebreak: "There should be no linebreak before ']'.", + missingOpeningLinebreak: "A linebreak is required after '['.", + missingClosingLinebreak: "A linebreak is required before ']'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} option An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(option) { + let consistent = false; + let multiline = false; + let minItems = 0; + + if (option) { + if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else if (option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + } else { + consistent = false; + multiline = true; + minItems = Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedOpeningLinebreak", + fix(fixer) { + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }); + + if (astUtils.isCommentToken(nextToken)) { + return null; + } + + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedClosingLinebreak", + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (astUtils.isCommentToken(previousToken)) { + return null; + } + + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningLinebreak", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + /** + * Reports that there should be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingLinebreak", + fix(fixer) { + return fixer.insertTextBefore(token, "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + const openBracket = sourceCode.getFirstToken(node); + const closeBracket = sourceCode.getLastToken(node); + const firstIncComment = sourceCode.getTokenAfter(openBracket, { includeComments: true }); + const lastIncComment = sourceCode.getTokenBefore(closeBracket, { includeComments: true }); + const first = sourceCode.getTokenAfter(openBracket); + const last = sourceCode.getTokenBefore(closeBracket); + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elements.length > 0 && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line + ) || + ( + elements.length === 0 && + firstIncComment.type === "Block" && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line && + firstIncComment === lastIncComment + ) || + ( + options.consistent && + openBracket.loc.end.line !== first.loc.start.line + ) + ); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether linebreaks are needed. + * This allows: + * var arr = [ // eslint-disable-line foo + * 'a' + * ] + */ + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(openBracket, first)) { + reportRequiredBeginningLinebreak(node, openBracket); + } + if (astUtils.isTokenOnSameLine(last, closeBracket)) { + reportRequiredEndingLinebreak(node, closeBracket); + } + } else { + if (!astUtils.isTokenOnSameLine(openBracket, first)) { + reportNoBeginningLinebreak(node, openBracket); + } + if (!astUtils.isTokenOnSameLine(last, closeBracket)) { + reportNoEndingLinebreak(node, closeBracket); + } + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-bracket-spacing.js b/node_modules/eslint/lib/rules/array-bracket-spacing.js new file mode 100644 index 0000000..c2b77a6 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Disallows or enforces spaces inside of array brackets. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside array brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-bracket-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + singleValue: { + type: "boolean" + }, + objectsInArrays: { + type: "boolean" + }, + arraysInArrays: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'.", + missingSpaceBefore: "A space is required before '{{tokenValue}}'." + } + }, + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = sourceCode.getTokenAfter(token); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = sourceCode.getTokenBefore(token); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if a node is an object type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an object type. + */ + function isObjectType(node) { + return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); + } + + /** + * Determines if a node is an array type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an array type. + */ + function isArrayType(node) { + return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + } + + /** + * Validates the spacing around array brackets + * @param {ASTNode} node The node we're checking for spacing + * @returns {void} + */ + function validateArraySpacing(node) { + if (options.spaced && node.elements.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + second = sourceCode.getFirstToken(node, 1), + last = node.typeAnnotation + ? sourceCode.getTokenBefore(node.typeAnnotation) + : sourceCode.getLastToken(node), + penultimate = sourceCode.getTokenBefore(last), + firstElement = node.elements[0], + lastElement = node.elements[node.elements.length - 1]; + + const openingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(firstElement) || + options.arraysInArraysException && isArrayType(firstElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + const closingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(lastElement) || + options.arraysInArraysException && isArrayType(lastElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (astUtils.isTokenOnSameLine(first, second)) { + if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrayPattern: validateArraySpacing, + ArrayExpression: validateArraySpacing + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-callback-return.js b/node_modules/eslint/lib/rules/array-callback-return.js new file mode 100644 index 0000000..7267347 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-callback-return.js @@ -0,0 +1,296 @@ +/** + * @fileoverview Rule to enforce return statements in callbacks of array's methods + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; +const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort)$/u; + +/** + * Checks a given code path segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks a given node is a member access which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a member access which has + * the specified name's property. The node may be a `(Chain|Member)Expression` node. + */ +function isTargetMethod(node) { + return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS); +} + +/** + * Returns a human-legible description of an array method + * @param {string} arrayMethodName A method name to fully qualify + * @returns {string} the method name prefixed with `Array.` if it is a class method, + * or else `Array.prototype.` if it is an instance method. + */ +function fullMethodName(arrayMethodName) { + if (["from", "of", "isArray"].includes(arrayMethodName)) { + return "Array.".concat(arrayMethodName); + } + return "Array.prototype.".concat(arrayMethodName); +} + +/** + * Checks whether or not a given node is a function expression which is the + * callback of an array method, returning the method name. + * @param {ASTNode} node A node to check. This is one of + * FunctionExpression or ArrowFunctionExpression. + * @returns {string} The method name if the node is a callback method, + * null otherwise. + */ +function getArrayMethodName(node) { + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. e.g., + * foo.every(nativeFoo || function foo() { ... }); + */ + case "LogicalExpression": + case "ConditionalExpression": + case "ChainExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * foo.every((function() { + * // setup... + * return function callback() { ... }; + * })()); + */ + case "ReturnStatement": { + const func = astUtils.getUpperFunction(parent); + + if (func === null || !astUtils.isCallee(func)) { + return null; + } + currentNode = func.parent; + break; + } + + /* + * e.g. + * Array.from([], function() {}); + * list.every(function() {}); + */ + case "CallExpression": + if (astUtils.isArrayFromMethod(parent.callee)) { + if ( + parent.arguments.length >= 2 && + parent.arguments[1] === currentNode + ) { + return "from"; + } + } + if (isTargetMethod(parent.callee)) { + if ( + parent.arguments.length >= 1 && + parent.arguments[0] === currentNode + ) { + return astUtils.getStaticPropertyName(parent.callee); + } + } + return null; + + // Otherwise this node is not target. + default: + return null; + } + } + + /* istanbul ignore next: unreachable */ + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce `return` statements in callbacks of array methods", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/array-callback-return" + }, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean", + default: false + }, + checkForEach: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectedAtEnd: "{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.", + expectedInside: "{{arrayMethodName}}() expects a return value from {{name}}.", + expectedReturnValue: "{{arrayMethodName}}() expects a return value from {{name}}.", + expectedNoReturnValue: "{{arrayMethodName}}() expects no useless return value from {{name}}." + } + }, + + create(context) { + + const options = context.options[0] || { allowImplicit: false, checkForEach: false }; + const sourceCode = context.getSourceCode(); + + let funcInfo = { + arrayMethodName: null, + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + let messageId = null; + + if (funcInfo.arrayMethodName === "forEach") { + if (options.checkForEach && node.type === "ArrowFunctionExpression" && node.expression) { + messageId = "expectedNoReturnValue"; + } + } else { + if (node.body.type === "BlockStatement" && funcInfo.codePath.currentSegments.some(isReachable)) { + messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; + } + } + + if (messageId) { + const name = astUtils.getFunctionNameWithKind(node); + + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId, + data: { name, arrayMethodName: fullMethodName(funcInfo.arrayMethodName) } + }); + } + } + + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + + let methodName = null; + + if (TARGET_NODE_TYPE.test(node.type)) { + methodName = getArrayMethodName(node); + } + + funcInfo = { + arrayMethodName: methodName, + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: + methodName && + !node.async && + !node.generator, + node + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + funcInfo.hasReturn = true; + + let messageId = null; + + if (funcInfo.arrayMethodName === "forEach") { + + // if checkForEach: true, returning a value at any path inside a forEach is not allowed + if (options.checkForEach && node.argument) { + messageId = "expectedNoReturnValue"; + } + } else { + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + messageId = "expectedReturnValue"; + } + } + + if (messageId) { + context.report({ + node, + messageId, + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node), + arrayMethodName: fullMethodName(funcInfo.arrayMethodName) + } + }); + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-element-newline.js b/node_modules/eslint/lib/rules/array-element-newline.js new file mode 100644 index 0000000..b7a9678 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-element-newline.js @@ -0,0 +1,301 @@ +/** + * @fileoverview Rule to enforce line breaks after each array element + * @author Jan Peer Stöcklmair + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks after each array element", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-element-newline" + }, + + fixable: "whitespace", + + schema: { + definitions: { + basicConfig: { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + }, + items: [ + { + oneOf: [ + { + $ref: "#/definitions/basicConfig" + }, + { + type: "object", + properties: { + ArrayExpression: { + $ref: "#/definitions/basicConfig" + }, + ArrayPattern: { + $ref: "#/definitions/basicConfig" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ] + }, + + messages: { + unexpectedLineBreak: "There should be no linebreak here.", + missingLineBreak: "There should be a linebreak after this element." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} providedOption An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(providedOption) { + let consistent = false; + let multiline = false; + let minItems; + + const option = providedOption || "always"; + + if (!option || option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + if (options && (options.ArrayExpression || options.ArrayPattern)) { + let expressionOptions, patternOptions; + + if (options.ArrayExpression) { + expressionOptions = normalizeOptionValue(options.ArrayExpression); + } + + if (options.ArrayPattern) { + patternOptions = normalizeOptionValue(options.ArrayPattern); + } + + return { ArrayExpression: expressionOptions, ArrayPattern: patternOptions }; + } + + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "unexpectedLineBreak", + fix(fixer) { + if (astUtils.isCommentToken(tokenBefore)) { + return null; + } + + if (!astUtils.isTokenOnSameLine(tokenBefore, token)) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " "); + } + + /* + * This will check if the comma is on the same line as the next element + * Following array: + * [ + * 1 + * , 2 + * , 3 + * ] + * + * will be fixed to: + * [ + * 1, 2, 3 + * ] + */ + const twoTokensBefore = sourceCode.getTokenBefore(tokenBefore, { includeComments: true }); + + if (astUtils.isCommentToken(twoTokensBefore)) { + return null; + } + + return fixer.replaceTextRange([twoTokensBefore.range[1], tokenBefore.range[0]], ""); + + } + }); + } + + /** + * Reports that there should be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "missingLineBreak", + fix(fixer) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + + if (!options) { + return; + } + + let elementBreak = false; + + /* + * MULTILINE: true + * loop through every element and check + * if at least one element has linebreaks inside + * this ensures that following is not valid (due to elements are on the same line): + * + * [ + * 1, + * 2, + * 3 + * ] + */ + if (options.multiline) { + elementBreak = elements + .filter(element => element !== null) + .some(element => element.loc.start.line !== element.loc.end.line); + } + + const linebreaksCount = node.elements.map((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return false; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + return !astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement); + }).filter(isBreak => isBreak === true).length; + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elementBreak + ) || + ( + options.consistent && + linebreaksCount > 0 && + linebreaksCount < node.elements.length + ) + ); + + elements.forEach((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportRequiredLineBreak(firstTokenOfCurrentElement); + } + } else { + if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportNoLineBreak(firstTokenOfCurrentElement); + } + } + }); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-body-style.js b/node_modules/eslint/lib/rules/arrow-body-style.js new file mode 100644 index 0000000..7b318ea --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-body-style.js @@ -0,0 +1,286 @@ +/** + * @fileoverview Rule to require braces in arrow function body. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require braces around arrow function bodies", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-body-style" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["as-needed"] + }, + { + type: "object", + properties: { + requireReturnForObjectLiteral: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + unexpectedOtherBlock: "Unexpected block statement surrounding arrow body.", + unexpectedEmptyBlock: "Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.", + unexpectedObjectBlock: "Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.", + unexpectedSingleBlock: "Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.", + expectedBlock: "Expected block statement surrounding arrow body." + } + }, + + create(context) { + const options = context.options; + const always = options[0] === "always"; + const asNeeded = !options[0] || options[0] === "as-needed"; + const never = options[0] === "never"; + const requireReturnForObjectLiteral = options[1] && options[1].requireReturnForObjectLiteral; + const sourceCode = context.getSourceCode(); + let funcInfo = null; + + /** + * Checks whether the given node has ASI problem or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed. + */ + function hasASIProblem(token) { + return token && token.type === "Punctuator" && /^[([/`+-]/u.test(token.value); + } + + /** + * Gets the closing parenthesis which is the pair of the given opening parenthesis. + * @param {Token} token The opening parenthesis token to get. + * @returns {Token} The found closing parenthesis token. + */ + function findClosingParen(token) { + let node = sourceCode.getNodeByRangeIndex(token.range[0]); + + while (!astUtils.isParenthesised(sourceCode, node)) { + node = node.parent; + } + return sourceCode.getTokenAfter(node); + } + + /** + * Check whether the node is inside of a for loop's init + * @param {ASTNode} node node is inside for loop + * @returns {boolean} `true` if the node is inside of a for loop, else `false` + */ + function isInsideForLoopInitializer(node) { + if (node && node.parent) { + if (node.parent.type === "ForStatement" && node.parent.init === node) { + return true; + } + return isInsideForLoopInitializer(node.parent); + } + return false; + } + + /** + * Determines whether a arrow function body needs braces + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function validate(node) { + const arrowBody = node.body; + + if (arrowBody.type === "BlockStatement") { + const blockBody = arrowBody.body; + + if (blockBody.length !== 1 && !never) { + return; + } + + if (asNeeded && requireReturnForObjectLiteral && blockBody[0].type === "ReturnStatement" && + blockBody[0].argument && blockBody[0].argument.type === "ObjectExpression") { + return; + } + + if (never || asNeeded && blockBody[0].type === "ReturnStatement") { + let messageId; + + if (blockBody.length === 0) { + messageId = "unexpectedEmptyBlock"; + } else if (blockBody.length > 1) { + messageId = "unexpectedOtherBlock"; + } else if (blockBody[0].argument === null) { + messageId = "unexpectedSingleBlock"; + } else if (astUtils.isOpeningBraceToken(sourceCode.getFirstToken(blockBody[0], { skip: 1 }))) { + messageId = "unexpectedObjectBlock"; + } else { + messageId = "unexpectedSingleBlock"; + } + + context.report({ + node, + loc: arrowBody.loc, + messageId, + fix(fixer) { + const fixes = []; + + if (blockBody.length !== 1 || + blockBody[0].type !== "ReturnStatement" || + !blockBody[0].argument || + hasASIProblem(sourceCode.getTokenAfter(arrowBody)) + ) { + return fixes; + } + + const openingBrace = sourceCode.getFirstToken(arrowBody); + const closingBrace = sourceCode.getLastToken(arrowBody); + const firstValueToken = sourceCode.getFirstToken(blockBody[0], 1); + const lastValueToken = sourceCode.getLastToken(blockBody[0]); + const commentsExist = + sourceCode.commentsExistBetween(openingBrace, firstValueToken) || + sourceCode.commentsExistBetween(lastValueToken, closingBrace); + + /* + * Remove tokens around the return value. + * If comments don't exist, remove extra spaces as well. + */ + if (commentsExist) { + fixes.push( + fixer.remove(openingBrace), + fixer.remove(closingBrace), + fixer.remove(sourceCode.getTokenAfter(openingBrace)) // return keyword + ); + } else { + fixes.push( + fixer.removeRange([openingBrace.range[0], firstValueToken.range[0]]), + fixer.removeRange([lastValueToken.range[1], closingBrace.range[1]]) + ); + } + + /* + * If the first token of the reutrn value is `{` or the return value is a sequence expression, + * enclose the return value by parentheses to avoid syntax error. + */ + if (astUtils.isOpeningBraceToken(firstValueToken) || blockBody[0].argument.type === "SequenceExpression" || (funcInfo.hasInOperator && isInsideForLoopInitializer(node))) { + if (!astUtils.isParenthesised(sourceCode, blockBody[0].argument)) { + fixes.push( + fixer.insertTextBefore(firstValueToken, "("), + fixer.insertTextAfter(lastValueToken, ")") + ); + } + } + + /* + * If the last token of the return statement is semicolon, remove it. + * Non-block arrow body is an expression, not a statement. + */ + if (astUtils.isSemicolonToken(lastValueToken)) { + fixes.push(fixer.remove(lastValueToken)); + } + + return fixes; + } + }); + } + } else { + if (always || (asNeeded && requireReturnForObjectLiteral && arrowBody.type === "ObjectExpression")) { + context.report({ + node, + loc: arrowBody.loc, + messageId: "expectedBlock", + fix(fixer) { + const fixes = []; + const arrowToken = sourceCode.getTokenBefore(arrowBody, astUtils.isArrowToken); + const [firstTokenAfterArrow, secondTokenAfterArrow] = sourceCode.getTokensAfter(arrowToken, { count: 2 }); + const lastToken = sourceCode.getLastToken(node); + const isParenthesisedObjectLiteral = + astUtils.isOpeningParenToken(firstTokenAfterArrow) && + astUtils.isOpeningBraceToken(secondTokenAfterArrow); + + // If the value is object literal, remove parentheses which were forced by syntax. + if (isParenthesisedObjectLiteral) { + const openingParenToken = firstTokenAfterArrow; + const openingBraceToken = secondTokenAfterArrow; + + if (astUtils.isTokenOnSameLine(openingParenToken, openingBraceToken)) { + fixes.push(fixer.replaceText(openingParenToken, "{return ")); + } else { + + // Avoid ASI + fixes.push( + fixer.replaceText(openingParenToken, "{"), + fixer.insertTextBefore(openingBraceToken, "return ") + ); + } + + // Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo() + fixes.push(fixer.remove(findClosingParen(openingBraceToken))); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + + } else { + fixes.push(fixer.insertTextBefore(firstTokenAfterArrow, "{return ")); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + } + + return fixes; + } + }); + } + } + } + + return { + "BinaryExpression[operator='in']"() { + let info = funcInfo; + + while (info) { + info.hasInOperator = true; + info = info.upper; + } + }, + ArrowFunctionExpression() { + funcInfo = { + upper: funcInfo, + hasInOperator: false + }; + }, + "ArrowFunctionExpression:exit"(node) { + validate(node); + funcInfo = funcInfo.upper; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-parens.js b/node_modules/eslint/lib/rules/arrow-parens.js new file mode 100644 index 0000000..eaa1aab --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-parens.js @@ -0,0 +1,183 @@ +/** + * @fileoverview Rule to require parens in arrow function arguments. + * @author Jxck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given arrow function has block body. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {boolean} `true` if the function has block body. + */ +function hasBlockBody(node) { + return node.body.type === "BlockStatement"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parentheses around arrow function arguments", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-parens" + }, + + fixable: "code", + + schema: [ + { + enum: ["always", "as-needed"] + }, + { + type: "object", + properties: { + requireForBlockBody: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedParens: "Unexpected parentheses around single function argument.", + expectedParens: "Expected parentheses around arrow function argument.", + + unexpectedParensInline: "Unexpected parentheses around single function argument having a body with no curly braces.", + expectedParensBlock: "Expected parentheses around arrow function argument having a body with curly braces." + } + }, + + create(context) { + const asNeeded = context.options[0] === "as-needed"; + const requireForBlockBody = asNeeded && context.options[1] && context.options[1].requireForBlockBody === true; + + const sourceCode = context.getSourceCode(); + + /** + * Finds opening paren of parameters for the given arrow function, if it exists. + * It is assumed that the given arrow function has exactly one parameter. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {Token|null} the opening paren, or `null` if the given arrow function doesn't have parens of parameters. + */ + function findOpeningParenOfParams(node) { + const tokenBeforeParams = sourceCode.getTokenBefore(node.params[0]); + + if ( + tokenBeforeParams && + astUtils.isOpeningParenToken(tokenBeforeParams) && + node.range[0] <= tokenBeforeParams.range[0] + ) { + return tokenBeforeParams; + } + + return null; + } + + /** + * Finds closing paren of parameters for the given arrow function. + * It is assumed that the given arrow function has parens of parameters and that it has exactly one parameter. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {Token} the closing paren of parameters. + */ + function getClosingParenOfParams(node) { + return sourceCode.getTokenAfter(node.params[0], astUtils.isClosingParenToken); + } + + /** + * Determines whether the given arrow function has comments inside parens of parameters. + * It is assumed that the given arrow function has parens of parameters. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @param {Token} openingParen Opening paren of parameters. + * @returns {boolean} `true` if the function has at least one comment inside of parens of parameters. + */ + function hasCommentsInParensOfParams(node, openingParen) { + return sourceCode.commentsExistBetween(openingParen, getClosingParenOfParams(node)); + } + + /** + * Determines whether the given arrow function has unexpected tokens before opening paren of parameters, + * in which case it will be assumed that the existing parens of parameters are necessary. + * Only tokens within the range of the arrow function (tokens that are part of the arrow function) are taken into account. + * Example: (a) => b + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @param {Token} openingParen Opening paren of parameters. + * @returns {boolean} `true` if the function has at least one unexpected token. + */ + function hasUnexpectedTokensBeforeOpeningParen(node, openingParen) { + const expectedCount = node.async ? 1 : 0; + + return sourceCode.getFirstToken(node, { skip: expectedCount }) !== openingParen; + } + + return { + "ArrowFunctionExpression[params.length=1]"(node) { + const shouldHaveParens = !asNeeded || requireForBlockBody && hasBlockBody(node); + const openingParen = findOpeningParenOfParams(node); + const hasParens = openingParen !== null; + const [param] = node.params; + + if (shouldHaveParens && !hasParens) { + context.report({ + node, + messageId: requireForBlockBody ? "expectedParensBlock" : "expectedParens", + loc: param.loc, + *fix(fixer) { + yield fixer.insertTextBefore(param, "("); + yield fixer.insertTextAfter(param, ")"); + } + }); + } + + if ( + !shouldHaveParens && + hasParens && + param.type === "Identifier" && + !param.typeAnnotation && + !node.returnType && + !hasCommentsInParensOfParams(node, openingParen) && + !hasUnexpectedTokensBeforeOpeningParen(node, openingParen) + ) { + context.report({ + node, + messageId: requireForBlockBody ? "unexpectedParensInline" : "unexpectedParens", + loc: param.loc, + *fix(fixer) { + const tokenBeforeOpeningParen = sourceCode.getTokenBefore(openingParen); + const closingParen = getClosingParenOfParams(node); + + if ( + tokenBeforeOpeningParen && + tokenBeforeOpeningParen.range[1] === openingParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeOpeningParen, sourceCode.getFirstToken(param)) + ) { + yield fixer.insertTextBefore(openingParen, " "); + } + + // remove parens, whitespace inside parens, and possible trailing comma + yield fixer.removeRange([openingParen.range[0], param.range[0]]); + yield fixer.removeRange([param.range[1], closingParen.range[1]]); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-spacing.js b/node_modules/eslint/lib/rules/arrow-spacing.js new file mode 100644 index 0000000..e5110c6 --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-spacing.js @@ -0,0 +1,161 @@ +/** + * @fileoverview Rule to define spacing before/after arrow function's arrow. + * @author Jxck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after the arrow in arrow functions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: true + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + expectedBefore: "Missing space before =>.", + unexpectedBefore: "Unexpected space before =>.", + + expectedAfter: "Missing space after =>.", + unexpectedAfter: "Unexpected space after =>." + } + }, + + create(context) { + + // merge rules with default + const rule = Object.assign({}, context.options[0]); + + rule.before = rule.before !== false; + rule.after = rule.after !== false; + + const sourceCode = context.getSourceCode(); + + /** + * Get tokens of arrow(`=>`) and before/after arrow. + * @param {ASTNode} node The arrow function node. + * @returns {Object} Tokens of arrow and before/after arrow. + */ + function getTokens(node) { + const arrow = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + + return { + before: sourceCode.getTokenBefore(arrow), + arrow, + after: sourceCode.getTokenAfter(arrow) + }; + } + + /** + * Count spaces before/after arrow(`=>`) token. + * @param {Object} tokens Tokens before/after arrow. + * @returns {Object} count of space before/after arrow. + */ + function countSpaces(tokens) { + const before = tokens.arrow.range[0] - tokens.before.range[1]; + const after = tokens.after.range[0] - tokens.arrow.range[1]; + + return { before, after }; + } + + /** + * Determines whether space(s) before after arrow(`=>`) is satisfy rule. + * if before/after value is `true`, there should be space(s). + * if before/after value is `false`, there should be no space. + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function spaces(node) { + const tokens = getTokens(node); + const countSpace = countSpaces(tokens); + + if (rule.before) { + + // should be space(s) before arrow + if (countSpace.before === 0) { + context.report({ + node: tokens.before, + messageId: "expectedBefore", + fix(fixer) { + return fixer.insertTextBefore(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space before arrow + if (countSpace.before > 0) { + context.report({ + node: tokens.before, + messageId: "unexpectedBefore", + fix(fixer) { + return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]); + } + }); + } + } + + if (rule.after) { + + // should be space(s) after arrow + if (countSpace.after === 0) { + context.report({ + node: tokens.after, + messageId: "expectedAfter", + fix(fixer) { + return fixer.insertTextAfter(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space after arrow + if (countSpace.after > 0) { + context.report({ + node: tokens.after, + messageId: "unexpectedAfter", + fix(fixer) { + return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); + } + }); + } + } + } + + return { + ArrowFunctionExpression: spaces + }; + } +}; diff --git a/node_modules/eslint/lib/rules/block-scoped-var.js b/node_modules/eslint/lib/rules/block-scoped-var.js new file mode 100644 index 0000000..481057b --- /dev/null +++ b/node_modules/eslint/lib/rules/block-scoped-var.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to check for "block scoped" variables by binding context + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the use of variables within the scope they are defined", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/block-scoped-var" + }, + + schema: [], + + messages: { + outOfScope: "'{{name}}' used outside of binding context." + } + }, + + create(context) { + let stack = []; + + /** + * Makes a block scope. + * @param {ASTNode} node A node of a scope. + * @returns {void} + */ + function enterScope(node) { + stack.push(node.range); + } + + /** + * Pops the last block scope. + * @returns {void} + */ + function exitScope() { + stack.pop(); + } + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @returns {void} + */ + function report(reference) { + const identifier = reference.identifier; + + context.report({ node: identifier, messageId: "outOfScope", data: { name: identifier.name } }); + } + + /** + * Finds and reports references which are outside of valid scopes. + * @param {ASTNode} node A node to get variables. + * @returns {void} + */ + function checkForVariables(node) { + if (node.kind !== "var") { + return; + } + + // Defines a predicate to check whether or not a given reference is outside of valid scope. + const scopeRange = stack[stack.length - 1]; + + /** + * Check if a reference is out of scope + * @param {ASTNode} reference node to examine + * @returns {boolean} True is its outside the scope + * @private + */ + function isOutsideOfScope(reference) { + const idRange = reference.identifier.range; + + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; + } + + // Gets declared variables, and checks its references. + const variables = context.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + + // Reports. + variables[i] + .references + .filter(isOutsideOfScope) + .forEach(report); + } + } + + return { + Program(node) { + stack = [node.range]; + }, + + // Manages scopes. + BlockStatement: enterScope, + "BlockStatement:exit": exitScope, + ForStatement: enterScope, + "ForStatement:exit": exitScope, + ForInStatement: enterScope, + "ForInStatement:exit": exitScope, + ForOfStatement: enterScope, + "ForOfStatement:exit": exitScope, + SwitchStatement: enterScope, + "SwitchStatement:exit": exitScope, + CatchClause: enterScope, + "CatchClause:exit": exitScope, + + // Finds and reports references which are outside of valid scope. + VariableDeclaration: checkForVariables + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/block-spacing.js b/node_modules/eslint/lib/rules/block-spacing.js new file mode 100644 index 0000000..c4b30b0 --- /dev/null +++ b/node_modules/eslint/lib/rules/block-spacing.js @@ -0,0 +1,164 @@ +/** + * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. + * @author Toru Nagashima + */ + +"use strict"; + +const util = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow or enforce spaces inside of blocks after opening block and before closing block", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/block-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + + messages: { + missing: "Requires a space {{location}} '{{token}}'.", + extra: "Unexpected space(s) {{location}} '{{token}}'." + } + }, + + create(context) { + const always = (context.options[0] !== "never"), + messageId = always ? "missing" : "extra", + sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + if (node.cases.length > 0) { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getLastToken(node, 1); + } + return sourceCode.getFirstToken(node); + } + + /** + * Checks whether or not: + * - given tokens are on same line. + * - there is/isn't a space between given tokens. + * @param {Token} left A token to check. + * @param {Token} right The token which is next to `left`. + * @returns {boolean} + * When the option is `"always"`, `true` if there are one or more spaces between given tokens. + * When the option is `"never"`, `true` if there are not any spaces between given tokens. + * If given tokens are not on same line, it's always `true`. + */ + function isValid(left, right) { + return ( + !util.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === always + ); + } + + /** + * Reports invalid spacing style inside braces. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @returns {void} + */ + function checkSpacingInsideBraces(node) { + + // Gets braces and the first/last token of content. + const openBrace = getOpenBrace(node); + const closeBrace = sourceCode.getLastToken(node); + const firstToken = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + const lastToken = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + // Skip if the node is invalid or empty. + if (openBrace.type !== "Punctuator" || + openBrace.value !== "{" || + closeBrace.type !== "Punctuator" || + closeBrace.value !== "}" || + firstToken === closeBrace + ) { + return; + } + + // Skip line comments for option never + if (!always && firstToken.type === "Line") { + return; + } + + // Check. + if (!isValid(openBrace, firstToken)) { + let loc = openBrace.loc; + + if (messageId === "extra") { + loc = { + start: openBrace.loc.end, + end: firstToken.loc.start + }; + } + + context.report({ + node, + loc, + messageId, + data: { + location: "after", + token: openBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextBefore(firstToken, " "); + } + + return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); + } + }); + } + if (!isValid(lastToken, closeBrace)) { + let loc = closeBrace.loc; + + if (messageId === "extra") { + loc = { + start: lastToken.loc.end, + end: closeBrace.loc.start + }; + } + context.report({ + node, + loc, + messageId, + data: { + location: "before", + token: closeBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextAfter(lastToken, " "); + } + + return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); + } + }); + } + } + + return { + BlockStatement: checkSpacingInsideBraces, + SwitchStatement: checkSpacingInsideBraces + }; + } +}; diff --git a/node_modules/eslint/lib/rules/brace-style.js b/node_modules/eslint/lib/rules/brace-style.js new file mode 100644 index 0000000..07223d1 --- /dev/null +++ b/node_modules/eslint/lib/rules/brace-style.js @@ -0,0 +1,188 @@ +/** + * @fileoverview Rule to flag block statements that do not use the one true brace style + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent brace style for blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/brace-style" + }, + + schema: [ + { + enum: ["1tbs", "stroustrup", "allman"] + }, + { + type: "object", + properties: { + allowSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + nextLineOpen: "Opening curly brace does not appear on the same line as controlling statement.", + sameLineOpen: "Opening curly brace appears on the same line as controlling statement.", + blockSameLine: "Statement inside of curly braces should be on next line.", + nextLineClose: "Closing curly brace does not appear on the same line as the subsequent block.", + singleLineClose: "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.", + sameLineClose: "Closing curly brace appears on the same line as the subsequent block." + } + }, + + create(context) { + const style = context.options[0] || "1tbs", + params = context.options[1] || {}, + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Fixes a place where a newline unexpectedly appears + * @param {Token} firstToken The token before the unexpected newline + * @param {Token} secondToken The token after the unexpected newline + * @returns {Function} A fixer function to remove the newlines between the tokens + */ + function removeNewlineBetween(firstToken, secondToken) { + const textRange = [firstToken.range[1], secondToken.range[0]]; + const textBetween = sourceCode.text.slice(textRange[0], textRange[1]); + + // Don't do a fix if there is a comment between the tokens + if (textBetween.trim()) { + return null; + } + return fixer => fixer.replaceTextRange(textRange, " "); + } + + /** + * Validates a pair of curly brackets based on the user's config + * @param {Token} openingCurly The opening curly bracket + * @param {Token} closingCurly The closing curly bracket + * @returns {void} + */ + function validateCurlyPair(openingCurly, closingCurly) { + const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurly); + const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurly); + const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurly); + const singleLineException = params.allowSingleLine && astUtils.isTokenOnSameLine(openingCurly, closingCurly); + + if (style !== "allman" && !astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly)) { + context.report({ + node: openingCurly, + messageId: "nextLineOpen", + fix: removeNewlineBetween(tokenBeforeOpeningCurly, openingCurly) + }); + } + + if (style === "allman" && astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly) && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "sameLineOpen", + fix: fixer => fixer.insertTextBefore(openingCurly, "\n") + }); + } + + if (astUtils.isTokenOnSameLine(openingCurly, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurly && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "blockSameLine", + fix: fixer => fixer.insertTextAfter(openingCurly, "\n") + }); + } + + if (tokenBeforeClosingCurly !== openingCurly && !singleLineException && astUtils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurly)) { + context.report({ + node: closingCurly, + messageId: "singleLineClose", + fix: fixer => fixer.insertTextBefore(closingCurly, "\n") + }); + } + } + + /** + * Validates the location of a token that appears before a keyword (e.g. a newline before `else`) + * @param {Token} curlyToken The closing curly token. This is assumed to precede a keyword token (such as `else` or `finally`). + * @returns {void} + */ + function validateCurlyBeforeKeyword(curlyToken) { + const keywordToken = sourceCode.getTokenAfter(curlyToken); + + if (style === "1tbs" && !astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "nextLineClose", + fix: removeNewlineBetween(curlyToken, keywordToken) + }); + } + + if (style !== "1tbs" && astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "sameLineClose", + fix: fixer => fixer.insertTextAfter(curlyToken, "\n") + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BlockStatement(node) { + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + } + }, + ClassBody(node) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + }, + SwitchStatement(node) { + const closingCurly = sourceCode.getLastToken(node); + const openingCurly = sourceCode.getTokenBefore(node.cases.length ? node.cases[0] : closingCurly); + + validateCurlyPair(openingCurly, closingCurly); + }, + IfStatement(node) { + if (node.consequent.type === "BlockStatement" && node.alternate) { + + // Handle the keyword after the `if` block (before `else`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.consequent)); + } + }, + TryStatement(node) { + + // Handle the keyword after the `try` block (before `catch` or `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block)); + + if (node.handler && node.finalizer) { + + // Handle the keyword after the `catch` block (before `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.handler.body)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/callback-return.js b/node_modules/eslint/lib/rules/callback-return.js new file mode 100644 index 0000000..ba13c9a --- /dev/null +++ b/node_modules/eslint/lib/rules/callback-return.js @@ -0,0 +1,186 @@ +/** + * @fileoverview Enforce return after a callback. + * @author Jamund Ferguson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require `return` statements after callbacks", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/callback-return" + }, + + schema: [{ + type: "array", + items: { type: "string" } + }], + + messages: { + missingReturn: "Expected return with your callback function." + } + }, + + create(context) { + + const callbacks = context.options[0] || ["callback", "cb", "next"], + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Find the closest parent matching a list of types. + * @param {ASTNode} node The node whose parents we are searching + * @param {Array} types The node types to match + * @returns {ASTNode} The matched node or undefined. + */ + function findClosestParentOfType(node, types) { + if (!node.parent) { + return null; + } + if (types.indexOf(node.parent.type) === -1) { + return findClosestParentOfType(node.parent, types); + } + return node.parent; + } + + /** + * Check to see if a node contains only identifers + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the node contains only identifers + */ + function containsOnlyIdentifiers(node) { + if (node.type === "Identifier") { + return true; + } + + if (node.type === "MemberExpression") { + if (node.object.type === "Identifier") { + return true; + } + if (node.object.type === "MemberExpression") { + return containsOnlyIdentifiers(node.object); + } + } + + return false; + } + + /** + * Check to see if a CallExpression is in our callback list. + * @param {ASTNode} node The node to check against our callback names list. + * @returns {boolean} Whether or not this function matches our callback name. + */ + function isCallback(node) { + return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1; + } + + /** + * Determines whether or not the callback is part of a callback expression. + * @param {ASTNode} node The callback node + * @param {ASTNode} parentNode The expression node + * @returns {boolean} Whether or not this is part of a callback expression + */ + function isCallbackExpression(node, parentNode) { + + // ensure the parent node exists and is an expression + if (!parentNode || parentNode.type !== "ExpressionStatement") { + return false; + } + + // cb() + if (parentNode.expression === node) { + return true; + } + + // special case for cb && cb() and similar + if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") { + if (parentNode.expression.right === node) { + return true; + } + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + + // if we're not a callback we can return + if (!isCallback(node)) { + return; + } + + // find the closest block, return or loop + const closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}; + + // if our parent is a return we know we're ok + if (closestBlock.type === "ReturnStatement") { + return; + } + + // arrow functions don't always have blocks and implicitly return + if (closestBlock.type === "ArrowFunctionExpression") { + return; + } + + // block statements are part of functions and most if statements + if (closestBlock.type === "BlockStatement") { + + // find the last item in the block + const lastItem = closestBlock.body[closestBlock.body.length - 1]; + + // if the callback is the last thing in a block that might be ok + if (isCallbackExpression(node, lastItem)) { + + const parentType = closestBlock.parent.type; + + // but only if the block is part of a function + if (parentType === "FunctionExpression" || + parentType === "FunctionDeclaration" || + parentType === "ArrowFunctionExpression" + ) { + return; + } + + } + + // ending a block with a return is also ok + if (lastItem.type === "ReturnStatement") { + + // but only if the callback is immediately before + if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) { + return; + } + } + + } + + // as long as you're the child of a function at this point you should be asked to return + if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) { + context.report({ node, messageId: "missingReturn" }); + } + + } + + }; + } +}; diff --git a/node_modules/eslint/lib/rules/camelcase.js b/node_modules/eslint/lib/rules/camelcase.js new file mode 100644 index 0000000..d34656c --- /dev/null +++ b/node_modules/eslint/lib/rules/camelcase.js @@ -0,0 +1,325 @@ +/** + * @fileoverview Rule to flag non-camelcased identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce camelcase naming convention", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/camelcase" + }, + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { + type: "boolean", + default: false + }, + ignoreImports: { + type: "boolean", + default: false + }, + ignoreGlobals: { + type: "boolean", + default: false + }, + properties: { + enum: ["always", "never"] + }, + allow: { + type: "array", + items: [ + { + type: "string" + } + ], + minItems: 0, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + notCamelCase: "Identifier '{{name}}' is not in camel case." + } + }, + + create(context) { + + const options = context.options[0] || {}; + let properties = options.properties || ""; + const ignoreDestructuring = options.ignoreDestructuring; + const ignoreImports = options.ignoreImports; + const ignoreGlobals = options.ignoreGlobals; + const allow = options.allow || []; + + let globalScope; + + if (properties !== "always" && properties !== "never") { + properties = "always"; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = []; + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + + /** + * Checks if a string contains an underscore and isn't all upper-case + * @param {string} name The string to check. + * @returns {boolean} if the string is underscored + * @private + */ + function isUnderscored(name) { + + // if there's an underscore, it might be A_CONSTANT, which is okay + return name.includes("_") && name !== name.toUpperCase(); + } + + /** + * Checks if a string match the ignore list + * @param {string} name The string to check. + * @returns {boolean} if the string is ignored + * @private + */ + function isAllowed(name) { + return allow.some( + entry => name === entry || name.match(new RegExp(entry, "u")) + ); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let current = node; + + while (current) { + const parent = current.parent; + + if (parent && parent.type === "Property" && parent.computed && parent.key === current) { + return false; + } + + if (current.type === "ObjectPattern") { + return true; + } + + current = parent; + } + + return false; + } + + /** + * Checks whether the given node represents assignment target property in destructuring. + * + * For examples: + * ({a: b.foo} = c); // => true for `foo` + * ([a.foo] = b); // => true for `foo` + * ([a.foo = 1] = b); // => true for `foo` + * ({...a.foo} = b); // => true for `foo` + * @param {ASTNode} node An Identifier node to check + * @returns {boolean} True if the node is an assignment target property in destructuring. + */ + function isAssignmentTargetPropertyInDestructuring(node) { + if ( + node.parent.type === "MemberExpression" && + node.parent.property === node && + !node.parent.computed + ) { + const effectiveParent = node.parent.parent; + + return ( + effectiveParent.type === "Property" && + effectiveParent.value === node.parent && + effectiveParent.parent.type === "ObjectPattern" || + effectiveParent.type === "ArrayPattern" || + effectiveParent.type === "RestElement" || + ( + effectiveParent.type === "AssignmentPattern" && + effectiveParent.left === node.parent + ) + ); + } + return false; + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Checks whether the given node represents a reference to a property of an object in an object literal expression. + * This allows to differentiate between a global variable that is allowed to be used as a reference, and the key + * of the expressed object (which shouldn't be allowed). + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a property name of an object literal expression + */ + function isPropertyNameInObjectLiteral(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + !parent.computed && + parent.key === node + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reported.includes(node)) { + reported.push(node); + context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + + /* + * Leading and trailing underscores are commonly used to flag + * private/protected identifiers, strip them before checking if underscored + */ + const name = node.name, + nameIsUnderscored = isUnderscored(name.replace(/^_+|_+$/gu, "")), + effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + + // First, we ignore the node if it match the ignore list + if (isAllowed(name)) { + return; + } + + // Check if it's a global variable + if (ignoreGlobals && isReferenceToGlobalVariable(node) && !isPropertyNameInObjectLiteral(node)) { + return; + } + + // MemberExpressions get special rules + if (node.parent.type === "MemberExpression") { + + // "never" check properties + if (properties === "never") { + return; + } + + // Always report underscored object names + if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && nameIsUnderscored) { + report(node); + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && nameIsUnderscored && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) { + report(node); + + } else if (isAssignmentTargetPropertyInDestructuring(node) && nameIsUnderscored) { + report(node); + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { + + if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { + if (node.parent.shorthand && node.parent.value.left && nameIsUnderscored) { + report(node); + } + + const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; + + if (nameIsUnderscored && node.parent.computed) { + report(node); + } + + // prevent checking righthand side of destructured object + if (node.parent.key === node && node.parent.value !== node) { + return; + } + + const valueIsUnderscored = node.parent.value.name && nameIsUnderscored; + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // "never" check properties or always ignore destructuring + if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { + report(node); + } + + // Check if it's an import specifier + } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.parent.type)) { + + if (node.parent.type === "ImportSpecifier" && ignoreImports) { + return; + } + + // Report only if the local imported identifier is underscored + if ( + node.parent.local && + node.parent.local.name === node.name && + nameIsUnderscored + ) { + report(node); + } + + // Report anything that is underscored that isn't a CallExpression + } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { + report(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/capitalized-comments.js b/node_modules/eslint/lib/rules/capitalized-comments.js new file mode 100644 index 0000000..d7524b8 --- /dev/null +++ b/node_modules/eslint/lib/rules/capitalized-comments.js @@ -0,0 +1,300 @@ +/** + * @fileoverview enforce or disallow capitalization of the first letter of a comment + * @author Kevin Partington + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const LETTER_PATTERN = require("./utils/patterns/letters"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN, + WHITESPACE = /\s/gu, + MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u; // TODO: Combine w/ max-len pattern? + +/* + * Base schema body for defining the basic capitalization rule, ignorePattern, + * and ignoreInlineComments values. + * This can be used in a few different ways in the actual schema. + */ +const SCHEMA_BODY = { + type: "object", + properties: { + ignorePattern: { + type: "string" + }, + ignoreInlineComments: { + type: "boolean" + }, + ignoreConsecutiveComments: { + type: "boolean" + } + }, + additionalProperties: false +}; +const DEFAULTS = { + ignorePattern: "", + ignoreInlineComments: false, + ignoreConsecutiveComments: false +}; + +/** + * Get normalized options for either block or line comments from the given + * user-provided options. + * - If the user-provided options is just a string, returns a normalized + * set of options using default values for all other options. + * - If the user-provided options is an object, then a normalized option + * set is returned. Options specified in overrides will take priority + * over options specified in the main options object, which will in + * turn take priority over the rule's defaults. + * @param {Object|string} rawOptions The user-provided options. + * @param {string} which Either "line" or "block". + * @returns {Object} The normalized options. + */ +function getNormalizedOptions(rawOptions, which) { + return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions); +} + +/** + * Get normalized options for block and line comments. + * @param {Object|string} rawOptions The user-provided options. + * @returns {Object} An object with "Line" and "Block" keys and corresponding + * normalized options objects. + */ +function getAllNormalizedOptions(rawOptions = {}) { + return { + Line: getNormalizedOptions(rawOptions, "line"), + Block: getNormalizedOptions(rawOptions, "block") + }; +} + +/** + * Creates a regular expression for each ignorePattern defined in the rule + * options. + * + * This is done in order to avoid invoking the RegExp constructor repeatedly. + * @param {Object} normalizedOptions The normalized rule options. + * @returns {void} + */ +function createRegExpForIgnorePatterns(normalizedOptions) { + Object.keys(normalizedOptions).forEach(key => { + const ignorePatternStr = normalizedOptions[key].ignorePattern; + + if (ignorePatternStr) { + const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u"); + + normalizedOptions[key].ignorePatternRegExp = regExp; + } + }); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce or disallow capitalization of the first letter of a comment", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/capitalized-comments" + }, + + fixable: "code", + + schema: [ + { enum: ["always", "never"] }, + { + oneOf: [ + SCHEMA_BODY, + { + type: "object", + properties: { + line: SCHEMA_BODY, + block: SCHEMA_BODY + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedLowercaseComment: "Comments should not begin with a lowercase character.", + unexpectedUppercaseComment: "Comments should not begin with an uppercase character." + } + }, + + create(context) { + + const capitalize = context.options[0] || "always", + normalizedOptions = getAllNormalizedOptions(context.options[1]), + sourceCode = context.getSourceCode(); + + createRegExpForIgnorePatterns(normalizedOptions); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks whether a comment is an inline comment. + * + * For the purpose of this rule, a comment is inline if: + * 1. The comment is preceded by a token on the same line; and + * 2. The command is followed by a token on the same line. + * + * Note that the comment itself need not be single-line! + * + * Also, it follows from this definition that only block comments can + * be considered as possibly inline. This is because line comments + * would consume any following tokens on the same line as the comment. + * @param {ASTNode} comment The comment node to check. + * @returns {boolean} True if the comment is an inline comment, false + * otherwise. + */ + function isInlineComment(comment) { + const previousToken = sourceCode.getTokenBefore(comment, { includeComments: true }), + nextToken = sourceCode.getTokenAfter(comment, { includeComments: true }); + + return Boolean( + previousToken && + nextToken && + comment.loc.start.line === previousToken.loc.end.line && + comment.loc.end.line === nextToken.loc.start.line + ); + } + + /** + * Determine if a comment follows another comment. + * @param {ASTNode} comment The comment to check. + * @returns {boolean} True if the comment follows a valid comment. + */ + function isConsecutiveComment(comment) { + const previousTokenOrComment = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return Boolean( + previousTokenOrComment && + ["Block", "Line"].indexOf(previousTokenOrComment.type) !== -1 + ); + } + + /** + * Check a comment to determine if it is valid for this rule. + * @param {ASTNode} comment The comment node to process. + * @param {Object} options The options for checking this comment. + * @returns {boolean} True if the comment is valid, false otherwise. + */ + function isCommentValid(comment, options) { + + // 1. Check for default ignore pattern. + if (DEFAULT_IGNORE_PATTERN.test(comment.value)) { + return true; + } + + // 2. Check for custom ignore pattern. + const commentWithoutAsterisks = comment.value + .replace(/\*/gu, ""); + + if (options.ignorePatternRegExp && options.ignorePatternRegExp.test(commentWithoutAsterisks)) { + return true; + } + + // 3. Check for inline comments. + if (options.ignoreInlineComments && isInlineComment(comment)) { + return true; + } + + // 4. Is this a consecutive comment (and are we tolerating those)? + if (options.ignoreConsecutiveComments && isConsecutiveComment(comment)) { + return true; + } + + // 5. Does the comment start with a possible URL? + if (MAYBE_URL.test(commentWithoutAsterisks)) { + return true; + } + + // 6. Is the initial word character a letter? + const commentWordCharsOnly = commentWithoutAsterisks + .replace(WHITESPACE, ""); + + if (commentWordCharsOnly.length === 0) { + return true; + } + + const firstWordChar = commentWordCharsOnly[0]; + + if (!LETTER_PATTERN.test(firstWordChar)) { + return true; + } + + // 7. Check the case of the initial word character. + const isUppercase = firstWordChar !== firstWordChar.toLocaleLowerCase(), + isLowercase = firstWordChar !== firstWordChar.toLocaleUpperCase(); + + if (capitalize === "always" && isLowercase) { + return false; + } + if (capitalize === "never" && isUppercase) { + return false; + } + + return true; + } + + /** + * Process a comment to determine if it needs to be reported. + * @param {ASTNode} comment The comment node to process. + * @returns {void} + */ + function processComment(comment) { + const options = normalizedOptions[comment.type], + commentValid = isCommentValid(comment, options); + + if (!commentValid) { + const messageId = capitalize === "always" + ? "unexpectedLowercaseComment" + : "unexpectedUppercaseComment"; + + context.report({ + node: null, // Intentionally using loc instead + loc: comment.loc, + messageId, + fix(fixer) { + const match = comment.value.match(LETTER_PATTERN); + + return fixer.replaceTextRange( + + // Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*) + [comment.range[0] + match.index + 2, comment.range[0] + match.index + 3], + capitalize === "always" ? match[0].toLocaleUpperCase() : match[0].toLocaleLowerCase() + ); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(processComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/class-methods-use-this.js b/node_modules/eslint/lib/rules/class-methods-use-this.js new file mode 100644 index 0000000..2cc5cc4 --- /dev/null +++ b/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -0,0 +1,125 @@ +/** + * @fileoverview Rule to enforce that all class methods use 'this'. + * @author Patrick Williams + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce that class methods utilize `this`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/class-methods-use-this" + }, + + schema: [{ + type: "object", + properties: { + exceptMethods: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + missingThis: "Expected 'this' to be used by class {{name}}." + } + }, + create(context) { + const config = Object.assign({}, context.options[0]); + const exceptMethods = new Set(config.exceptMethods || []); + + const stack = []; + + /** + * Initializes the current context to false and pushes it onto the stack. + * These booleans represent whether 'this' has been used in the context. + * @returns {void} + * @private + */ + function enterFunction() { + stack.push(false); + } + + /** + * Check if the node is an instance method + * @param {ASTNode} node node to check + * @returns {boolean} True if its an instance method + * @private + */ + function isInstanceMethod(node) { + return !node.static && node.kind !== "constructor" && node.type === "MethodDefinition"; + } + + /** + * Check if the node is an instance method not excluded by config + * @param {ASTNode} node node to check + * @returns {boolean} True if it is an instance method, and not excluded by config + * @private + */ + function isIncludedInstanceMethod(node) { + return isInstanceMethod(node) && + (node.computed || !exceptMethods.has(node.key.name)); + } + + /** + * Checks if we are leaving a function that is a method, and reports if 'this' has not been used. + * Static methods and the constructor are exempt. + * Then pops the context off the stack. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + * @private + */ + function exitFunction(node) { + const methodUsesThis = stack.pop(); + + if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) { + context.report({ + node, + messageId: "missingThis", + data: { + name: astUtils.getFunctionNameWithKind(node) + } + }); + } + } + + /** + * Mark the current context as having used 'this'. + * @returns {void} + * @private + */ + function markThisUsed() { + if (stack.length) { + stack[stack.length - 1] = true; + } + } + + return { + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markThisUsed, + Super: markThisUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/comma-dangle.js b/node_modules/eslint/lib/rules/comma-dangle.js new file mode 100644 index 0000000..e22b7f3 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-dangle.js @@ -0,0 +1,340 @@ +/** + * @fileoverview Rule to forbid or enforce dangling commas. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_OPTIONS = Object.freeze({ + arrays: "never", + objects: "never", + imports: "never", + exports: "never", + functions: "never" +}); + +/** + * Checks whether or not a trailing comma is allowed in a given node. + * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas. + * @param {ASTNode} lastItem The node of the last element in the given node. + * @returns {boolean} `true` if a trailing comma is allowed. + */ +function isTrailingCommaAllowed(lastItem) { + return !( + lastItem.type === "RestElement" || + lastItem.type === "RestProperty" || + lastItem.type === "ExperimentalRestProperty" + ); +} + +/** + * Normalize option value. + * @param {string|Object|undefined} optionValue The 1st option value to normalize. + * @param {number} ecmaVersion The normalized ECMAScript version. + * @returns {Object} The normalized option value. + */ +function normalizeOptions(optionValue, ecmaVersion) { + if (typeof optionValue === "string") { + return { + arrays: optionValue, + objects: optionValue, + imports: optionValue, + exports: optionValue, + functions: (!ecmaVersion || ecmaVersion < 8) ? "ignore" : optionValue + }; + } + if (typeof optionValue === "object" && optionValue !== null) { + return { + arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays, + objects: optionValue.objects || DEFAULT_OPTIONS.objects, + imports: optionValue.imports || DEFAULT_OPTIONS.imports, + exports: optionValue.exports || DEFAULT_OPTIONS.exports, + functions: optionValue.functions || DEFAULT_OPTIONS.functions + }; + } + + return DEFAULT_OPTIONS; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow trailing commas", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-dangle" + }, + + fixable: "code", + + schema: { + definitions: { + value: { + enum: [ + "always-multiline", + "always", + "never", + "only-multiline" + ] + }, + valueWithIgnore: { + enum: [ + "always-multiline", + "always", + "ignore", + "never", + "only-multiline" + ] + } + }, + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + arrays: { $ref: "#/definitions/valueWithIgnore" }, + objects: { $ref: "#/definitions/valueWithIgnore" }, + imports: { $ref: "#/definitions/valueWithIgnore" }, + exports: { $ref: "#/definitions/valueWithIgnore" }, + functions: { $ref: "#/definitions/valueWithIgnore" } + }, + additionalProperties: false + } + ] + } + ] + }, + + messages: { + unexpected: "Unexpected trailing comma.", + missing: "Missing trailing comma." + } + }, + + create(context) { + const options = normalizeOptions(context.options[0], context.parserOptions.ecmaVersion); + + const sourceCode = context.getSourceCode(); + + /** + * Gets the last item of the given node. + * @param {ASTNode} node The node to get. + * @returns {ASTNode|null} The last node or null. + */ + function getLastItem(node) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + return lodash.last(node.properties); + case "ArrayExpression": + case "ArrayPattern": + return lodash.last(node.elements); + case "ImportDeclaration": + case "ExportNamedDeclaration": + return lodash.last(node.specifiers); + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + return lodash.last(node.params); + case "CallExpression": + case "NewExpression": + return lodash.last(node.arguments); + default: + return null; + } + } + + /** + * Gets the trailing comma token of the given node. + * If the trailing comma does not exist, this returns the token which is + * the insertion point of the trailing comma token. + * @param {ASTNode} node The node to get. + * @param {ASTNode} lastItem The last item of the node. + * @returns {Token} The trailing comma token or the insertion point. + */ + function getTrailingToken(node, lastItem) { + switch (node.type) { + case "ObjectExpression": + case "ArrayExpression": + case "CallExpression": + case "NewExpression": + return sourceCode.getLastToken(node, 1); + default: { + const nextToken = sourceCode.getTokenAfter(lastItem); + + if (astUtils.isCommaToken(nextToken)) { + return nextToken; + } + return sourceCode.getLastToken(lastItem); + } + } + } + + /** + * Checks whether or not a given node is multiline. + * This rule handles a given node as multiline when the closing parenthesis + * and the last element are not on the same line. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is multiline. + */ + function isMultiline(node) { + const lastItem = getLastItem(node); + + if (!lastItem) { + return false; + } + + const penultimateToken = getTrailingToken(node, lastItem); + const lastToken = sourceCode.getTokenAfter(penultimateToken); + + return lastToken.loc.end.line !== penultimateToken.loc.end.line; + } + + /** + * Reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forbidTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (astUtils.isCommaToken(trailingToken)) { + context.report({ + node: lastItem, + loc: trailingToken.loc, + messageId: "unexpected", + fix(fixer) { + return fixer.remove(trailingToken); + } + }); + } + } + + /** + * Reports the last element of a given node if it does not have a trailing + * comma. + * + * If a given node is `ArrayPattern` which has `RestElement`, the trailing + * comma is disallowed, so report if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + if (!isTrailingCommaAllowed(lastItem)) { + forbidTrailingComma(node); + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (trailingToken.value !== ",") { + context.report({ + node: lastItem, + loc: { + start: trailingToken.loc.end, + end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end) + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(trailingToken, ","); + } + }); + } + } + + /** + * If a given node is multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingCommaIfMultiline(node) { + if (isMultiline(node)) { + forceTrailingComma(node); + } else { + forbidTrailingComma(node); + } + } + + /** + * Only if a given node is not multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function allowTrailingCommaIfMultiline(node) { + if (!isMultiline(node)) { + forbidTrailingComma(node); + } + } + + const predicate = { + always: forceTrailingComma, + "always-multiline": forceTrailingCommaIfMultiline, + "only-multiline": allowTrailingCommaIfMultiline, + never: forbidTrailingComma, + ignore: lodash.noop + }; + + return { + ObjectExpression: predicate[options.objects], + ObjectPattern: predicate[options.objects], + + ArrayExpression: predicate[options.arrays], + ArrayPattern: predicate[options.arrays], + + ImportDeclaration: predicate[options.imports], + + ExportNamedDeclaration: predicate[options.exports], + + FunctionDeclaration: predicate[options.functions], + FunctionExpression: predicate[options.functions], + ArrowFunctionExpression: predicate[options.functions], + CallExpression: predicate[options.functions], + NewExpression: predicate[options.functions] + }; + } +}; diff --git a/node_modules/eslint/lib/rules/comma-spacing.js b/node_modules/eslint/lib/rules/comma-spacing.js new file mode 100644 index 0000000..73c10a7 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-spacing.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Comma spacing - validates spacing before and after comma + * @author Vignesh Anand aka vegetableman. + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after commas", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + missing: "A space is required {{loc}} ','.", + unexpected: "There should be no space {{loc}} ','." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + const tokensAndComments = sourceCode.tokensAndComments; + + const options = { + before: context.options[0] ? context.options[0].before : false, + after: context.options[0] ? context.options[0].after : true + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // list of comma tokens to ignore for the check of leading whitespace + const commaTokensToIgnore = []; + + /** + * Reports a spacing error with an appropriate message. + * @param {ASTNode} node The binary expression node to report. + * @param {string} loc Is the error "before" or "after" the comma? + * @param {ASTNode} otherNode The node at the left or right of `node` + * @returns {void} + * @private + */ + function report(node, loc, otherNode) { + context.report({ + node, + fix(fixer) { + if (options[loc]) { + if (loc === "before") { + return fixer.insertTextBefore(node, " "); + } + return fixer.insertTextAfter(node, " "); + + } + let start, end; + const newText = ""; + + if (loc === "before") { + start = otherNode.range[1]; + end = node.range[0]; + } else { + start = node.range[1]; + end = otherNode.range[0]; + } + + return fixer.replaceTextRange([start, end], newText); + + }, + messageId: options[loc] ? "missing" : "unexpected", + data: { + loc + } + }); + } + + /** + * Validates the spacing around a comma token. + * @param {Object} tokens The tokens to be validated. + * @param {Token} tokens.comma The token representing the comma. + * @param {Token} [tokens.left] The last token before the comma. + * @param {Token} [tokens.right] The first token after the comma. + * @param {Token|ASTNode} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(tokens, reportItem) { + if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) && + (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma)) + ) { + report(reportItem, "before", tokens.left); + } + + if (tokens.right && astUtils.isClosingParenToken(tokens.right)) { + return; + } + + if (tokens.right && !options.after && tokens.right.type === "Line") { + return; + } + + if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) && + (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right)) + ) { + report(reportItem, "after", tokens.right); + } + } + + /** + * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. + * @param {ASTNode} node An ArrayExpression or ArrayPattern node. + * @returns {void} + */ + function addNullElementsToIgnoreList(node) { + let previousToken = sourceCode.getFirstToken(node); + + node.elements.forEach(element => { + let token; + + if (element === null) { + token = sourceCode.getTokenAfter(previousToken); + + if (astUtils.isCommaToken(token)) { + commaTokensToIgnore.push(token); + } + } else { + token = sourceCode.getTokenAfter(element); + } + + previousToken = token; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"() { + tokensAndComments.forEach((token, i) => { + + if (!astUtils.isCommaToken(token)) { + return; + } + + if (token && token.type === "JSXText") { + return; + } + + const previousToken = tokensAndComments[i - 1]; + const nextToken = tokensAndComments[i + 1]; + + validateCommaItemSpacing({ + comma: token, + left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, + right: astUtils.isCommaToken(nextToken) ? null : nextToken + }, token); + }); + }, + ArrayExpression: addNullElementsToIgnoreList, + ArrayPattern: addNullElementsToIgnoreList + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/comma-style.js b/node_modules/eslint/lib/rules/comma-style.js new file mode 100644 index 0000000..f1a23d6 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-style.js @@ -0,0 +1,310 @@ +/** + * @fileoverview Comma style - enforces comma styles of two types: last and first + * @author Vignesh Anand aka vegetableman + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent comma style", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-style" + }, + + fixable: "code", + + schema: [ + { + enum: ["first", "last"] + }, + { + type: "object", + properties: { + exceptions: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLineBeforeAndAfterComma: "Bad line breaking before and after ','.", + expectedCommaFirst: "',' should be placed first.", + expectedCommaLast: "',' should be placed last." + } + }, + + create(context) { + const style = context.options[0] || "last", + sourceCode = context.getSourceCode(); + const exceptions = { + ArrayPattern: true, + ArrowFunctionExpression: true, + CallExpression: true, + FunctionDeclaration: true, + FunctionExpression: true, + ImportDeclaration: true, + ObjectPattern: true, + NewExpression: true + }; + + if (context.options.length === 2 && Object.prototype.hasOwnProperty.call(context.options[1], "exceptions")) { + const keys = Object.keys(context.options[1].exceptions); + + for (let i = 0; i < keys.length; i++) { + exceptions[keys[i]] = context.options[1].exceptions[keys[i]]; + } + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Modified text based on the style + * @param {string} styleType Style type + * @param {string} text Source code text + * @returns {string} modified text + * @private + */ + function getReplacedText(styleType, text) { + switch (styleType) { + case "between": + return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`; + + case "first": + return `${text},`; + + case "last": + return `,${text}`; + + default: + return ""; + } + } + + /** + * Determines the fixer function for a given style. + * @param {string} styleType comma style + * @param {ASTNode} previousItemToken The token to check. + * @param {ASTNode} commaToken The token to check. + * @param {ASTNode} currentItemToken The token to check. + * @returns {Function} Fixer function + * @private + */ + function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) { + const text = + sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) + + sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]); + const range = [previousItemToken.range[1], currentItemToken.range[0]]; + + return function(fixer) { + return fixer.replaceTextRange(range, getReplacedText(styleType, text)); + }; + } + + /** + * Validates the spacing around single items in lists. + * @param {Token} previousItemToken The last token from the previous item. + * @param {Token} commaToken The token representing the comma. + * @param {Token} currentItemToken The first token of the current item. + * @param {Token} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { + + // if single line + if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + // do nothing. + + } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + const comment = sourceCode.getCommentsAfter(commaToken)[0]; + const styleType = comment && comment.type === "Block" && astUtils.isTokenOnSameLine(commaToken, comment) + ? style + : "between"; + + // lone comma + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "unexpectedLineBeforeAndAfterComma", + fix: getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaFirst", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaLast", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + } + } + + /** + * Checks the comma placement with regards to a declaration/property/element + * @param {ASTNode} node The binary expression node to check + * @param {string} property The property of the node containing child nodes. + * @private + * @returns {void} + */ + function validateComma(node, property) { + const items = node[property], + arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + + if (items.length > 1 || arrayLiteral) { + + // seed as opening [ + let previousItemToken = sourceCode.getFirstToken(node); + + items.forEach(item => { + const commaToken = item ? sourceCode.getTokenBefore(item) : previousItemToken, + currentItemToken = item ? sourceCode.getFirstToken(item) : sourceCode.getTokenAfter(commaToken), + reportItem = item || currentItemToken; + + /* + * This works by comparing three token locations: + * - previousItemToken is the last token of the previous item + * - commaToken is the location of the comma before the current item + * - currentItemToken is the first token of the current item + * + * These values get switched around if item is undefined. + * previousItemToken will refer to the last token not belonging + * to the current item, which could be a comma or an opening + * square bracket. currentItemToken could be a comma. + * + * All comparisons are done based on these tokens directly, so + * they are always valid regardless of an undefined item. + */ + if (astUtils.isCommaToken(commaToken)) { + validateCommaItemSpacing(previousItemToken, commaToken, + currentItemToken, reportItem); + } + + if (item) { + const tokenAfterItem = sourceCode.getTokenAfter(item, astUtils.isNotClosingParenToken); + + previousItemToken = tokenAfterItem + ? sourceCode.getTokenBefore(tokenAfterItem) + : sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1]; + } + }); + + /* + * Special case for array literals that have empty last items, such + * as [ 1, 2, ]. These arrays only have two items show up in the + * AST, so we need to look at the token to verify that there's no + * dangling comma. + */ + if (arrayLiteral) { + + const lastToken = sourceCode.getLastToken(node), + nextToLastToken = sourceCode.getTokenBefore(lastToken); + + if (astUtils.isCommaToken(nextToLastToken)) { + validateCommaItemSpacing( + sourceCode.getTokenBefore(nextToLastToken), + nextToLastToken, + lastToken, + lastToken + ); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const nodes = {}; + + if (!exceptions.VariableDeclaration) { + nodes.VariableDeclaration = function(node) { + validateComma(node, "declarations"); + }; + } + if (!exceptions.ObjectExpression) { + nodes.ObjectExpression = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ObjectPattern) { + nodes.ObjectPattern = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ArrayExpression) { + nodes.ArrayExpression = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.ArrayPattern) { + nodes.ArrayPattern = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.FunctionDeclaration) { + nodes.FunctionDeclaration = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.FunctionExpression) { + nodes.FunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.ArrowFunctionExpression) { + nodes.ArrowFunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.CallExpression) { + nodes.CallExpression = function(node) { + validateComma(node, "arguments"); + }; + } + if (!exceptions.ImportDeclaration) { + nodes.ImportDeclaration = function(node) { + validateComma(node, "specifiers"); + }; + } + if (!exceptions.NewExpression) { + nodes.NewExpression = function(node) { + validateComma(node, "arguments"); + }; + } + + return nodes; + } +}; diff --git a/node_modules/eslint/lib/rules/complexity.js b/node_modules/eslint/lib/rules/complexity.js new file mode 100644 index 0000000..7fc8bf9 --- /dev/null +++ b/node_modules/eslint/lib/rules/complexity.js @@ -0,0 +1,160 @@ +/** + * @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity. + * Counts the number of if, conditional, for, while, try, switch/case, + * @author Patrick Brosset + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum cyclomatic complexity allowed in a program", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/complexity" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + complex: "{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let THRESHOLD = 20; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store complexity (handling nested functions) + const fns = []; + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + fns.push(1); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + const complexity = fns.pop(); + + if (complexity > THRESHOLD) { + context.report({ + node, + messageId: "complex", + data: { name, complexity, max: THRESHOLD } + }); + } + } + + /** + * Increase the complexity of the function in context + * @returns {void} + * @private + */ + function increaseComplexity() { + if (fns.length) { + fns[fns.length - 1]++; + } + } + + /** + * Increase the switch complexity in context + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function increaseSwitchComplexity(node) { + + // Avoiding `default` + if (node.test) { + increaseComplexity(); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + + CatchClause: increaseComplexity, + ConditionalExpression: increaseComplexity, + LogicalExpression: increaseComplexity, + ForStatement: increaseComplexity, + ForInStatement: increaseComplexity, + ForOfStatement: increaseComplexity, + IfStatement: increaseComplexity, + SwitchCase: increaseSwitchComplexity, + WhileStatement: increaseComplexity, + DoWhileStatement: increaseComplexity + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/computed-property-spacing.js b/node_modules/eslint/lib/rules/computed-property-spacing.js new file mode 100644 index 0000000..53fdb8f --- /dev/null +++ b/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Disallows or enforces spaces inside computed properties. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside computed property brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/computed-property-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + + missingSpaceBefore: "A space is required before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" + const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenAfter The token after `token`. + * @returns {void} + */ + function reportNoBeginningSpace(node, token, tokenAfter) { + context.report({ + node, + loc: { start: token.loc.end, end: tokenAfter.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenBefore The token before `token`. + * @returns {void} + */ + function reportNoEndingSpace(node, token, tokenBefore) { + context.report({ + node, + loc: { start: tokenBefore.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Returns a function that checks the spacing of a node on the property name + * that was passed in. + * @param {string} propertyName The property on the node to check for spacing + * @returns {Function} A function that will check spacing on a node + */ + function checkSpacing(propertyName) { + return function(node) { + if (!node.computed) { + return; + } + + const property = node[propertyName]; + + const before = sourceCode.getTokenBefore(property, astUtils.isOpeningBracketToken), + first = sourceCode.getTokenAfter(before, { includeComments: true }), + after = sourceCode.getTokenAfter(property, astUtils.isClosingBracketToken), + last = sourceCode.getTokenBefore(after, { includeComments: true }); + + if (astUtils.isTokenOnSameLine(before, first)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) { + reportRequiredBeginningSpace(node, before); + } + } else { + if (sourceCode.isSpaceBetweenTokens(before, first)) { + reportNoBeginningSpace(node, before, first); + } + } + } + + if (astUtils.isTokenOnSameLine(last, after)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { + reportRequiredEndingSpace(node, after); + } + } else { + if (sourceCode.isSpaceBetweenTokens(last, after)) { + reportNoEndingSpace(node, after, last); + } + } + } + }; + } + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const listeners = { + Property: checkSpacing("key"), + MemberExpression: checkSpacing("property") + }; + + if (enforceForClassMembers) { + listeners.MethodDefinition = checkSpacing("key"); + } + + return listeners; + + } +}; diff --git a/node_modules/eslint/lib/rules/consistent-return.js b/node_modules/eslint/lib/rules/consistent-return.js new file mode 100644 index 0000000..94db253 --- /dev/null +++ b/node_modules/eslint/lib/rules/consistent-return.js @@ -0,0 +1,185 @@ +/** + * @fileoverview Rule to flag consistent return values + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} + +/** + * Checks whether a given node is a `constructor` method in an ES6 class + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is a `constructor` method + */ +function isClassConstructor(node) { + return node.type === "FunctionExpression" && + node.parent && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `return` statements to either always or never specify values", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/consistent-return" + }, + + schema: [{ + type: "object", + properties: { + treatUndefinedAsUnspecified: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + missingReturn: "Expected to return a value at the end of {{name}}.", + missingReturnValue: "{{name}} expected a return value.", + unexpectedReturnValue: "{{name}} expected no return value." + } + }, + + create(context) { + const options = context.options[0] || {}; + const treatUndefinedAsUnspecified = options.treatUndefinedAsUnspecified === true; + let funcInfo = null; + + /** + * Checks whether of not the implicit returning is consistent if the last + * code path segment is reachable. + * @param {ASTNode} node A program/function node to check. + * @returns {void} + */ + function checkLastSegment(node) { + let loc, name; + + /* + * Skip if it expected no return value or unreachable. + * When unreachable, all paths are returned or thrown. + */ + if (!funcInfo.hasReturnValue || + funcInfo.codePath.currentSegments.every(isUnreachable) || + astUtils.isES5Constructor(node) || + isClassConstructor(node) + ) { + return; + } + + // Adjust a location and a message. + if (node.type === "Program") { + + // The head of program. + loc = { line: 1, column: 0 }; + name = "program"; + } else if (node.type === "ArrowFunctionExpression") { + + // `=>` token + loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc.start; + } else if ( + node.parent.type === "MethodDefinition" || + (node.parent.type === "Property" && node.parent.method) + ) { + + // Method name. + loc = node.parent.key.loc.start; + } else { + + // Function name or `function` keyword. + loc = (node.id || node).loc.start; + } + + if (!name) { + name = astUtils.getFunctionNameWithKind(node); + } + + // Reports. + context.report({ + node, + loc, + messageId: "missingReturn", + data: { name } + }); + } + + return { + + // Initializes/Disposes state of each code path. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + hasReturnValue: false, + messageId: "", + node + }; + }, + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Reports a given return statement if it's inconsistent. + ReturnStatement(node) { + const argument = node.argument; + let hasReturnValue = Boolean(argument); + + if (treatUndefinedAsUnspecified && hasReturnValue) { + hasReturnValue = !astUtils.isSpecificId(argument, "undefined") && argument.operator !== "void"; + } + + if (!funcInfo.hasReturn) { + funcInfo.hasReturn = true; + funcInfo.hasReturnValue = hasReturnValue; + funcInfo.messageId = hasReturnValue ? "missingReturnValue" : "unexpectedReturnValue"; + funcInfo.data = { + name: funcInfo.node.type === "Program" + ? "Program" + : lodash.upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) + }; + } else if (funcInfo.hasReturnValue !== hasReturnValue) { + context.report({ + node, + messageId: funcInfo.messageId, + data: funcInfo.data + }); + } + }, + + // Reports a given program/function if the implicit returning is not consistent. + "Program:exit": checkLastSegment, + "FunctionDeclaration:exit": checkLastSegment, + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/consistent-this.js b/node_modules/eslint/lib/rules/consistent-this.js new file mode 100644 index 0000000..e5bc967 --- /dev/null +++ b/node_modules/eslint/lib/rules/consistent-this.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Rule to enforce consistent naming of "this" context variables + * @author Raphael Pigulla + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent naming when capturing the current execution context", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/consistent-this" + }, + + schema: { + type: "array", + items: { + type: "string", + minLength: 1 + }, + uniqueItems: true + }, + + messages: { + aliasNotAssignedToThis: "Designated alias '{{name}}' is not assigned to 'this'.", + unexpectedAlias: "Unexpected alias '{{name}}' for 'this'." + } + }, + + create(context) { + let aliases = []; + + if (context.options.length === 0) { + aliases.push("that"); + } else { + aliases = context.options; + } + + /** + * Reports that a variable declarator or assignment expression is assigning + * a non-'this' value to the specified alias. + * @param {ASTNode} node The assigning node. + * @param {string} name the name of the alias that was incorrectly used. + * @returns {void} + */ + function reportBadAssignment(node, name) { + context.report({ node, messageId: "aliasNotAssignedToThis", data: { name } }); + } + + /** + * Checks that an assignment to an identifier only assigns 'this' to the + * appropriate alias, and the alias is only assigned to 'this'. + * @param {ASTNode} node The assigning node. + * @param {Identifier} name The name of the variable assigned to. + * @param {Expression} value The value of the assignment. + * @returns {void} + */ + function checkAssignment(node, name, value) { + const isThis = value.type === "ThisExpression"; + + if (aliases.indexOf(name) !== -1) { + if (!isThis || node.operator && node.operator !== "=") { + reportBadAssignment(node, name); + } + } else if (isThis) { + context.report({ node, messageId: "unexpectedAlias", data: { name } }); + } + } + + /** + * Ensures that a variable declaration of the alias in a program or function + * is assigned to the correct value. + * @param {string} alias alias the check the assignment of. + * @param {Object} scope scope of the current code we are checking. + * @private + * @returns {void} + */ + function checkWasAssigned(alias, scope) { + const variable = scope.set.get(alias); + + if (!variable) { + return; + } + + if (variable.defs.some(def => def.node.type === "VariableDeclarator" && + def.node.init !== null)) { + return; + } + + /* + * The alias has been declared and not assigned: check it was + * assigned later in the same scope. + */ + if (!variable.references.some(reference => { + const write = reference.writeExpr; + + return ( + reference.from === scope && + write && write.type === "ThisExpression" && + write.parent.operator === "=" + ); + })) { + variable.defs.map(def => def.node).forEach(node => { + reportBadAssignment(node, alias); + }); + } + } + + /** + * Check each alias to ensure that is was assigned to the correct value. + * @returns {void} + */ + function ensureWasAssigned() { + const scope = context.getScope(); + + aliases.forEach(alias => { + checkWasAssigned(alias, scope); + }); + } + + return { + "Program:exit": ensureWasAssigned, + "FunctionExpression:exit": ensureWasAssigned, + "FunctionDeclaration:exit": ensureWasAssigned, + + VariableDeclarator(node) { + const id = node.id; + const isDestructuring = + id.type === "ArrayPattern" || id.type === "ObjectPattern"; + + if (node.init !== null && !isDestructuring) { + checkAssignment(node, id.name, node.init); + } + }, + + AssignmentExpression(node) { + if (node.left.type === "Identifier") { + checkAssignment(node, node.left.name, node.right); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/constructor-super.js b/node_modules/eslint/lib/rules/constructor-super.js new file mode 100644 index 0000000..8787fc5 --- /dev/null +++ b/node_modules/eslint/lib/rules/constructor-super.js @@ -0,0 +1,412 @@ +/** + * @fileoverview A rule to verify `super()` callings in constructor. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given code path segment is reachable or not. + * @param {CodePathSegment} segment A code path segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +/** + * Checks whether a given node can be a constructor or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node can be a constructor. + */ +function isPossibleConstructor(node) { + if (!node) { + return false; + } + + switch (node.type) { + case "ClassExpression": + case "FunctionExpression": + case "ThisExpression": + case "MemberExpression": + case "CallExpression": + case "NewExpression": + case "ChainExpression": + case "YieldExpression": + case "TaggedTemplateExpression": + case "MetaProperty": + return true; + + case "Identifier": + return node.name !== "undefined"; + + case "AssignmentExpression": + if (["=", "&&="].includes(node.operator)) { + return isPossibleConstructor(node.right); + } + + if (["||=", "??="].includes(node.operator)) { + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + } + + /** + * All other assignment operators are mathematical assignment operators (arithmetic or bitwise). + * An assignment expression with a mathematical operator can either evaluate to a primitive value, + * or throw, depending on the operands. Thus, it cannot evaluate to a constructor function. + */ + return false; + + case "LogicalExpression": + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + + case "ConditionalExpression": + return ( + isPossibleConstructor(node.alternate) || + isPossibleConstructor(node.consequent) + ); + + case "SequenceExpression": { + const lastExpression = node.expressions[node.expressions.length - 1]; + + return isPossibleConstructor(lastExpression); + } + + default: + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "require `super()` calls in constructors", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/constructor-super" + }, + + schema: [], + + messages: { + missingSome: "Lacked a call of 'super()' in some code paths.", + missingAll: "Expected to call 'super()'.", + + duplicate: "Unexpected duplicate 'super()'.", + badSuper: "Unexpected 'super()' because 'super' is not a constructor.", + unexpected: "Unexpected 'super()'." + } + }, + + create(context) { + + /* + * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]} + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether own class has a valid `extends` + * part. + * - scope: The scope of own class. + * - codePath: The code path object of the constructor. + */ + let funcInfo = null; + + /* + * {Map} + * Information for each code path segment. + * - calledInSomePaths: A flag of be called `super()` in some code paths. + * - calledInEveryPaths: A flag of be called `super()` in all code paths. + * - validNodes: + */ + let segInfoMap = Object.create(null); + + /** + * Gets the flag which shows `super()` is called in some paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in some paths + */ + function isCalledInSomePath(segment) { + return segment.reachable && segInfoMap[segment.id].calledInSomePaths; + } + + /** + * Gets the flag which shows `super()` is called in all paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in all paths. + */ + function isCalledInEveryPath(segment) { + + /* + * If specific segment is the looped segment of the current segment, + * skip the segment. + * If not skipped, this never becomes true after a loop. + */ + if (segment.nextSegments.length === 1 && + segment.nextSegments[0].isLoopedPrevSegment(segment) + ) { + return true; + } + return segment.reachable && segInfoMap[segment.id].calledInEveryPaths; + } + + return { + + /** + * Stacks a constructor information. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + const superClass = classNode.superClass; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean(superClass), + superIsConstructor: isPossibleConstructor(superClass), + codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + superIsConstructor: false, + codePath + }; + } + }, + + /** + * Pops a constructor information. + * And reports if `super()` lacked. + * @param {CodePath} codePath A code path which was ended. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathEnd(codePath, node) { + const hasExtends = funcInfo.hasExtends; + + // Pop. + funcInfo = funcInfo.upper; + + if (!hasExtends) { + return; + } + + // Reports if `super()` lacked. + const segments = codePath.returnedSegments; + const calledInEveryPaths = segments.every(isCalledInEveryPath); + const calledInSomePaths = segments.some(isCalledInSomePath); + + if (!calledInEveryPaths) { + context.report({ + messageId: calledInSomePaths + ? "missingSome" + : "missingAll", + node: node.parent + }); + } + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Initialize info. + const info = segInfoMap[segment.id] = { + calledInSomePaths: false, + calledInEveryPaths: false, + validNodes: [] + }; + + // When there are previous segments, aggregates these. + const prevSegments = segment.prevSegments; + + if (prevSegments.length > 0) { + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + } + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Update information inside of the loop. + const isRealLoop = toSegment.prevSegments.length >= 2; + + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + segment => { + const info = segInfoMap[segment.id]; + const prevSegments = segment.prevSegments; + + // Updates flags. + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + + // If flags become true anew, reports the valid nodes. + if (info.calledInSomePaths || isRealLoop) { + const nodes = info.validNodes; + + info.validNodes = []; + + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + + context.report({ + messageId: "duplicate", + node + }); + } + } + } + ); + }, + + /** + * Checks for a call of `super()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (!(funcInfo && funcInfo.isConstructor)) { + return; + } + + // Skips except `super()`. + if (node.callee.type !== "Super") { + return; + } + + // Reports if needed. + if (funcInfo.hasExtends) { + const segments = funcInfo.codePath.currentSegments; + let duplicate = false; + let info = null; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + info = segInfoMap[segment.id]; + + duplicate = duplicate || info.calledInSomePaths; + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + + if (info) { + if (duplicate) { + context.report({ + messageId: "duplicate", + node + }); + } else if (!funcInfo.superIsConstructor) { + context.report({ + messageId: "badSuper", + node + }); + } else { + info.validNodes.push(node); + } + } + } else if (funcInfo.codePath.currentSegments.some(isReachable)) { + context.report({ + messageId: "unexpected", + node + }); + } + }, + + /** + * Set the mark to the returned path as `super()` was called. + * @param {ASTNode} node A ReturnStatement node to check. + * @returns {void} + */ + ReturnStatement(node) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Skips if no argument. + if (!node.argument) { + return; + } + + // Returning argument is a substitute of 'super()'. + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + const info = segInfoMap[segment.id]; + + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/curly.js b/node_modules/eslint/lib/rules/curly.js new file mode 100644 index 0000000..92d31a6 --- /dev/null +++ b/node_modules/eslint/lib/rules/curly.js @@ -0,0 +1,495 @@ +/** + * @fileoverview Rule to flag statements without curly braces + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent brace style for all control statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/curly" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["all"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["multi", "multi-line", "multi-or-nest"] + }, + { + enum: ["consistent"] + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + missingCurlyAfter: "Expected { after '{{name}}'.", + missingCurlyAfterCondition: "Expected { after '{{name}}' condition.", + unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.", + unexpectedCurlyAfterCondition: "Unnecessary { after '{{name}}' condition." + } + }, + + create(context) { + + const multiOnly = (context.options[0] === "multi"); + const multiLine = (context.options[0] === "multi-line"); + const multiOrNest = (context.options[0] === "multi-or-nest"); + const consistent = (context.options[1] === "consistent"); + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines if a given node is a one-liner that's on the same line as it's preceding code. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code. + * @private + */ + function isCollapsedOneLiner(node) { + const before = sourceCode.getTokenBefore(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return before.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if a given node is a one-liner. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner. + * @private + */ + function isOneLiner(node) { + if (node.type === "EmptyStatement") { + return true; + } + + const first = sourceCode.getFirstToken(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return first.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if the given node is a lexical declaration (let, const, function, or class) + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lexical declaration + * @private + */ + function isLexicalDeclaration(node) { + if (node.type === "VariableDeclaration") { + return node.kind === "const" || node.kind === "let"; + } + + return node.type === "FunctionDeclaration" || node.type === "ClassDeclaration"; + } + + /** + * Checks if the given token is an `else` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an `else` token. + */ + function isElseKeywordToken(token) { + return token.value === "else" && token.type === "Keyword"; + } + + /** + * Gets the `else` keyword token of a given `IfStatement` node. + * @param {ASTNode} node A `IfStatement` node to get. + * @returns {Token} The `else` keyword token. + */ + function getElseKeyword(node) { + return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken); + } + + /** + * Determines whether the given node has an `else` keyword token as the first token after. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is followed by an `else` keyword token. + */ + function isFollowedByElseKeyword(node) { + const nextToken = sourceCode.getTokenAfter(node); + + return Boolean(nextToken) && isElseKeywordToken(nextToken); + } + + /** + * Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError. + * @param {Token} closingBracket The } token + * @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block. + */ + function needsSemicolon(closingBracket) { + const tokenBefore = sourceCode.getTokenBefore(closingBracket); + const tokenAfter = sourceCode.getTokenAfter(closingBracket); + const lastBlockNode = sourceCode.getNodeByRangeIndex(tokenBefore.range[0]); + + if (astUtils.isSemicolonToken(tokenBefore)) { + + // If the last statement already has a semicolon, don't add another one. + return false; + } + + if (!tokenAfter) { + + // If there are no statements after this block, there is no need to add a semicolon. + return false; + } + + if (lastBlockNode.type === "BlockStatement" && lastBlockNode.parent.type !== "FunctionExpression" && lastBlockNode.parent.type !== "ArrowFunctionExpression") { + + /* + * If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression), + * don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause + * a SyntaxError if it was followed by `else`. + */ + return false; + } + + if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) { + + // If the next token is on the same line, insert a semicolon. + return true; + } + + if (/^[([/`+-]/u.test(tokenAfter.value)) { + + // If the next token starts with a character that would disrupt ASI, insert a semicolon. + return true; + } + + if (tokenBefore.type === "Punctuator" && (tokenBefore.value === "++" || tokenBefore.value === "--")) { + + // If the last token is ++ or --, insert a semicolon to avoid disrupting ASI. + return true; + } + + // Otherwise, do not insert a semicolon. + return false; + } + + /** + * Determines whether the code represented by the given node contains an `if` statement + * that would become associated with an `else` keyword directly appended to that code. + * + * Examples where it returns `true`: + * + * if (a) + * foo(); + * + * if (a) { + * foo(); + * } + * + * if (a) + * foo(); + * else if (b) + * bar(); + * + * while (a) + * if (b) + * if(c) + * foo(); + * else + * bar(); + * + * Examples where it returns `false`: + * + * if (a) + * foo(); + * else + * bar(); + * + * while (a) { + * if (b) + * if(c) + * foo(); + * else + * bar(); + * } + * + * while (a) + * if (b) { + * if(c) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node Node representing the code to check. + * @returns {boolean} `true` if an `if` statement within the code would become associated with an `else` appended to that code. + */ + function hasUnsafeIf(node) { + switch (node.type) { + case "IfStatement": + if (!node.alternate) { + return true; + } + return hasUnsafeIf(node.alternate); + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + case "LabeledStatement": + case "WithStatement": + case "WhileStatement": + return hasUnsafeIf(node.body); + default: + return false; + } + } + + /** + * Determines whether the existing curly braces around the single statement are necessary to preserve the semantics of the code. + * The braces, which make the given block body, are necessary in either of the following situations: + * + * 1. The statement is a lexical declaration. + * 2. Without the braces, an `if` within the statement would become associated with an `else` after the closing brace: + * + * if (a) { + * if (b) + * foo(); + * } + * else + * bar(); + * + * if (a) + * while (b) + * while (c) { + * while (d) + * if (e) + * while(f) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node `BlockStatement` body with exactly one statement directly inside. The statement can have its own nested statements. + * @returns {boolean} `true` if the braces are necessary - removing them (replacing the given `BlockStatement` body with its single statement content) + * would change the semantics of the code or produce a syntax error. + */ + function areBracesNecessary(node) { + const statement = node.body[0]; + + return isLexicalDeclaration(statement) || + hasUnsafeIf(statement) && isFollowedByElseKeyword(node); + } + + /** + * Prepares to check the body of a node to see if it's a block statement. + * @param {ASTNode} node The node to report if there's a problem. + * @param {ASTNode} body The body node to check for blocks. + * @param {string} name The name to report if there's a problem. + * @param {{ condition: boolean }} opts Options to pass to the report functions + * @returns {Object} a prepared check object, with "actual", "expected", "check" properties. + * "actual" will be `true` or `false` whether the body is already a block statement. + * "expected" will be `true` or `false` if the body should be a block statement or not, or + * `null` if it doesn't matter, depending on the rule options. It can be modified to change + * the final behavior of "check". + * "check" will be a function reporting appropriate problems depending on the other + * properties. + */ + function prepareCheck(node, body, name, opts) { + const hasBlock = (body.type === "BlockStatement"); + let expected = null; + + if (hasBlock && (body.body.length !== 1 || areBracesNecessary(body))) { + expected = true; + } else if (multiOnly) { + expected = false; + } else if (multiLine) { + if (!isCollapsedOneLiner(body)) { + expected = true; + } + + // otherwise, the body is allowed to have braces or not to have braces + + } else if (multiOrNest) { + if (hasBlock) { + const statement = body.body[0]; + const leadingCommentsInBlock = sourceCode.getCommentsBefore(statement); + + expected = !isOneLiner(statement) || leadingCommentsInBlock.length > 0; + } else { + expected = !isOneLiner(body); + } + } else { + + // default "all" + expected = true; + } + + return { + actual: hasBlock, + expected, + check() { + if (this.expected !== null && this.expected !== this.actual) { + if (this.expected) { + context.report({ + node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + messageId: opts && opts.condition ? "missingCurlyAfterCondition" : "missingCurlyAfter", + data: { + name + }, + fix: fixer => fixer.replaceText(body, `{${sourceCode.getText(body)}}`) + }); + } else { + context.report({ + node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + messageId: opts && opts.condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter", + data: { + name + }, + fix(fixer) { + + /* + * `do while` expressions sometimes need a space to be inserted after `do`. + * e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)` + */ + const needsPrecedingSpace = node.type === "DoWhileStatement" && + sourceCode.getTokenBefore(body).range[1] === body.range[0] && + !astUtils.canTokensBeAdjacent("do", sourceCode.getFirstToken(body, { skip: 1 })); + + const openingBracket = sourceCode.getFirstToken(body); + const closingBracket = sourceCode.getLastToken(body); + const lastTokenInBlock = sourceCode.getTokenBefore(closingBracket); + + if (needsSemicolon(closingBracket)) { + + /* + * If removing braces would cause a SyntaxError due to multiple statements on the same line (or + * change the semantics of the code due to ASI), don't perform a fix. + */ + return null; + } + + const resultingBodyText = sourceCode.getText().slice(openingBracket.range[1], lastTokenInBlock.range[0]) + + sourceCode.getText(lastTokenInBlock) + + sourceCode.getText().slice(lastTokenInBlock.range[1], closingBracket.range[0]); + + return fixer.replaceText(body, (needsPrecedingSpace ? " " : "") + resultingBodyText); + } + }); + } + } + } + }; + } + + /** + * Prepares to check the bodies of a "if", "else if" and "else" chain. + * @param {ASTNode} node The first IfStatement node of the chain. + * @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more + * information. + */ + function prepareIfChecks(node) { + const preparedChecks = []; + + for (let currentNode = node; currentNode; currentNode = currentNode.alternate) { + preparedChecks.push(prepareCheck(currentNode, currentNode.consequent, "if", { condition: true })); + if (currentNode.alternate && currentNode.alternate.type !== "IfStatement") { + preparedChecks.push(prepareCheck(currentNode, currentNode.alternate, "else")); + break; + } + } + + if (consistent) { + + /* + * If any node should have or already have braces, make sure they + * all have braces. + * If all nodes shouldn't have braces, make sure they don't. + */ + const expected = preparedChecks.some(preparedCheck => { + if (preparedCheck.expected !== null) { + return preparedCheck.expected; + } + return preparedCheck.actual; + }); + + preparedChecks.forEach(preparedCheck => { + preparedCheck.expected = expected; + }); + } + + return preparedChecks; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + IfStatement(node) { + const parent = node.parent; + const isElseIf = parent.type === "IfStatement" && parent.alternate === node; + + if (!isElseIf) { + + // This is a top `if`, check the whole `if-else-if` chain + prepareIfChecks(node).forEach(preparedCheck => { + preparedCheck.check(); + }); + } + + // Skip `else if`, it's already checked (when the top `if` was visited) + }, + + WhileStatement(node) { + prepareCheck(node, node.body, "while", { condition: true }).check(); + }, + + DoWhileStatement(node) { + prepareCheck(node, node.body, "do").check(); + }, + + ForStatement(node) { + prepareCheck(node, node.body, "for", { condition: true }).check(); + }, + + ForInStatement(node) { + prepareCheck(node, node.body, "for-in").check(); + }, + + ForOfStatement(node) { + prepareCheck(node, node.body, "for-of").check(); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-case-last.js b/node_modules/eslint/lib/rules/default-case-last.js new file mode 100644 index 0000000..80c5d6b --- /dev/null +++ b/node_modules/eslint/lib/rules/default-case-last.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to enforce default clauses in switch statements to be last + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce default clauses in switch statements to be last", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-case-last" + }, + + schema: [], + + messages: { + notLast: "Default clause should be the last clause." + } + }, + + create(context) { + return { + SwitchStatement(node) { + const cases = node.cases, + indexOfDefault = cases.findIndex(c => c.test === null); + + if (indexOfDefault !== -1 && indexOfDefault !== cases.length - 1) { + const defaultClause = cases[indexOfDefault]; + + context.report({ node: defaultClause, messageId: "notLast" }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-case.js b/node_modules/eslint/lib/rules/default-case.js new file mode 100644 index 0000000..821e0d7 --- /dev/null +++ b/node_modules/eslint/lib/rules/default-case.js @@ -0,0 +1,97 @@ +/** + * @fileoverview require default case in switch statements + * @author Aliaksei Shytkin + */ +"use strict"; + +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `default` cases in `switch` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-case" + }, + + schema: [{ + type: "object", + properties: { + commentPattern: { + type: "string" + } + }, + additionalProperties: false + }], + + messages: { + missingDefaultCase: "Expected a default case." + } + }, + + create(context) { + const options = context.options[0] || {}; + const commentPattern = options.commentPattern + ? new RegExp(options.commentPattern, "u") + : DEFAULT_COMMENT_PATTERN; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Shortcut to get last element of array + * @param {*[]} collection Array + * @returns {*} Last element + */ + function last(collection) { + return collection[collection.length - 1]; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + SwitchStatement(node) { + + if (!node.cases.length) { + + /* + * skip check of empty switch because there is no easy way + * to extract comments inside it now + */ + return; + } + + const hasDefault = node.cases.some(v => v.test === null); + + if (!hasDefault) { + + let comment; + + const lastCase = last(node.cases); + const comments = sourceCode.getCommentsAfter(lastCase); + + if (comments.length) { + comment = last(comments); + } + + if (!comment || !commentPattern.test(comment.value.trim())) { + context.report({ node, messageId: "missingDefaultCase" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-param-last.js b/node_modules/eslint/lib/rules/default-param-last.js new file mode 100644 index 0000000..12e0b59 --- /dev/null +++ b/node_modules/eslint/lib/rules/default-param-last.js @@ -0,0 +1,62 @@ +/** + * @fileoverview enforce default parameters to be last + * @author Chiawen Chen + */ + +"use strict"; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce default parameters to be last", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-param-last" + }, + + schema: [], + + messages: { + shouldBeLast: "Default parameters should be last." + } + }, + + create(context) { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + let hasSeenPlainParam = false; + + for (let i = node.params.length - 1; i >= 0; i -= 1) { + const param = node.params[i]; + + if ( + param.type !== "AssignmentPattern" && + param.type !== "RestElement" + ) { + hasSeenPlainParam = true; + continue; + } + + if (hasSeenPlainParam && param.type === "AssignmentPattern") { + context.report({ + node: param, + messageId: "shouldBeLast" + }); + } + } + } + + return { + FunctionDeclaration: handleFunction, + FunctionExpression: handleFunction, + ArrowFunctionExpression: handleFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/dot-location.js b/node_modules/eslint/lib/rules/dot-location.js new file mode 100644 index 0000000..0a739b1 --- /dev/null +++ b/node_modules/eslint/lib/rules/dot-location.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Validates newlines before and after dots + * @author Greg Cochard + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent newlines before and after dots", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/dot-location" + }, + + schema: [ + { + enum: ["object", "property"] + } + ], + + fixable: "code", + + messages: { + expectedDotAfterObject: "Expected dot to be on same line as object.", + expectedDotBeforeProperty: "Expected dot to be on same line as property." + } + }, + + create(context) { + + const config = context.options[0]; + + // default to onObject if no preference is passed + const onObject = config === "object" || !config; + + const sourceCode = context.getSourceCode(); + + /** + * Reports if the dot between object and property is on the correct loccation. + * @param {ASTNode} node The `MemberExpression` node. + * @returns {void} + */ + function checkDotLocation(node) { + const property = node.property; + const dotToken = sourceCode.getTokenBefore(property); + + if (onObject) { + + // `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node. + const tokenBeforeDot = sourceCode.getTokenBefore(dotToken); + + if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dotToken)) { + context.report({ + node, + loc: dotToken.loc, + messageId: "expectedDotAfterObject", + *fix(fixer) { + if (dotToken.value.startsWith(".") && astUtils.isDecimalIntegerNumericToken(tokenBeforeDot)) { + yield fixer.insertTextAfter(tokenBeforeDot, ` ${dotToken.value}`); + } else { + yield fixer.insertTextAfter(tokenBeforeDot, dotToken.value); + } + yield fixer.remove(dotToken); + } + }); + } + } else if (!astUtils.isTokenOnSameLine(dotToken, property)) { + context.report({ + node, + loc: dotToken.loc, + messageId: "expectedDotBeforeProperty", + *fix(fixer) { + yield fixer.remove(dotToken); + yield fixer.insertTextBefore(property, dotToken.value); + } + }); + } + } + + /** + * Checks the spacing of the dot within a member expression. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + if (!node.computed) { + checkDotLocation(node); + } + } + + return { + MemberExpression: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/dot-notation.js b/node_modules/eslint/lib/rules/dot-notation.js new file mode 100644 index 0000000..751b462 --- /dev/null +++ b/node_modules/eslint/lib/rules/dot-notation.js @@ -0,0 +1,176 @@ +/** + * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible. + * @author Josh Perez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; + +// `null` literal must be handled separately. +const literalTypesToCheck = new Set(["string", "boolean"]); + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce dot notation whenever possible", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/dot-notation" + }, + + schema: [ + { + type: "object", + properties: { + allowKeywords: { + type: "boolean", + default: true + }, + allowPattern: { + type: "string", + default: "" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + useDot: "[{{key}}] is better written in dot notation.", + useBrackets: ".{{key}} is a syntax error." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowKeywords = options.allowKeywords === void 0 || options.allowKeywords; + const sourceCode = context.getSourceCode(); + + let allowPattern; + + if (options.allowPattern) { + allowPattern = new RegExp(options.allowPattern, "u"); + } + + /** + * Check if the property is valid dot notation + * @param {ASTNode} node The dot notation node + * @param {string} value Value which is to be checked + * @returns {void} + */ + function checkComputedProperty(node, value) { + if ( + validIdentifier.test(value) && + (allowKeywords || keywords.indexOf(String(value)) === -1) && + !(allowPattern && allowPattern.test(value)) + ) { + const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``; + + context.report({ + node: node.property, + messageId: "useDot", + data: { + key: formattedValue + }, + *fix(fixer) { + const leftBracket = sourceCode.getTokenAfter(node.object, astUtils.isOpeningBracketToken); + const rightBracket = sourceCode.getLastToken(node); + const nextToken = sourceCode.getTokenAfter(node); + + // Don't perform any fixes if there are comments inside the brackets. + if (sourceCode.commentsExistBetween(leftBracket, rightBracket)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Replace the brackets by an identifier. + if (!node.optional) { + yield fixer.insertTextBefore( + leftBracket, + astUtils.isDecimalInteger(node.object) ? " ." : "." + ); + } + yield fixer.replaceTextRange( + [leftBracket.range[0], rightBracket.range[1]], + value + ); + + // Insert a space after the property if it will be connected to the next token. + if ( + nextToken && + rightBracket.range[1] === nextToken.range[0] && + !astUtils.canTokensBeAdjacent(String(value), nextToken) + ) { + yield fixer.insertTextAfter(node, " "); + } + } + }); + } + } + + return { + MemberExpression(node) { + if ( + node.computed && + node.property.type === "Literal" && + (literalTypesToCheck.has(typeof node.property.value) || astUtils.isNullLiteral(node.property)) + ) { + checkComputedProperty(node, node.property.value); + } + if ( + node.computed && + node.property.type === "TemplateLiteral" && + node.property.expressions.length === 0 + ) { + checkComputedProperty(node, node.property.quasis[0].value.cooked); + } + if ( + !allowKeywords && + !node.computed && + keywords.indexOf(String(node.property.name)) !== -1 + ) { + context.report({ + node: node.property, + messageId: "useBrackets", + data: { + key: node.property.name + }, + *fix(fixer) { + const dotToken = sourceCode.getTokenBefore(node.property); + + // A statement that starts with `let[` is parsed as a destructuring variable declaration, not a MemberExpression. + if (node.object.type === "Identifier" && node.object.name === "let" && !node.optional) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Don't perform any fixes if there are comments between the dot and the property name. + if (sourceCode.commentsExistBetween(dotToken, node.property)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Replace the identifier to brackets. + if (!node.optional) { + yield fixer.remove(dotToken); + } + yield fixer.replaceText(node.property, `["${node.property.name}"]`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/eol-last.js b/node_modules/eslint/lib/rules/eol-last.js new file mode 100644 index 0000000..fbba6c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/eol-last.js @@ -0,0 +1,112 @@ +/** + * @fileoverview Require or disallow newline at the end of files + * @author Nodeca Team + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow newline at the end of files", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/eol-last" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "unix", "windows"] + } + ], + + messages: { + missing: "Newline required at end of file but not found.", + unexpected: "Newline not allowed at end of file." + } + }, + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkBadEOF(node) { + const sourceCode = context.getSourceCode(), + src = sourceCode.getText(), + location = { + column: lodash.last(sourceCode.lines).length, + line: sourceCode.lines.length + }, + LF = "\n", + CRLF = `\r${LF}`, + endsWithNewline = lodash.endsWith(src, LF); + + /* + * Empty source is always valid: No content in file so we don't + * need to lint for a newline on the last line of content. + */ + if (!src.length) { + return; + } + + let mode = context.options[0] || "always", + appendCRLF = false; + + if (mode === "unix") { + + // `"unix"` should behave exactly as `"always"` + mode = "always"; + } + if (mode === "windows") { + + // `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility + mode = "always"; + appendCRLF = true; + } + if (mode === "always" && !endsWithNewline) { + + // File is not newline-terminated, but should be + context.report({ + node, + loc: location, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfterRange([0, src.length], appendCRLF ? CRLF : LF); + } + }); + } else if (mode === "never" && endsWithNewline) { + + // File is newline-terminated, but shouldn't be + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + const finalEOLs = /(?:\r?\n)+$/u, + match = finalEOLs.exec(sourceCode.text), + start = match.index, + end = sourceCode.text.length; + + return fixer.replaceTextRange([start, end], ""); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/eqeqeq.js b/node_modules/eslint/lib/rules/eqeqeq.js new file mode 100644 index 0000000..57926db --- /dev/null +++ b/node_modules/eslint/lib/rules/eqeqeq.js @@ -0,0 +1,174 @@ +/** + * @fileoverview Rule to flag statements that use != and == instead of !== and === + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require the use of `===` and `!==`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/eqeqeq" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + null: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ], + additionalItems: false + }, + { + type: "array", + items: [ + { + enum: ["smart", "allow-null"] + } + ], + additionalItems: false + } + ] + }, + + fixable: "code", + + messages: { + unexpected: "Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'." + } + }, + + create(context) { + const config = context.options[0] || "always"; + const options = context.options[1] || {}; + const sourceCode = context.getSourceCode(); + + const nullOption = (config === "always") + ? options.null || "always" + : "ignore"; + const enforceRuleForNull = (nullOption === "always"); + const enforceInverseRuleForNull = (nullOption === "never"); + + /** + * Checks if an expression is a typeof expression + * @param {ASTNode} node The node to check + * @returns {boolean} if the node is a typeof expression + */ + function isTypeOf(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + /** + * Checks if either operand of a binary expression is a typeof operation + * @param {ASTNode} node The node to check + * @returns {boolean} if one of the operands is typeof + * @private + */ + function isTypeOfBinary(node) { + return isTypeOf(node.left) || isTypeOf(node.right); + } + + /** + * Checks if operands are literals of the same type (via typeof) + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are of same type + * @private + */ + function areLiteralsAndSameType(node) { + return node.left.type === "Literal" && node.right.type === "Literal" && + typeof node.left.value === typeof node.right.value; + } + + /** + * Checks if one of the operands is a literal null + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are null + * @private + */ + function isNullCheck(node) { + return astUtils.isNullLiteral(node.right) || astUtils.isNullLiteral(node.left); + } + + /** + * Reports a message for this rule. + * @param {ASTNode} node The binary expression node that was checked + * @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==') + * @returns {void} + * @private + */ + function report(node, expectedOperator) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpected", + data: { expectedOperator, actualOperator: node.operator }, + fix(fixer) { + + // If the comparison is a `typeof` comparison or both sides are literals with the same type, then it's safe to fix. + if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) { + return fixer.replaceText(operatorToken, expectedOperator); + } + return null; + } + }); + } + + return { + BinaryExpression(node) { + const isNull = isNullCheck(node); + + if (node.operator !== "==" && node.operator !== "!=") { + if (enforceInverseRuleForNull && isNull) { + report(node, node.operator.slice(0, -1)); + } + return; + } + + if (config === "smart" && (isTypeOfBinary(node) || + areLiteralsAndSameType(node) || isNull)) { + return; + } + + if (!enforceRuleForNull && isNull) { + return; + } + + report(node, `${node.operator}=`); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/for-direction.js b/node_modules/eslint/lib/rules/for-direction.js new file mode 100644 index 0000000..c15d10e --- /dev/null +++ b/node_modules/eslint/lib/rules/for-direction.js @@ -0,0 +1,126 @@ +/** + * @fileoverview enforce "for" loop update clause moving the counter in the right direction.(for-direction) + * @author Aladdin-ADD + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce \"for\" loop update clause moving the counter in the right direction.", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/for-direction" + }, + + fixable: null, + schema: [], + + messages: { + incorrectDirection: "The update clause in this loop moves the variable in the wrong direction." + } + }, + + create(context) { + + /** + * report an error. + * @param {ASTNode} node the node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "incorrectDirection" + }); + } + + /** + * check the right side of the assignment + * @param {ASTNode} update UpdateExpression to check + * @param {int} dir expected direction that could either be turned around or invalidated + * @returns {int} return dir, the negated dir or zero if it's not clear for identifiers + */ + function getRightDirection(update, dir) { + if (update.right.type === "UnaryExpression") { + if (update.right.operator === "-") { + return -dir; + } + } else if (update.right.type === "Identifier") { + return 0; + } + return dir; + } + + /** + * check UpdateExpression add/sub the counter + * @param {ASTNode} update UpdateExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getUpdateDirection(update, counter) { + if (update.argument.type === "Identifier" && update.argument.name === counter) { + if (update.operator === "++") { + return 1; + } + if (update.operator === "--") { + return -1; + } + } + return 0; + } + + /** + * check AssignmentExpression add/sub the counter + * @param {ASTNode} update AssignmentExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getAssignmentDirection(update, counter) { + if (update.left.name === counter) { + if (update.operator === "+=") { + return getRightDirection(update, 1); + } + if (update.operator === "-=") { + return getRightDirection(update, -1); + } + } + return 0; + } + return { + ForStatement(node) { + + if (node.test && node.test.type === "BinaryExpression" && node.test.left.type === "Identifier" && node.update) { + const counter = node.test.left.name; + const operator = node.test.operator; + const update = node.update; + + let wrongDirection; + + if (operator === "<" || operator === "<=") { + wrongDirection = -1; + } else if (operator === ">" || operator === ">=") { + wrongDirection = 1; + } else { + return; + } + + if (update.type === "UpdateExpression") { + if (getUpdateDirection(update, counter) === wrongDirection) { + report(node); + } + } else if (update.type === "AssignmentExpression" && getAssignmentDirection(update, counter) === wrongDirection) { + report(node); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-call-spacing.js b/node_modules/eslint/lib/rules/func-call-spacing.js new file mode 100644 index 0000000..8fe690d --- /dev/null +++ b/node_modules/eslint/lib/rules/func-call-spacing.js @@ -0,0 +1,230 @@ +/** + * @fileoverview Rule to control spacing within function calls + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing between function identifiers and their invocations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-call-spacing" + }, + + fixable: "whitespace", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + allowNewlines: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpectedWhitespace: "Unexpected whitespace between function name and paren.", + unexpectedNewline: "Unexpected newline between function name and paren.", + missing: "Missing space between function name and paren." + } + }, + + create(context) { + + const never = context.options[0] !== "always"; + const allowNewlines = !never && context.options[1] && context.options[1].allowNewlines; + const sourceCode = context.getSourceCode(); + const text = sourceCode.getText(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee. + * @param {Token} rightToken Tha first token of the arguments. this is the opening parenthesis that encloses the arguments. + * @returns {void} + * @private + */ + function checkSpacing(node, leftToken, rightToken) { + const textBetweenTokens = text.slice(leftToken.range[1], rightToken.range[0]).replace(/\/\*.*?\*\//gu, ""); + const hasWhitespace = /\s/u.test(textBetweenTokens); + const hasNewline = hasWhitespace && astUtils.LINEBREAK_MATCHER.test(textBetweenTokens); + + /* + * never allowNewlines hasWhitespace hasNewline message + * F F F F Missing space between function name and paren. + * F F F T (Invalid `!hasWhitespace && hasNewline`) + * F F T T Unexpected newline between function name and paren. + * F F T F (OK) + * F T T F (OK) + * F T T T (OK) + * F T F T (Invalid `!hasWhitespace && hasNewline`) + * F T F F Missing space between function name and paren. + * T T F F (Invalid `never && allowNewlines`) + * T T F T (Invalid `!hasWhitespace && hasNewline`) + * T T T T (Invalid `never && allowNewlines`) + * T T T F (Invalid `never && allowNewlines`) + * T F T F Unexpected space between function name and paren. + * T F T T Unexpected space between function name and paren. + * T F F T (Invalid `!hasWhitespace && hasNewline`) + * T F F F (OK) + * + * T T Unexpected space between function name and paren. + * F F Missing space between function name and paren. + * F F T Unexpected newline between function name and paren. + */ + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: { + line: rightToken.loc.start.line, + column: rightToken.loc.start.column - 1 + } + }, + messageId: "unexpectedWhitespace", + fix(fixer) { + + // Don't remove comments. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + // If `?.` exsits, it doesn't hide no-undexpected-multiline errors + if (node.optional) { + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], "?."); + } + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + */ + if (hasNewline) { + return null; + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: { + line: leftToken.loc.end.line, + column: leftToken.loc.end.column - 1 + }, + end: rightToken.loc.start + }, + messageId: "missing", + fix(fixer) { + if (node.optional) { + return null; // Not sure if inserting a space to either before/after `?.` token. + } + return fixer.insertTextBefore(rightToken, " "); + } + }); + } else if (!never && !allowNewlines && hasNewline) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedNewline", + fix(fixer) { + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + * But if `?.` exsits, it doesn't hide no-undexpected-multiline errors + */ + if (!node.optional) { + return null; + } + + // Don't remove comments. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + const range = [leftToken.range[1], rightToken.range[0]]; + const qdToken = sourceCode.getTokenAfter(leftToken); + + if (qdToken.range[0] === leftToken.range[1]) { + return fixer.replaceTextRange(range, "?. "); + } + if (qdToken.range[1] === rightToken.range[0]) { + return fixer.replaceTextRange(range, " ?."); + } + return fixer.replaceTextRange(range, " ?. "); + } + }); + } + } + + return { + "CallExpression, NewExpression"(node) { + const lastToken = sourceCode.getLastToken(node); + const lastCalleeToken = sourceCode.getLastToken(node.callee); + const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken); + const prevToken = parenToken && sourceCode.getTokenBefore(parenToken, astUtils.isNotQuestionDotToken); + + // Parens in NewExpression are optional + if (!(parenToken && parenToken.range[1] < node.range[1])) { + return; + } + + checkSpacing(node, prevToken, parenToken); + }, + + ImportExpression(node) { + const leftToken = sourceCode.getFirstToken(node); + const rightToken = sourceCode.getTokenAfter(leftToken); + + checkSpacing(node, leftToken, rightToken); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/func-name-matching.js b/node_modules/eslint/lib/rules/func-name-matching.js new file mode 100644 index 0000000..755c2ee --- /dev/null +++ b/node_modules/eslint/lib/rules/func-name-matching.js @@ -0,0 +1,249 @@ +/** + * @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned. + * @author Annie Zhang, Pavel Strashkin + */ + +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); +const esutils = require("esutils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines if a pattern is `module.exports` or `module["exports"]` + * @param {ASTNode} pattern The left side of the AssignmentExpression + * @returns {boolean} True if the pattern is `module.exports` or `module["exports"]` + */ +function isModuleExports(pattern) { + if (pattern.type === "MemberExpression" && pattern.object.type === "Identifier" && pattern.object.name === "module") { + + // module.exports + if (pattern.property.type === "Identifier" && pattern.property.name === "exports") { + return true; + } + + // module["exports"] + if (pattern.property.type === "Literal" && pattern.property.value === "exports") { + return true; + } + } + return false; +} + +/** + * Determines if a string name is a valid identifier + * @param {string} name The string to be checked + * @param {int} ecmaVersion The ECMAScript version if specified in the parserOptions config + * @returns {boolean} True if the string is a valid identifier + */ +function isIdentifier(name, ecmaVersion) { + if (ecmaVersion >= 6) { + return esutils.keyword.isIdentifierES6(name); + } + return esutils.keyword.isIdentifierES5(name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const alwaysOrNever = { enum: ["always", "never"] }; +const optionsObject = { + type: "object", + properties: { + considerPropertyDescriptor: { + type: "boolean" + }, + includeCommonJSModuleExports: { + type: "boolean" + } + }, + additionalProperties: false +}; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require function names to match the name of the variable or property to which they are assigned", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-name-matching" + }, + + schema: { + anyOf: [{ + type: "array", + additionalItems: false, + items: [alwaysOrNever, optionsObject] + }, { + type: "array", + additionalItems: false, + items: [optionsObject] + }] + }, + + messages: { + matchProperty: "Function name `{{funcName}}` should match property name `{{name}}`.", + matchVariable: "Function name `{{funcName}}` should match variable name `{{name}}`.", + notMatchProperty: "Function name `{{funcName}}` should not match property name `{{name}}`.", + notMatchVariable: "Function name `{{funcName}}` should not match variable name `{{name}}`." + } + }, + + create(context) { + const options = (typeof context.options[0] === "object" ? context.options[0] : context.options[1]) || {}; + const nameMatches = typeof context.options[0] === "string" ? context.options[0] : "always"; + const considerPropertyDescriptor = options.considerPropertyDescriptor; + const includeModuleExports = options.includeCommonJSModuleExports; + const ecmaVersion = context.parserOptions && context.parserOptions.ecmaVersion ? context.parserOptions.ecmaVersion : 5; + + /** + * Check whether node is a certain CallExpression. + * @param {string} objName object name + * @param {string} funcName function name + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if node matches CallExpression + */ + function isPropertyCall(objName, funcName, node) { + if (!node) { + return false; + } + return node.type === "CallExpression" && astUtils.isSpecificMemberAccess(node.callee, objName, funcName); + } + + /** + * Compares identifiers based on the nameMatches option + * @param {string} x the first identifier + * @param {string} y the second identifier + * @returns {boolean} whether the two identifiers should warn. + */ + function shouldWarn(x, y) { + return (nameMatches === "always" && x !== y) || (nameMatches === "never" && x === y); + } + + /** + * Reports + * @param {ASTNode} node The node to report + * @param {string} name The variable or property name + * @param {string} funcName The function name + * @param {boolean} isProp True if the reported node is a property assignment + * @returns {void} + */ + function report(node, name, funcName, isProp) { + let messageId; + + if (nameMatches === "always" && isProp) { + messageId = "matchProperty"; + } else if (nameMatches === "always") { + messageId = "matchVariable"; + } else if (isProp) { + messageId = "notMatchProperty"; + } else { + messageId = "notMatchVariable"; + } + context.report({ + node, + messageId, + data: { + name, + funcName + } + }); + } + + /** + * Determines whether a given node is a string literal + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a string literal + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator(node) { + if (!node.init || node.init.type !== "FunctionExpression" || node.id.type !== "Identifier") { + return; + } + if (node.init.id && shouldWarn(node.id.name, node.init.id.name)) { + report(node, node.id.name, node.init.id.name, false); + } + }, + + AssignmentExpression(node) { + if ( + node.right.type !== "FunctionExpression" || + (node.left.computed && node.left.property.type !== "Literal") || + (!includeModuleExports && isModuleExports(node.left)) || + (node.left.type !== "Identifier" && node.left.type !== "MemberExpression") + ) { + return; + } + + const isProp = node.left.type === "MemberExpression"; + const name = isProp ? astUtils.getStaticPropertyName(node.left) : node.left.name; + + if (node.right.id && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { + report(node, name, node.right.id.name, isProp); + } + }, + + Property(node) { + if (node.value.type !== "FunctionExpression" || !node.value.id || node.computed && !isStringLiteral(node.key)) { + return; + } + + if (node.key.type === "Identifier") { + const functionName = node.value.id.name; + let propertyName = node.key.name; + + if (considerPropertyDescriptor && propertyName === "value") { + if (isPropertyCall("Object", "defineProperty", node.parent.parent) || isPropertyCall("Reflect", "defineProperty", node.parent.parent)) { + const property = node.parent.parent.arguments[1]; + + if (isStringLiteral(property) && shouldWarn(property.value, functionName)) { + report(node, property.value, functionName, true); + } + } else if (isPropertyCall("Object", "defineProperties", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (isPropertyCall("Object", "create", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + return; + } + + if ( + isStringLiteral(node.key) && + isIdentifier(node.key.value, ecmaVersion) && + shouldWarn(node.key.value, node.value.id.name) + ) { + report(node, node.key.value, node.value.id.name, true); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-names.js b/node_modules/eslint/lib/rules/func-names.js new file mode 100644 index 0000000..ecfedb9 --- /dev/null +++ b/node_modules/eslint/lib/rules/func-names.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Rule to warn when a function expression does not have a name. + * @author Kyle T. Nunery + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow named `function` expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-names" + }, + + schema: { + definitions: { + value: { + enum: [ + "always", + "as-needed", + "never" + ] + } + }, + items: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + generators: { + $ref: "#/definitions/value" + } + }, + additionalProperties: false + } + ] + }, + + messages: { + unnamed: "Unexpected unnamed {{name}}.", + named: "Unexpected named {{name}}." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Returns the config option for the given node. + * @param {ASTNode} node A node to get the config for. + * @returns {string} The config option. + */ + function getConfigForNode(node) { + if ( + node.generator && + context.options.length > 1 && + context.options[1].generators + ) { + return context.options[1].generators; + } + + return context.options[0] || "always"; + } + + /** + * Determines whether the current FunctionExpression node is a get, set, or + * shorthand method in an object literal or a class. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a get, set, or shorthand method. + */ + function isObjectOrClassMethod(node) { + const parent = node.parent; + + return (parent.type === "MethodDefinition" || ( + parent.type === "Property" && ( + parent.method || + parent.kind === "get" || + parent.kind === "set" + ) + )); + } + + /** + * Determines whether the current FunctionExpression node has a name that would be + * inferred from context in a conforming ES6 environment. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node would have a name assigned automatically. + */ + function hasInferredName(node) { + const parent = node.parent; + + return isObjectOrClassMethod(node) || + (parent.type === "VariableDeclarator" && parent.id.type === "Identifier" && parent.init === node) || + (parent.type === "Property" && parent.value === node) || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier" && parent.right === node) || + (parent.type === "AssignmentPattern" && parent.left.type === "Identifier" && parent.right === node); + } + + /** + * Reports that an unnamed function should be named + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedUnnamedFunction(node) { + context.report({ + node, + messageId: "unnamed", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * Reports that a named function should be unnamed + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedNamedFunction(node) { + context.report({ + node, + messageId: "named", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * The listener for function nodes. + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + + // Skip recursive functions. + const nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + const hasName = Boolean(node.id && node.id.name); + const config = getConfigForNode(node); + + if (config === "never") { + if (hasName && node.type !== "FunctionDeclaration") { + reportUnexpectedNamedFunction(node); + } + } else if (config === "as-needed") { + if (!hasName && !hasInferredName(node)) { + reportUnexpectedUnnamedFunction(node); + } + } else { + if (!hasName && !isObjectOrClassMethod(node)) { + reportUnexpectedUnnamedFunction(node); + } + } + } + + return { + "FunctionExpression:exit": handleFunction, + "ExportDefaultDeclaration > FunctionDeclaration": handleFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-style.js b/node_modules/eslint/lib/rules/func-style.js new file mode 100644 index 0000000..e150b1a --- /dev/null +++ b/node_modules/eslint/lib/rules/func-style.js @@ -0,0 +1,98 @@ +/** + * @fileoverview Rule to enforce a particular function style + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the consistent use of either `function` declarations or expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-style" + }, + + schema: [ + { + enum: ["declaration", "expression"] + }, + { + type: "object", + properties: { + allowArrowFunctions: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expression: "Expected a function expression.", + declaration: "Expected a function declaration." + } + }, + + create(context) { + + const style = context.options[0], + allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions, + enforceDeclarations = (style === "declaration"), + stack = []; + + const nodesToCheck = { + FunctionDeclaration(node) { + stack.push(false); + + if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") { + context.report({ node, messageId: "expression" }); + } + }, + "FunctionDeclaration:exit"() { + stack.pop(); + }, + + FunctionExpression(node) { + stack.push(false); + + if (enforceDeclarations && node.parent.type === "VariableDeclarator") { + context.report({ node: node.parent, messageId: "declaration" }); + } + }, + "FunctionExpression:exit"() { + stack.pop(); + }, + + ThisExpression() { + if (stack.length > 0) { + stack[stack.length - 1] = true; + } + } + }; + + if (!allowArrowFunctions) { + nodesToCheck.ArrowFunctionExpression = function() { + stack.push(false); + }; + + nodesToCheck["ArrowFunctionExpression:exit"] = function(node) { + const hasThisExpr = stack.pop(); + + if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") { + context.report({ node: node.parent, messageId: "declaration" }); + } + }; + } + + return nodesToCheck; + + } +}; diff --git a/node_modules/eslint/lib/rules/function-call-argument-newline.js b/node_modules/eslint/lib/rules/function-call-argument-newline.js new file mode 100644 index 0000000..b6abbe9 --- /dev/null +++ b/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to enforce line breaks between arguments of a function call + * @author Alexey Gonchar + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks between arguments of a function call", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-call-argument-newline" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "consistent"] + } + ], + + messages: { + unexpectedLineBreak: "There should be no line break here.", + missingLineBreak: "There should be a line break after this argument." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const checkers = { + unexpected: { + messageId: "unexpectedLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line !== currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " ") + }, + missing: { + messageId: "missingLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line === currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n") + } + }; + + /** + * Check all arguments for line breaks in the CallExpression + * @param {CallExpression} node node to evaluate + * @param {{ messageId: string, check: Function }} checker selected checker + * @returns {void} + * @private + */ + function checkArguments(node, checker) { + for (let i = 1; i < node.arguments.length; i++) { + const prevArgToken = sourceCode.getLastToken(node.arguments[i - 1]); + const currentArgToken = sourceCode.getFirstToken(node.arguments[i]); + + if (checker.check(prevArgToken, currentArgToken)) { + const tokenBefore = sourceCode.getTokenBefore( + currentArgToken, + { includeComments: true } + ); + + const hasLineCommentBefore = tokenBefore.type === "Line"; + + context.report({ + node, + loc: { + start: tokenBefore.loc.end, + end: currentArgToken.loc.start + }, + messageId: checker.messageId, + fix: hasLineCommentBefore ? null : checker.createFix(currentArgToken, tokenBefore) + }); + } + } + } + + /** + * Check if open space is present in a function name + * @param {CallExpression} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if (node.arguments.length < 2) { + return; + } + + const option = context.options[0] || "always"; + + if (option === "never") { + checkArguments(node, checkers.unexpected); + } else if (option === "always") { + checkArguments(node, checkers.missing); + } else if (option === "consistent") { + const firstArgToken = sourceCode.getLastToken(node.arguments[0]); + const secondArgToken = sourceCode.getFirstToken(node.arguments[1]); + + if (firstArgToken.loc.end.line === secondArgToken.loc.start.line) { + checkArguments(node, checkers.unexpected); + } else { + checkArguments(node, checkers.missing); + } + } + } + + return { + CallExpression: check, + NewExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/function-paren-newline.js b/node_modules/eslint/lib/rules/function-paren-newline.js new file mode 100644 index 0000000..894c8e3 --- /dev/null +++ b/node_modules/eslint/lib/rules/function-paren-newline.js @@ -0,0 +1,281 @@ +/** + * @fileoverview enforce consistent line breaks inside function parentheses + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent line breaks inside function parentheses", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-paren-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent", "multiline", "multiline-arguments"] + }, + { + type: "object", + properties: { + minItems: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + expectedBefore: "Expected newline before ')'.", + expectedAfter: "Expected newline after '('.", + expectedBetween: "Expected newline between arguments/params.", + unexpectedBefore: "Unexpected newline before ')'.", + unexpectedAfter: "Unexpected newline after '('." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const rawOption = context.options[0] || "multiline"; + const multilineOption = rawOption === "multiline"; + const multilineArgumentsOption = rawOption === "multiline-arguments"; + const consistentOption = rawOption === "consistent"; + let minItems; + + if (typeof rawOption === "object") { + minItems = rawOption.minItems; + } else if (rawOption === "always") { + minItems = 0; + } else if (rawOption === "never") { + minItems = Infinity; + } else { + minItems = null; + } + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Determines whether there should be newlines inside function parens + * @param {ASTNode[]} elements The arguments or parameters in the list + * @param {boolean} hasLeftNewline `true` if the left paren has a newline in the current code. + * @returns {boolean} `true` if there should be newlines inside the function parens + */ + function shouldHaveNewlines(elements, hasLeftNewline) { + if (multilineArgumentsOption && elements.length === 1) { + return hasLeftNewline; + } + if (multilineOption || multilineArgumentsOption) { + return elements.some((element, index) => index !== elements.length - 1 && element.loc.end.line !== elements[index + 1].loc.start.line); + } + if (consistentOption) { + return hasLeftNewline; + } + return elements.length >= minItems; + } + + /** + * Validates parens + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateParens(parens, elements) { + const leftParen = parens.leftParen; + const rightParen = parens.rightParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const hasRightNewline = !astUtils.isTokenOnSameLine(tokenBeforeRightParen, rightParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + if (hasLeftNewline && !needsNewlines) { + context.report({ + node: leftParen, + messageId: "unexpectedAfter", + fix(fixer) { + return sourceCode.getText().slice(leftParen.range[1], tokenAfterLeftParen.range[0]).trim() + + // If there is a comment between the ( and the first element, don't do a fix. + ? null + : fixer.removeRange([leftParen.range[1], tokenAfterLeftParen.range[0]]); + } + }); + } else if (!hasLeftNewline && needsNewlines) { + context.report({ + node: leftParen, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(leftParen, "\n") + }); + } + + if (hasRightNewline && !needsNewlines) { + context.report({ + node: rightParen, + messageId: "unexpectedBefore", + fix(fixer) { + return sourceCode.getText().slice(tokenBeforeRightParen.range[1], rightParen.range[0]).trim() + + // If there is a comment between the last element and the ), don't do a fix. + ? null + : fixer.removeRange([tokenBeforeRightParen.range[1], rightParen.range[0]]); + } + }); + } else if (!hasRightNewline && needsNewlines) { + context.report({ + node: rightParen, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(rightParen, "\n") + }); + } + } + + /** + * Validates a list of arguments or parameters + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateArguments(parens, elements) { + const leftParen = parens.leftParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + for (let i = 0; i <= elements.length - 2; i++) { + const currentElement = elements[i]; + const nextElement = elements[i + 1]; + const hasNewLine = currentElement.loc.end.line !== nextElement.loc.start.line; + + if (!hasNewLine && needsNewlines) { + context.report({ + node: currentElement, + messageId: "expectedBetween", + fix: fixer => fixer.insertTextBefore(nextElement, "\n") + }); + } + } + } + + /** + * Gets the left paren and right paren tokens of a node. + * @param {ASTNode} node The node with parens + * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token. + * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression + * with a single parameter) + */ + function getParenTokens(node) { + switch (node.type) { + case "NewExpression": + if (!node.arguments.length && !( + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) && + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) + )) { + + // If the NewExpression does not have parens (e.g. `new Foo`), return null. + return null; + } + + // falls through + + case "CallExpression": + return { + leftParen: sourceCode.getTokenAfter(node.callee, astUtils.isOpeningParenToken), + rightParen: sourceCode.getLastToken(node) + }; + + case "FunctionDeclaration": + case "FunctionExpression": { + const leftParen = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const rightParen = node.params.length + ? sourceCode.getTokenAfter(node.params[node.params.length - 1], astUtils.isClosingParenToken) + : sourceCode.getTokenAfter(leftParen); + + return { leftParen, rightParen }; + } + + case "ArrowFunctionExpression": { + const firstToken = sourceCode.getFirstToken(node); + + if (!astUtils.isOpeningParenToken(firstToken)) { + + // If the ArrowFunctionExpression has a single param without parens, return null. + return null; + } + + return { + leftParen: firstToken, + rightParen: sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken) + }; + } + + case "ImportExpression": { + const leftParen = sourceCode.getFirstToken(node, 1); + const rightParen = sourceCode.getLastToken(node); + + return { leftParen, rightParen }; + } + + default: + throw new TypeError(`unexpected node with type ${node.type}`); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + [[ + "ArrowFunctionExpression", + "CallExpression", + "FunctionDeclaration", + "FunctionExpression", + "ImportExpression", + "NewExpression" + ]](node) { + const parens = getParenTokens(node); + let params; + + if (node.type === "ImportExpression") { + params = [node.source]; + } else if (astUtils.isFunction(node)) { + params = node.params; + } else { + params = node.arguments; + } + + if (parens) { + validateParens(parens, params); + + if (multilineArgumentsOption) { + validateArguments(parens, params); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/generator-star-spacing.js b/node_modules/eslint/lib/rules/generator-star-spacing.js new file mode 100644 index 0000000..65534f7 --- /dev/null +++ b/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -0,0 +1,206 @@ +/** + * @fileoverview Rule to check the spacing around the * in generator functions. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const OVERRIDE_SCHEMA = { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] +}; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing around `*` operators in generator functions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/generator-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" }, + named: OVERRIDE_SCHEMA, + anonymous: OVERRIDE_SCHEMA, + method: OVERRIDE_SCHEMA + }, + additionalProperties: false + } + ] + } + ], + + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + + const optionDefinitions = { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }; + + /** + * Returns resolved option definitions based on an option and defaults + * @param {any} option The option object or string value + * @param {Object} defaults The defaults to use if options are not present + * @returns {Object} the resolved object definition + */ + function optionToDefinition(option, defaults) { + if (!option) { + return defaults; + } + + return typeof option === "string" + ? optionDefinitions[option] + : Object.assign({}, defaults, option); + } + + const modes = (function(option) { + const defaults = optionToDefinition(option, optionDefinitions.before); + + return { + named: optionToDefinition(option.named, defaults), + anonymous: optionToDefinition(option.anonymous, defaults), + method: optionToDefinition(option.method, defaults) + }; + }(context.options[0] || {})); + + const sourceCode = context.getSourceCode(); + + /** + * Checks if the given token is a star token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a star token. + */ + function isStarToken(token) { + return token.value === "*" && token.type === "Punctuator"; + } + + /** + * Gets the generator star token of the given function node. + * @param {ASTNode} node The function node to get. + * @returns {Token} Found star token. + */ + function getStarToken(node) { + return sourceCode.getFirstToken( + (node.parent.method || node.parent.type === "MethodDefinition") ? node.parent : node, + isStarToken + ); + } + + /** + * capitalize a given string. + * @param {string} str the given string. + * @returns {string} the capitalized string. + */ + function capitalize(str) { + return str[0].toUpperCase() + str.slice(1); + } + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} kind Either "named", "anonymous", or "method" + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(kind, side, leftToken, rightToken) { + if (!!(rightToken.range[0] - leftToken.range[1]) !== modes[kind][side]) { + const after = leftToken.value === "*"; + const spaceRequired = modes[kind][side]; + const node = after ? leftToken : rightToken; + const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`; + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a generator function. + * @param {ASTNode} node A function expression or declaration node. + * @returns {void} + */ + function checkFunction(node) { + if (!node.generator) { + return; + } + + const starToken = getStarToken(node); + const prevToken = sourceCode.getTokenBefore(starToken); + const nextToken = sourceCode.getTokenAfter(starToken); + + let kind = "named"; + + if (node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method)) { + kind = "method"; + } else if (!node.id) { + kind = "anonymous"; + } + + // Only check before when preceded by `function`|`static` keyword + if (!(kind === "method" && starToken === sourceCode.getFirstToken(node.parent))) { + checkSpacing(kind, "before", prevToken, starToken); + } + + checkSpacing(kind, "after", starToken, nextToken); + } + + return { + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/getter-return.js b/node_modules/eslint/lib/rules/getter-return.js new file mode 100644 index 0000000..c54ebfb --- /dev/null +++ b/node_modules/eslint/lib/rules/getter-return.js @@ -0,0 +1,173 @@ +/** + * @fileoverview Enforces that a return statement is present in property getters. + * @author Aladdin-ADD(hh_2013@foxmail.com) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; + +/** + * Checks a given code path segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce `return` statements in getters", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/getter-return" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expected: "Expected to return a value in {{name}}.", + expectedAlways: "Expected {{name}} to always return a value." + } + }, + + create(context) { + + const options = context.options[0] || { allowImplicit: false }; + const sourceCode = context.getSourceCode(); + + let funcInfo = { + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + if (funcInfo.shouldCheck && + funcInfo.codePath.currentSegments.some(isReachable) + ) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: funcInfo.hasReturn ? "expectedAlways" : "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + + /** + * Checks whether a node means a getter function. + * @param {ASTNode} node a node to check. + * @returns {boolean} if node means a getter, return true; else return false. + */ + function isGetter(node) { + const parent = node.parent; + + if (TARGET_NODE_TYPE.test(node.type) && node.body.type === "BlockStatement") { + if (parent.kind === "get") { + return true; + } + if (parent.type === "Property" && astUtils.getStaticPropertyName(parent) === "get" && parent.parent.type === "ObjectExpression") { + + // Object.defineProperty() + if (parent.parent.parent.type === "CallExpression" && + astUtils.getStaticPropertyName(parent.parent.parent.callee) === "defineProperty") { + return true; + } + + // Object.defineProperties() + if (parent.parent.parent.type === "Property" && + parent.parent.parent.parent.type === "ObjectExpression" && + parent.parent.parent.parent.parent.type === "CallExpression" && + astUtils.getStaticPropertyName(parent.parent.parent.parent.parent.callee) === "defineProperties") { + return true; + } + } + } + return false; + } + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: isGetter(node), + node + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + if (funcInfo.shouldCheck) { + funcInfo.hasReturn = true; + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + context.report({ + node, + messageId: "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/global-require.js b/node_modules/eslint/lib/rules/global-require.js new file mode 100644 index 0000000..09d0332 --- /dev/null +++ b/node_modules/eslint/lib/rules/global-require.js @@ -0,0 +1,86 @@ +/** + * @fileoverview Rule for disallowing require() outside of the top-level module context + * @author Jamund Ferguson + */ + +"use strict"; + +const ACCEPTABLE_PARENTS = [ + "AssignmentExpression", + "VariableDeclarator", + "MemberExpression", + "ExpressionStatement", + "CallExpression", + "ConditionalExpression", + "Program", + "VariableDeclaration", + "ChainExpression" +]; + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + /* istanbul ignore else: correctly returns null */ + if (references.length === 1) { + return references[0]; + } + return null; + +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {ASTNode} node The identifier node to check. + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require `require()` calls to be placed at top-level module scope", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/global-require" + }, + + schema: [], + messages: { + unexpected: "Unexpected require()." + } + }, + + create(context) { + return { + CallExpression(node) { + const currentScope = context.getScope(); + + if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { + const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1); + + if (!isGoodRequire) { + context.report({ node, messageId: "unexpected" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/grouped-accessor-pairs.js b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js new file mode 100644 index 0000000..a790f83 --- /dev/null +++ b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js @@ -0,0 +1,224 @@ +/** + * @fileoverview Rule to require grouped accessor pairs in object literals and classes + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require grouped accessor pairs in object literals and classes", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/grouped-accessor-pairs" + }, + + schema: [ + { + enum: ["anyOrder", "getBeforeSet", "setBeforeGet"] + } + ], + + messages: { + notGrouped: "Accessor pair {{ formerName }} and {{ latterName }} should be grouped.", + invalidOrder: "Expected {{ latterName }} to be before {{ formerName }}." + } + }, + + create(context) { + const order = context.options[0] || "anyOrder"; + const sourceCode = context.getSourceCode(); + + /** + * Reports the given accessor pair. + * @param {string} messageId messageId to report. + * @param {ASTNode} formerNode getter/setter node that is defined before `latterNode`. + * @param {ASTNode} latterNode getter/setter node that is defined after `formerNode`. + * @returns {void} + * @private + */ + function report(messageId, formerNode, latterNode) { + context.report({ + node: latterNode, + messageId, + loc: astUtils.getFunctionHeadLoc(latterNode.value, sourceCode), + data: { + formerName: astUtils.getFunctionNameWithKind(formerNode.value), + latterName: astUtils.getFunctionNameWithKind(latterNode.value) + } + }); + } + + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } + + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); + + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } + + return accessors; + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @param {Function} shouldCheck – Predicate that returns `true` if the node should be checked. + * @returns {void} + * @private + */ + function checkList(nodes, shouldCheck) { + const accessors = nodes + .filter(shouldCheck) + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); + + for (const { getters, setters } of accessors) { + + // Don't report accessor properties that have duplicate getters or setters. + if (getters.length === 1 && setters.length === 1) { + const [getter] = getters, + [setter] = setters, + getterIndex = nodes.indexOf(getter), + setterIndex = nodes.indexOf(setter), + formerNode = getterIndex < setterIndex ? getter : setter, + latterNode = getterIndex < setterIndex ? setter : getter; + + if (Math.abs(getterIndex - setterIndex) > 1) { + report("notGrouped", formerNode, latterNode); + } else if ( + (order === "getBeforeSet" && getterIndex > setterIndex) || + (order === "setBeforeGet" && getterIndex < setterIndex) + ) { + report("invalidOrder", formerNode, latterNode); + } + } + } + } + + return { + ObjectExpression(node) { + checkList(node.properties, n => n.type === "Property"); + }, + ClassBody(node) { + checkList(node.body, n => n.type === "MethodDefinition" && !n.static); + checkList(node.body, n => n.type === "MethodDefinition" && n.static); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/guard-for-in.js b/node_modules/eslint/lib/rules/guard-for-in.js new file mode 100644 index 0000000..2c0976d --- /dev/null +++ b/node_modules/eslint/lib/rules/guard-for-in.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag for-in loops without if statements inside + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `for-in` loops to include an `if` statement", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/guard-for-in" + }, + + schema: [], + messages: { + wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype." + } + }, + + create(context) { + + return { + + ForInStatement(node) { + const body = node.body; + + // empty statement + if (body.type === "EmptyStatement") { + return; + } + + // if statement + if (body.type === "IfStatement") { + return; + } + + // empty block + if (body.type === "BlockStatement" && body.body.length === 0) { + return; + } + + // block with just if statement + if (body.type === "BlockStatement" && body.body.length === 1 && body.body[0].type === "IfStatement") { + return; + } + + // block that starts with if statement + if (body.type === "BlockStatement" && body.body.length >= 1 && body.body[0].type === "IfStatement") { + const i = body.body[0]; + + // ... whose consequent is a continue + if (i.consequent.type === "ContinueStatement") { + return; + } + + // ... whose consequent is a block that contains only a continue + if (i.consequent.type === "BlockStatement" && i.consequent.body.length === 1 && i.consequent.body[0].type === "ContinueStatement") { + return; + } + } + + context.report({ node, messageId: "wrap" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/handle-callback-err.js b/node_modules/eslint/lib/rules/handle-callback-err.js new file mode 100644 index 0000000..b92490a --- /dev/null +++ b/node_modules/eslint/lib/rules/handle-callback-err.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Ensure handling of errors when we know they exist. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require error handling in callbacks", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/handle-callback-err" + }, + + schema: [ + { + type: "string" + } + ], + messages: { + expected: "Expected error to be handled." + } + }, + + create(context) { + + const errorArgument = context.options[0] || "err"; + + /** + * Checks if the given argument should be interpreted as a regexp pattern. + * @param {string} stringToCheck The string which should be checked. + * @returns {boolean} Whether or not the string should be interpreted as a pattern. + */ + function isPattern(stringToCheck) { + const firstChar = stringToCheck[0]; + + return firstChar === "^"; + } + + /** + * Checks if the given name matches the configured error argument. + * @param {string} name The name which should be compared. + * @returns {boolean} Whether or not the given name matches the configured error variable name. + */ + function matchesConfiguredErrorName(name) { + if (isPattern(errorArgument)) { + const regexp = new RegExp(errorArgument, "u"); + + return regexp.test(name); + } + return name === errorArgument; + } + + /** + * Get the parameters of a given function scope. + * @param {Object} scope The function scope. + * @returns {Array} All parameters of the given scope. + */ + function getParameters(scope) { + return scope.variables.filter(variable => variable.defs[0] && variable.defs[0].type === "Parameter"); + } + + /** + * Check to see if we're handling the error object properly. + * @param {ASTNode} node The AST node to check. + * @returns {void} + */ + function checkForError(node) { + const scope = context.getScope(), + parameters = getParameters(scope), + firstParameter = parameters[0]; + + if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { + if (firstParameter.references.length === 0) { + context.report({ node, messageId: "expected" }); + } + } + } + + return { + FunctionDeclaration: checkForError, + FunctionExpression: checkForError, + ArrowFunctionExpression: checkForError + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/id-blacklist.js b/node_modules/eslint/lib/rules/id-blacklist.js new file mode 100644 index 0000000..4fbba90 --- /dev/null +++ b/node_modules/eslint/lib/rules/id-blacklist.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * specified in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; // node `a` is renamed node. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + */ +function isRenamedInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.value !== node && + parent.key === node + ) + ); +} + +/** + * Checks whether the given node represents shorthand definition of a property in an object literal. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a shorthand property definition. + */ +function isShorthandPropertyDefinition(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.shorthand + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + replacedBy: ["id-denylist"], + + type: "suggestion", + + docs: { + description: "disallow specified identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-blacklist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + restricted: "Identifier '{{name}}' is restricted." + } + }, + + create(context) { + + const denyList = new Set(context.options); + const reportedNodes = new Set(); + + let globalScope; + + /** + * Checks whether the given name is restricted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is restricted. + * @private + */ + function isRestricted(name) { + return denyList.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a restricted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isRenamedInDestructuring(node) && + !( + isReferenceToGlobalVariable(node) && + !isShorthandPropertyDefinition(node) + ) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reportedNodes.has(node)) { + context.report({ + node, + messageId: "restricted", + data: { + name: node.name + } + }); + reportedNodes.add(node); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + if (isRestricted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-denylist.js b/node_modules/eslint/lib/rules/id-denylist.js new file mode 100644 index 0000000..112fd8a --- /dev/null +++ b/node_modules/eslint/lib/rules/id-denylist.js @@ -0,0 +1,230 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * specified in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; // node `a` is renamed node. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + */ +function isRenamedInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.value !== node && + parent.key === node + ) + ); +} + +/** + * Checks whether the given node represents shorthand definition of a property in an object literal. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a shorthand property definition. + */ +function isShorthandPropertyDefinition(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.shorthand + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-denylist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + restricted: "Identifier '{{name}}' is restricted." + } + }, + + create(context) { + + const denyList = new Set(context.options); + const reportedNodes = new Set(); + + let globalScope; + + /** + * Checks whether the given name is restricted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is restricted. + * @private + */ + function isRestricted(name) { + return denyList.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a restricted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isRenamedInDestructuring(node) && + !( + isReferenceToGlobalVariable(node) && + !isShorthandPropertyDefinition(node) + ) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reportedNodes.has(node)) { + context.report({ + node, + messageId: "restricted", + data: { + name: node.name + } + }); + reportedNodes.add(node); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + if (isRestricted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-length.js b/node_modules/eslint/lib/rules/id-length.js new file mode 100644 index 0000000..4df081f --- /dev/null +++ b/node_modules/eslint/lib/rules/id-length.js @@ -0,0 +1,145 @@ +/** + * @fileoverview Rule that warns when identifier names are shorter or longer + * than the values provided in configuration. + * @author Burak Yigit Kaya aka BYK + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce minimum and maximum identifier lengths", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-length" + }, + + schema: [ + { + type: "object", + properties: { + min: { + type: "integer", + default: 2 + }, + max: { + type: "integer" + }, + exceptions: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + exceptionPatterns: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + properties: { + enum: ["always", "never"] + } + }, + additionalProperties: false + } + ], + messages: { + tooShort: "Identifier name '{{name}}' is too short (< {{min}}).", + tooLong: "Identifier name '{{name}}' is too long (> {{max}})." + } + }, + + create(context) { + const options = context.options[0] || {}; + const minLength = typeof options.min !== "undefined" ? options.min : 2; + const maxLength = typeof options.max !== "undefined" ? options.max : Infinity; + const properties = options.properties !== "never"; + const exceptions = new Set(options.exceptions); + const exceptionPatterns = (options.exceptionPatterns || []).map(pattern => new RegExp(pattern, "u")); + const reportedNode = new Set(); + + /** + * Checks if a string matches the provided exception patterns + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function matchesExceptionPattern(name) { + return exceptionPatterns.some(pattern => pattern.test(name)); + } + + const SUPPORTED_EXPRESSIONS = { + MemberExpression: properties && function(parent) { + return !parent.computed && ( + + // regular property assignment + (parent.parent.left === parent && parent.parent.type === "AssignmentExpression" || + + // or the last identifier in an ObjectPattern destructuring + parent.parent.type === "Property" && parent.parent.value === parent && + parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent) + ); + }, + AssignmentPattern(parent, node) { + return parent.left === node; + }, + VariableDeclarator(parent, node) { + return parent.id === node; + }, + Property(parent, node) { + + if (parent.parent.type === "ObjectPattern") { + return ( + parent.value !== parent.key && parent.value === node || + parent.value === parent.key && parent.key === node && properties + ); + } + return properties && !parent.computed && parent.key === node; + }, + ImportDefaultSpecifier: true, + RestElement: true, + FunctionExpression: true, + ArrowFunctionExpression: true, + ClassDeclaration: true, + FunctionDeclaration: true, + MethodDefinition: true, + CatchClause: true, + ArrayPattern: true + }; + + return { + Identifier(node) { + const name = node.name; + const parent = node.parent; + + const isShort = name.length < minLength; + const isLong = name.length > maxLength; + + if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { + return; // Nothing to report + } + + const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; + + if (isValidExpression && !reportedNode.has(node) && (isValidExpression === true || isValidExpression(parent, node))) { + reportedNode.add(node); + context.report({ + node, + messageId: isShort ? "tooShort" : "tooLong", + data: { name, min: minLength, max: maxLength } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-match.js b/node_modules/eslint/lib/rules/id-match.js new file mode 100644 index 0000000..7e400d0 --- /dev/null +++ b/node_modules/eslint/lib/rules/id-match.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Rule to flag non-matching identifiers + * @author Matthieu Larcher + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require identifiers to match a specified regular expression", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-match" + }, + + schema: [ + { + type: "string" + }, + { + type: "object", + properties: { + properties: { + type: "boolean", + default: false + }, + onlyDeclarations: { + type: "boolean", + default: false + }, + ignoreDestructuring: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Options + //-------------------------------------------------------------------------- + const pattern = context.options[0] || "^.+$", + regexp = new RegExp(pattern, "u"); + + const options = context.options[1] || {}, + properties = !!options.properties, + onlyDeclarations = !!options.onlyDeclarations, + ignoreDestructuring = !!options.ignoreDestructuring; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = new Map(); + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]); + const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]); + + /** + * Checks if a string matches the provided pattern + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function isInvalid(name) { + return !regexp.test(name); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let { parent } = node; + + while (parent) { + if (parent.type === "ObjectPattern") { + return true; + } + + parent = parent.parent; + } + + return false; + } + + /** + * Verifies if we should report an error or not based on the effective + * parent node and the identifier name. + * @param {ASTNode} effectiveParent The effective parent node of the node to be reported + * @param {string} name The identifier name of the identifier node + * @returns {boolean} whether an error should be reported or not + */ + function shouldReport(effectiveParent, name) { + return (!onlyDeclarations || DECLARATION_TYPES.has(effectiveParent.type)) && + !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && isInvalid(name); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reported.has(node)) { + context.report({ + node, + messageId: "notMatch", + data: { + name: node.name, + pattern + } + }); + reported.set(node, true); + } + } + + return { + + Identifier(node) { + const name = node.name, + parent = node.parent, + effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent; + + if (parent.type === "MemberExpression") { + + if (!properties) { + return; + } + + // Always check object names + if (parent.object.type === "Identifier" && + parent.object.name === name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions left side's assigned variable id + } else if (effectiveParent.type === "AssignmentExpression" && + effectiveParent.left.type === "MemberExpression" && + effectiveParent.left.property.name === node.name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && effectiveParent.right.type !== "MemberExpression") { + if (isInvalid(name)) { + report(node); + } + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (parent.type === "Property" || parent.type === "AssignmentPattern") { + + if (parent.parent && parent.parent.type === "ObjectPattern") { + if (parent.shorthand && parent.value.left && isInvalid(name)) { + + report(node); + } + + const assignmentKeyEqualsValue = parent.key.name === parent.value.name; + + // prevent checking righthand side of destructured object + if (!assignmentKeyEqualsValue && parent.key === node) { + return; + } + + const valueIsInvalid = parent.value.name && isInvalid(name); + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsInvalid && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // never check properties or always ignore destructuring + if (!properties || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (parent.right !== node && shouldReport(effectiveParent, name)) { + report(node); + } + + // Check if it's an import specifier + } else if (IMPORT_TYPES.has(parent.type)) { + + // Report only if the local imported identifier is invalid + if (parent.local && parent.local.name === node.name && isInvalid(name)) { + report(node); + } + + // Report anything that is invalid that isn't a CallExpression + } else if (shouldReport(effectiveParent, name)) { + report(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js new file mode 100644 index 0000000..409145e --- /dev/null +++ b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -0,0 +1,81 @@ +/** + * @fileoverview enforce the location of arrow function bodies + * @author Sharmila Jesupaul + */ +"use strict"; + +const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the location of arrow function bodies", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/implicit-arrow-linebreak" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["beside", "below"] + } + ], + messages: { + expected: "Expected a linebreak before this expression.", + unexpected: "Expected no linebreak before this expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "beside"; + + /** + * Validates the location of an arrow function body + * @param {ASTNode} node The arrow function body + * @returns {void} + */ + function validateExpression(node) { + if (node.body.type === "BlockStatement") { + return; + } + + const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken); + const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken); + + if (arrowToken.loc.end.line === firstTokenOfBody.loc.start.line && option === "below") { + context.report({ + node: firstTokenOfBody, + messageId: "expected", + fix: fixer => fixer.insertTextBefore(firstTokenOfBody, "\n") + }); + } else if (arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line && option === "beside") { + context.report({ + node: firstTokenOfBody, + messageId: "unexpected", + fix(fixer) { + if (sourceCode.getFirstTokenBetween(arrowToken, firstTokenOfBody, { includeComments: true, filter: isCommentToken })) { + return null; + } + + return fixer.replaceTextRange([arrowToken.range[1], firstTokenOfBody.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + ArrowFunctionExpression: node => validateExpression(node) + }; + } +}; diff --git a/node_modules/eslint/lib/rules/indent-legacy.js b/node_modules/eslint/lib/rules/indent-legacy.js new file mode 100644 index 0000000..50010d3 --- /dev/null +++ b/node_modules/eslint/lib/rules/indent-legacy.js @@ -0,0 +1,1125 @@ +/** + * @fileoverview This option sets a specific tab width for your code + * + * This rule has been ported and modified from nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent indentation", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/indent-legacy" + }, + + deprecated: true, + + replacedBy: ["indent"], + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0 + }, + VariableDeclarator: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + var: { + type: "integer", + minimum: 0 + }, + let: { + type: "integer", + minimum: 0 + }, + const: { + type: "integer", + minimum: 0 + } + } + } + ] + }, + outerIIFEBody: { + type: "integer", + minimum: 0 + }, + MemberExpression: { + type: "integer", + minimum: 0 + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + FunctionExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + CallExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + } + }, + ArrayExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + ObjectExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + }, + additionalProperties: false + } + ], + messages: { + expected: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = null; // For backwards compatibility, don't check parameter indentation unless specified in the config + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: null, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + ArrayExpression: 1, + ObjectExpression: 1 + }; + + const sourceCode = context.getSourceCode(); + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + const opts = context.options[1]; + + options.SwitchCase = opts.SwitchCase || 0; + const variableDeclaratorRules = opts.VariableDeclarator; + + if (typeof variableDeclaratorRules === "number") { + options.VariableDeclarator = { + var: variableDeclaratorRules, + let: variableDeclaratorRules, + const: variableDeclaratorRules + }; + } else if (typeof variableDeclaratorRules === "object") { + Object.assign(options.VariableDeclarator, variableDeclaratorRules); + } + + if (typeof opts.outerIIFEBody === "number") { + options.outerIIFEBody = opts.outerIIFEBody; + } + + if (typeof opts.MemberExpression === "number") { + options.MemberExpression = opts.MemberExpression; + } + + if (typeof opts.FunctionDeclaration === "object") { + Object.assign(options.FunctionDeclaration, opts.FunctionDeclaration); + } + + if (typeof opts.FunctionExpression === "object") { + Object.assign(options.FunctionExpression, opts.FunctionExpression); + } + + if (typeof opts.CallExpression === "object") { + Object.assign(options.CallExpression, opts.CallExpression); + } + + if (typeof opts.ArrayExpression === "number" || typeof opts.ArrayExpression === "string") { + options.ArrayExpression = opts.ArrayExpression; + } + + if (typeof opts.ObjectExpression === "number" || typeof opts.ObjectExpression === "string") { + options.ObjectExpression = opts.ObjectExpression; + } + } + } + + const caseIndentStore = {}; + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0 && actualTabs > 0) { + foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs" + } else if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {ASTNode} node Node violating the indent rule + * @param {int} needed Expected indentation character count + * @param {int} gottenSpaces Indentation space count in the actual node/code + * @param {int} gottenTabs Indentation tab count in the actual node/code + * @param {Object} [loc] Error line and column location + * @param {boolean} isLastNodeCheck Is the error for last node check + * @returns {void} + */ + function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) { + if (gottenSpaces && gottenTabs) { + + // To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs. + return; + } + + const desiredIndent = (indentType === "space" ? " " : "\t").repeat(needed); + + const textRange = isLastNodeCheck + ? [node.range[1] - node.loc.end.column, node.range[1] - node.loc.end.column + gottenSpaces + gottenTabs] + : [node.range[0] - node.loc.start.column, node.range[0] - node.loc.start.column + gottenSpaces + gottenTabs]; + + context.report({ + node, + loc, + messageId: "expected", + data: createErrorMessageData(needed, gottenSpaces, gottenTabs), + fix: fixer => fixer.replaceTextRange(textRange, desiredIndent) + }); + } + + /** + * Get the actual indent of node + * @param {ASTNode|Token} node Node to examine + * @param {boolean} [byLastLine=false] get indent of node's last line + * @returns {Object} The node's indent. Contains keys `space` and `tab`, representing the indent of each character. Also + * contains keys `goodChar` and `badChar`, where `goodChar` is the amount of the user's desired indentation character, and + * `badChar` is the amount of the other indentation character. + */ + function getNodeIndent(node, byLastLine) { + const token = byLastLine ? sourceCode.getLastToken(node) : sourceCode.getFirstToken(node); + const srcCharsBeforeNode = sourceCode.getText(token, token.loc.start.column).split(""); + const indentChars = srcCharsBeforeNode.slice(0, srcCharsBeforeNode.findIndex(char => char !== " " && char !== "\t")); + const spaces = indentChars.filter(char => char === " ").length; + const tabs = indentChars.filter(char => char === "\t").length; + + return { + space: spaces, + tab: tabs, + goodChar: indentType === "space" ? spaces : tabs, + badChar: indentType === "space" ? tabs : spaces + }; + } + + /** + * Checks node is the first in its own start line. By default it looks by start line. + * @param {ASTNode} node The node to check + * @param {boolean} [byEndLocation=false] Lookup based on start position or end + * @returns {boolean} true if its the first in the its start line + */ + function isNodeFirstInLine(node, byEndLocation) { + const firstToken = byEndLocation === true ? sourceCode.getLastToken(node, 1) : sourceCode.getTokenBefore(node), + startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line, + endLine = firstToken ? firstToken.loc.end.line : -1; + + return startLine !== endLine; + } + + /** + * Check indent for node + * @param {ASTNode} node Node to check + * @param {int} neededIndent needed indent + * @returns {void} + */ + function checkNodeIndent(node, neededIndent) { + const actualIndent = getNodeIndent(node, false); + + if ( + node.type !== "ArrayExpression" && + node.type !== "ObjectExpression" && + (actualIndent.goodChar !== neededIndent || actualIndent.badChar !== 0) && + isNodeFirstInLine(node) + ) { + report(node, neededIndent, actualIndent.space, actualIndent.tab); + } + + if (node.type === "IfStatement" && node.alternate) { + const elseToken = sourceCode.getTokenBefore(node.alternate); + + checkNodeIndent(elseToken, neededIndent); + + if (!isNodeFirstInLine(node.alternate)) { + checkNodeIndent(node.alternate, neededIndent); + } + } + + if (node.type === "TryStatement" && node.handler) { + const catchToken = sourceCode.getFirstToken(node.handler); + + checkNodeIndent(catchToken, neededIndent); + } + + if (node.type === "TryStatement" && node.finalizer) { + const finallyToken = sourceCode.getTokenBefore(node.finalizer); + + checkNodeIndent(finallyToken, neededIndent); + } + + if (node.type === "DoWhileStatement") { + const whileToken = sourceCode.getTokenAfter(node.body); + + checkNodeIndent(whileToken, neededIndent); + } + } + + /** + * Check indent for nodes list + * @param {ASTNode[]} nodes list of node objects + * @param {int} indent needed indent + * @returns {void} + */ + function checkNodesIndent(nodes, indent) { + nodes.forEach(node => checkNodeIndent(node, indent)); + } + + /** + * Check last node line indent this detects, that block closed correctly + * @param {ASTNode} node Node to examine + * @param {int} lastLineIndent needed indent + * @returns {void} + */ + function checkLastNodeLineIndent(node, lastLineIndent) { + const lastToken = sourceCode.getLastToken(node); + const endIndent = getNodeIndent(lastToken, true); + + if ((endIndent.goodChar !== lastLineIndent || endIndent.badChar !== 0) && isNodeFirstInLine(node, true)) { + report( + node, + lastLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check last node line indent this detects, that block closed correctly + * This function for more complicated return statement case, where closing parenthesis may be followed by ';' + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent first line needed indent + * @returns {void} + */ + function checkLastReturnStatementLineIndent(node, firstLineIndent) { + + /* + * in case if return statement ends with ');' we have traverse back to ')' + * otherwise we'll measure indent for ';' and replace ')' + */ + const lastToken = sourceCode.getLastToken(node, astUtils.isClosingParenToken); + const textBeforeClosingParenthesis = sourceCode.getText(lastToken, lastToken.loc.start.column).slice(0, -1); + + if (textBeforeClosingParenthesis.trim()) { + + // There are tokens before the closing paren, don't report this case + return; + } + + const endIndent = getNodeIndent(lastToken, true); + + if (endIndent.goodChar !== firstLineIndent) { + report( + node, + firstLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check first node line indent is correct + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent needed indent + * @returns {void} + */ + function checkFirstNodeLineIndent(node, firstLineIndent) { + const startIndent = getNodeIndent(node, false); + + if ((startIndent.goodChar !== firstLineIndent || startIndent.badChar !== 0) && isNodeFirstInLine(node)) { + report( + node, + firstLineIndent, + startIndent.space, + startIndent.tab, + { line: node.loc.start.line, column: node.loc.start.column } + ); + } + } + + /** + * Returns a parent node of given node based on a specified type + * if not present then return null + * @param {ASTNode} node node to examine + * @param {string} type type that is being looked for + * @param {string} stopAtList end points for the evaluating code + * @returns {ASTNode|void} if found then node otherwise null + */ + function getParentNodeByType(node, type, stopAtList) { + let parent = node.parent; + const stopAtSet = new Set(stopAtList || ["Program"]); + + while (parent.type !== type && !stopAtSet.has(parent.type) && parent.type !== "Program") { + parent = parent.parent; + } + + return parent.type === type ? parent : null; + } + + /** + * Returns the VariableDeclarator based on the current node + * if not present then return null + * @param {ASTNode} node node to examine + * @returns {ASTNode|void} if found then node otherwise null + */ + function getVariableDeclaratorNode(node) { + return getParentNodeByType(node, "VariableDeclarator"); + } + + /** + * Check to see if the node is part of the multi-line variable declaration. + * Also if its on the same line as the varNode + * @param {ASTNode} node node to check + * @param {ASTNode} varNode variable declaration node to check against + * @returns {boolean} True if all the above condition satisfy + */ + function isNodeInVarOnTop(node, varNode) { + return varNode && + varNode.parent.loc.start.line === node.loc.start.line && + varNode.parent.declarations.length > 1; + } + + /** + * Check to see if the argument before the callee node is multi-line and + * there should only be 1 argument before the callee node + * @param {ASTNode} node node to check + * @returns {boolean} True if arguments are multi-line + */ + function isArgBeforeCalleeNodeMultiline(node) { + const parent = node.parent; + + if (parent.arguments.length >= 2 && parent.arguments[1] === node) { + return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line; + } + + return false; + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + const parent = node.parent; + let stmt = parent.parent; + + /* + * Verify that the node is an IIEF + */ + if ( + parent.type !== "CallExpression" || + parent.callee !== node) { + + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIEF is outer + */ + while ( + stmt.type === "UnaryExpression" && ( + stmt.operator === "!" || + stmt.operator === "~" || + stmt.operator === "+" || + stmt.operator === "-") || + stmt.type === "AssignmentExpression" || + stmt.type === "LogicalExpression" || + stmt.type === "SequenceExpression" || + stmt.type === "VariableDeclarator") { + + stmt = stmt.parent; + } + + return (( + stmt.type === "ExpressionStatement" || + stmt.type === "VariableDeclaration") && + stmt.parent && stmt.parent.type === "Program" + ); + } + + /** + * Check indent for function block content + * @param {ASTNode} node A BlockStatement node that is inside of a function. + * @returns {void} + */ + function checkIndentInFunctionBlock(node) { + + /* + * Search first caller in chain. + * Ex.: + * + * Models <- Identifier + * .User + * .find() + * .exec(function() { + * // function body + * }); + * + * Looks for 'Models' + */ + const calleeNode = node.parent; // FunctionExpression + let indent; + + if (calleeNode.parent && + (calleeNode.parent.type === "Property" || + calleeNode.parent.type === "ArrayExpression")) { + + // If function is part of array or object, comma can be put at left + indent = getNodeIndent(calleeNode, false).goodChar; + } else { + + // If function is standalone, simple calculate indent + indent = getNodeIndent(calleeNode).goodChar; + } + + if (calleeNode.parent.type === "CallExpression") { + const calleeParent = calleeNode.parent; + + if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") { + if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) { + indent = getNodeIndent(calleeParent).goodChar; + } + } else { + if (isArgBeforeCalleeNodeMultiline(calleeNode) && + calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line && + !isNodeFirstInLine(calleeNode)) { + indent = getNodeIndent(calleeParent).goodChar; + } + } + } + + /* + * function body indent should be indent + indent size, unless this + * is a FunctionDeclaration, FunctionExpression, or outer IIFE and the corresponding options are enabled. + */ + let functionOffset = indentSize; + + if (options.outerIIFEBody !== null && isOuterIIFE(calleeNode)) { + functionOffset = options.outerIIFEBody * indentSize; + } else if (calleeNode.type === "FunctionExpression") { + functionOffset = options.FunctionExpression.body * indentSize; + } else if (calleeNode.type === "FunctionDeclaration") { + functionOffset = options.FunctionDeclaration.body * indentSize; + } + indent += functionOffset; + + // check if the node is inside a variable + const parentVarNode = getVariableDeclaratorNode(node); + + if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) { + indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + if (node.body.length > 0) { + checkNodesIndent(node.body, indent); + } + + checkLastNodeLineIndent(node, indent - functionOffset); + } + + + /** + * Checks if the given node starts and ends on the same line + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the block starts and ends on the same line. + */ + function isSingleLineNode(node) { + const lastToken = sourceCode.getLastToken(node), + startLine = node.loc.start.line, + endLine = lastToken.loc.end.line; + + return startLine === endLine; + } + + /** + * Check indent for array block content or object block content + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInArrayOrObjectBlock(node) { + + // Skip inline + if (isSingleLineNode(node)) { + return; + } + + let elements = (node.type === "ArrayExpression") ? node.elements : node.properties; + + // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null + elements = elements.filter(elem => elem !== null); + + let nodeIndent; + let elementsIndent; + const parentVarNode = getVariableDeclaratorNode(node); + + // TODO - come up with a better strategy in future + if (isNodeFirstInLine(node)) { + const parent = node.parent; + + nodeIndent = getNodeIndent(parent).goodChar; + if (!parentVarNode || parentVarNode.loc.start.line !== node.loc.start.line) { + if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) { + if (parent.type === "VariableDeclarator" && parentVarNode.loc.start.line === parent.loc.start.line) { + nodeIndent += (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); + } else if (parent.type === "ObjectExpression" || parent.type === "ArrayExpression") { + const parentElements = node.parent.type === "ObjectExpression" ? node.parent.properties : node.parent.elements; + + if (parentElements[0] && + parentElements[0].loc.start.line === parent.loc.start.line && + parentElements[0].loc.end.line !== parent.loc.start.line) { + + /* + * If the first element of the array spans multiple lines, don't increase the expected indentation of the rest. + * e.g. [{ + * foo: 1 + * }, + * { + * bar: 1 + * }] + * the second object is not indented. + */ + } else if (typeof options[parent.type] === "number") { + nodeIndent += options[parent.type] * indentSize; + } else { + nodeIndent = parentElements[0].loc.start.column; + } + } else if (parent.type === "CallExpression" || parent.type === "NewExpression") { + if (typeof options.CallExpression.arguments === "number") { + nodeIndent += options.CallExpression.arguments * indentSize; + } else if (options.CallExpression.arguments === "first") { + if (parent.arguments.indexOf(node) !== -1) { + nodeIndent = parent.arguments[0].loc.start.column; + } + } else { + nodeIndent += indentSize; + } + } else if (parent.type === "LogicalExpression" || parent.type === "ArrowFunctionExpression") { + nodeIndent += indentSize; + } + } + } + + checkFirstNodeLineIndent(node, nodeIndent); + } else { + nodeIndent = getNodeIndent(node).goodChar; + } + + if (options[node.type] === "first") { + elementsIndent = elements.length ? elements[0].loc.start.column : 0; // If there are no elements, elementsIndent doesn't matter. + } else { + elementsIndent = nodeIndent + indentSize * options[node.type]; + } + + /* + * Check if the node is a multiple variable declaration; if so, then + * make sure indentation takes that into account. + */ + if (isNodeInVarOnTop(node, parentVarNode)) { + elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + checkNodesIndent(elements, elementsIndent); + + if (elements.length > 0) { + + // Skip last block line check if last item in same line + if (elements[elements.length - 1].loc.end.line === node.loc.end.line) { + return; + } + } + + checkLastNodeLineIndent(node, nodeIndent + + (isNodeInVarOnTop(node, parentVarNode) ? options.VariableDeclarator[parentVarNode.parent.kind] * indentSize : 0)); + } + + /** + * Check if the node or node body is a BlockStatement or not + * @param {ASTNode} node node to test + * @returns {boolean} True if it or its body is a block statement + */ + function isNodeBodyBlock(node) { + return node.type === "BlockStatement" || node.type === "ClassBody" || (node.body && node.body.type === "BlockStatement") || + (node.consequent && node.consequent.type === "BlockStatement"); + } + + /** + * Check indentation for blocks + * @param {ASTNode} node node to check + * @returns {void} + */ + function blockIndentationCheck(node) { + + // Skip inline blocks + if (isSingleLineNode(node)) { + return; + } + + if (node.parent && ( + node.parent.type === "FunctionExpression" || + node.parent.type === "FunctionDeclaration" || + node.parent.type === "ArrowFunctionExpression") + ) { + checkIndentInFunctionBlock(node); + return; + } + + let indent; + let nodesToCheck = []; + + /* + * For this statements we should check indent from statement beginning, + * not from the beginning of the block. + */ + const statementsWithProperties = [ + "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration", "TryStatement" + ]; + + if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { + indent = getNodeIndent(node.parent).goodChar; + } else if (node.parent && node.parent.type === "CatchClause") { + indent = getNodeIndent(node.parent.parent).goodChar; + } else { + indent = getNodeIndent(node).goodChar; + } + + if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { + nodesToCheck = [node.consequent]; + } else if (Array.isArray(node.body)) { + nodesToCheck = node.body; + } else { + nodesToCheck = [node.body]; + } + + if (nodesToCheck.length > 0) { + checkNodesIndent(nodesToCheck, indent + indentSize); + } + + if (node.type === "BlockStatement") { + checkLastNodeLineIndent(node, indent); + } + } + + /** + * Filter out the elements which are on the same line of each other or the node. + * basically have only 1 elements from each line except the variable declaration line. + * @param {ASTNode} node Variable declaration node + * @returns {ASTNode[]} Filtered elements + */ + function filterOutSameLineVars(node) { + return node.declarations.reduce((finalCollection, elem) => { + const lastElem = finalCollection[finalCollection.length - 1]; + + if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || + (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { + finalCollection.push(elem); + } + + return finalCollection; + }, []); + } + + /** + * Check indentation for variable declarations + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInVariableDeclarations(node) { + const elements = filterOutSameLineVars(node); + const nodeIndent = getNodeIndent(node).goodChar; + const lastElement = elements[elements.length - 1]; + + const elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind]; + + checkNodesIndent(elements, elementsIndent); + + // Only check the last line if there is any token after the last item + if (sourceCode.getLastToken(node).loc.end.line <= lastElement.loc.end.line) { + return; + } + + const tokenBeforeLastElement = sourceCode.getTokenBefore(lastElement); + + if (tokenBeforeLastElement.value === ",") { + + // Special case for comma-first syntax where the semicolon is indented + checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement).goodChar); + } else { + checkLastNodeLineIndent(node, elementsIndent - indentSize); + } + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function blockLessNodes(node) { + if (node.body.type !== "BlockStatement") { + blockIndentationCheck(node); + } + } + + /** + * Returns the expected indentation for the case statement + * @param {ASTNode} node node to examine + * @param {int} [providedSwitchIndent] indent for switch statement + * @returns {int} indent size + */ + function expectedCaseIndent(node, providedSwitchIndent) { + const switchNode = (node.type === "SwitchStatement") ? node : node.parent; + const switchIndent = typeof providedSwitchIndent === "undefined" + ? getNodeIndent(switchNode).goodChar + : providedSwitchIndent; + let caseIndent; + + if (caseIndentStore[switchNode.loc.start.line]) { + return caseIndentStore[switchNode.loc.start.line]; + } + + if (switchNode.cases.length > 0 && options.SwitchCase === 0) { + caseIndent = switchIndent; + } else { + caseIndent = switchIndent + (indentSize * options.SwitchCase); + } + + caseIndentStore[switchNode.loc.start.line] = caseIndent; + return caseIndent; + + } + + /** + * Checks wether a return statement is wrapped in () + * @param {ASTNode} node node to examine + * @returns {boolean} the result + */ + function isWrappedInParenthesis(node) { + const regex = /^return\s*?\(\s*?\);*?/u; + + const statementWithoutArgument = sourceCode.getText(node).replace( + sourceCode.getText(node.argument), "" + ); + + return regex.test(statementWithoutArgument); + } + + return { + Program(node) { + if (node.body.length > 0) { + + // Root nodes should have no indent + checkNodesIndent(node.body, getNodeIndent(node).goodChar); + } + }, + + ClassBody: blockIndentationCheck, + + BlockStatement: blockIndentationCheck, + + WhileStatement: blockLessNodes, + + ForStatement: blockLessNodes, + + ForInStatement: blockLessNodes, + + ForOfStatement: blockLessNodes, + + DoWhileStatement: blockLessNodes, + + IfStatement(node) { + if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { + blockIndentationCheck(node); + } + }, + + VariableDeclaration(node) { + if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) { + checkIndentInVariableDeclarations(node); + } + }, + + ObjectExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + ArrayExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + MemberExpression(node) { + + if (typeof options.MemberExpression === "undefined") { + return; + } + + if (isSingleLineNode(node)) { + return; + } + + /* + * The typical layout of variable declarations and assignments + * alter the expectation of correct indentation. Skip them. + * TODO: Add appropriate configuration options for variable + * declarations and assignments. + */ + if (getParentNodeByType(node, "VariableDeclarator", ["FunctionExpression", "ArrowFunctionExpression"])) { + return; + } + + if (getParentNodeByType(node, "AssignmentExpression", ["FunctionExpression"])) { + return; + } + + const propertyIndent = getNodeIndent(node).goodChar + indentSize * options.MemberExpression; + + const checkNodes = [node.property]; + + const dot = sourceCode.getTokenBefore(node.property); + + if (dot.type === "Punctuator" && dot.value === ".") { + checkNodes.push(dot); + } + + checkNodesIndent(checkNodes, propertyIndent); + }, + + SwitchStatement(node) { + + // Switch is not a 'BlockStatement' + const switchIndent = getNodeIndent(node).goodChar; + const caseIndent = expectedCaseIndent(node, switchIndent); + + checkNodesIndent(node.cases, caseIndent); + + + checkLastNodeLineIndent(node, switchIndent); + }, + + SwitchCase(node) { + + // Skip inline cases + if (isSingleLineNode(node)) { + return; + } + const caseIndent = expectedCaseIndent(node); + + checkNodesIndent(node.consequent, caseIndent + indentSize); + }, + + FunctionDeclaration(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionDeclaration.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionDeclaration.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionDeclaration.parameters); + } + }, + + FunctionExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionExpression.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionExpression.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionExpression.parameters); + } + }, + + ReturnStatement(node) { + if (isSingleLineNode(node)) { + return; + } + + const firstLineIndent = getNodeIndent(node).goodChar; + + // in case if return statement is wrapped in parenthesis + if (isWrappedInParenthesis(node)) { + checkLastReturnStatementLineIndent(node, firstLineIndent); + } else { + checkNodeIndent(node, firstLineIndent); + } + }, + + CallExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.CallExpression.arguments === "first" && node.arguments.length) { + checkNodesIndent(node.arguments.slice(1), node.arguments[0].loc.start.column); + } else if (options.CallExpression.arguments !== null) { + checkNodesIndent(node.arguments, getNodeIndent(node).goodChar + indentSize * options.CallExpression.arguments); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/indent.js b/node_modules/eslint/lib/rules/indent.js new file mode 100644 index 0000000..1c0dccc --- /dev/null +++ b/node_modules/eslint/lib/rules/indent.js @@ -0,0 +1,1706 @@ +/** + * @fileoverview This rule sets a specific indentation style and width for your code + * + * @author Teddy Katz + * @author Vitaly Puzrin + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); +const createTree = require("functional-red-black-tree"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const KNOWN_NODES = new Set([ + "AssignmentExpression", + "AssignmentPattern", + "ArrayExpression", + "ArrayPattern", + "ArrowFunctionExpression", + "AwaitExpression", + "BlockStatement", + "BinaryExpression", + "BreakStatement", + "CallExpression", + "CatchClause", + "ChainExpression", + "ClassBody", + "ClassDeclaration", + "ClassExpression", + "ConditionalExpression", + "ContinueStatement", + "DoWhileStatement", + "DebuggerStatement", + "EmptyStatement", + "ExperimentalRestProperty", + "ExperimentalSpreadProperty", + "ExpressionStatement", + "ForStatement", + "ForInStatement", + "ForOfStatement", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "IfStatement", + "Literal", + "LabeledStatement", + "LogicalExpression", + "MemberExpression", + "MetaProperty", + "MethodDefinition", + "NewExpression", + "ObjectExpression", + "ObjectPattern", + "Program", + "Property", + "RestElement", + "ReturnStatement", + "SequenceExpression", + "SpreadElement", + "Super", + "SwitchCase", + "SwitchStatement", + "TaggedTemplateExpression", + "TemplateElement", + "TemplateLiteral", + "ThisExpression", + "ThrowStatement", + "TryStatement", + "UnaryExpression", + "UpdateExpression", + "VariableDeclaration", + "VariableDeclarator", + "WhileStatement", + "WithStatement", + "YieldExpression", + "JSXFragment", + "JSXOpeningFragment", + "JSXClosingFragment", + "JSXIdentifier", + "JSXNamespacedName", + "JSXMemberExpression", + "JSXEmptyExpression", + "JSXExpressionContainer", + "JSXElement", + "JSXClosingElement", + "JSXOpeningElement", + "JSXAttribute", + "JSXSpreadAttribute", + "JSXText", + "ExportDefaultDeclaration", + "ExportNamedDeclaration", + "ExportAllDeclaration", + "ExportSpecifier", + "ImportDeclaration", + "ImportSpecifier", + "ImportDefaultSpecifier", + "ImportNamespaceSpecifier", + "ImportExpression" +]); + +/* + * General rule strategy: + * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another + * specified token or to the first column. + * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a + * BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly + * brace of the BlockStatement. + * 3. After traversing the AST, calculate the expected indentation levels of every token according to the + * OffsetStorage container. + * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file, + * and report the token if the two values are not equal. + */ + + +/** + * A mutable balanced binary search tree that stores (key, value) pairs. The keys are numeric, and must be unique. + * This is intended to be a generic wrapper around a balanced binary search tree library, so that the underlying implementation + * can easily be swapped out. + */ +class BinarySearchTree { + + /** + * Creates an empty tree + */ + constructor() { + this._rbTree = createTree(); + } + + /** + * Inserts an entry into the tree. + * @param {number} key The entry's key + * @param {*} value The entry's value + * @returns {void} + */ + insert(key, value) { + const iterator = this._rbTree.find(key); + + if (iterator.valid) { + this._rbTree = iterator.update(value); + } else { + this._rbTree = this._rbTree.insert(key, value); + } + } + + /** + * Finds the entry with the largest key less than or equal to the provided key + * @param {number} key The provided key + * @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists. + */ + findLe(key) { + const iterator = this._rbTree.le(key); + + return iterator && { key: iterator.key, value: iterator.value }; + } + + /** + * Deletes all of the keys in the interval [start, end) + * @param {number} start The start of the range + * @param {number} end The end of the range + * @returns {void} + */ + deleteRange(start, end) { + + // Exit without traversing the tree if the range has zero size. + if (start === end) { + return; + } + const iterator = this._rbTree.ge(start); + + while (iterator.valid && iterator.key < end) { + this._rbTree = this._rbTree.remove(iterator.key); + iterator.next(); + } + } +} + +/** + * A helper class to get token-based info related to indentation + */ +class TokenInfo { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {SourceCode} sourceCode A SourceCode object + */ + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.firstTokensByLineNumber = sourceCode.tokensAndComments.reduce((map, token) => { + if (!map.has(token.loc.start.line)) { + map.set(token.loc.start.line, token); + } + if (!map.has(token.loc.end.line) && sourceCode.text.slice(token.range[1] - token.loc.end.column, token.range[1]).trim()) { + map.set(token.loc.end.line, token); + } + return map; + }, new Map()); + } + + /** + * Gets the first token on a given token's line + * @param {Token|ASTNode} token a node or token + * @returns {Token} The first token on the given line + */ + getFirstTokenOfLine(token) { + return this.firstTokensByLineNumber.get(token.loc.start.line); + } + + /** + * Determines whether a token is the first token in its line + * @param {Token} token The token + * @returns {boolean} `true` if the token is the first on its line + */ + isFirstTokenOfLine(token) { + return this.getFirstTokenOfLine(token) === token; + } + + /** + * Get the actual indent of a token + * @param {Token} token Token to examine. This should be the first token on its line. + * @returns {string} The indentation characters that precede the token + */ + getTokenIndent(token) { + return this.sourceCode.text.slice(token.range[0] - token.loc.start.column, token.range[0]); + } +} + +/** + * A class to store information on desired offsets of tokens from each other + */ +class OffsetStorage { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {TokenInfo} tokenInfo a TokenInfo instance + * @param {number} indentSize The desired size of each indentation level + * @param {string} indentType The indentation character + */ + constructor(tokenInfo, indentSize, indentType) { + this._tokenInfo = tokenInfo; + this._indentSize = indentSize; + this._indentType = indentType; + + this._tree = new BinarySearchTree(); + this._tree.insert(0, { offset: 0, from: null, force: false }); + + this._lockedFirstTokens = new WeakMap(); + this._desiredIndentCache = new WeakMap(); + this._ignoredTokens = new WeakSet(); + } + + _getOffsetDescriptor(token) { + return this._tree.findLe(token.range[0]).value; + } + + /** + * Sets the offset column of token B to match the offset column of token A. + * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In + * most cases, `setDesiredOffset` should be used instead. + * @param {Token} baseToken The first token + * @param {Token} offsetToken The second token, whose offset should be matched to the first token + * @returns {void} + */ + matchOffsetOf(baseToken, offsetToken) { + + /* + * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to + * the token that it depends on. For example, with the `ArrayExpression: first` option, the first + * token of each element in the array after the first will be mapped to the first token of the first + * element. The desired indentation of each of these tokens is computed based on the desired indentation + * of the "first" element, rather than through the normal offset mechanism. + */ + this._lockedFirstTokens.set(offsetToken, baseToken); + } + + /** + * Sets the desired offset of a token. + * + * This uses a line-based offset collapsing behavior to handle tokens on the same line. + * For example, consider the following two cases: + * + * ( + * [ + * bar + * ] + * ) + * + * ([ + * bar + * ]) + * + * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from + * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is + * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces) + * from the start of its line. + * + * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level + * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the + * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented + * by 1 indent level from the start of the line. + * + * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node, + * without needing to check which lines those tokens are on. + * + * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive + * behavior can occur. For example, consider the following cases: + * + * foo( + * ). + * bar( + * baz + * ) + * + * foo( + * ).bar( + * baz + * ) + * + * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz` + * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz` + * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no + * collapsing would occur). + * + * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and + * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed + * in the second case. + * @param {Token} token The token + * @param {Token} fromToken The token that `token` should be offset from + * @param {number} offset The desired indent level + * @returns {void} + */ + setDesiredOffset(token, fromToken, offset) { + return this.setDesiredOffsets(token.range, fromToken, offset); + } + + /** + * Sets the desired offset of all tokens in a range + * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens. + * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains + * it). This means that the offset of each token is updated O(AST depth) times. + * It would not be performant to store and update the offsets for each token independently, because the rule would end + * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files. + * + * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following + * list could represent the state of the offset tree at a given point: + * + * * Tokens starting in the interval [0, 15) are aligned with the beginning of the file + * * Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token + * * Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token + * * Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token + * * Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token + * + * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: + * `setDesiredOffsets([30, 43], fooToken, 1);` + * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. + * @param {Token} fromToken The token that this is offset from + * @param {number} offset The desired indent level + * @param {boolean} force `true` if this offset should not use the normal collapsing behavior. This should almost always be false. + * @returns {void} + */ + setDesiredOffsets(range, fromToken, offset, force) { + + /* + * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset + * descriptor. The tree for the example above would have the following nodes: + * + * * key: 0, value: { offset: 0, from: null } + * * key: 15, value: { offset: 1, from: barToken } + * * key: 30, value: { offset: 1, from: fooToken } + * * key: 43, value: { offset: 2, from: barToken } + * * key: 820, value: { offset: 1, from: bazToken } + * + * To find the offset descriptor for any given token, one needs to find the node with the largest key + * which is <= token.start. To make this operation fast, the nodes are stored in a balanced binary + * search tree indexed by key. + */ + + const descriptorToInsert = { offset, from: fromToken, force }; + + const descriptorAfterRange = this._tree.findLe(range[1]).value; + + const fromTokenIsInRange = fromToken && fromToken.range[0] >= range[0] && fromToken.range[1] <= range[1]; + const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); + + // First, remove any existing nodes in the range from the tree. + this._tree.deleteRange(range[0] + 1, range[1]); + + // Insert a new node into the tree for this range + this._tree.insert(range[0], descriptorToInsert); + + /* + * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, + * even if it's in the current range. + */ + if (fromTokenIsInRange) { + this._tree.insert(fromToken.range[0], fromTokenDescriptor); + this._tree.insert(fromToken.range[1], descriptorToInsert); + } + + /* + * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following + * tokens the same as it was before. + */ + this._tree.insert(range[1], descriptorAfterRange); + } + + /** + * Gets the desired indent of a token + * @param {Token} token The token + * @returns {string} The desired indent of the token + */ + getDesiredIndent(token) { + if (!this._desiredIndentCache.has(token)) { + + if (this._ignoredTokens.has(token)) { + + /* + * If the token is ignored, use the actual indent of the token as the desired indent. + * This ensures that no errors are reported for this token. + */ + this._desiredIndentCache.set( + token, + this._tokenInfo.getTokenIndent(token) + ); + } else if (this._lockedFirstTokens.has(token)) { + const firstToken = this._lockedFirstTokens.get(token); + + this._desiredIndentCache.set( + token, + + // (indentation for the first element's line) + this.getDesiredIndent(this._tokenInfo.getFirstTokenOfLine(firstToken)) + + + // (space between the start of the first element's line and the first element) + this._indentType.repeat(firstToken.loc.start.column - this._tokenInfo.getFirstTokenOfLine(firstToken).loc.start.column) + ); + } else { + const offsetInfo = this._getOffsetDescriptor(token); + const offset = ( + offsetInfo.from && + offsetInfo.from.loc.start.line === token.loc.start.line && + !/^\s*?\n/u.test(token.value) && + !offsetInfo.force + ) ? 0 : offsetInfo.offset * this._indentSize; + + this._desiredIndentCache.set( + token, + (offsetInfo.from ? this.getDesiredIndent(offsetInfo.from) : "") + this._indentType.repeat(offset) + ); + } + } + return this._desiredIndentCache.get(token); + } + + /** + * Ignores a token, preventing it from being reported. + * @param {Token} token The token + * @returns {void} + */ + ignoreToken(token) { + if (this._tokenInfo.isFirstTokenOfLine(token)) { + this._ignoredTokens.add(token); + } + } + + /** + * Gets the first token that the given token's indentation is dependent on + * @param {Token} token The token + * @returns {Token} The token that the given token depends on, or `null` if the given token is at the top level + */ + getFirstDependency(token) { + return this._getOffsetDescriptor(token).from; + } +} + +const ELEMENT_LIST_SCHEMA = { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first", "off"] + } + ] +}; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent indentation", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/indent" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0, + default: 0 + }, + VariableDeclarator: { + oneOf: [ + ELEMENT_LIST_SCHEMA, + { + type: "object", + properties: { + var: ELEMENT_LIST_SCHEMA, + let: ELEMENT_LIST_SCHEMA, + const: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + } + ] + }, + outerIIFEBody: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + MemberExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + FunctionExpression: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + CallExpression: { + type: "object", + properties: { + arguments: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + }, + ArrayExpression: ELEMENT_LIST_SCHEMA, + ObjectExpression: ELEMENT_LIST_SCHEMA, + ImportDeclaration: ELEMENT_LIST_SCHEMA, + flatTernaryExpressions: { + type: "boolean", + default: false + }, + offsetTernaryExpressions: { + type: "boolean", + default: false + }, + ignoredNodes: { + type: "array", + items: { + type: "string", + not: { + pattern: ":exit$" + } + } + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + wrongIndentation: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = 1; + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: 1, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + MemberExpression: 1, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + ignoreComments: false + }; + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + Object.assign(options, context.options[1]); + + if (typeof options.VariableDeclarator === "number" || options.VariableDeclarator === "first") { + options.VariableDeclarator = { + var: options.VariableDeclarator, + let: options.VariableDeclarator, + const: options.VariableDeclarator + }; + } + } + } + + const sourceCode = context.getSourceCode(); + const tokenInfo = new TokenInfo(sourceCode); + const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t"); + const parameterParens = new WeakSet(); + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {Token} token Token violating the indent rule + * @param {string} neededIndent Expected indentation string + * @returns {void} + */ + function report(token, neededIndent) { + const actualIndent = Array.from(tokenInfo.getTokenIndent(token)); + const numSpaces = actualIndent.filter(char => char === " ").length; + const numTabs = actualIndent.filter(char => char === "\t").length; + + context.report({ + node: token, + messageId: "wrongIndentation", + data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), + loc: { + start: { line: token.loc.start.line, column: 0 }, + end: { line: token.loc.start.line, column: token.loc.start.column } + }, + fix(fixer) { + const range = [token.range[0] - token.loc.start.column, token.range[0]]; + const newText = neededIndent; + + return fixer.replaceTextRange(range, newText); + } + }); + } + + /** + * Checks if a token's indentation is correct + * @param {Token} token Token to examine + * @param {string} desiredIndent Desired indentation of the string + * @returns {boolean} `true` if the token's indentation is correct + */ + function validateTokenIndent(token, desiredIndent) { + const indentation = tokenInfo.getTokenIndent(token); + + return indentation === desiredIndent || + + // To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs. + indentation.includes(" ") && indentation.includes("\t"); + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + + /* + * Verify that the node is an IIFE + */ + if (!node.parent || node.parent.type !== "CallExpression" || node.parent.callee !== node) { + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIFE is outer. + * A "legal ancestor" is an expression or statement that causes the function to get executed immediately. + * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator. + */ + let statement = node.parent && node.parent.parent; + + while ( + statement.type === "UnaryExpression" && ["!", "~", "+", "-"].indexOf(statement.operator) > -1 || + statement.type === "AssignmentExpression" || + statement.type === "LogicalExpression" || + statement.type === "SequenceExpression" || + statement.type === "VariableDeclarator" + ) { + statement = statement.parent; + } + + return (statement.type === "ExpressionStatement" || statement.type === "VariableDeclaration") && statement.parent.type === "Program"; + } + + /** + * Counts the number of linebreaks that follow the last non-whitespace character in a string + * @param {string} string The string to check + * @returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character, + * or the total number of linebreaks if the string is all whitespace. + */ + function countTrailingLinebreaks(string) { + const trailingWhitespace = string.match(/\s*$/u)[0]; + const linebreakMatches = trailingWhitespace.match(astUtils.createGlobalLinebreakMatcher()); + + return linebreakMatches === null ? 0 : linebreakMatches.length; + } + + /** + * Check indentation for lists of elements (arrays, objects, function params) + * @param {ASTNode[]} elements List of elements that should be offset + * @param {Token} startToken The start token of the list that element should be aligned against, e.g. '[' + * @param {Token} endToken The end token of the list, e.g. ']' + * @param {number|string} offset The amount that the elements should be offset + * @returns {void} + */ + function addElementListIndent(elements, startToken, endToken, offset) { + + /** + * Gets the first token of a given element, including surrounding parentheses. + * @param {ASTNode} element A node in the `elements` list + * @returns {Token} The first token of this element + */ + function getFirstToken(element) { + let token = sourceCode.getTokenBefore(element); + + while (astUtils.isOpeningParenToken(token) && token !== startToken) { + token = sourceCode.getTokenBefore(token); + } + return sourceCode.getTokenAfter(token); + } + + // Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden) + offsets.setDesiredOffsets( + [startToken.range[1], endToken.range[0]], + startToken, + typeof offset === "number" ? offset : 1 + ); + offsets.setDesiredOffset(endToken, startToken, 0); + + // If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level. + if (offset === "first" && elements.length && !elements[0]) { + return; + } + elements.forEach((element, index) => { + if (!element) { + + // Skip holes in arrays + return; + } + if (offset === "off") { + + // Ignore the first token of every element if the "off" option is used + offsets.ignoreToken(getFirstToken(element)); + } + + // Offset the following elements correctly relative to the first element + if (index === 0) { + return; + } + if (offset === "first" && tokenInfo.isFirstTokenOfLine(getFirstToken(element))) { + offsets.matchOffsetOf(getFirstToken(elements[0]), getFirstToken(element)); + } else { + const previousElement = elements[index - 1]; + const firstTokenOfPreviousElement = previousElement && getFirstToken(previousElement); + const previousElementLastToken = previousElement && sourceCode.getLastToken(previousElement); + + if ( + previousElement && + previousElementLastToken.loc.end.line - countTrailingLinebreaks(previousElementLastToken.value) > startToken.loc.end.line + ) { + offsets.setDesiredOffsets( + [previousElement.range[1], element.range[1]], + firstTokenOfPreviousElement, + 0 + ); + } + } + }); + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function addBlocklessNodeIndent(node) { + if (node.type !== "BlockStatement") { + const lastParentToken = sourceCode.getTokenBefore(node, astUtils.isNotOpeningParenToken); + + let firstBodyToken = sourceCode.getFirstToken(node); + let lastBodyToken = sourceCode.getLastToken(node); + + while ( + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)) && + astUtils.isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken)) + ) { + firstBodyToken = sourceCode.getTokenBefore(firstBodyToken); + lastBodyToken = sourceCode.getTokenAfter(lastBodyToken); + } + + offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1); + + /* + * For blockless nodes with semicolon-first style, don't indent the semicolon. + * e.g. + * if (foo) bar() + * ; [1, 2, 3].map(foo) + */ + const lastToken = sourceCode.getLastToken(node); + + if (node.type !== "EmptyStatement" && astUtils.isSemicolonToken(lastToken)) { + offsets.setDesiredOffset(lastToken, lastParentToken, 0); + } + } + } + + /** + * Checks the indentation for nodes that are like function calls (`CallExpression` and `NewExpression`) + * @param {ASTNode} node A CallExpression or NewExpression node + * @returns {void} + */ + function addFunctionCallIndent(node) { + let openingParen; + + if (node.arguments.length) { + openingParen = sourceCode.getFirstTokenBetween(node.callee, node.arguments[0], astUtils.isOpeningParenToken); + } else { + openingParen = sourceCode.getLastToken(node, 1); + } + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + + /* + * If `?.` token exists, set desired offset for that. + * This logic is copied from `MemberExpression`'s. + */ + if (node.optional) { + const dotToken = sourceCode.getTokenAfter(node.callee, astUtils.isQuestionDotToken); + const calleeParenCount = sourceCode.getTokensBetween(node.callee, dotToken, { filter: astUtils.isClosingParenToken }).length; + const firstTokenOfCallee = calleeParenCount + ? sourceCode.getTokenBefore(node.callee, { skip: calleeParenCount - 1 }) + : sourceCode.getFirstToken(node.callee); + const lastTokenOfCallee = sourceCode.getTokenBefore(dotToken); + const offsetBase = lastTokenOfCallee.loc.end.line === openingParen.loc.start.line + ? lastTokenOfCallee + : firstTokenOfCallee; + + offsets.setDesiredOffset(dotToken, offsetBase, 1); + } + + const offsetAfterToken = node.callee.type === "TaggedTemplateExpression" ? sourceCode.getFirstToken(node.callee.quasi) : openingParen; + const offsetToken = sourceCode.getTokenBefore(offsetAfterToken); + + offsets.setDesiredOffset(openingParen, offsetToken, 0); + + addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments); + } + + /** + * Checks the indentation of parenthesized values, given a list of tokens in a program + * @param {Token[]} tokens A list of tokens + * @returns {void} + */ + function addParensIndent(tokens) { + const parenStack = []; + const parenPairs = []; + + tokens.forEach(nextToken => { + + // Accumulate a list of parenthesis pairs + if (astUtils.isOpeningParenToken(nextToken)) { + parenStack.push(nextToken); + } else if (astUtils.isClosingParenToken(nextToken)) { + parenPairs.unshift({ left: parenStack.pop(), right: nextToken }); + } + }); + + parenPairs.forEach(pair => { + const leftParen = pair.left; + const rightParen = pair.right; + + // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. + if (!parameterParens.has(leftParen) && !parameterParens.has(rightParen)) { + const parenthesizedTokens = new Set(sourceCode.getTokensBetween(leftParen, rightParen)); + + parenthesizedTokens.forEach(token => { + if (!parenthesizedTokens.has(offsets.getFirstDependency(token))) { + offsets.setDesiredOffset(token, leftParen, 1); + } + }); + } + + offsets.setDesiredOffset(rightParen, leftParen, 0); + }); + } + + /** + * Ignore all tokens within an unknown node whose offset do not depend + * on another token's offset within the unknown node + * @param {ASTNode} node Unknown Node + * @returns {void} + */ + function ignoreNode(node) { + const unknownNodeTokens = new Set(sourceCode.getTokens(node, { includeComments: true })); + + unknownNodeTokens.forEach(token => { + if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) { + const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); + + if (token === firstTokenOfLine) { + offsets.ignoreToken(token); + } else { + offsets.setDesiredOffset(token, firstTokenOfLine, 0); + } + } + }); + } + + /** + * Check whether the given token is on the first line of a statement. + * @param {Token} token The token to check. + * @param {ASTNode} leafNode The expression node that the token belongs directly. + * @returns {boolean} `true` if the token is on the first line of a statement. + */ + function isOnFirstLineOfStatement(token, leafNode) { + let node = leafNode; + + while (node.parent && !node.parent.type.endsWith("Statement") && !node.parent.type.endsWith("Declaration")) { + node = node.parent; + } + node = node.parent; + + return !node || node.loc.start.line === token.loc.start.line; + } + + /** + * Check whether there are any blank (whitespace-only) lines between + * two tokens on separate lines. + * @param {Token} firstToken The first token. + * @param {Token} secondToken The second token. + * @returns {boolean} `true` if the tokens are on separate lines and + * there exists a blank line between them, `false` otherwise. + */ + function hasBlankLinesBetween(firstToken, secondToken) { + const firstTokenLine = firstToken.loc.end.line; + const secondTokenLine = secondToken.loc.start.line; + + if (firstTokenLine === secondTokenLine || firstTokenLine === secondTokenLine - 1) { + return false; + } + + for (let line = firstTokenLine + 1; line < secondTokenLine; ++line) { + if (!tokenInfo.firstTokensByLineNumber.has(line)) { + return true; + } + } + + return false; + } + + const ignoredNodeFirstTokens = new Set(); + + const baseOffsetListeners = { + "ArrayExpression, ArrayPattern"(node) { + const openingBracket = sourceCode.getFirstToken(node); + const closingBracket = sourceCode.getTokenAfter(lodash.findLast(node.elements) || openingBracket, astUtils.isClosingBracketToken); + + addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression); + }, + + "ObjectExpression, ObjectPattern"(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getTokenAfter( + node.properties.length ? node.properties[node.properties.length - 1] : openingCurly, + astUtils.isClosingBraceToken + ); + + addElementListIndent(node.properties, openingCurly, closingCurly, options.ObjectExpression); + }, + + ArrowFunctionExpression(node) { + const maybeOpeningParen = sourceCode.getFirstToken(node, { skip: node.async ? 1 : 0 }); + + if (astUtils.isOpeningParenToken(maybeOpeningParen)) { + const openingParen = maybeOpeningParen; + const closingParen = sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options.FunctionExpression.parameters); + } + + addBlocklessNodeIndent(node.body); + }, + + AssignmentExpression(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + offsets.setDesiredOffsets([operator.range[0], node.range[1]], sourceCode.getLastToken(node.left), 1); + offsets.ignoreToken(operator); + offsets.ignoreToken(sourceCode.getTokenAfter(operator)); + }, + + "BinaryExpression, LogicalExpression"(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + /* + * For backwards compatibility, don't check BinaryExpression indents, e.g. + * var foo = bar && + * baz; + */ + + const tokenAfterOperator = sourceCode.getTokenAfter(operator); + + offsets.ignoreToken(operator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffset(tokenAfterOperator, operator, 0); + }, + + "BlockStatement, ClassBody"(node) { + let blockIndentLevel; + + if (node.parent && isOuterIIFE(node.parent)) { + blockIndentLevel = options.outerIIFEBody; + } else if (node.parent && (node.parent.type === "FunctionExpression" || node.parent.type === "ArrowFunctionExpression")) { + blockIndentLevel = options.FunctionExpression.body; + } else if (node.parent && node.parent.type === "FunctionDeclaration") { + blockIndentLevel = options.FunctionDeclaration.body; + } else { + blockIndentLevel = 1; + } + + /* + * For blocks that aren't lone statements, ensure that the opening curly brace + * is aligned with the parent. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + offsets.setDesiredOffset(sourceCode.getFirstToken(node), sourceCode.getFirstToken(node.parent), 0); + } + + addElementListIndent(node.body, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), blockIndentLevel); + }, + + CallExpression: addFunctionCallIndent, + + "ClassDeclaration[superClass], ClassExpression[superClass]"(node) { + const classToken = sourceCode.getFirstToken(node); + const extendsToken = sourceCode.getTokenBefore(node.superClass, astUtils.isNotOpeningParenToken); + + offsets.setDesiredOffsets([extendsToken.range[0], node.body.range[0]], classToken, 1); + }, + + ConditionalExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + + // `flatTernaryExpressions` option is for the following style: + // var a = + // foo > 0 ? bar : + // foo < 0 ? baz : + // /*else*/ qiz ; + if (!options.flatTernaryExpressions || + !astUtils.isTokenOnSameLine(node.test, node.consequent) || + isOnFirstLineOfStatement(firstToken, node) + ) { + const questionMarkToken = sourceCode.getFirstTokenBetween(node.test, node.consequent, token => token.type === "Punctuator" && token.value === "?"); + const colonToken = sourceCode.getFirstTokenBetween(node.consequent, node.alternate, token => token.type === "Punctuator" && token.value === ":"); + + const firstConsequentToken = sourceCode.getTokenAfter(questionMarkToken); + const lastConsequentToken = sourceCode.getTokenBefore(colonToken); + const firstAlternateToken = sourceCode.getTokenAfter(colonToken); + + offsets.setDesiredOffset(questionMarkToken, firstToken, 1); + offsets.setDesiredOffset(colonToken, firstToken, 1); + + offsets.setDesiredOffset(firstConsequentToken, firstToken, + options.offsetTernaryExpressions ? 2 : 1); + + /* + * The alternate and the consequent should usually have the same indentation. + * If they share part of a line, align the alternate against the first token of the consequent. + * This allows the alternate to be indented correctly in cases like this: + * foo ? ( + * bar + * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo` + * baz // as a result, `baz` is offset by 1 rather than 2 + * ) + */ + if (lastConsequentToken.loc.end.line === firstAlternateToken.loc.start.line) { + offsets.setDesiredOffset(firstAlternateToken, firstConsequentToken, 0); + } else { + + /** + * If the alternate and consequent do not share part of a line, offset the alternate from the first + * token of the conditional expression. For example: + * foo ? bar + * : baz + * + * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up + * having no expected indentation. + */ + offsets.setDesiredOffset(firstAlternateToken, firstToken, + firstAlternateToken.type === "Punctuator" && + options.offsetTernaryExpressions ? 2 : 1); + } + } + }, + + "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body), + + ExportNamedDeclaration(node) { + if (node.declaration === null) { + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + // Indent the specifiers in `export {foo, bar, baz}` + addElementListIndent(node.specifiers, sourceCode.getFirstToken(node, { skip: 1 }), closingCurly, 1); + + if (node.source) { + + // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` + offsets.setDesiredOffsets([closingCurly.range[1], node.range[1]], sourceCode.getFirstToken(node), 1); + } + } + }, + + ForStatement(node) { + const forOpeningParen = sourceCode.getFirstToken(node, 1); + + if (node.init) { + offsets.setDesiredOffsets(node.init.range, forOpeningParen, 1); + } + if (node.test) { + offsets.setDesiredOffsets(node.test.range, forOpeningParen, 1); + } + if (node.update) { + offsets.setDesiredOffsets(node.update.range, forOpeningParen, 1); + } + addBlocklessNodeIndent(node.body); + }, + + "FunctionDeclaration, FunctionExpression"(node) { + const closingParen = sourceCode.getTokenBefore(node.body); + const openingParen = sourceCode.getTokenBefore(node.params.length ? node.params[0] : closingParen); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options[node.type].parameters); + }, + + IfStatement(node) { + addBlocklessNodeIndent(node.consequent); + if (node.alternate && node.alternate.type !== "IfStatement") { + addBlocklessNodeIndent(node.alternate); + } + }, + + ImportDeclaration(node) { + if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) { + const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + addElementListIndent(node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"), openingCurly, closingCurly, options.ImportDeclaration); + } + + const fromToken = sourceCode.getLastToken(node, token => token.type === "Identifier" && token.value === "from"); + const sourceToken = sourceCode.getLastToken(node, token => token.type === "String"); + const semiToken = sourceCode.getLastToken(node, token => token.type === "Punctuator" && token.value === ";"); + + if (fromToken) { + const end = semiToken && semiToken.range[1] === sourceToken.range[1] ? node.range[1] : sourceToken.range[1]; + + offsets.setDesiredOffsets([fromToken.range[0], end], sourceCode.getFirstToken(node), 1); + } + }, + + ImportExpression(node) { + const openingParen = sourceCode.getFirstToken(node, 1); + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0); + + addElementListIndent([node.source], openingParen, closingParen, options.CallExpression.arguments); + }, + + "MemberExpression, JSXMemberExpression, MetaProperty"(node) { + const object = node.type === "MetaProperty" ? node.meta : node.object; + const firstNonObjectToken = sourceCode.getFirstTokenBetween(object, node.property, astUtils.isNotClosingParenToken); + const secondNonObjectToken = sourceCode.getTokenAfter(firstNonObjectToken); + + const objectParenCount = sourceCode.getTokensBetween(object, node.property, { filter: astUtils.isClosingParenToken }).length; + const firstObjectToken = objectParenCount + ? sourceCode.getTokenBefore(object, { skip: objectParenCount - 1 }) + : sourceCode.getFirstToken(object); + const lastObjectToken = sourceCode.getTokenBefore(firstNonObjectToken); + const firstPropertyToken = node.computed ? firstNonObjectToken : secondNonObjectToken; + + if (node.computed) { + + // For computed MemberExpressions, match the closing bracket with the opening bracket. + offsets.setDesiredOffset(sourceCode.getLastToken(node), firstNonObjectToken, 0); + offsets.setDesiredOffsets(node.property.range, firstNonObjectToken, 1); + } + + /* + * If the object ends on the same line that the property starts, match against the last token + * of the object, to ensure that the MemberExpression is not indented. + * + * Otherwise, match against the first token of the object, e.g. + * foo + * .bar + * .baz // <-- offset by 1 from `foo` + */ + const offsetBase = lastObjectToken.loc.end.line === firstPropertyToken.loc.start.line + ? lastObjectToken + : firstObjectToken; + + if (typeof options.MemberExpression === "number") { + + // Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, options.MemberExpression); + + /* + * For computed MemberExpressions, match the first token of the property against the opening bracket. + * Otherwise, match the first token of the property against the object. + */ + offsets.setDesiredOffset(secondNonObjectToken, node.computed ? firstNonObjectToken : offsetBase, options.MemberExpression); + } else { + + // If the MemberExpression option is off, ignore the dot and the first token of the property. + offsets.ignoreToken(firstNonObjectToken); + offsets.ignoreToken(secondNonObjectToken); + + // To ignore the property indentation, ensure that the property tokens depend on the ignored tokens. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, 0); + offsets.setDesiredOffset(secondNonObjectToken, firstNonObjectToken, 0); + } + }, + + NewExpression(node) { + + // Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo` + if (node.arguments.length > 0 || + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) && + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, 1))) { + addFunctionCallIndent(node); + } + }, + + Property(node) { + if (!node.shorthand && !node.method && node.kind === "init") { + const colon = sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isColonToken); + + offsets.ignoreToken(sourceCode.getTokenAfter(colon)); + } + }, + + SwitchStatement(node) { + const openingCurly = sourceCode.getTokenAfter(node.discriminant, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets([openingCurly.range[1], closingCurly.range[0]], openingCurly, options.SwitchCase); + + if (node.cases.length) { + sourceCode.getTokensBetween( + node.cases[node.cases.length - 1], + closingCurly, + { includeComments: true, filter: astUtils.isCommentToken } + ).forEach(token => offsets.ignoreToken(token)); + } + }, + + SwitchCase(node) { + if (!(node.consequent.length === 1 && node.consequent[0].type === "BlockStatement")) { + const caseKeyword = sourceCode.getFirstToken(node); + const tokenAfterCurrentCase = sourceCode.getTokenAfter(node); + + offsets.setDesiredOffsets([caseKeyword.range[1], tokenAfterCurrentCase.range[0]], caseKeyword, 1); + } + }, + + TemplateLiteral(node) { + node.expressions.forEach((expression, index) => { + const previousQuasi = node.quasis[index]; + const nextQuasi = node.quasis[index + 1]; + const tokenToAlignFrom = previousQuasi.loc.start.line === previousQuasi.loc.end.line + ? sourceCode.getFirstToken(previousQuasi) + : null; + + offsets.setDesiredOffsets([previousQuasi.range[1], nextQuasi.range[0]], tokenToAlignFrom, 1); + offsets.setDesiredOffset(sourceCode.getFirstToken(nextQuasi), tokenToAlignFrom, 0); + }); + }, + + VariableDeclaration(node) { + let variableIndent = Object.prototype.hasOwnProperty.call(options.VariableDeclarator, node.kind) + ? options.VariableDeclarator[node.kind] + : DEFAULT_VARIABLE_INDENT; + + const firstToken = sourceCode.getFirstToken(node), + lastToken = sourceCode.getLastToken(node); + + if (options.VariableDeclarator[node.kind] === "first") { + if (node.declarations.length > 1) { + addElementListIndent( + node.declarations, + firstToken, + lastToken, + "first" + ); + return; + } + + variableIndent = DEFAULT_VARIABLE_INDENT; + } + + if (node.declarations[node.declarations.length - 1].loc.start.line > node.loc.start.line) { + + /* + * VariableDeclarator indentation is a bit different from other forms of indentation, in that the + * indentation of an opening bracket sometimes won't match that of a closing bracket. For example, + * the following indentations are correct: + * + * var foo = { + * ok: true + * }; + * + * var foo = { + * ok: true, + * }, + * bar = 1; + * + * Account for when exiting the AST (after indentations have already been set for the nodes in + * the declaration) by manually increasing the indentation level of the tokens in this declarator + * on the same line as the start of the declaration, provided that there are declarators that + * follow this one. + */ + offsets.setDesiredOffsets(node.range, firstToken, variableIndent, true); + } else { + offsets.setDesiredOffsets(node.range, firstToken, variableIndent); + } + + if (astUtils.isSemicolonToken(lastToken)) { + offsets.ignoreToken(lastToken); + } + }, + + VariableDeclarator(node) { + if (node.init) { + const equalOperator = sourceCode.getTokenBefore(node.init, astUtils.isNotOpeningParenToken); + const tokenAfterOperator = sourceCode.getTokenAfter(equalOperator); + + offsets.ignoreToken(equalOperator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffsets([tokenAfterOperator.range[0], node.range[1]], equalOperator, 1); + offsets.setDesiredOffset(equalOperator, sourceCode.getLastToken(node.id), 0); + } + }, + + "JSXAttribute[value]"(node) { + const equalsToken = sourceCode.getFirstTokenBetween(node.name, node.value, token => token.type === "Punctuator" && token.value === "="); + + offsets.setDesiredOffsets([equalsToken.range[0], node.value.range[1]], sourceCode.getFirstToken(node.name), 1); + }, + + JSXElement(node) { + if (node.closingElement) { + addElementListIndent(node.children, sourceCode.getFirstToken(node.openingElement), sourceCode.getFirstToken(node.closingElement), 1); + } + }, + + JSXOpeningElement(node) { + const firstToken = sourceCode.getFirstToken(node); + let closingToken; + + if (node.selfClosing) { + closingToken = sourceCode.getLastToken(node, { skip: 1 }); + offsets.setDesiredOffset(sourceCode.getLastToken(node), closingToken, 0); + } else { + closingToken = sourceCode.getLastToken(node); + } + offsets.setDesiredOffsets(node.name.range, sourceCode.getFirstToken(node)); + addElementListIndent(node.attributes, firstToken, closingToken, 1); + }, + + JSXClosingElement(node) { + const firstToken = sourceCode.getFirstToken(node); + + offsets.setDesiredOffsets(node.name.range, firstToken, 1); + }, + + JSXFragment(node) { + const firstOpeningToken = sourceCode.getFirstToken(node.openingFragment); + const firstClosingToken = sourceCode.getFirstToken(node.closingFragment); + + addElementListIndent(node.children, firstOpeningToken, firstClosingToken, 1); + }, + + JSXOpeningFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const closingToken = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, closingToken); + }, + + JSXClosingFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const slashToken = sourceCode.getLastToken(node, { skip: 1 }); + const closingToken = sourceCode.getLastToken(node); + const tokenToMatch = astUtils.isTokenOnSameLine(slashToken, closingToken) ? slashToken : closingToken; + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, tokenToMatch); + }, + + JSXExpressionContainer(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + JSXSpreadAttribute(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + "*"(node) { + const firstToken = sourceCode.getFirstToken(node); + + // Ensure that the children of every node are indented at least as much as the first token. + if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) { + offsets.setDesiredOffsets(node.range, firstToken, 0); + } + } + }; + + const listenerCallQueue = []; + + /* + * To ignore the indentation of a node: + * 1. Don't call the node's listener when entering it (if it has a listener) + * 2. Don't set any offsets against the first token of the node. + * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. + */ + const offsetListeners = lodash.mapValues( + baseOffsetListeners, + + /* + * Offset listener calls are deferred until traversal is finished, and are called as + * part of the final `Program:exit` listener. This is necessary because a node might + * be matched by multiple selectors. + * + * Example: Suppose there is an offset listener for `Identifier`, and the user has + * specified in configuration that `MemberExpression > Identifier` should be ignored. + * Due to selector specificity rules, the `Identifier` listener will get called first. However, + * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener + * should not have been called at all. Without doing extra selector matching, we don't know + * whether the Identifier matches the `MemberExpression > Identifier` selector until the + * `MemberExpression > Identifier` listener is called. + * + * To avoid this, the `Identifier` listener isn't called until traversal finishes and all + * ignored nodes are known. + */ + listener => + node => + listenerCallQueue.push({ listener, node }) + ); + + // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. + const ignoredNodes = new Set(); + + /** + * Ignores a node + * @param {ASTNode} node The node to ignore + * @returns {void} + */ + function addToIgnoredNodes(node) { + ignoredNodes.add(node); + ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node)); + } + + const ignoredNodeListeners = options.ignoredNodes.reduce( + (listeners, ignoredSelector) => Object.assign(listeners, { [ignoredSelector]: addToIgnoredNodes }), + {} + ); + + /* + * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation + * at the end. + * + * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears + * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored, + * so those listeners wouldn't be called anyway. + */ + return Object.assign( + offsetListeners, + ignoredNodeListeners, + { + "*:exit"(node) { + + // If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it. + if (!KNOWN_NODES.has(node.type)) { + addToIgnoredNodes(node); + } + }, + "Program:exit"() { + + // If ignoreComments option is enabled, ignore all comment tokens. + if (options.ignoreComments) { + sourceCode.getAllComments() + .forEach(comment => offsets.ignoreToken(comment)); + } + + // Invoke the queued offset listeners for the nodes that aren't ignored. + listenerCallQueue + .filter(nodeInfo => !ignoredNodes.has(nodeInfo.node)) + .forEach(nodeInfo => nodeInfo.listener(nodeInfo.node)); + + // Update the offsets for ignored nodes to prevent their child tokens from being reported. + ignoredNodes.forEach(ignoreNode); + + addParensIndent(sourceCode.ast.tokens); + + /* + * Create a Map from (tokenOrComment) => (precedingToken). + * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. + */ + const precedingTokens = sourceCode.ast.comments.reduce((commentMap, comment) => { + const tokenOrCommentBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return commentMap.set(comment, commentMap.has(tokenOrCommentBefore) ? commentMap.get(tokenOrCommentBefore) : tokenOrCommentBefore); + }, new WeakMap()); + + sourceCode.lines.forEach((line, lineIndex) => { + const lineNumber = lineIndex + 1; + + if (!tokenInfo.firstTokensByLineNumber.has(lineNumber)) { + + // Don't check indentation on blank lines + return; + } + + const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(lineNumber); + + if (firstTokenOfLine.loc.start.line !== lineNumber) { + + // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. + return; + } + + if (astUtils.isCommentToken(firstTokenOfLine)) { + const tokenBefore = precedingTokens.get(firstTokenOfLine); + const tokenAfter = tokenBefore ? sourceCode.getTokenAfter(tokenBefore) : sourceCode.ast.tokens[0]; + const mayAlignWithBefore = tokenBefore && !hasBlankLinesBetween(tokenBefore, firstTokenOfLine); + const mayAlignWithAfter = tokenAfter && !hasBlankLinesBetween(firstTokenOfLine, tokenAfter); + + /* + * If a comment precedes a line that begins with a semicolon token, align to that token, i.e. + * + * let foo + * // comment + * ;(async () => {})() + */ + if (tokenAfter && astUtils.isSemicolonToken(tokenAfter) && !astUtils.isTokenOnSameLine(firstTokenOfLine, tokenAfter)) { + offsets.setDesiredOffset(firstTokenOfLine, tokenAfter, 0); + } + + // If a comment matches the expected indentation of the token immediately before or after, don't report it. + if ( + mayAlignWithBefore && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenBefore)) || + mayAlignWithAfter && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenAfter)) + ) { + return; + } + } + + // If the token matches the expected indentation, don't report it. + if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { + return; + } + + // Otherwise, report the token/comment. + report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); + }); + } + } + ); + } +}; diff --git a/node_modules/eslint/lib/rules/index.js b/node_modules/eslint/lib/rules/index.js new file mode 100644 index 0000000..3cf26e5 --- /dev/null +++ b/node_modules/eslint/lib/rules/index.js @@ -0,0 +1,297 @@ +/** + * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without + * using the file-system directly. + * @author Peter (Somogyvari) Metz + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] */ + +const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map"); + +/** @type {Map} */ +module.exports = new LazyLoadingRuleMap(Object.entries({ + "accessor-pairs": () => require("./accessor-pairs"), + "array-bracket-newline": () => require("./array-bracket-newline"), + "array-bracket-spacing": () => require("./array-bracket-spacing"), + "array-callback-return": () => require("./array-callback-return"), + "array-element-newline": () => require("./array-element-newline"), + "arrow-body-style": () => require("./arrow-body-style"), + "arrow-parens": () => require("./arrow-parens"), + "arrow-spacing": () => require("./arrow-spacing"), + "block-scoped-var": () => require("./block-scoped-var"), + "block-spacing": () => require("./block-spacing"), + "brace-style": () => require("./brace-style"), + "callback-return": () => require("./callback-return"), + camelcase: () => require("./camelcase"), + "capitalized-comments": () => require("./capitalized-comments"), + "class-methods-use-this": () => require("./class-methods-use-this"), + "comma-dangle": () => require("./comma-dangle"), + "comma-spacing": () => require("./comma-spacing"), + "comma-style": () => require("./comma-style"), + complexity: () => require("./complexity"), + "computed-property-spacing": () => require("./computed-property-spacing"), + "consistent-return": () => require("./consistent-return"), + "consistent-this": () => require("./consistent-this"), + "constructor-super": () => require("./constructor-super"), + curly: () => require("./curly"), + "default-case": () => require("./default-case"), + "default-case-last": () => require("./default-case-last"), + "default-param-last": () => require("./default-param-last"), + "dot-location": () => require("./dot-location"), + "dot-notation": () => require("./dot-notation"), + "eol-last": () => require("./eol-last"), + eqeqeq: () => require("./eqeqeq"), + "for-direction": () => require("./for-direction"), + "func-call-spacing": () => require("./func-call-spacing"), + "func-name-matching": () => require("./func-name-matching"), + "func-names": () => require("./func-names"), + "func-style": () => require("./func-style"), + "function-call-argument-newline": () => require("./function-call-argument-newline"), + "function-paren-newline": () => require("./function-paren-newline"), + "generator-star-spacing": () => require("./generator-star-spacing"), + "getter-return": () => require("./getter-return"), + "global-require": () => require("./global-require"), + "grouped-accessor-pairs": () => require("./grouped-accessor-pairs"), + "guard-for-in": () => require("./guard-for-in"), + "handle-callback-err": () => require("./handle-callback-err"), + "id-blacklist": () => require("./id-blacklist"), + "id-denylist": () => require("./id-denylist"), + "id-length": () => require("./id-length"), + "id-match": () => require("./id-match"), + "implicit-arrow-linebreak": () => require("./implicit-arrow-linebreak"), + indent: () => require("./indent"), + "indent-legacy": () => require("./indent-legacy"), + "init-declarations": () => require("./init-declarations"), + "jsx-quotes": () => require("./jsx-quotes"), + "key-spacing": () => require("./key-spacing"), + "keyword-spacing": () => require("./keyword-spacing"), + "line-comment-position": () => require("./line-comment-position"), + "linebreak-style": () => require("./linebreak-style"), + "lines-around-comment": () => require("./lines-around-comment"), + "lines-around-directive": () => require("./lines-around-directive"), + "lines-between-class-members": () => require("./lines-between-class-members"), + "max-classes-per-file": () => require("./max-classes-per-file"), + "max-depth": () => require("./max-depth"), + "max-len": () => require("./max-len"), + "max-lines": () => require("./max-lines"), + "max-lines-per-function": () => require("./max-lines-per-function"), + "max-nested-callbacks": () => require("./max-nested-callbacks"), + "max-params": () => require("./max-params"), + "max-statements": () => require("./max-statements"), + "max-statements-per-line": () => require("./max-statements-per-line"), + "multiline-comment-style": () => require("./multiline-comment-style"), + "multiline-ternary": () => require("./multiline-ternary"), + "new-cap": () => require("./new-cap"), + "new-parens": () => require("./new-parens"), + "newline-after-var": () => require("./newline-after-var"), + "newline-before-return": () => require("./newline-before-return"), + "newline-per-chained-call": () => require("./newline-per-chained-call"), + "no-alert": () => require("./no-alert"), + "no-array-constructor": () => require("./no-array-constructor"), + "no-async-promise-executor": () => require("./no-async-promise-executor"), + "no-await-in-loop": () => require("./no-await-in-loop"), + "no-bitwise": () => require("./no-bitwise"), + "no-buffer-constructor": () => require("./no-buffer-constructor"), + "no-caller": () => require("./no-caller"), + "no-case-declarations": () => require("./no-case-declarations"), + "no-catch-shadow": () => require("./no-catch-shadow"), + "no-class-assign": () => require("./no-class-assign"), + "no-compare-neg-zero": () => require("./no-compare-neg-zero"), + "no-cond-assign": () => require("./no-cond-assign"), + "no-confusing-arrow": () => require("./no-confusing-arrow"), + "no-console": () => require("./no-console"), + "no-const-assign": () => require("./no-const-assign"), + "no-constant-condition": () => require("./no-constant-condition"), + "no-constructor-return": () => require("./no-constructor-return"), + "no-continue": () => require("./no-continue"), + "no-control-regex": () => require("./no-control-regex"), + "no-debugger": () => require("./no-debugger"), + "no-delete-var": () => require("./no-delete-var"), + "no-div-regex": () => require("./no-div-regex"), + "no-dupe-args": () => require("./no-dupe-args"), + "no-dupe-class-members": () => require("./no-dupe-class-members"), + "no-dupe-else-if": () => require("./no-dupe-else-if"), + "no-dupe-keys": () => require("./no-dupe-keys"), + "no-duplicate-case": () => require("./no-duplicate-case"), + "no-duplicate-imports": () => require("./no-duplicate-imports"), + "no-else-return": () => require("./no-else-return"), + "no-empty": () => require("./no-empty"), + "no-empty-character-class": () => require("./no-empty-character-class"), + "no-empty-function": () => require("./no-empty-function"), + "no-empty-pattern": () => require("./no-empty-pattern"), + "no-eq-null": () => require("./no-eq-null"), + "no-eval": () => require("./no-eval"), + "no-ex-assign": () => require("./no-ex-assign"), + "no-extend-native": () => require("./no-extend-native"), + "no-extra-bind": () => require("./no-extra-bind"), + "no-extra-boolean-cast": () => require("./no-extra-boolean-cast"), + "no-extra-label": () => require("./no-extra-label"), + "no-extra-parens": () => require("./no-extra-parens"), + "no-extra-semi": () => require("./no-extra-semi"), + "no-fallthrough": () => require("./no-fallthrough"), + "no-floating-decimal": () => require("./no-floating-decimal"), + "no-func-assign": () => require("./no-func-assign"), + "no-global-assign": () => require("./no-global-assign"), + "no-implicit-coercion": () => require("./no-implicit-coercion"), + "no-implicit-globals": () => require("./no-implicit-globals"), + "no-implied-eval": () => require("./no-implied-eval"), + "no-import-assign": () => require("./no-import-assign"), + "no-inline-comments": () => require("./no-inline-comments"), + "no-inner-declarations": () => require("./no-inner-declarations"), + "no-invalid-regexp": () => require("./no-invalid-regexp"), + "no-invalid-this": () => require("./no-invalid-this"), + "no-irregular-whitespace": () => require("./no-irregular-whitespace"), + "no-iterator": () => require("./no-iterator"), + "no-label-var": () => require("./no-label-var"), + "no-labels": () => require("./no-labels"), + "no-lone-blocks": () => require("./no-lone-blocks"), + "no-lonely-if": () => require("./no-lonely-if"), + "no-loop-func": () => require("./no-loop-func"), + "no-loss-of-precision": () => require("./no-loss-of-precision"), + "no-magic-numbers": () => require("./no-magic-numbers"), + "no-misleading-character-class": () => require("./no-misleading-character-class"), + "no-mixed-operators": () => require("./no-mixed-operators"), + "no-mixed-requires": () => require("./no-mixed-requires"), + "no-mixed-spaces-and-tabs": () => require("./no-mixed-spaces-and-tabs"), + "no-multi-assign": () => require("./no-multi-assign"), + "no-multi-spaces": () => require("./no-multi-spaces"), + "no-multi-str": () => require("./no-multi-str"), + "no-multiple-empty-lines": () => require("./no-multiple-empty-lines"), + "no-native-reassign": () => require("./no-native-reassign"), + "no-negated-condition": () => require("./no-negated-condition"), + "no-negated-in-lhs": () => require("./no-negated-in-lhs"), + "no-nested-ternary": () => require("./no-nested-ternary"), + "no-new": () => require("./no-new"), + "no-new-func": () => require("./no-new-func"), + "no-new-object": () => require("./no-new-object"), + "no-new-require": () => require("./no-new-require"), + "no-new-symbol": () => require("./no-new-symbol"), + "no-new-wrappers": () => require("./no-new-wrappers"), + "no-obj-calls": () => require("./no-obj-calls"), + "no-octal": () => require("./no-octal"), + "no-octal-escape": () => require("./no-octal-escape"), + "no-param-reassign": () => require("./no-param-reassign"), + "no-path-concat": () => require("./no-path-concat"), + "no-plusplus": () => require("./no-plusplus"), + "no-process-env": () => require("./no-process-env"), + "no-process-exit": () => require("./no-process-exit"), + "no-promise-executor-return": () => require("./no-promise-executor-return"), + "no-proto": () => require("./no-proto"), + "no-prototype-builtins": () => require("./no-prototype-builtins"), + "no-redeclare": () => require("./no-redeclare"), + "no-regex-spaces": () => require("./no-regex-spaces"), + "no-restricted-exports": () => require("./no-restricted-exports"), + "no-restricted-globals": () => require("./no-restricted-globals"), + "no-restricted-imports": () => require("./no-restricted-imports"), + "no-restricted-modules": () => require("./no-restricted-modules"), + "no-restricted-properties": () => require("./no-restricted-properties"), + "no-restricted-syntax": () => require("./no-restricted-syntax"), + "no-return-assign": () => require("./no-return-assign"), + "no-return-await": () => require("./no-return-await"), + "no-script-url": () => require("./no-script-url"), + "no-self-assign": () => require("./no-self-assign"), + "no-self-compare": () => require("./no-self-compare"), + "no-sequences": () => require("./no-sequences"), + "no-setter-return": () => require("./no-setter-return"), + "no-shadow": () => require("./no-shadow"), + "no-shadow-restricted-names": () => require("./no-shadow-restricted-names"), + "no-spaced-func": () => require("./no-spaced-func"), + "no-sparse-arrays": () => require("./no-sparse-arrays"), + "no-sync": () => require("./no-sync"), + "no-tabs": () => require("./no-tabs"), + "no-template-curly-in-string": () => require("./no-template-curly-in-string"), + "no-ternary": () => require("./no-ternary"), + "no-this-before-super": () => require("./no-this-before-super"), + "no-throw-literal": () => require("./no-throw-literal"), + "no-trailing-spaces": () => require("./no-trailing-spaces"), + "no-undef": () => require("./no-undef"), + "no-undef-init": () => require("./no-undef-init"), + "no-undefined": () => require("./no-undefined"), + "no-underscore-dangle": () => require("./no-underscore-dangle"), + "no-unexpected-multiline": () => require("./no-unexpected-multiline"), + "no-unmodified-loop-condition": () => require("./no-unmodified-loop-condition"), + "no-unneeded-ternary": () => require("./no-unneeded-ternary"), + "no-unreachable": () => require("./no-unreachable"), + "no-unreachable-loop": () => require("./no-unreachable-loop"), + "no-unsafe-finally": () => require("./no-unsafe-finally"), + "no-unsafe-negation": () => require("./no-unsafe-negation"), + "no-unused-expressions": () => require("./no-unused-expressions"), + "no-unused-labels": () => require("./no-unused-labels"), + "no-unused-vars": () => require("./no-unused-vars"), + "no-use-before-define": () => require("./no-use-before-define"), + "no-useless-backreference": () => require("./no-useless-backreference"), + "no-useless-call": () => require("./no-useless-call"), + "no-useless-catch": () => require("./no-useless-catch"), + "no-useless-computed-key": () => require("./no-useless-computed-key"), + "no-useless-concat": () => require("./no-useless-concat"), + "no-useless-constructor": () => require("./no-useless-constructor"), + "no-useless-escape": () => require("./no-useless-escape"), + "no-useless-rename": () => require("./no-useless-rename"), + "no-useless-return": () => require("./no-useless-return"), + "no-var": () => require("./no-var"), + "no-void": () => require("./no-void"), + "no-warning-comments": () => require("./no-warning-comments"), + "no-whitespace-before-property": () => require("./no-whitespace-before-property"), + "no-with": () => require("./no-with"), + "nonblock-statement-body-position": () => require("./nonblock-statement-body-position"), + "object-curly-newline": () => require("./object-curly-newline"), + "object-curly-spacing": () => require("./object-curly-spacing"), + "object-property-newline": () => require("./object-property-newline"), + "object-shorthand": () => require("./object-shorthand"), + "one-var": () => require("./one-var"), + "one-var-declaration-per-line": () => require("./one-var-declaration-per-line"), + "operator-assignment": () => require("./operator-assignment"), + "operator-linebreak": () => require("./operator-linebreak"), + "padded-blocks": () => require("./padded-blocks"), + "padding-line-between-statements": () => require("./padding-line-between-statements"), + "prefer-arrow-callback": () => require("./prefer-arrow-callback"), + "prefer-const": () => require("./prefer-const"), + "prefer-destructuring": () => require("./prefer-destructuring"), + "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"), + "prefer-named-capture-group": () => require("./prefer-named-capture-group"), + "prefer-numeric-literals": () => require("./prefer-numeric-literals"), + "prefer-object-spread": () => require("./prefer-object-spread"), + "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"), + "prefer-reflect": () => require("./prefer-reflect"), + "prefer-regex-literals": () => require("./prefer-regex-literals"), + "prefer-rest-params": () => require("./prefer-rest-params"), + "prefer-spread": () => require("./prefer-spread"), + "prefer-template": () => require("./prefer-template"), + "quote-props": () => require("./quote-props"), + quotes: () => require("./quotes"), + radix: () => require("./radix"), + "require-atomic-updates": () => require("./require-atomic-updates"), + "require-await": () => require("./require-await"), + "require-jsdoc": () => require("./require-jsdoc"), + "require-unicode-regexp": () => require("./require-unicode-regexp"), + "require-yield": () => require("./require-yield"), + "rest-spread-spacing": () => require("./rest-spread-spacing"), + semi: () => require("./semi"), + "semi-spacing": () => require("./semi-spacing"), + "semi-style": () => require("./semi-style"), + "sort-imports": () => require("./sort-imports"), + "sort-keys": () => require("./sort-keys"), + "sort-vars": () => require("./sort-vars"), + "space-before-blocks": () => require("./space-before-blocks"), + "space-before-function-paren": () => require("./space-before-function-paren"), + "space-in-parens": () => require("./space-in-parens"), + "space-infix-ops": () => require("./space-infix-ops"), + "space-unary-ops": () => require("./space-unary-ops"), + "spaced-comment": () => require("./spaced-comment"), + strict: () => require("./strict"), + "switch-colon-spacing": () => require("./switch-colon-spacing"), + "symbol-description": () => require("./symbol-description"), + "template-curly-spacing": () => require("./template-curly-spacing"), + "template-tag-spacing": () => require("./template-tag-spacing"), + "unicode-bom": () => require("./unicode-bom"), + "use-isnan": () => require("./use-isnan"), + "valid-jsdoc": () => require("./valid-jsdoc"), + "valid-typeof": () => require("./valid-typeof"), + "vars-on-top": () => require("./vars-on-top"), + "wrap-iife": () => require("./wrap-iife"), + "wrap-regex": () => require("./wrap-regex"), + "yield-star-spacing": () => require("./yield-star-spacing"), + yoda: () => require("./yoda") +})); diff --git a/node_modules/eslint/lib/rules/init-declarations.js b/node_modules/eslint/lib/rules/init-declarations.js new file mode 100644 index 0000000..6cfdf92 --- /dev/null +++ b/node_modules/eslint/lib/rules/init-declarations.js @@ -0,0 +1,139 @@ +/** + * @fileoverview A rule to control the style of variable initializations. + * @author Colin Ihrig + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a for loop. + * @param {ASTNode} block A node to check. + * @returns {boolean} `true` when the node is a for loop. + */ +function isForLoop(block) { + return block.type === "ForInStatement" || + block.type === "ForOfStatement" || + block.type === "ForStatement"; +} + +/** + * Checks whether or not a given declarator node has its initializer. + * @param {ASTNode} node A declarator node to check. + * @returns {boolean} `true` when the node has its initializer. + */ +function isInitialized(node) { + const declaration = node.parent; + const block = declaration.parent; + + if (isForLoop(block)) { + if (block.type === "ForStatement") { + return block.init === declaration; + } + return block.left === declaration; + } + return Boolean(node.init); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow initialization in variable declarations", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/init-declarations" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + ignoreForLoopInit: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + messages: { + initialized: "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: "Variable '{{idName}}' should not be initialized on declaration." + } + }, + + create(context) { + + const MODE_ALWAYS = "always", + MODE_NEVER = "never"; + + const mode = context.options[0] || MODE_ALWAYS; + const params = context.options[1] || {}; + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration:exit"(node) { + + const kind = node.kind, + declarations = node.declarations; + + for (let i = 0; i < declarations.length; ++i) { + const declaration = declarations[i], + id = declaration.id, + initialized = isInitialized(declaration), + isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); + let messageId = ""; + + if (mode === MODE_ALWAYS && !initialized) { + messageId = "initialized"; + } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { + messageId = "notInitialized"; + } + + if (id.type === "Identifier" && messageId) { + context.report({ + node: declaration, + messageId, + data: { + idName: id.name + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/jsx-quotes.js b/node_modules/eslint/lib/rules/jsx-quotes.js new file mode 100644 index 0000000..3b282df --- /dev/null +++ b/node_modules/eslint/lib/rules/jsx-quotes.js @@ -0,0 +1,95 @@ +/** + * @fileoverview A rule to ensure consistent quotes used in jsx syntax. + * @author Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + "prefer-double": { + quote: "\"", + description: "singlequote", + convert(str) { + return str.replace(/'/gu, "\""); + } + }, + "prefer-single": { + quote: "'", + description: "doublequote", + convert(str) { + return str.replace(/"/gu, "'"); + } + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the consistent use of either double or single quotes in JSX attributes", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/jsx-quotes" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["prefer-single", "prefer-double"] + } + ], + messages: { + unexpected: "Unexpected usage of {{description}}." + } + }, + + create(context) { + const quoteOption = context.options[0] || "prefer-double", + setting = QUOTE_SETTINGS[quoteOption]; + + /** + * Checks if the given string literal node uses the expected quotes + * @param {ASTNode} node A string literal node. + * @returns {boolean} Whether or not the string literal used the expected quotes. + * @public + */ + function usesExpectedQuotes(node) { + return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote); + } + + return { + JSXAttribute(node) { + const attributeValue = node.value; + + if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { + context.report({ + node: attributeValue, + messageId: "unexpected", + data: { + description: setting.description + }, + fix(fixer) { + return fixer.replaceText(attributeValue, setting.convert(attributeValue.raw)); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/key-spacing.js b/node_modules/eslint/lib/rules/key-spacing.js new file mode 100644 index 0000000..fc885a1 --- /dev/null +++ b/node_modules/eslint/lib/rules/key-spacing.js @@ -0,0 +1,674 @@ +/** + * @fileoverview Rule to specify spacing of object literal keys and values + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a string contains a line terminator as defined in + * http://www.ecma-international.org/ecma-262/5.1/#sec-7.3 + * @param {string} str String to test. + * @returns {boolean} True if str contains a line terminator. + */ +function containsLineTerminator(str) { + return astUtils.LINEBREAK_MATCHER.test(str); +} + +/** + * Gets the last element of an array. + * @param {Array} arr An array. + * @returns {any} Last element of arr. + */ +function last(arr) { + return arr[arr.length - 1]; +} + +/** + * Checks whether a node is contained on a single line. + * @param {ASTNode} node AST Node being evaluated. + * @returns {boolean} True if the node is a single line. + */ +function isSingleLine(node) { + return (node.loc.end.line === node.loc.start.line); +} + +/** + * Checks whether the properties on a single line. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {boolean} True if all properties is on a single line. + */ +function isSingleLineProperties(properties) { + const [firstProp] = properties, + lastProp = last(properties); + + return firstProp.loc.start.line === lastProp.loc.end.line; +} + +/** + * Initializes a single option property from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptionProperty(toOptions, fromOptions) { + toOptions.mode = fromOptions.mode || "strict"; + + // Set value of beforeColon + if (typeof fromOptions.beforeColon !== "undefined") { + toOptions.beforeColon = +fromOptions.beforeColon; + } else { + toOptions.beforeColon = 0; + } + + // Set value of afterColon + if (typeof fromOptions.afterColon !== "undefined") { + toOptions.afterColon = +fromOptions.afterColon; + } else { + toOptions.afterColon = 1; + } + + // Set align if exists + if (typeof fromOptions.align !== "undefined") { + if (typeof fromOptions.align === "object") { + toOptions.align = fromOptions.align; + } else { // "string" + toOptions.align = { + on: fromOptions.align, + mode: toOptions.mode, + beforeColon: toOptions.beforeColon, + afterColon: toOptions.afterColon + }; + } + } + + return toOptions; +} + +/** + * Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptions(toOptions, fromOptions) { + if (typeof fromOptions.align === "object") { + + // Initialize the alignment configuration + toOptions.align = initOptionProperty({}, fromOptions.align); + toOptions.align.on = fromOptions.align.on || "colon"; + toOptions.align.mode = fromOptions.align.mode || "strict"; + + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + } else { // string or undefined + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + // If alignment options are defined in multiLine, pull them out into the general align configuration + if (toOptions.multiLine.align) { + toOptions.align = { + on: toOptions.multiLine.align.on, + mode: toOptions.multiLine.align.mode || toOptions.multiLine.mode, + beforeColon: toOptions.multiLine.align.beforeColon, + afterColon: toOptions.multiLine.align.afterColon + }; + } + } + + return toOptions; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing between keys and values in object literal properties", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/key-spacing" + }, + + fixable: "whitespace", + + schema: [{ + anyOf: [ + { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + align: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ] + }], + messages: { + extraKey: "Extra space after {{computed}}key '{{key}}'.", + extraValue: "Extra space before value for {{computed}}key '{{key}}'.", + missingKey: "Missing space after {{computed}}key '{{key}}'.", + missingValue: "Missing space before value for {{computed}}key '{{key}}'." + } + }, + + create(context) { + + /** + * OPTIONS + * "key-spacing": [2, { + * beforeColon: false, + * afterColon: true, + * align: "colon" // Optional, or "value" + * } + */ + const options = context.options[0] || {}, + ruleOptions = initOptions({}, options), + multiLineOptions = ruleOptions.multiLine, + singleLineOptions = ruleOptions.singleLine, + alignmentOptions = ruleOptions.align || null; + + const sourceCode = context.getSourceCode(); + + /** + * Checks whether a property is a member of the property group it follows. + * @param {ASTNode} lastMember The last Property known to be in the group. + * @param {ASTNode} candidate The next Property that might be in the group. + * @returns {boolean} True if the candidate property is part of the group. + */ + function continuesPropertyGroup(lastMember, candidate) { + const groupEndLine = lastMember.loc.start.line, + candidateStartLine = candidate.loc.start.line; + + if (candidateStartLine - groupEndLine <= 1) { + return true; + } + + /* + * Check that the first comment is adjacent to the end of the group, the + * last comment is adjacent to the candidate property, and that successive + * comments are adjacent to each other. + */ + const leadingComments = sourceCode.getCommentsBefore(candidate); + + if ( + leadingComments.length && + leadingComments[0].loc.start.line - groupEndLine <= 1 && + candidateStartLine - last(leadingComments).loc.end.line <= 1 + ) { + for (let i = 1; i < leadingComments.length; i++) { + if (leadingComments[i].loc.start.line - leadingComments[i - 1].loc.end.line > 1) { + return false; + } + } + return true; + } + + return false; + } + + /** + * Determines if the given property is key-value property. + * @param {ASTNode} property Property node to check. + * @returns {boolean} Whether the property is a key-value property. + */ + function isKeyValueProperty(property) { + return !( + (property.method || + property.shorthand || + property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadElement" + ); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The last token before a colon punctuator. + */ + function getLastTokenBeforeColon(node) { + const colonToken = sourceCode.getTokenAfter(node, astUtils.isColonToken); + + return sourceCode.getTokenBefore(colonToken); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The colon punctuator. + */ + function getNextColon(node) { + return sourceCode.getTokenAfter(node, astUtils.isColonToken); + } + + /** + * Gets an object literal property's key as the identifier name or string value. + * @param {ASTNode} property Property node whose key to retrieve. + * @returns {string} The property's key. + */ + function getKey(property) { + const key = property.key; + + if (property.computed) { + return sourceCode.getText().slice(key.range[0], key.range[1]); + } + return astUtils.getStaticPropertyName(property); + } + + /** + * Reports an appropriately-formatted error if spacing is incorrect on one + * side of the colon. + * @param {ASTNode} property Key-value pair in an object literal. + * @param {string} side Side being verified - either "key" or "value". + * @param {string} whitespace Actual whitespace string. + * @param {int} expected Expected whitespace length. + * @param {string} mode Value of the mode as "strict" or "minimum" + * @returns {void} + */ + function report(property, side, whitespace, expected, mode) { + const diff = whitespace.length - expected, + nextColon = getNextColon(property.key), + tokenBeforeColon = sourceCode.getTokenBefore(nextColon, { includeComments: true }), + tokenAfterColon = sourceCode.getTokenAfter(nextColon, { includeComments: true }), + isKeySide = side === "key", + isExtra = diff > 0, + diffAbs = Math.abs(diff), + spaces = Array(diffAbs + 1).join(" "); + + const locStart = isKeySide ? tokenBeforeColon.loc.end : nextColon.loc.start; + const locEnd = isKeySide ? nextColon.loc.start : tokenAfterColon.loc.start; + const missingLoc = isKeySide ? tokenBeforeColon.loc : tokenAfterColon.loc; + const loc = isExtra ? { start: locStart, end: locEnd } : missingLoc; + + if (( + diff && mode === "strict" || + diff < 0 && mode === "minimum" || + diff > 0 && !expected && mode === "minimum") && + !(expected && containsLineTerminator(whitespace)) + ) { + let fix; + + if (isExtra) { + let range; + + // Remove whitespace + if (isKeySide) { + range = [tokenBeforeColon.range[1], tokenBeforeColon.range[1] + diffAbs]; + } else { + range = [tokenAfterColon.range[0] - diffAbs, tokenAfterColon.range[0]]; + } + fix = function(fixer) { + return fixer.removeRange(range); + }; + } else { + + // Add whitespace + if (isKeySide) { + fix = function(fixer) { + return fixer.insertTextAfter(tokenBeforeColon, spaces); + }; + } else { + fix = function(fixer) { + return fixer.insertTextBefore(tokenAfterColon, spaces); + }; + } + } + + let messageId = ""; + + if (isExtra) { + messageId = side === "key" ? "extraKey" : "extraValue"; + } else { + messageId = side === "key" ? "missingKey" : "missingValue"; + } + + context.report({ + node: property[side], + loc, + messageId, + data: { + computed: property.computed ? "computed " : "", + key: getKey(property) + }, + fix + }); + } + } + + /** + * Gets the number of characters in a key, including quotes around string + * keys and braces around computed property keys. + * @param {ASTNode} property Property of on object literal. + * @returns {int} Width of the key. + */ + function getKeyWidth(property) { + const startToken = sourceCode.getFirstToken(property); + const endToken = getLastTokenBeforeColon(property.key); + + return endToken.range[1] - startToken.range[0]; + } + + /** + * Gets the whitespace around the colon in an object literal property. + * @param {ASTNode} property Property node from an object literal. + * @returns {Object} Whitespace before and after the property's colon. + */ + function getPropertyWhitespace(property) { + const whitespace = /(\s*):(\s*)/u.exec(sourceCode.getText().slice( + property.key.range[1], property.value.range[0] + )); + + if (whitespace) { + return { + beforeColon: whitespace[1], + afterColon: whitespace[2] + }; + } + return null; + } + + /** + * Creates groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {Array.} Groups of property AST node lists. + */ + function createGroups(node) { + if (node.properties.length === 1) { + return [node.properties]; + } + + return node.properties.reduce((groups, property) => { + const currentGroup = last(groups), + prev = last(currentGroup); + + if (!prev || continuesPropertyGroup(prev, property)) { + currentGroup.push(property); + } else { + groups.push([property]); + } + + return groups; + }, [ + [] + ]); + } + + /** + * Verifies correct vertical alignment of a group of properties. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {void} + */ + function verifyGroupAlignment(properties) { + const length = properties.length, + widths = properties.map(getKeyWidth), // Width of keys, including quotes + align = alignmentOptions.on; // "value" or "colon" + let targetWidth = Math.max(...widths), + beforeColon, afterColon, mode; + + if (alignmentOptions && length > 1) { // When aligning values within a group, use the alignment configuration. + beforeColon = alignmentOptions.beforeColon; + afterColon = alignmentOptions.afterColon; + mode = alignmentOptions.mode; + } else { + beforeColon = multiLineOptions.beforeColon; + afterColon = multiLineOptions.afterColon; + mode = alignmentOptions.mode; + } + + // Conditionally include one space before or after colon + targetWidth += (align === "colon" ? beforeColon : afterColon); + + for (let i = 0; i < length; i++) { + const property = properties[i]; + const whitespace = getPropertyWhitespace(property); + + if (whitespace) { // Object literal getters/setters lack a colon + const width = widths[i]; + + if (align === "value") { + report(property, "key", whitespace.beforeColon, beforeColon, mode); + report(property, "value", whitespace.afterColon, targetWidth - width, mode); + } else { // align = "colon" + report(property, "key", whitespace.beforeColon, targetWidth - width, mode); + report(property, "value", whitespace.afterColon, afterColon, mode); + } + } + } + } + + /** + * Verifies spacing of property conforms to specified options. + * @param {ASTNode} node Property node being evaluated. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifySpacing(node, lineOptions) { + const actual = getPropertyWhitespace(node); + + if (actual) { // Object literal getters/setters lack colons + report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode); + report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode); + } + } + + /** + * Verifies spacing of each property in a list. + * @param {ASTNode[]} properties List of Property AST nodes. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifyListSpacing(properties, lineOptions) { + const length = properties.length; + + for (let i = 0; i < length; i++) { + verifySpacing(properties[i], lineOptions); + } + } + + /** + * Verifies vertical alignment, taking into account groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {void} + */ + function verifyAlignment(node) { + createGroups(node).forEach(group => { + const properties = group.filter(isKeyValueProperty); + + if (properties.length > 0 && isSingleLineProperties(properties)) { + verifyListSpacing(properties, multiLineOptions); + } else { + verifyGroupAlignment(properties); + } + }); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + if (alignmentOptions) { // Verify vertical alignment + + return { + ObjectExpression(node) { + if (isSingleLine(node)) { + verifyListSpacing(node.properties.filter(isKeyValueProperty), singleLineOptions); + } else { + verifyAlignment(node); + } + } + }; + + } + + // Obey beforeColon and afterColon in each property as configured + return { + Property(node) { + verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions); + } + }; + + + } +}; diff --git a/node_modules/eslint/lib/rules/keyword-spacing.js b/node_modules/eslint/lib/rules/keyword-spacing.js new file mode 100644 index 0000000..913cf46 --- /dev/null +++ b/node_modules/eslint/lib/rules/keyword-spacing.js @@ -0,0 +1,573 @@ +/** + * @fileoverview Rule to enforce spacing before and after keywords. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const PREV_TOKEN = /^[)\]}>]$/u; +const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u; +const PREV_TOKEN_M = /^[)\]}>*]$/u; +const NEXT_TOKEN_M = /^[{*]$/u; +const TEMPLATE_OPEN_PAREN = /\$\{$/u; +const TEMPLATE_CLOSE_PAREN = /^\}/u; +const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template)$/u; +const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]); + +// check duplications. +(function() { + KEYS.sort(); + for (let i = 1; i < KEYS.length; ++i) { + if (KEYS[i] === KEYS[i - 1]) { + throw new Error(`Duplication was found in the keyword list: ${KEYS[i]}`); + } + } +}()); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given token is a "Template" token ends with "${". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token ends with "${". + */ +function isOpenParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value); +} + +/** + * Checks whether or not a given token is a "Template" token starts with "}". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token starts with "}". + */ +function isCloseParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after keywords", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/keyword-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: true }, + after: { type: "boolean", default: true }, + overrides: { + type: "object", + properties: KEYS.reduce((retv, key) => { + retv[key] = { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + }; + return retv; + }, {}), + additionalProperties: false + } + }, + additionalProperties: false + } + ], + messages: { + expectedBefore: "Expected space(s) before \"{{value}}\".", + expectedAfter: "Expected space(s) after \"{{value}}\".", + unexpectedBefore: "Unexpected space(s) before \"{{value}}\".", + unexpectedAfter: "Unexpected space(s) after \"{{value}}\"." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports a given token if there are not space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function expectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + !sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: token.loc, + messageId: "expectedBefore", + data: token, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function unexpectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "unexpectedBefore", + data: token, + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + } + + /** + * Reports a given token if there are not space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function expectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + !sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + context.report({ + loc: token.loc, + messageId: "expectedAfter", + data: token, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function unexpectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + + context.report({ + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedAfter", + data: token, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + } + + /** + * Parses the option object and determines check methods for each keyword. + * @param {Object|undefined} options The option object to parse. + * @returns {Object} - Normalized option object. + * Keys are keywords (there are for every keyword). + * Values are instances of `{"before": function, "after": function}`. + */ + function parseOptions(options = {}) { + const before = options.before !== false; + const after = options.after !== false; + const defaultValue = { + before: before ? expectSpaceBefore : unexpectSpaceBefore, + after: after ? expectSpaceAfter : unexpectSpaceAfter + }; + const overrides = (options && options.overrides) || {}; + const retv = Object.create(null); + + for (let i = 0; i < KEYS.length; ++i) { + const key = KEYS[i]; + const override = overrides[key]; + + if (override) { + const thisBefore = ("before" in override) ? override.before : before; + const thisAfter = ("after" in override) ? override.after : after; + + retv[key] = { + before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, + after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter + }; + } else { + retv[key] = defaultValue; + } + } + + return retv; + } + + const checkMethodMap = parseOptions(context.options[0]); + + /** + * Reports a given token if usage of spacing followed by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function checkSpacingBefore(token, pattern) { + checkMethodMap[token.value].before(token, pattern || PREV_TOKEN); + } + + /** + * Reports a given token if usage of spacing preceded by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function checkSpacingAfter(token, pattern) { + checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN); + } + + /** + * Reports a given token if usage of spacing around the token is invalid. + * @param {Token} token A token to report. + * @returns {void} + */ + function checkSpacingAround(token) { + checkSpacingBefore(token); + checkSpacingAfter(token); + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingAround(firstToken); + } + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing followed by the token is invalid. + * + * This is used for unary operators (e.g. `typeof`), `function`, and `super`. + * Other rules are handling usage of spacing preceded by those keywords. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingBeforeFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports the previous token of a given node if the token is a keyword and + * usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundTokenBefore(node) { + if (node) { + const token = sourceCode.getTokenBefore(node, astUtils.isKeywordToken); + + checkSpacingAround(token); + } + } + + /** + * Reports `async` or `function` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForFunction(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && + ((firstToken.type === "Keyword" && firstToken.value === "function") || + firstToken.value === "async") + ) { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports `class` and `extends` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForClass(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.superClass); + } + + /** + * Reports `if` and `else` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForIfStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.alternate); + } + + /** + * Reports `try`, `catch`, and `finally` keywords of a given node if usage + * of spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForTryStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundFirstToken(node.handler); + checkSpacingAroundTokenBefore(node.finalizer); + } + + /** + * Reports `do` and `while` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForDoWhileStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.test); + } + + /** + * Reports `for` and `in` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForInStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.right); + } + + /** + * Reports `for` and `of` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForOfStatement(node) { + if (node.await) { + checkSpacingBefore(sourceCode.getFirstToken(node, 0)); + checkSpacingAfter(sourceCode.getFirstToken(node, 1)); + } else { + checkSpacingAroundFirstToken(node); + } + checkSpacingAround(sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken)); + } + + /** + * Reports `import`, `export`, `as`, and `from` keywords of a given node if + * usage of spacing around those keywords is invalid. + * + * This rule handles the `*` token in module declarations. + * + * import*as A from "./a"; /*error Expected space(s) after "import". + * error Expected space(s) before "as". + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForModuleDeclaration(node) { + const firstToken = sourceCode.getFirstToken(node); + + checkSpacingBefore(firstToken, PREV_TOKEN_M); + checkSpacingAfter(firstToken, NEXT_TOKEN_M); + + if (node.type === "ExportDefaultDeclaration") { + checkSpacingAround(sourceCode.getTokenAfter(firstToken)); + } + + if (node.type === "ExportAllDeclaration" && node.exported) { + const asToken = sourceCode.getTokenBefore(node.exported); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + if (node.source) { + const fromToken = sourceCode.getTokenBefore(node.source); + + checkSpacingBefore(fromToken, PREV_TOKEN_M); + checkSpacingAfter(fromToken, NEXT_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForImportNamespaceSpecifier(node) { + const asToken = sourceCode.getFirstToken(node, 1); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + /** + * Reports `static`, `get`, and `set` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForProperty(node) { + if (node.static) { + checkSpacingAroundFirstToken(node); + } + if (node.kind === "get" || + node.kind === "set" || + ( + (node.method || node.type === "MethodDefinition") && + node.value.async + ) + ) { + const token = sourceCode.getTokenBefore( + node.key, + tok => { + switch (tok.value) { + case "get": + case "set": + case "async": + return true; + default: + return false; + } + } + ); + + if (!token) { + throw new Error("Failed to find token get, set, or async beside method name"); + } + + + checkSpacingAround(token); + } + } + + /** + * Reports `await` keyword of a given node if usage of spacing before + * this keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForAwaitExpression(node) { + checkSpacingBefore(sourceCode.getFirstToken(node)); + } + + return { + + // Statements + DebuggerStatement: checkSpacingAroundFirstToken, + WithStatement: checkSpacingAroundFirstToken, + + // Statements - Control flow + BreakStatement: checkSpacingAroundFirstToken, + ContinueStatement: checkSpacingAroundFirstToken, + ReturnStatement: checkSpacingAroundFirstToken, + ThrowStatement: checkSpacingAroundFirstToken, + TryStatement: checkSpacingForTryStatement, + + // Statements - Choice + IfStatement: checkSpacingForIfStatement, + SwitchStatement: checkSpacingAroundFirstToken, + SwitchCase: checkSpacingAroundFirstToken, + + // Statements - Loops + DoWhileStatement: checkSpacingForDoWhileStatement, + ForInStatement: checkSpacingForForInStatement, + ForOfStatement: checkSpacingForForOfStatement, + ForStatement: checkSpacingAroundFirstToken, + WhileStatement: checkSpacingAroundFirstToken, + + // Statements - Declarations + ClassDeclaration: checkSpacingForClass, + ExportNamedDeclaration: checkSpacingForModuleDeclaration, + ExportDefaultDeclaration: checkSpacingForModuleDeclaration, + ExportAllDeclaration: checkSpacingForModuleDeclaration, + FunctionDeclaration: checkSpacingForFunction, + ImportDeclaration: checkSpacingForModuleDeclaration, + VariableDeclaration: checkSpacingAroundFirstToken, + + // Expressions + ArrowFunctionExpression: checkSpacingForFunction, + AwaitExpression: checkSpacingForAwaitExpression, + ClassExpression: checkSpacingForClass, + FunctionExpression: checkSpacingForFunction, + NewExpression: checkSpacingBeforeFirstToken, + Super: checkSpacingBeforeFirstToken, + ThisExpression: checkSpacingBeforeFirstToken, + UnaryExpression: checkSpacingBeforeFirstToken, + YieldExpression: checkSpacingBeforeFirstToken, + + // Others + ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier, + MethodDefinition: checkSpacingForProperty, + Property: checkSpacingForProperty + }; + } +}; diff --git a/node_modules/eslint/lib/rules/line-comment-position.js b/node_modules/eslint/lib/rules/line-comment-position.js new file mode 100644 index 0000000..77ee147 --- /dev/null +++ b/node_modules/eslint/lib/rules/line-comment-position.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to enforce the position of line comments + * @author Alberto Rodríguez + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce position of line comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/line-comment-position" + }, + + schema: [ + { + oneOf: [ + { + enum: ["above", "beside"] + }, + { + type: "object", + properties: { + position: { + enum: ["above", "beside"] + }, + ignorePattern: { + type: "string" + }, + applyDefaultPatterns: { + type: "boolean" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + above: "Expected comment to be above code.", + beside: "Expected comment to be beside code." + } + }, + + create(context) { + const options = context.options[0]; + + let above, + ignorePattern, + applyDefaultIgnorePatterns = true; + + if (!options || typeof options === "string") { + above = !options || options === "above"; + + } else { + above = !options.position || options.position === "above"; + ignorePattern = options.ignorePattern; + + if (Object.prototype.hasOwnProperty.call(options, "applyDefaultIgnorePatterns")) { + applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns; + } else { + applyDefaultIgnorePatterns = options.applyDefaultPatterns !== false; + } + } + + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const fallThroughRegExp = /^\s*falls?\s?through/u; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type === "Line").forEach(node => { + if (applyDefaultIgnorePatterns && (defaultIgnoreRegExp.test(node.value) || fallThroughRegExp.test(node.value))) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(node.value)) { + return; + } + + const previous = sourceCode.getTokenBefore(node, { includeComments: true }); + const isOnSameLine = previous && previous.loc.end.line === node.loc.start.line; + + if (above) { + if (isOnSameLine) { + context.report({ + node, + messageId: "above" + }); + } + } else { + if (!isOnSameLine) { + context.report({ + node, + messageId: "beside" + }); + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/linebreak-style.js b/node_modules/eslint/lib/rules/linebreak-style.js new file mode 100644 index 0000000..b3b393e --- /dev/null +++ b/node_modules/eslint/lib/rules/linebreak-style.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to enforce a single linebreak style. + * @author Erik Mueller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent linebreak style", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/linebreak-style" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["unix", "windows"] + } + ], + messages: { + expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.", + expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Builds a fix function that replaces text at the specified range in the source text. + * @param {int[]} range The range to replace + * @param {string} text The text to insert. + * @returns {Function} Fixer function + * @private + */ + function createFix(range, text) { + return function(fixer) { + return fixer.replaceTextRange(range, text); + }; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkForLinebreakStyle(node) { + const linebreakStyle = context.options[0] || "unix", + expectedLF = linebreakStyle === "unix", + expectedLFChars = expectedLF ? "\n" : "\r\n", + source = sourceCode.getText(), + pattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + let i = 0; + + while ((match = pattern.exec(source)) !== null) { + i++; + if (match[0] === expectedLFChars) { + continue; + } + + const index = match.index; + const range = [index, index + match[0].length]; + + context.report({ + node, + loc: { + start: { + line: i, + column: sourceCode.lines[i - 1].length + }, + end: { + line: i + 1, + column: 0 + } + }, + messageId: expectedLF ? "expectedLF" : "expectedCRLF", + fix: createFix(range, expectedLFChars) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-around-comment.js b/node_modules/eslint/lib/rules/lines-around-comment.js new file mode 100644 index 0000000..5e1b83c --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-around-comment.js @@ -0,0 +1,404 @@ +/** + * @fileoverview Enforces empty lines around comments. + * @author Jamund Ferguson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Return an array with with any line numbers that are empty. + * @param {Array} lines An array of each line of the file. + * @returns {Array} An array of line numbers. + */ +function getEmptyLineNums(lines) { + const emptyLines = lines.map((line, i) => ({ + code: line.trim(), + num: i + 1 + })).filter(line => !line.code).map(line => line.num); + + return emptyLines; +} + +/** + * Return an array with with any line numbers that contain comments. + * @param {Array} comments An array of comment tokens. + * @returns {Array} An array of line numbers. + */ +function getCommentLineNums(comments) { + const lines = []; + + comments.forEach(token => { + const start = token.loc.start.line; + const end = token.loc.end.line; + + lines.push(start, end); + }); + return lines; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require empty lines around comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-around-comment" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + beforeBlockComment: { + type: "boolean", + default: true + }, + afterBlockComment: { + type: "boolean", + default: false + }, + beforeLineComment: { + type: "boolean", + default: false + }, + afterLineComment: { + type: "boolean", + default: false + }, + allowBlockStart: { + type: "boolean", + default: false + }, + allowBlockEnd: { + type: "boolean", + default: false + }, + allowClassStart: { + type: "boolean" + }, + allowClassEnd: { + type: "boolean" + }, + allowObjectStart: { + type: "boolean" + }, + allowObjectEnd: { + type: "boolean" + }, + allowArrayStart: { + type: "boolean" + }, + allowArrayEnd: { + type: "boolean" + }, + ignorePattern: { + type: "string" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + after: "Expected line after comment.", + before: "Expected line before comment." + } + }, + + create(context) { + + const options = Object.assign({}, context.options[0]); + const ignorePattern = options.ignorePattern; + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false; + + options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; + + const sourceCode = context.getSourceCode(); + + const lines = sourceCode.lines, + numLines = lines.length + 1, + comments = sourceCode.getAllComments(), + commentLines = getCommentLineNums(comments), + emptyLines = getEmptyLineNums(lines), + commentAndEmptyLines = commentLines.concat(emptyLines); + + /** + * Returns whether or not comments are on lines starting with or ending with code + * @param {token} token The comment token to check. + * @returns {boolean} True if the comment is not alone. + */ + function codeAroundComment(token) { + let currentToken = token; + + do { + currentToken = sourceCode.getTokenBefore(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(currentToken, token)) { + return true; + } + + currentToken = token; + do { + currentToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(token, currentToken)) { + return true; + } + + return false; + } + + /** + * Returns whether or not comments are inside a node type or not. + * @param {ASTNode} parent The Comment parent node. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is inside nodeType. + */ + function isParentNodeType(parent, nodeType) { + return parent.type === nodeType || + (parent.body && parent.body.type === nodeType) || + (parent.consequent && parent.consequent.type === nodeType); + } + + /** + * Returns the parent node that contains the given token. + * @param {token} token The token to check. + * @returns {ASTNode} The parent node that contains the given token. + */ + function getParentNodeOfToken(token) { + return sourceCode.getNodeByRangeIndex(token.range[0]); + } + + /** + * Returns whether or not comments are at the parent start or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent start. + */ + function isCommentAtParentStart(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return parent && isParentNodeType(parent, nodeType) && + token.loc.start.line - parent.loc.start.line === 1; + } + + /** + * Returns whether or not comments are at the parent end or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent end. + */ + function isCommentAtParentEnd(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return parent && isParentNodeType(parent, nodeType) && + parent.loc.end.line - token.loc.end.line === 1; + } + + /** + * Returns whether or not comments are at the block start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block start. + */ + function isCommentAtBlockStart(token) { + return isCommentAtParentStart(token, "ClassBody") || isCommentAtParentStart(token, "BlockStatement") || isCommentAtParentStart(token, "SwitchCase"); + } + + /** + * Returns whether or not comments are at the block end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block end. + */ + function isCommentAtBlockEnd(token) { + return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement"); + } + + /** + * Returns whether or not comments are at the class start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class start. + */ + function isCommentAtClassStart(token) { + return isCommentAtParentStart(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the class end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class end. + */ + function isCommentAtClassEnd(token) { + return isCommentAtParentEnd(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the object start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object start. + */ + function isCommentAtObjectStart(token) { + return isCommentAtParentStart(token, "ObjectExpression") || isCommentAtParentStart(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the object end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object end. + */ + function isCommentAtObjectEnd(token) { + return isCommentAtParentEnd(token, "ObjectExpression") || isCommentAtParentEnd(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the array start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array start. + */ + function isCommentAtArrayStart(token) { + return isCommentAtParentStart(token, "ArrayExpression") || isCommentAtParentStart(token, "ArrayPattern"); + } + + /** + * Returns whether or not comments are at the array end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array end. + */ + function isCommentAtArrayEnd(token) { + return isCommentAtParentEnd(token, "ArrayExpression") || isCommentAtParentEnd(token, "ArrayPattern"); + } + + /** + * Checks if a comment token has lines around it (ignores inline comments) + * @param {token} token The Comment token. + * @param {Object} opts Options to determine the newline. + * @param {boolean} opts.after Should have a newline after this line. + * @param {boolean} opts.before Should have a newline before this line. + * @returns {void} + */ + function checkForEmptyLine(token, opts) { + if (applyDefaultIgnorePatterns && defaultIgnoreRegExp.test(token.value)) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(token.value)) { + return; + } + + let after = opts.after, + before = opts.before; + + const prevLineNum = token.loc.start.line - 1, + nextLineNum = token.loc.end.line + 1, + commentIsNotAlone = codeAroundComment(token); + + const blockStartAllowed = options.allowBlockStart && + isCommentAtBlockStart(token) && + !(options.allowClassStart === false && + isCommentAtClassStart(token)), + blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(token) && !(options.allowClassEnd === false && isCommentAtClassEnd(token)), + classStartAllowed = options.allowClassStart && isCommentAtClassStart(token), + classEndAllowed = options.allowClassEnd && isCommentAtClassEnd(token), + objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(token), + objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(token), + arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(token), + arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(token); + + const exceptionStartAllowed = blockStartAllowed || classStartAllowed || objectStartAllowed || arrayStartAllowed; + const exceptionEndAllowed = blockEndAllowed || classEndAllowed || objectEndAllowed || arrayEndAllowed; + + // ignore top of the file and bottom of the file + if (prevLineNum < 1) { + before = false; + } + if (nextLineNum >= numLines) { + after = false; + } + + // we ignore all inline comments + if (commentIsNotAlone) { + return; + } + + const previousTokenOrComment = sourceCode.getTokenBefore(token, { includeComments: true }); + const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true }); + + // check for newline before + if (!exceptionStartAllowed && before && !lodash.includes(commentAndEmptyLines, prevLineNum) && + !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) { + const lineStart = token.range[0] - token.loc.start.column; + const range = [lineStart, lineStart]; + + context.report({ + node: token, + messageId: "before", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\n"); + } + }); + } + + // check for newline after + if (!exceptionEndAllowed && after && !lodash.includes(commentAndEmptyLines, nextLineNum) && + !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { + context.report({ + node: token, + messageId: "after", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + comments.forEach(token => { + if (token.type === "Line") { + if (options.beforeLineComment || options.afterLineComment) { + checkForEmptyLine(token, { + after: options.afterLineComment, + before: options.beforeLineComment + }); + } + } else if (token.type === "Block") { + if (options.beforeBlockComment || options.afterBlockComment) { + checkForEmptyLine(token, { + after: options.afterBlockComment, + before: options.beforeBlockComment + }); + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-around-directive.js b/node_modules/eslint/lib/rules/lines-around-directive.js new file mode 100644 index 0000000..fb439da --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-around-directive.js @@ -0,0 +1,201 @@ +/** + * @fileoverview Require or disallow newlines around directives. + * @author Kai Cataldo + * @deprecated + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow newlines around directives", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-around-directive" + }, + + schema: [{ + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + before: { + enum: ["always", "never"] + }, + after: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 2 + } + ] + }], + + fixable: "whitespace", + messages: { + expected: "Expected newline {{location}} \"{{value}}\" directive.", + unexpected: "Unexpected newline {{location}} \"{{value}}\" directive." + }, + deprecated: true, + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const config = context.options[0] || "always"; + const expectLineBefore = typeof config === "string" ? config : config.before; + const expectLineAfter = typeof config === "string" ? config : config.after; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if node is preceded by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is preceded by a blank newline. + */ + function hasNewlineBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true }); + const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0; + + return node.loc.start.line - tokenLineBefore >= 2; + } + + /** + * Gets the last token of a node that is on the same line as the rest of the node. + * This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing + * semicolon on a different line. + * @param {ASTNode} node A directive node + * @returns {Token} The last token of the node on the line + */ + function getLastTokenOnLine(node) { + const lastToken = sourceCode.getLastToken(node); + const secondToLastToken = sourceCode.getTokenBefore(lastToken); + + return astUtils.isSemicolonToken(lastToken) && lastToken.loc.start.line > secondToLastToken.loc.end.line + ? secondToLastToken + : lastToken; + } + + /** + * Check if node is followed by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is followed by a blank newline. + */ + function hasNewlineAfter(node) { + const lastToken = getLastTokenOnLine(node); + const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true }); + + return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2; + } + + /** + * Report errors for newlines around directives. + * @param {ASTNode} node Node to check. + * @param {string} location Whether the error was found before or after the directive. + * @param {boolean} expected Whether or not a newline was expected or unexpected. + * @returns {void} + */ + function reportError(node, location, expected) { + context.report({ + node, + messageId: expected ? "expected" : "unexpected", + data: { + value: node.expression.value, + location + }, + fix(fixer) { + const lastToken = getLastTokenOnLine(node); + + if (expected) { + return location === "before" ? fixer.insertTextBefore(node, "\n") : fixer.insertTextAfter(lastToken, "\n"); + } + return fixer.removeRange(location === "before" ? [node.range[0] - 1, node.range[0]] : [lastToken.range[1], lastToken.range[1] + 1]); + } + }); + } + + /** + * Check lines around directives in node + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDirectives(node) { + const directives = astUtils.getDirectivePrologue(node); + + if (!directives.length) { + return; + } + + const firstDirective = directives[0]; + const leadingComments = sourceCode.getCommentsBefore(firstDirective); + + /* + * Only check before the first directive if it is preceded by a comment or if it is at the top of + * the file and expectLineBefore is set to "never". This is to not force a newline at the top of + * the file if there are no comments as well as for compatibility with padded-blocks. + */ + if (leadingComments.length) { + if (expectLineBefore === "always" && !hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", true); + } + + if (expectLineBefore === "never" && hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", false); + } + } else if ( + node.type === "Program" && + expectLineBefore === "never" && + !leadingComments.length && + hasNewlineBefore(firstDirective) + ) { + reportError(firstDirective, "before", false); + } + + const lastDirective = directives[directives.length - 1]; + const statements = node.type === "Program" ? node.body : node.body.body; + + /* + * Do not check after the last directive if the body only + * contains a directive prologue and isn't followed by a comment to ensure + * this rule behaves well with padded-blocks. + */ + if (lastDirective === statements[statements.length - 1] && !lastDirective.trailingComments) { + return; + } + + if (expectLineAfter === "always" && !hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", true); + } + + if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", false); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: checkDirectives, + FunctionDeclaration: checkDirectives, + FunctionExpression: checkDirectives, + ArrowFunctionExpression: checkDirectives + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-between-class-members.js b/node_modules/eslint/lib/rules/lines-between-class-members.js new file mode 100644 index 0000000..9723530 --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Rule to check empty newline between class members + * @author 薛定谔的猫 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow an empty line between class members", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-between-class-members" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptAfterSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + never: "Unexpected blank line between class members.", + always: "Expected blank line between class members." + } + }, + + create(context) { + + const options = []; + + options[0] = context.options[0] || "always"; + options[1] = context.options[1] || { exceptAfterSingleLine: false }; + + const sourceCode = context.getSourceCode(); + + /** + * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The last token among the consecutive tokens. + */ + function findLastConsecutiveTokenAfter(prevLastToken, nextFirstToken, maxLine) { + const after = sourceCode.getTokenAfter(prevLastToken, { includeComments: true }); + + if (after !== nextFirstToken && after.loc.start.line - prevLastToken.loc.end.line <= maxLine) { + return findLastConsecutiveTokenAfter(after, nextFirstToken, maxLine); + } + return prevLastToken; + } + + /** + * Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The first token among the consecutive tokens. + */ + function findFirstConsecutiveTokenBefore(nextFirstToken, prevLastToken, maxLine) { + const before = sourceCode.getTokenBefore(nextFirstToken, { includeComments: true }); + + if (before !== prevLastToken && nextFirstToken.loc.start.line - before.loc.end.line <= maxLine) { + return findFirstConsecutiveTokenBefore(before, prevLastToken, maxLine); + } + return nextFirstToken; + } + + /** + * Checks if there is a token or comment between two tokens. + * @param {Token} before The token before. + * @param {Token} after The token after. + * @returns {boolean} True if there is a token or comment between two tokens. + */ + function hasTokenOrCommentBetween(before, after) { + return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0; + } + + return { + ClassBody(node) { + const body = node.body; + + for (let i = 0; i < body.length - 1; i++) { + const curFirst = sourceCode.getFirstToken(body[i]); + const curLast = sourceCode.getLastToken(body[i]); + const nextFirst = sourceCode.getFirstToken(body[i + 1]); + const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast); + const skip = !isMulti && options[1].exceptAfterSingleLine; + const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1); + const afterPadding = findFirstConsecutiveTokenBefore(nextFirst, curLast, 1); + const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1; + const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding); + const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0); + + if ((options[0] === "always" && !skip && !isPadded) || + (options[0] === "never" && isPadded)) { + context.report({ + node: body[i + 1], + messageId: isPadded ? "never" : "always", + fix(fixer) { + if (hasTokenInPadding) { + return null; + } + return isPadded + ? fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n") + : fixer.insertTextAfter(curLineLastToken, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-classes-per-file.js b/node_modules/eslint/lib/rules/max-classes-per-file.js new file mode 100644 index 0000000..bb48a54 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-classes-per-file.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Enforce a maximum number of classes per file + * @author James Garbutt + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of classes per file", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/max-classes-per-file" + }, + + schema: [ + { + type: "integer", + minimum: 1 + } + ], + + messages: { + maximumExceeded: "File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}." + } + }, + create(context) { + + const maxClasses = context.options[0] || 1; + + let classCount = 0; + + return { + Program() { + classCount = 0; + }, + "Program:exit"(node) { + if (classCount > maxClasses) { + context.report({ + node, + messageId: "maximumExceeded", + data: { + classCount, + max: maxClasses + } + }); + } + }, + "ClassDeclaration, ClassExpression"() { + classCount++; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-depth.js b/node_modules/eslint/lib/rules/max-depth.js new file mode 100644 index 0000000..5c5296b --- /dev/null +++ b/node_modules/eslint/lib/rules/max-depth.js @@ -0,0 +1,154 @@ +/** + * @fileoverview A rule to set the maximum depth block can be nested in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum depth that blocks can be nested", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-depth" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + tooDeeply: "Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0]; + let maxDepth = 4; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + maxDepth = option.maximum || option.max; + } + if (typeof option === "number") { + maxDepth = option; + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * When parsing is done then pop out the reference + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + } + + /** + * Save the block and Evaluate the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function pushBlock(node) { + const len = ++functionStack[functionStack.length - 1]; + + if (len > maxDepth) { + context.report({ node, messageId: "tooDeeply", data: { depth: len, maxDepth } }); + } + } + + /** + * Pop the saved block + * @returns {void} + * @private + */ + function popBlock() { + functionStack[functionStack.length - 1]--; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + + IfStatement(node) { + if (node.parent.type !== "IfStatement") { + pushBlock(node); + } + }, + SwitchStatement: pushBlock, + TryStatement: pushBlock, + DoWhileStatement: pushBlock, + WhileStatement: pushBlock, + WithStatement: pushBlock, + ForStatement: pushBlock, + ForInStatement: pushBlock, + ForOfStatement: pushBlock, + + "IfStatement:exit": popBlock, + "SwitchStatement:exit": popBlock, + "TryStatement:exit": popBlock, + "DoWhileStatement:exit": popBlock, + "WhileStatement:exit": popBlock, + "WithStatement:exit": popBlock, + "ForStatement:exit": popBlock, + "ForInStatement:exit": popBlock, + "ForOfStatement:exit": popBlock, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + "Program:exit": endFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-len.js b/node_modules/eslint/lib/rules/max-len.js new file mode 100644 index 0000000..dd76760 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-len.js @@ -0,0 +1,433 @@ +/** + * @fileoverview Rule to check for max length on a line. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + code: { + type: "integer", + minimum: 0 + }, + comments: { + type: "integer", + minimum: 0 + }, + tabWidth: { + type: "integer", + minimum: 0 + }, + ignorePattern: { + type: "string" + }, + ignoreComments: { + type: "boolean" + }, + ignoreStrings: { + type: "boolean" + }, + ignoreUrls: { + type: "boolean" + }, + ignoreTemplateLiterals: { + type: "boolean" + }, + ignoreRegExpLiterals: { + type: "boolean" + }, + ignoreTrailingComments: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + anyOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 0 + } + ] +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce a maximum line length", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-len" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_SCHEMA + ], + messages: { + max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.", + maxComment: "This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}." + } + }, + + create(context) { + + /* + * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however: + * - They're matching an entire string that we know is a URI + * - We're matching part of a string where we think there *might* be a URL + * - We're only concerned about URLs, as picking out any URI would cause + * too many false positives + * - We don't care about matching the entire URL, any small segment is fine + */ + const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u; + + const sourceCode = context.getSourceCode(); + + /** + * Computes the length of a line that may contain tabs. The width of each + * tab will be the number of spaces to the next tab stop. + * @param {string} line The line. + * @param {int} tabWidth The width of each tab stop in spaces. + * @returns {int} The computed line length. + * @private + */ + function computeLineLength(line, tabWidth) { + let extraCharacterCount = 0; + + line.replace(/\t/gu, (match, offset) => { + const totalOffset = offset + extraCharacterCount, + previousTabStopOffset = tabWidth ? totalOffset % tabWidth : 0, + spaceCount = tabWidth - previousTabStopOffset; + + extraCharacterCount += spaceCount - 1; // -1 for the replaced tab + }); + return Array.from(line).length + extraCharacterCount; + } + + // The options object must be the last option specified… + const options = Object.assign({}, context.options[context.options.length - 1]); + + // …but max code length… + if (typeof context.options[0] === "number") { + options.code = context.options[0]; + } + + // …and tabWidth can be optionally specified directly as integers. + if (typeof context.options[1] === "number") { + options.tabWidth = context.options[1]; + } + + const maxLength = typeof options.code === "number" ? options.code : 80, + tabWidth = typeof options.tabWidth === "number" ? options.tabWidth : 4, + ignoreComments = !!options.ignoreComments, + ignoreStrings = !!options.ignoreStrings, + ignoreTemplateLiterals = !!options.ignoreTemplateLiterals, + ignoreRegExpLiterals = !!options.ignoreRegExpLiterals, + ignoreTrailingComments = !!options.ignoreTrailingComments || !!options.ignoreComments, + ignoreUrls = !!options.ignoreUrls, + maxCommentLength = options.comments; + let ignorePattern = options.ignorePattern || null; + + if (ignorePattern) { + ignorePattern = new RegExp(ignorePattern, "u"); + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a given comment is trailing: it starts on the current line and + * extends to or past the end of the current line. + * @param {string} line The source line we want to check for a trailing comment on + * @param {number} lineNumber The one-indexed line number for line + * @param {ASTNode} comment The comment to inspect + * @returns {boolean} If the comment is trailing on the given line + */ + function isTrailingComment(line, lineNumber, comment) { + return comment && + (comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line) && + (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length); + } + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = !line.slice(0, comment.loc.start.column).trim(); + + return comment && + (start.line < lineNumber || (start.line === lineNumber && isFirstTokenOnLine)) && + (end.line > lineNumber || (end.line === lineNumber && end.column === line.length)); + } + + /** + * Check if a node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + */ + function isJSXEmptyExpressionInSingleLineContainer(node) { + if (!node || !node.parent || node.type !== "JSXEmptyExpression" || node.parent.type !== "JSXExpressionContainer") { + return false; + } + + const parent = node.parent; + + return parent.loc.start.line === parent.loc.end.line; + } + + /** + * Gets the line after the comment and any remaining trailing whitespace is + * stripped. + * @param {string} line The source line with a trailing comment + * @param {ASTNode} comment The comment to remove + * @returns {string} Line without comment and trailing whitespace + */ + function stripTrailingComment(line, comment) { + + // loc.column is zero-indexed + return line.slice(0, comment.loc.start.column).replace(/\s+$/u, ""); + } + + /** + * Ensure that an array exists at [key] on `object`, and add `value` to it. + * @param {Object} object the object to mutate + * @param {string} key the object's key + * @param {*} value the value to add + * @returns {void} + * @private + */ + function ensureArrayAndPush(object, key, value) { + if (!Array.isArray(object[key])) { + object[key] = []; + } + object[key].push(value); + } + + /** + * Retrieves an array containing all strings (" or ') in the source code. + * @returns {ASTNode[]} An array of string nodes. + */ + function getAllStrings() { + return sourceCode.ast.tokens.filter(token => (token.type === "String" || + (token.type === "JSXText" && sourceCode.getNodeByRangeIndex(token.range[0] - 1).type === "JSXAttribute"))); + } + + /** + * Retrieves an array containing all template literals in the source code. + * @returns {ASTNode[]} An array of template literal nodes. + */ + function getAllTemplateLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "Template"); + } + + + /** + * Retrieves an array containing all RegExp literals in the source code. + * @returns {ASTNode[]} An array of RegExp literal nodes. + */ + function getAllRegExpLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "RegularExpression"); + } + + + /** + * A reducer to group an AST node by line number, both start and end. + * @param {Object} acc the accumulator + * @param {ASTNode} node the AST node in question + * @returns {Object} the modified accumulator + * @private + */ + function groupByLineNumber(acc, node) { + for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) { + ensureArrayAndPush(acc, i, node); + } + return acc; + } + + /** + * Returns an array of all comments in the source code. + * If the element in the array is a JSXEmptyExpression contained with a single line JSXExpressionContainer, + * the element is changed with JSXExpressionContainer node. + * @returns {ASTNode[]} An array of comment nodes + */ + function getAllComments() { + const comments = []; + + sourceCode.getAllComments() + .forEach(commentNode => { + const containingNode = sourceCode.getNodeByRangeIndex(commentNode.range[0]); + + if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) { + + // push a unique node only + if (comments[comments.length - 1] !== containingNode.parent) { + comments.push(containingNode.parent); + } + } else { + comments.push(commentNode); + } + }); + + return comments; + } + + /** + * Check the program for max length + * @param {ASTNode} node Node to examine + * @returns {void} + * @private + */ + function checkProgramForMaxLength(node) { + + // split (honors line-ending) + const lines = sourceCode.lines, + + // list of comments to ignore + comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? getAllComments() : []; + + // we iterate over comments in parallel with the lines + let commentsIndex = 0; + + const strings = getAllStrings(); + const stringsByLine = strings.reduce(groupByLineNumber, {}); + + const templateLiterals = getAllTemplateLiterals(); + const templateLiteralsByLine = templateLiterals.reduce(groupByLineNumber, {}); + + const regExpLiterals = getAllRegExpLiterals(); + const regExpLiteralsByLine = regExpLiterals.reduce(groupByLineNumber, {}); + + lines.forEach((line, i) => { + + // i is zero-indexed, line numbers are one-indexed + const lineNumber = i + 1; + + /* + * if we're checking comment length; we need to know whether this + * line is a comment + */ + let lineIsComment = false; + let textToMeasure; + + /* + * We can short-circuit the comment checks if we're already out of + * comments to check. + */ + if (commentsIndex < comments.length) { + let comment = null; + + // iterate over comments until we find one past the current line + do { + comment = comments[++commentsIndex]; + } while (comment && comment.loc.start.line <= lineNumber); + + // and step back by one + comment = comments[--commentsIndex]; + + if (isFullLineComment(line, lineNumber, comment)) { + lineIsComment = true; + textToMeasure = line; + } else if (ignoreTrailingComments && isTrailingComment(line, lineNumber, comment)) { + textToMeasure = stripTrailingComment(line, comment); + + // ignore multiple trailing comments in the same line + let lastIndex = commentsIndex; + + while (isTrailingComment(textToMeasure, lineNumber, comments[--lastIndex])) { + textToMeasure = stripTrailingComment(textToMeasure, comments[lastIndex]); + } + } else { + textToMeasure = line; + } + } else { + textToMeasure = line; + } + if (ignorePattern && ignorePattern.test(textToMeasure) || + ignoreUrls && URL_REGEXP.test(textToMeasure) || + ignoreStrings && stringsByLine[lineNumber] || + ignoreTemplateLiterals && templateLiteralsByLine[lineNumber] || + ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber] + ) { + + // ignore this line + return; + } + + const lineLength = computeLineLength(textToMeasure, tabWidth); + const commentLengthApplies = lineIsComment && maxCommentLength; + + if (lineIsComment && ignoreComments) { + return; + } + + const loc = { + start: { + line: lineNumber, + column: 0 + }, + end: { + line: lineNumber, + column: textToMeasure.length + } + }; + + if (commentLengthApplies) { + if (lineLength > maxCommentLength) { + context.report({ + node, + loc, + messageId: "maxComment", + data: { + lineLength, + maxCommentLength + } + }); + } + } else if (lineLength > maxLength) { + context.report({ + node, + loc, + messageId: "max", + data: { + lineLength, + maxLength + } + }); + } + }); + } + + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: checkProgramForMaxLength + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-lines-per-function.js b/node_modules/eslint/lib/rules/max-lines-per-function.js new file mode 100644 index 0000000..aa423a6 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -0,0 +1,214 @@ +/** + * @fileoverview A rule to set the maximum number of line of code in a function. + * @author Pete Ward + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + }, + IIFEs: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + oneOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 1 + } + ] +}; + +/** + * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values. + * @param {Array} comments An array of comment nodes. + * @returns {Map.} A map with numeric keys (source code line numbers) and comment token values. + */ +function getCommentLineNumbers(comments) { + const map = new Map(); + + comments.forEach(comment => { + for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) { + map.set(i, comment); + } + }); + return map; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of line of code in a function", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-lines-per-function" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA + ], + messages: { + exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const lines = sourceCode.lines; + + const option = context.options[0]; + let maxLines = 50; + let skipComments = false; + let skipBlankLines = false; + let IIFEs = false; + + if (typeof option === "object") { + maxLines = typeof option.max === "number" ? option.max : 50; + skipComments = !!option.skipComments; + skipBlankLines = !!option.skipBlankLines; + IIFEs = !!option.IIFEs; + } else if (typeof option === "number") { + maxLines = option; + } + + const commentLineNumbers = getCommentLineNumbers(sourceCode.getAllComments()); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = start.line === lineNumber && !line.slice(0, start.column).trim(), + isLastTokenOnLine = end.line === lineNumber && !line.slice(end.column).trim(); + + return comment && + (start.line < lineNumber || isFirstTokenOnLine) && + (end.line > lineNumber || isLastTokenOnLine); + } + + /** + * Identifies is a node is a FunctionExpression which is part of an IIFE + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's an IIFE + */ + function isIIFE(node) { + return (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && node.parent && node.parent.type === "CallExpression" && node.parent.callee === node; + } + + /** + * Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property + */ + function isEmbedded(node) { + if (!node.parent) { + return false; + } + if (node !== node.parent.value) { + return false; + } + if (node.parent.type === "MethodDefinition") { + return true; + } + if (node.parent.type === "Property") { + return node.parent.method === true || node.parent.kind === "get" || node.parent.kind === "set"; + } + return false; + } + + /** + * Count the lines in the function + * @param {ASTNode} funcNode Function AST node + * @returns {void} + * @private + */ + function processFunction(funcNode) { + const node = isEmbedded(funcNode) ? funcNode.parent : funcNode; + + if (!IIFEs && isIIFE(node)) { + return; + } + let lineCount = 0; + + for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) { + const line = lines[i]; + + if (skipComments) { + if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) { + continue; + } + } + + if (skipBlankLines) { + if (line.match(/^\s*$/u)) { + continue; + } + } + + lineCount++; + } + + if (lineCount > maxLines) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(funcNode)); + + context.report({ + node, + messageId: "exceed", + data: { name, lineCount, maxLines } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: processFunction, + FunctionExpression: processFunction, + ArrowFunctionExpression: processFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-lines.js b/node_modules/eslint/lib/rules/max-lines.js new file mode 100644 index 0000000..f33adbd --- /dev/null +++ b/node_modules/eslint/lib/rules/max-lines.js @@ -0,0 +1,174 @@ +/** + * @fileoverview enforce a maximum file length + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of lines per file", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-lines" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: + "File has too many lines ({{actual}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let max = 300; + + if ( + typeof option === "object" && + Object.prototype.hasOwnProperty.call(option, "max") + ) { + max = option.max; + } else if (typeof option === "number") { + max = option; + } + + const skipComments = option && option.skipComments; + const skipBlankLines = option && option.skipBlankLines; + + const sourceCode = context.getSourceCode(); + + /** + * Returns whether or not a token is a comment node type + * @param {Token} token The token to check + * @returns {boolean} True if the token is a comment node + */ + function isCommentNodeType(token) { + return token && (token.type === "Block" || token.type === "Line"); + } + + /** + * Returns the line numbers of a comment that don't have any code on the same line + * @param {Node} comment The comment node to check + * @returns {number[]} The line numbers + */ + function getLinesWithoutCode(comment) { + let start = comment.loc.start.line; + let end = comment.loc.end.line; + + let token; + + token = comment; + do { + token = sourceCode.getTokenBefore(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(token, comment)) { + start += 1; + } + + token = comment; + do { + token = sourceCode.getTokenAfter(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(comment, token)) { + end -= 1; + } + + if (start <= end) { + return lodash.range(start, end + 1); + } + return []; + } + + return { + "Program:exit"() { + let lines = sourceCode.lines.map((text, i) => ({ + lineNumber: i + 1, + text + })); + + if (skipBlankLines) { + lines = lines.filter(l => l.text.trim() !== ""); + } + + if (skipComments) { + const comments = sourceCode.getAllComments(); + + const commentLines = lodash.flatten( + comments.map(comment => getLinesWithoutCode(comment)) + ); + + lines = lines.filter( + l => !lodash.includes(commentLines, l.lineNumber) + ); + } + + if (lines.length > max) { + const loc = { + start: { + line: lines[max].lineNumber, + column: 0 + }, + end: { + line: sourceCode.lines.length, + column: lodash.last(sourceCode.lines).length + } + }; + + context.report({ + loc, + messageId: "exceed", + data: { + max, + actual: lines.length + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-nested-callbacks.js b/node_modules/eslint/lib/rules/max-nested-callbacks.js new file mode 100644 index 0000000..df1bace --- /dev/null +++ b/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -0,0 +1,117 @@ +/** + * @fileoverview Rule to enforce a maximum number of nested callbacks. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum depth that callbacks can be nested", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-nested-callbacks" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Constants + //-------------------------------------------------------------------------- + const option = context.options[0]; + let THRESHOLD = 10; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const callbackStack = []; + + /** + * Checks a given function node for too many callbacks. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + const parent = node.parent; + + if (parent.type === "CallExpression") { + callbackStack.push(node); + } + + if (callbackStack.length > THRESHOLD) { + const opts = { num: callbackStack.length, max: THRESHOLD }; + + context.report({ node, messageId: "exceed", data: opts }); + } + } + + /** + * Pops the call stack. + * @returns {void} + * @private + */ + function popStack() { + callbackStack.pop(); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: checkFunction, + "ArrowFunctionExpression:exit": popStack, + + FunctionExpression: checkFunction, + "FunctionExpression:exit": popStack + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-params.js b/node_modules/eslint/lib/rules/max-params.js new file mode 100644 index 0000000..4eebe2d --- /dev/null +++ b/node_modules/eslint/lib/rules/max-params.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to flag when a function has too many parameters + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of parameters in function definitions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-params" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0]; + let numParams = 3; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + numParams = option.maximum || option.max; + } + if (typeof option === "number") { + numParams = option; + } + + /** + * Checks a function to see if it has too many parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + if (node.params.length > numParams) { + context.report({ + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + node, + messageId: "exceed", + data: { + name: lodash.upperFirst(astUtils.getFunctionNameWithKind(node)), + count: node.params.length, + max: numParams + } + }); + } + } + + return { + FunctionDeclaration: checkFunction, + ArrowFunctionExpression: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-statements-per-line.js b/node_modules/eslint/lib/rules/max-statements-per-line.js new file mode 100644 index 0000000..5407cff --- /dev/null +++ b/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Specify the maximum number of statements allowed per line. + * @author Kenneth Williams + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce a maximum number of statements allowed per line", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-statements-per-line" + }, + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 1, + default: 1 + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(), + options = context.options[0] || {}, + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; + + let lastStatementLine = 0, + numberOfStatementsOnThisLine = 0, + firstExtraStatement; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const SINGLE_CHILD_ALLOWED = /^(?:(?:DoWhile|For|ForIn|ForOf|If|Labeled|While)Statement|Export(?:Default|Named)Declaration)$/u; + + /** + * Reports with the first extra statement, and clears it. + * @returns {void} + */ + function reportFirstExtraStatementAndClear() { + if (firstExtraStatement) { + context.report({ + node: firstExtraStatement, + messageId: "exceed", + data: { + numberOfStatementsOnThisLine, + maxStatementsPerLine, + statements: numberOfStatementsOnThisLine === 1 ? "statement" : "statements" + } + }); + } + firstExtraStatement = null; + } + + /** + * Gets the actual last token of a given node. + * @param {ASTNode} node A node to get. This is a node except EmptyStatement. + * @returns {Token} The actual last token. + */ + function getActualLastToken(node) { + return sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + } + + /** + * Addresses a given node. + * It updates the state of this rule, then reports the node if the node violated this rule. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function enterStatement(node) { + const line = node.loc.start.line; + + /* + * Skip to allow non-block statements if this is direct child of control statements. + * `if (a) foo();` is counted as 1. + * But `if (a) foo(); else foo();` should be counted as 2. + */ + if (SINGLE_CHILD_ALLOWED.test(node.parent.type) && + node.parent.alternate !== node + ) { + return; + } + + // Update state. + if (line === lastStatementLine) { + numberOfStatementsOnThisLine += 1; + } else { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + + // Reports if the node violated this rule. + if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) { + firstExtraStatement = firstExtraStatement || node; + } + } + + /** + * Updates the state of this rule with the end line of leaving node to check with the next statement. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function leaveStatement(node) { + const line = getActualLastToken(node).loc.end.line; + + // Update state. + if (line !== lastStatementLine) { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BreakStatement: enterStatement, + ClassDeclaration: enterStatement, + ContinueStatement: enterStatement, + DebuggerStatement: enterStatement, + DoWhileStatement: enterStatement, + ExpressionStatement: enterStatement, + ForInStatement: enterStatement, + ForOfStatement: enterStatement, + ForStatement: enterStatement, + FunctionDeclaration: enterStatement, + IfStatement: enterStatement, + ImportDeclaration: enterStatement, + LabeledStatement: enterStatement, + ReturnStatement: enterStatement, + SwitchStatement: enterStatement, + ThrowStatement: enterStatement, + TryStatement: enterStatement, + VariableDeclaration: enterStatement, + WhileStatement: enterStatement, + WithStatement: enterStatement, + ExportNamedDeclaration: enterStatement, + ExportDefaultDeclaration: enterStatement, + ExportAllDeclaration: enterStatement, + + "BreakStatement:exit": leaveStatement, + "ClassDeclaration:exit": leaveStatement, + "ContinueStatement:exit": leaveStatement, + "DebuggerStatement:exit": leaveStatement, + "DoWhileStatement:exit": leaveStatement, + "ExpressionStatement:exit": leaveStatement, + "ForInStatement:exit": leaveStatement, + "ForOfStatement:exit": leaveStatement, + "ForStatement:exit": leaveStatement, + "FunctionDeclaration:exit": leaveStatement, + "IfStatement:exit": leaveStatement, + "ImportDeclaration:exit": leaveStatement, + "LabeledStatement:exit": leaveStatement, + "ReturnStatement:exit": leaveStatement, + "SwitchStatement:exit": leaveStatement, + "ThrowStatement:exit": leaveStatement, + "TryStatement:exit": leaveStatement, + "VariableDeclaration:exit": leaveStatement, + "WhileStatement:exit": leaveStatement, + "WithStatement:exit": leaveStatement, + "ExportNamedDeclaration:exit": leaveStatement, + "ExportDefaultDeclaration:exit": leaveStatement, + "ExportAllDeclaration:exit": leaveStatement, + "Program:exit": reportFirstExtraStatementAndClear + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-statements.js b/node_modules/eslint/lib/rules/max-statements.js new file mode 100644 index 0000000..437b393 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-statements.js @@ -0,0 +1,175 @@ +/** + * @fileoverview A rule to set the maximum number of statements in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of statements allowed in function blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-statements" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + ignoreTopLevelFunctions: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0], + ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false, + topLevelFunctions = []; + let maxStatements = 10; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + maxStatements = option.maximum || option.max; + } else if (typeof option === "number") { + maxStatements = option; + } + + /** + * Reports a node if it has too many statements + * @param {ASTNode} node node to evaluate + * @param {int} count Number of statements in node + * @param {int} max Maximum number of statements allowed + * @returns {void} + * @private + */ + function reportIfTooManyStatements(node, count, max) { + if (count > max) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + + context.report({ + node, + messageId: "exceed", + data: { name, count, max } + }); + } + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const count = functionStack.pop(); + + if (ignoreTopLevelFunctions && functionStack.length === 0) { + topLevelFunctions.push({ node, count }); + } else { + reportIfTooManyStatements(node, count, maxStatements); + } + } + + /** + * Increment the count of the functions + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function countStatements(node) { + functionStack[functionStack.length - 1] += node.body.length; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + + BlockStatement: countStatements, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + + "Program:exit"() { + if (topLevelFunctions.length === 1) { + return; + } + + topLevelFunctions.forEach(element => { + const count = element.count; + const node = element.node; + + reportIfTooManyStatements(node, count, maxStatements); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/multiline-comment-style.js b/node_modules/eslint/lib/rules/multiline-comment-style.js new file mode 100644 index 0000000..9524818 --- /dev/null +++ b/node_modules/eslint/lib/rules/multiline-comment-style.js @@ -0,0 +1,435 @@ +/** + * @fileoverview enforce a particular style for multiline comments + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a particular style for multiline comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/multiline-comment-style" + }, + + fixable: "whitespace", + schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], + messages: { + expectedBlock: "Expected a block comment instead of consecutive line comments.", + expectedBareBlock: "Expected a block comment without padding stars.", + startNewline: "Expected a linebreak after '/*'.", + endNewline: "Expected a linebreak before '*/'.", + missingStar: "Expected a '*' at the start of this line.", + alignment: "Expected this line to be aligned with the start of the comment.", + expectedLines: "Expected multiple line comments instead of a block comment." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "starred-block"; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks if a comment line is starred. + * @param {string} line A string representing a comment line. + * @returns {boolean} Whether or not the comment line is starred. + */ + function isStarredCommentLine(line) { + return /^\s*\*/u.test(line); + } + + /** + * Checks if a comment group is in starred-block form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in starred block form. + */ + function isStarredBlockComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + // The first and last lines can only contain whitespace. + return lines.length > 0 && lines.every((line, i) => (i === 0 || i === lines.length - 1 ? /^\s*$/u : /^\s*\*/u).test(line)); + } + + /** + * Checks if a comment group is in JSDoc form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in JSDoc form. + */ + function isJSDocComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + return /^\*\s*$/u.test(lines[0]) && + lines.slice(1, -1).every(line => /^\s* /u.test(line)) && + /^\s*$/u.test(lines[lines.length - 1]); + } + + /** + * Processes a comment group that is currently in separate-line form, calculating the offset for each line. + * @param {Token[]} commentGroup A group of comments containing multiple line comments. + * @returns {string[]} An array of the processed lines. + */ + function processSeparateLineComments(commentGroup) { + const allLinesHaveLeadingSpace = commentGroup + .map(({ value }) => value) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return commentGroup.map(({ value }) => (allLinesHaveLeadingSpace ? value.replace(/^ /u, "") : value)); + } + + /** + * Processes a comment group that is currently in starred-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in starred-block form. + * @returns {string[]} An array of the processed lines. + */ + function processStarredBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER) + .filter((line, i, linesArr) => !(i === 0 || i === linesArr.length - 1)) + .map(line => line.replace(/^\s*$/u, "")); + const allLinesHaveLeadingSpace = lines + .map(line => line.replace(/\s*\*/u, "")) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return lines.map(line => line.replace(allLinesHaveLeadingSpace ? /\s*\* ?/u : /\s*\*/u, "")); + } + + /** + * Processes a comment group that is currently in bare-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in bare-block form. + * @returns {string[]} An array of the processed lines. + */ + function processBareBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER).map(line => line.replace(/^\s*$/u, "")); + const leadingWhitespace = `${sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0])} `; + let offset = ""; + + /* + * Calculate the offset of the least indented line and use that as the basis for offsetting all the lines. + * The first line should not be checked because it is inline with the opening block comment delimiter. + */ + for (const [i, line] of lines.entries()) { + if (!line.trim().length || i === 0) { + continue; + } + + const [, lineOffset] = line.match(/^(\s*\*?\s*)/u); + + if (lineOffset.length < leadingWhitespace.length) { + const newOffset = leadingWhitespace.slice(lineOffset.length - leadingWhitespace.length); + + if (newOffset.length > offset.length) { + offset = newOffset; + } + } + } + + return lines.map(line => { + const match = line.match(/^(\s*\*?\s*)(.*)/u); + const [, lineOffset, lineContents] = match; + + if (lineOffset.length > leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length - (offset.length + lineOffset.length))}${lineContents}`; + } + + if (lineOffset.length < leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length)}${lineContents}`; + } + + return lineContents; + }); + } + + /** + * Gets a list of comment lines in a group, formatting leading whitespace as necessary. + * @param {Token[]} commentGroup A group of comments containing either multiple line comments or a single block comment. + * @returns {string[]} A list of comment lines. + */ + function getCommentLines(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type === "Line") { + return processSeparateLineComments(commentGroup); + } + + if (isStarredBlockComment(commentGroup)) { + return processStarredBlockComment(firstComment); + } + + return processBareBlockComment(firstComment); + } + + /** + * Gets the initial offset (whitespace) from the beginning of a line to a given comment token. + * @param {Token} comment The token to check. + * @returns {string} The offset from the beginning of a line to the token. + */ + function getInitialOffset(comment) { + return sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0]); + } + + /** + * Converts a comment into starred-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in starred-block form, excluding start and end markers + */ + function convertToStarredBlock(firstComment, commentLinesList) { + const initialOffset = getInitialOffset(firstComment); + + return `/*\n${commentLinesList.map(line => `${initialOffset} * ${line}`).join("\n")}\n${initialOffset} */`; + } + + /** + * Converts a comment into separate-line form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in separate-line form + */ + function convertToSeparateLines(firstComment, commentLinesList) { + return commentLinesList.map(line => `// ${line}`).join(`\n${getInitialOffset(firstComment)}`); + } + + /** + * Converts a comment into bare-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in bare-block form + */ + function convertToBlock(firstComment, commentLinesList) { + return `/* ${commentLinesList.join(`\n${getInitialOffset(firstComment)} `)} */`; + } + + /** + * Each method checks a group of comments to see if it's valid according to the given option. + * @param {Token[]} commentGroup A list of comments that appear together. This will either contain a single + * block comment or multiple line comments. + * @returns {void} + */ + const commentGroupCheckers = { + "starred-block"(commentGroup) { + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + if (commentLines.some(value => value.includes("*/"))) { + return; + } + + if (commentGroup.length > 1) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup[commentGroup.length - 1].loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + const range = [firstComment.range[0], commentGroup[commentGroup.length - 1].range[1]]; + + return commentLines.some(value => value.startsWith("/")) + ? null + : fixer.replaceTextRange(range, convertToStarredBlock(firstComment, commentLines)); + } + }); + } else { + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + const expectedLeadingWhitespace = getInitialOffset(firstComment); + const expectedLinePrefix = `${expectedLeadingWhitespace} *`; + + if (!/^\*?\s*$/u.test(lines[0])) { + const start = firstComment.value.startsWith("*") ? firstComment.range[0] + 1 : firstComment.range[0]; + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "startNewline", + fix: fixer => fixer.insertTextAfterRange([start, start + 2], `\n${expectedLinePrefix}`) + }); + } + + if (!/^\s*$/u.test(lines[lines.length - 1])) { + context.report({ + loc: { + start: { line: firstComment.loc.end.line, column: firstComment.loc.end.column - 2 }, + end: firstComment.loc.end + }, + messageId: "endNewline", + fix: fixer => fixer.replaceTextRange([firstComment.range[1] - 2, firstComment.range[1]], `\n${expectedLinePrefix}/`) + }); + } + + for (let lineNumber = firstComment.loc.start.line + 1; lineNumber <= firstComment.loc.end.line; lineNumber++) { + const lineText = sourceCode.lines[lineNumber - 1]; + const errorType = isStarredCommentLine(lineText) + ? "alignment" + : "missingStar"; + + if (!lineText.startsWith(expectedLinePrefix)) { + context.report({ + loc: { + start: { line: lineNumber, column: 0 }, + end: { line: lineNumber, column: lineText.length } + }, + messageId: errorType, + fix(fixer) { + const lineStartIndex = sourceCode.getIndexFromLoc({ line: lineNumber, column: 0 }); + + if (errorType === "alignment") { + const [, commentTextPrefix = ""] = lineText.match(/^(\s*\*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], expectedLinePrefix); + } + + const [, commentTextPrefix = ""] = lineText.match(/^(\s*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + let offset; + + for (const [idx, line] of lines.entries()) { + if (!/\S+/u.test(line)) { + continue; + } + + const lineTextToAlignWith = sourceCode.lines[firstComment.loc.start.line - 1 + idx]; + const [, prefix = "", initialOffset = ""] = lineTextToAlignWith.match(/^(\s*(?:\/?\*)?(\s*))/u) || []; + + offset = `${commentTextPrefix.slice(prefix.length)}${initialOffset}`; + + if (/^\s*\//u.test(lineText) && offset.length === 0) { + offset += " "; + } + break; + } + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], `${expectedLinePrefix}${offset}`); + } + }); + } + } + } + }, + "separate-lines"(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type !== "Block" || isJSDocComment(commentGroup)) { + return; + } + + const commentLines = getCommentLines(commentGroup); + const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); + + if (tokenAfter && firstComment.loc.end.line === tokenAfter.loc.start.line) { + return; + } + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedLines", + fix(fixer) { + return fixer.replaceText(firstComment, convertToSeparateLines(firstComment, commentLines)); + } + }); + }, + "bare-block"(commentGroup) { + if (isJSDocComment(commentGroup)) { + return; + } + + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + // Disallows consecutive line comments in favor of using a block comment. + if (firstComment.type === "Line" && commentLines.length > 1 && + !commentLines.some(value => value.includes("*/"))) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup[commentGroup.length - 1].loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + return fixer.replaceTextRange( + [firstComment.range[0], commentGroup[commentGroup.length - 1].range[1]], + convertToBlock(firstComment, commentLines) + ); + } + }); + } + + // Prohibits block comments from having a * at the beginning of each line. + if (isStarredBlockComment(commentGroup)) { + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedBareBlock", + fix(fixer) { + return fixer.replaceText(firstComment, convertToBlock(firstComment, commentLines)); + } + }); + } + } + }; + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + return sourceCode.getAllComments() + .filter(comment => comment.type !== "Shebang") + .filter(comment => !astUtils.COMMENTS_IGNORE_PATTERN.test(comment.value)) + .filter(comment => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return !tokenBefore || tokenBefore.loc.end.line < comment.loc.start.line; + }) + .reduce((commentGroups, comment, index, commentList) => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + if ( + comment.type === "Line" && + index && commentList[index - 1].type === "Line" && + tokenBefore && tokenBefore.loc.end.line === comment.loc.start.line - 1 && + tokenBefore === commentList[index - 1] + ) { + commentGroups[commentGroups.length - 1].push(comment); + } else { + commentGroups.push([comment]); + } + + return commentGroups; + }, []) + .filter(commentGroup => !(commentGroup.length === 1 && commentGroup[0].loc.start.line === commentGroup[0].loc.end.line)) + .forEach(commentGroupCheckers[option]); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/multiline-ternary.js b/node_modules/eslint/lib/rules/multiline-ternary.js new file mode 100644 index 0000000..6668bff --- /dev/null +++ b/node_modules/eslint/lib/rules/multiline-ternary.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Enforce newlines between operands of ternary expressions + * @author Kai Cataldo + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce newlines between operands of ternary expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/multiline-ternary" + }, + + schema: [ + { + enum: ["always", "always-multiline", "never"] + } + ], + messages: { + expectedTestCons: "Expected newline between test and consequent of ternary expression.", + expectedConsAlt: "Expected newline between consequent and alternate of ternary expression.", + unexpectedTestCons: "Unexpected newline between test and consequent of ternary expression.", + unexpectedConsAlt: "Unexpected newline between consequent and alternate of ternary expression." + } + }, + + create(context) { + const option = context.options[0]; + const multiline = option !== "never"; + const allowSingleLine = option === "always-multiline"; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression(node) { + const questionToken = sourceCode.getTokenAfter(node.test, astUtils.isNotClosingParenToken); + const colonToken = sourceCode.getTokenAfter(node.consequent, astUtils.isNotClosingParenToken); + + const firstTokenOfTest = sourceCode.getFirstToken(node); + const lastTokenOfTest = sourceCode.getTokenBefore(questionToken); + const firstTokenOfConsequent = sourceCode.getTokenAfter(questionToken); + const lastTokenOfConsequent = sourceCode.getTokenBefore(colonToken); + const firstTokenOfAlternate = sourceCode.getTokenAfter(colonToken); + + const areTestAndConsequentOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, firstTokenOfConsequent); + const areConsequentAndAlternateOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, firstTokenOfAlternate); + + if (!multiline) { + if (!areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "unexpectedTestCons" + }); + } + + if (!areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "unexpectedConsAlt" + }); + } + } else { + if (allowSingleLine && node.loc.start.line === node.loc.end.line) { + return; + } + + if (areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "expectedTestCons" + }); + } + + if (areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "expectedConsAlt" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/new-cap.js b/node_modules/eslint/lib/rules/new-cap.js new file mode 100644 index 0000000..4249a54 --- /dev/null +++ b/node_modules/eslint/lib/rules/new-cap.js @@ -0,0 +1,275 @@ +/** + * @fileoverview Rule to flag use of constructors without capital letters + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const CAPS_ALLOWED = [ + "Array", + "Boolean", + "Date", + "Error", + "Function", + "Number", + "Object", + "RegExp", + "String", + "Symbol", + "BigInt" +]; + +/** + * Ensure that if the key is provided, it must be an array. + * @param {Object} obj Object to check with `key`. + * @param {string} key Object key to check on `obj`. + * @param {*} fallback If obj[key] is not present, this will be returned. + * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` + */ +function checkArray(obj, key, fallback) { + + /* istanbul ignore if */ + if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { + throw new TypeError(`${key}, if provided, must be an Array`); + } + return obj[key] || fallback; +} + +/** + * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. + * @param {Object} map Accumulator object for the reduce. + * @param {string} key Object key to set to `true`. + * @returns {Object} Returns the updated Object for further reduction. + */ +function invert(map, key) { + map[key] = true; + return map; +} + +/** + * Creates an object with the cap is new exceptions as its keys and true as their values. + * @param {Object} config Rule configuration + * @returns {Object} Object with cap is new exceptions. + */ +function calculateCapIsNewExceptions(config) { + let capIsNewExceptions = checkArray(config, "capIsNewExceptions", CAPS_ALLOWED); + + if (capIsNewExceptions !== CAPS_ALLOWED) { + capIsNewExceptions = capIsNewExceptions.concat(CAPS_ALLOWED); + } + + return capIsNewExceptions.reduce(invert, {}); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require constructor names to begin with a capital letter", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/new-cap" + }, + + schema: [ + { + type: "object", + properties: { + newIsCap: { + type: "boolean", + default: true + }, + capIsNew: { + type: "boolean", + default: true + }, + newIsCapExceptions: { + type: "array", + items: { + type: "string" + } + }, + newIsCapExceptionPattern: { + type: "string" + }, + capIsNewExceptions: { + type: "array", + items: { + type: "string" + } + }, + capIsNewExceptionPattern: { + type: "string" + }, + properties: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + messages: { + upper: "A function with a name starting with an uppercase letter should only be used as a constructor.", + lower: "A constructor name should not start with a lowercase letter." + } + }, + + create(context) { + + const config = Object.assign({}, context.options[0]); + + config.newIsCap = config.newIsCap !== false; + config.capIsNew = config.capIsNew !== false; + const skipProperties = config.properties === false; + + const newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); + const newIsCapExceptionPattern = config.newIsCapExceptionPattern ? new RegExp(config.newIsCapExceptionPattern, "u") : null; + + const capIsNewExceptions = calculateCapIsNewExceptions(config); + const capIsNewExceptionPattern = config.capIsNewExceptionPattern ? new RegExp(config.capIsNewExceptionPattern, "u") : null; + + const listeners = {}; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Get exact callee name from expression + * @param {ASTNode} node CallExpression or NewExpression node + * @returns {string} name + */ + function extractNameFromExpression(node) { + return node.callee.type === "Identifier" + ? node.callee.name + : astUtils.getStaticPropertyName(node.callee) || ""; + } + + /** + * Returns the capitalization state of the string - + * Whether the first character is uppercase, lowercase, or non-alphabetic + * @param {string} str String + * @returns {string} capitalization state: "non-alpha", "lower", or "upper" + */ + function getCap(str) { + const firstChar = str.charAt(0); + + const firstCharLower = firstChar.toLowerCase(); + const firstCharUpper = firstChar.toUpperCase(); + + if (firstCharLower === firstCharUpper) { + + // char has no uppercase variant, so it's non-alphabetic + return "non-alpha"; + } + if (firstChar === firstCharLower) { + return "lower"; + } + return "upper"; + + } + + /** + * Check if capitalization is allowed for a CallExpression + * @param {Object} allowedMap Object mapping calleeName to a Boolean + * @param {ASTNode} node CallExpression node + * @param {string} calleeName Capitalized callee name from a CallExpression + * @param {Object} pattern RegExp object from options pattern + * @returns {boolean} Returns true if the callee may be capitalized + */ + function isCapAllowed(allowedMap, node, calleeName, pattern) { + const sourceText = sourceCode.getText(node.callee); + + if (allowedMap[calleeName] || allowedMap[sourceText]) { + return true; + } + + if (pattern && pattern.test(sourceText)) { + return true; + } + + const callee = astUtils.skipChainExpression(node.callee); + + if (calleeName === "UTC" && callee.type === "MemberExpression") { + + // allow if callee is Date.UTC + return callee.object.type === "Identifier" && + callee.object.name === "Date"; + } + + return skipProperties && callee.type === "MemberExpression"; + } + + /** + * Reports the given messageId for the given node. The location will be the start of the property or the callee. + * @param {ASTNode} node CallExpression or NewExpression node. + * @param {string} messageId The messageId to report. + * @returns {void} + */ + function report(node, messageId) { + let callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "MemberExpression") { + callee = callee.property; + } + + context.report({ node, loc: callee.loc, messageId }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + if (config.newIsCap) { + listeners.NewExpression = function(node) { + + const constructorName = extractNameFromExpression(node); + + if (constructorName) { + const capitalization = getCap(constructorName); + const isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName, newIsCapExceptionPattern); + + if (!isAllowed) { + report(node, "lower"); + } + } + }; + } + + if (config.capIsNew) { + listeners.CallExpression = function(node) { + + const calleeName = extractNameFromExpression(node); + + if (calleeName) { + const capitalization = getCap(calleeName); + const isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName, capIsNewExceptionPattern); + + if (!isAllowed) { + report(node, "upper"); + } + } + }; + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/new-parens.js b/node_modules/eslint/lib/rules/new-parens.js new file mode 100644 index 0000000..405ec1b --- /dev/null +++ b/node_modules/eslint/lib/rules/new-parens.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to flag when using constructor without parentheses + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce or disallow parentheses when invoking a constructor with no arguments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/new-parens" + }, + + fixable: "code", + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + } + ] + }, + messages: { + missing: "Missing '()' invoking a constructor.", + unnecessary: "Unnecessary '()' invoking a constructor with no arguments." + } + }, + + create(context) { + const options = context.options; + const always = options[0] !== "never"; // Default is always + + const sourceCode = context.getSourceCode(); + + return { + NewExpression(node) { + if (node.arguments.length !== 0) { + return; // if there are arguments, there have to be parens + } + + const lastToken = sourceCode.getLastToken(node); + const hasLastParen = lastToken && astUtils.isClosingParenToken(lastToken); + + // `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end with its own parens + const hasParens = hasLastParen && + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(lastToken)) && + node.callee.range[1] < node.range[1]; + + if (always) { + if (!hasParens) { + context.report({ + node, + messageId: "missing", + fix: fixer => fixer.insertTextAfter(node, "()") + }); + } + } else { + if (hasParens) { + context.report({ + node, + messageId: "unnecessary", + fix: fixer => [ + fixer.remove(sourceCode.getTokenBefore(lastToken)), + fixer.remove(lastToken), + fixer.insertTextBefore(node, "("), + fixer.insertTextAfter(node, ")") + ] + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/newline-after-var.js b/node_modules/eslint/lib/rules/newline-after-var.js new file mode 100644 index 0000000..4809d9b --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-after-var.js @@ -0,0 +1,255 @@ +/** + * @fileoverview Rule to check empty newline after "var" statement + * @author Gopal Venkatesan + * @deprecated + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow an empty line after variable declarations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-after-var" + }, + schema: [ + { + enum: ["never", "always"] + } + ], + fixable: "whitespace", + messages: { + expected: "Expected blank line after variable declarations.", + unexpected: "Unexpected blank line after variable declarations." + }, + + deprecated: true, + + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + // Default `mode` to "always". + const mode = context.options[0] === "never" ? "never" : "always"; + + // Cache starting and ending line numbers of comments for faster lookup + const commentEndLine = sourceCode.getAllComments().reduce((result, token) => { + result[token.loc.start.line] = token.loc.end.line; + return result; + }, {}); + + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a token from the given node to compare line to the next statement. + * + * In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy. + * + * - The last token is semicolon. + * - The semicolon is on a different line from the previous token of the semicolon. + * + * This behavior would address semicolon-less style code. e.g.: + * + * var foo = 1 + * + * ;(a || b).doSomething() + * @param {ASTNode} node The node to get. + * @returns {Token} The token to compare line to the next statement. + */ + function getLastToken(node) { + const lastToken = sourceCode.getLastToken(node); + + if (lastToken.type === "Punctuator" && lastToken.value === ";") { + const prevToken = sourceCode.getTokenBefore(lastToken); + + if (prevToken.loc.end.line !== lastToken.loc.start.line) { + return prevToken; + } + } + + return lastToken; + } + + /** + * Determine if provided keyword is a variable declaration + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a type of var + */ + function isVar(keyword) { + return keyword === "var" || keyword === "let" || keyword === "const"; + } + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Determine if provided keyword is an export specifiers + * @private + * @param {string} nodeType nodeType to test + * @returns {boolean} True if `nodeType` is an export specifier + */ + function isExportSpecifier(nodeType) { + return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" || + nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration"; + } + + /** + * Determine if provided node is the last of their parent block. + * @private + * @param {ASTNode} node node to test + * @returns {boolean} True if `node` is last of their parent block. + */ + function isLastNode(node) { + const token = sourceCode.getTokenAfter(node); + + return !token || (token.type === "Punctuator" && token.value === "}"); + } + + /** + * Gets the last line of a group of consecutive comments + * @param {number} commentStartLine The starting line of the group + * @returns {number} The number of the last comment line of the group + */ + function getLastCommentLineOfBlock(commentStartLine) { + const currentCommentEnd = commentEndLine[commentStartLine]; + + return commentEndLine[currentCommentEnd + 1] ? getLastCommentLineOfBlock(currentCommentEnd + 1) : currentCommentEnd; + } + + /** + * Determine if a token starts more than one line after a comment ends + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment + */ + function hasBlankLineAfterComment(token, commentStartLine) { + return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1; + } + + /** + * Checks that a blank line exists after a variable declaration when mode is + * set to "always", or checks that there is no blank line when mode is set + * to "never" + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForBlankLine(node) { + + /* + * lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will + * sometimes be second-last if there is a semicolon on a different line. + */ + const lastToken = getLastToken(node), + + /* + * If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken + * is the last token of the node. + */ + nextToken = lastToken === sourceCode.getLastToken(node) ? sourceCode.getTokenAfter(node) : sourceCode.getLastToken(node), + nextLineNum = lastToken.loc.end.line + 1; + + // Ignore if there is no following statement + if (!nextToken) { + return; + } + + // Ignore if parent of node is a for variant + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + // Ignore if parent of node is an export specifier + if (isExportSpecifier(node.parent.type)) { + return; + } + + /* + * Some coding styles use multiple `var` statements, so do nothing if + * the next token is a `var` statement. + */ + if (nextToken.type === "Keyword" && isVar(nextToken.value)) { + return; + } + + // Ignore if it is last statement in a block + if (isLastNode(node)) { + return; + } + + // Next statement is not a `var`... + const noNextLineToken = nextToken.loc.start.line > nextLineNum; + const hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined"); + + if (mode === "never" && noNextLineToken && !hasNextLineComment) { + context.report({ + node, + messageId: "unexpected", + data: { identifier: node.name }, + fix(fixer) { + const linesBetween = sourceCode.getText().slice(lastToken.range[1], nextToken.range[0]).split(astUtils.LINEBREAK_MATCHER); + + return fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], `${linesBetween.slice(0, -1).join("")}\n${linesBetween[linesBetween.length - 1]}`); + } + }); + } + + // Token on the next line, or comment without blank line + if ( + mode === "always" && ( + !noNextLineToken || + hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum) + ) + ) { + context.report({ + node, + messageId: "expected", + data: { identifier: node.name }, + fix(fixer) { + if ((noNextLineToken ? getLastCommentLineOfBlock(nextLineNum) : lastToken.loc.end.line) === nextToken.loc.start.line) { + return fixer.insertTextBefore(nextToken, "\n\n"); + } + + return fixer.insertTextBeforeRange([nextToken.range[0] - nextToken.loc.start.column, nextToken.range[1]], "\n"); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForBlankLine + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/newline-before-return.js b/node_modules/eslint/lib/rules/newline-before-return.js new file mode 100644 index 0000000..65ca323 --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-before-return.js @@ -0,0 +1,217 @@ +/** + * @fileoverview Rule to require newlines before `return` statement + * @author Kai Cataldo + * @deprecated + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require an empty line before `return` statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-before-return" + }, + + fixable: "whitespace", + schema: [], + messages: { + expected: "Expected newline before return statement." + }, + + deprecated: true, + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tests whether node is preceded by supplied tokens + * @param {ASTNode} node node to check + * @param {Array} testTokens array of tokens to test against + * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens + * @private + */ + function isPrecededByTokens(node, testTokens) { + const tokenBefore = sourceCode.getTokenBefore(node); + + return testTokens.some(token => tokenBefore.value === token); + } + + /** + * Checks whether node is the first node after statement or in block + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is the first node after statement or in block + * @private + */ + function isFirstNode(node) { + const parentType = node.parent.type; + + if (node.parent.body) { + return Array.isArray(node.parent.body) + ? node.parent.body[0] === node + : node.parent.body === node; + } + + if (parentType === "IfStatement") { + return isPrecededByTokens(node, ["else", ")"]); + } + if (parentType === "DoWhileStatement") { + return isPrecededByTokens(node, ["do"]); + } + if (parentType === "SwitchCase") { + return isPrecededByTokens(node, [":"]); + } + return isPrecededByTokens(node, [")"]); + + } + + /** + * Returns the number of lines of comments that precede the node + * @param {ASTNode} node node to check for overlapping comments + * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments + * @returns {number} Number of lines of comments that precede the node + * @private + */ + function calcCommentLines(node, lineNumTokenBefore) { + const comments = sourceCode.getCommentsBefore(node); + let numLinesComments = 0; + + if (!comments.length) { + return numLinesComments; + } + + comments.forEach(comment => { + numLinesComments++; + + if (comment.type === "Block") { + numLinesComments += comment.loc.end.line - comment.loc.start.line; + } + + // avoid counting lines with inline comments twice + if (comment.loc.start.line === lineNumTokenBefore) { + numLinesComments--; + } + + if (comment.loc.end.line === node.loc.start.line) { + numLinesComments--; + } + }); + + return numLinesComments; + } + + /** + * Returns the line number of the token before the node that is passed in as an argument + * @param {ASTNode} node The node to use as the start of the calculation + * @returns {number} Line number of the token before `node` + * @private + */ + function getLineNumberOfTokenBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + let lineNumTokenBefore; + + /** + * Global return (at the beginning of a script) is a special case. + * If there is no token before `return`, then we expect no line + * break before the return. Comments are allowed to occupy lines + * before the global return, just no blank lines. + * Setting lineNumTokenBefore to zero in that case results in the + * desired behavior. + */ + if (tokenBefore) { + lineNumTokenBefore = tokenBefore.loc.end.line; + } else { + lineNumTokenBefore = 0; // global return at beginning of script + } + + return lineNumTokenBefore; + } + + /** + * Checks whether node is preceded by a newline + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is preceded by a newline + * @private + */ + function hasNewlineBefore(node) { + const lineNumNode = node.loc.start.line; + const lineNumTokenBefore = getLineNumberOfTokenBefore(node); + const commentLines = calcCommentLines(node, lineNumTokenBefore); + + return (lineNumNode - lineNumTokenBefore - commentLines) > 1; + } + + /** + * Checks whether it is safe to apply a fix to a given return statement. + * + * The fix is not considered safe if the given return statement has leading comments, + * as we cannot safely determine if the newline should be added before or after the comments. + * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211 + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if it can fix the node. + * @private + */ + function canFix(node) { + const leadingComments = sourceCode.getCommentsBefore(node); + const lastLeadingComment = leadingComments[leadingComments.length - 1]; + const tokenBefore = sourceCode.getTokenBefore(node); + + if (leadingComments.length === 0) { + return true; + } + + /* + * if the last leading comment ends in the same line as the previous token and + * does not share a line with the `return` node, we can consider it safe to fix. + * Example: + * function a() { + * var b; //comment + * return; + * } + */ + if (lastLeadingComment.loc.end.line === tokenBefore.loc.end.line && + lastLeadingComment.loc.end.line !== node.loc.start.line) { + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ReturnStatement(node) { + if (!isFirstNode(node) && !hasNewlineBefore(node)) { + context.report({ + node, + messageId: "expected", + fix(fixer) { + if (canFix(node)) { + const tokenBefore = sourceCode.getTokenBefore(node); + const newlines = node.loc.start.line === tokenBefore.loc.end.line ? "\n\n" : "\n"; + + return fixer.insertTextBefore(node, newlines); + } + return null; + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/newline-per-chained-call.js b/node_modules/eslint/lib/rules/newline-per-chained-call.js new file mode 100644 index 0000000..46c9d6c --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -0,0 +1,123 @@ +/** + * @fileoverview Rule to ensure newline per method call when chaining calls + * @author Rajendra Patil + * @author Burak Yigit Kaya + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require a newline after each call in a method chain", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-per-chained-call" + }, + + fixable: "whitespace", + + schema: [{ + type: "object", + properties: { + ignoreChainWithDepth: { + type: "integer", + minimum: 1, + maximum: 10, + default: 2 + } + }, + additionalProperties: false + }], + messages: { + expected: "Expected line break before `{{callee}}`." + } + }, + + create(context) { + + const options = context.options[0] || {}, + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + + const sourceCode = context.getSourceCode(); + + /** + * Get the prefix of a given MemberExpression node. + * If the MemberExpression node is a computed value it returns a + * left bracket. If not it returns a period. + * @param {ASTNode} node A MemberExpression node to get + * @returns {string} The prefix of the node. + */ + function getPrefix(node) { + if (node.computed) { + if (node.optional) { + return "?.["; + } + return "["; + } + if (node.optional) { + return "?."; + } + return "."; + } + + /** + * Gets the property text of a given MemberExpression node. + * If the text is multiline, this returns only the first line. + * @param {ASTNode} node A MemberExpression node to get. + * @returns {string} The property text of the node. + */ + function getPropertyText(node) { + const prefix = getPrefix(node); + const lines = sourceCode.getText(node.property).split(astUtils.LINEBREAK_MATCHER); + const suffix = node.computed && lines.length === 1 ? "]" : ""; + + return prefix + lines[0] + suffix; + } + + return { + "CallExpression:exit"(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type !== "MemberExpression") { + return; + } + + let parent = astUtils.skipChainExpression(callee.object); + let depth = 1; + + while (parent && parent.callee) { + depth += 1; + parent = astUtils.skipChainExpression(astUtils.skipChainExpression(parent.callee).object); + } + + if (depth > ignoreChainWithDepth && astUtils.isTokenOnSameLine(callee.object, callee.property)) { + const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, astUtils.isNotClosingParenToken); + + context.report({ + node: callee.property, + loc: { + start: firstTokenAfterObject.loc.start, + end: callee.loc.end + }, + messageId: "expected", + data: { + callee: getPropertyText(callee) + }, + fix(fixer) { + return fixer.insertTextBefore(firstTokenAfterObject, "\n"); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-alert.js b/node_modules/eslint/lib/rules/no-alert.js new file mode 100644 index 0000000..702b4d2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-alert.js @@ -0,0 +1,136 @@ +/** + * @fileoverview Rule to flag use of alert, confirm, prompt + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getStaticPropertyName: getPropertyName, + getVariableByName, + skipChainExpression +} = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given name is a prohibited identifier. + * @param {string} name The name to check + * @returns {boolean} Whether or not the name is prohibited. + */ +function isProhibitedIdentifier(name) { + return /^(alert|confirm|prompt)$/u.test(name); +} + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + if (references.length === 1) { + return references[0]; + } + return null; +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +/** + * Checks if the given identifier node is a ThisExpression in the global scope or the global window property. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the node is a reference to the global object. + */ +function isGlobalThisReferenceOrGlobalWindow(scope, node) { + if (scope.type === "global" && node.type === "ThisExpression") { + return true; + } + if ( + node.type === "Identifier" && + ( + node.name === "window" || + (node.name === "globalThis" && getVariableByName(scope, "globalThis")) + ) + ) { + return !isShadowed(scope, node); + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `alert`, `confirm`, and `prompt`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-alert" + }, + + schema: [], + + messages: { + unexpected: "Unexpected {{name}}." + } + }, + + create(context) { + return { + CallExpression(node) { + const callee = skipChainExpression(node.callee), + currentScope = context.getScope(); + + // without window. + if (callee.type === "Identifier") { + const name = callee.name; + + if (!isShadowed(currentScope, callee) && isProhibitedIdentifier(callee.name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + + } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, callee.object)) { + const name = getPropertyName(callee); + + if (isProhibitedIdentifier(name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-array-constructor.js b/node_modules/eslint/lib/rules/no-array-constructor.js new file mode 100644 index 0000000..90c6d6b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-array-constructor.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Disallow construction of dense arrays using the Array constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `Array` constructors", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-array-constructor" + }, + + schema: [], + + messages: { + preferLiteral: "The array literal notation [] is preferable." + } + }, + + create(context) { + + /** + * Disallow construction of dense arrays using the Array constructor + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if ( + node.arguments.length !== 1 && + node.callee.type === "Identifier" && + node.callee.name === "Array" + ) { + context.report({ node, messageId: "preferLiteral" }); + } + } + + return { + CallExpression: check, + NewExpression: check + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-async-promise-executor.js b/node_modules/eslint/lib/rules/no-async-promise-executor.js new file mode 100644 index 0000000..553311e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-async-promise-executor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview disallow using an async function as a Promise executor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow using an async function as a Promise executor", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-async-promise-executor" + }, + + fixable: null, + schema: [], + messages: { + async: "Promise executor functions should not be async." + } + }, + + create(context) { + return { + "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { + context.report({ + node: context.getSourceCode().getFirstToken(node.arguments[0], token => token.value === "async"), + messageId: "async" + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-await-in-loop.js b/node_modules/eslint/lib/rules/no-await-in-loop.js new file mode 100644 index 0000000..9ca8986 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-await-in-loop.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Rule to disallow uses of await inside of loops. + * @author Nat Mote (nmote) + */ +"use strict"; + +/** + * Check whether it should stop traversing ancestors at the given node. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if it should stop traversing. + */ +function isBoundary(node) { + const t = node.type; + + return ( + t === "FunctionDeclaration" || + t === "FunctionExpression" || + t === "ArrowFunctionExpression" || + + /* + * Don't report the await expressions on for-await-of loop since it's + * asynchronous iteration intentionally. + */ + (t === "ForOfStatement" && node.await === true) + ); +} + +/** + * Check whether the given node is in loop. + * @param {ASTNode} node A node to check. + * @param {ASTNode} parent A parent node to check. + * @returns {boolean} `true` if the node is in loop. + */ +function isLooped(node, parent) { + switch (parent.type) { + case "ForStatement": + return ( + node === parent.test || + node === parent.update || + node === parent.body + ); + + case "ForOfStatement": + case "ForInStatement": + return node === parent.body; + + case "WhileStatement": + case "DoWhileStatement": + return node === parent.test || node === parent.body; + + default: + return false; + } +} + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `await` inside of loops", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-await-in-loop" + }, + + schema: [], + + messages: { + unexpectedAwait: "Unexpected `await` inside a loop." + } + }, + create(context) { + + /** + * Validate an await expression. + * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate. + * @returns {void} + */ + function validate(awaitNode) { + if (awaitNode.type === "ForOfStatement" && !awaitNode.await) { + return; + } + + let node = awaitNode; + let parent = node.parent; + + while (parent && !isBoundary(parent)) { + if (isLooped(node, parent)) { + context.report({ + node: awaitNode, + messageId: "unexpectedAwait" + }); + return; + } + node = parent; + parent = parent.parent; + } + } + + return { + AwaitExpression: validate, + ForOfStatement: validate + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-bitwise.js b/node_modules/eslint/lib/rules/no-bitwise.js new file mode 100644 index 0000000..a9c3360 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-bitwise.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Rule to flag bitwise identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * + * Set of bitwise operators. + * + */ +const BITWISE_OPERATORS = [ + "^", "|", "&", "<<", ">>", ">>>", + "^=", "|=", "&=", "<<=", ">>=", ">>>=", + "~" +]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow bitwise operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-bitwise" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + enum: BITWISE_OPERATORS + }, + uniqueItems: true + }, + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected use of '{{operator}}'." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + const int32Hint = options.int32Hint === true; + + /** + * Reports an unexpected use of a bitwise operator. + * @param {ASTNode} node Node which contains the bitwise operator. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "unexpected", data: { operator: node.operator } }); + } + + /** + * Checks if the given node has a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function hasBitwiseOperator(node) { + return BITWISE_OPERATORS.indexOf(node.operator) !== -1; + } + + /** + * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function allowedOperator(node) { + return allowed.indexOf(node.operator) !== -1; + } + + /** + * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is used in integer typecasting. + */ + function isInt32Hint(node) { + return int32Hint && node.operator === "|" && node.right && + node.right.type === "Literal" && node.right.value === 0; + } + + /** + * Report if the given node contains a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNodeForBitwiseOperator(node) { + if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) { + report(node); + } + } + + return { + AssignmentExpression: checkNodeForBitwiseOperator, + BinaryExpression: checkNodeForBitwiseOperator, + UnaryExpression: checkNodeForBitwiseOperator + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-buffer-constructor.js b/node_modules/eslint/lib/rules/no-buffer-constructor.js new file mode 100644 index 0000000..152dda0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-buffer-constructor.js @@ -0,0 +1,49 @@ +/** + * @fileoverview disallow use of the Buffer() constructor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "problem", + + docs: { + description: "disallow use of the `Buffer()` constructor", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-buffer-constructor" + }, + + schema: [], + + messages: { + deprecated: "{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead." + } + }, + + create(context) { + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + "CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(node) { + context.report({ + node, + messageId: "deprecated", + data: { expr: node.type === "CallExpression" ? "Buffer()" : "new Buffer()" } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-caller.js b/node_modules/eslint/lib/rules/no-caller.js new file mode 100644 index 0000000..5fe1bd4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-caller.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag use of arguments.callee and arguments.caller. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `arguments.caller` or `arguments.callee`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-caller" + }, + + schema: [], + + messages: { + unexpected: "Avoid arguments.{{prop}}." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/u)) { + context.report({ node, messageId: "unexpected", data: { prop: propertyName } }); + } + + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-case-declarations.js b/node_modules/eslint/lib/rules/no-case-declarations.js new file mode 100644 index 0000000..1d54e22 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-case-declarations.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag use of an lexical declarations inside a case clause + * @author Erik Arvidsson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow lexical declarations in case clauses", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-case-declarations" + }, + + schema: [], + + messages: { + unexpected: "Unexpected lexical declaration in case block." + } + }, + + create(context) { + + /** + * Checks whether or not a node is a lexical declaration. + * @param {ASTNode} node A direct child statement of a switch case. + * @returns {boolean} Whether or not the node is a lexical declaration. + */ + function isLexicalDeclaration(node) { + switch (node.type) { + case "FunctionDeclaration": + case "ClassDeclaration": + return true; + case "VariableDeclaration": + return node.kind !== "var"; + default: + return false; + } + } + + return { + SwitchCase(node) { + for (let i = 0; i < node.consequent.length; i++) { + const statement = node.consequent[i]; + + if (isLexicalDeclaration(statement)) { + context.report({ + node: statement, + messageId: "unexpected" + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-catch-shadow.js b/node_modules/eslint/lib/rules/no-catch-shadow.js new file mode 100644 index 0000000..4917af8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-catch-shadow.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier + * @author Ian Christian Myers + * @deprecated in ESLint v5.1.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `catch` clause parameters from shadowing variables in the outer scope", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-catch-shadow" + }, + + replacedBy: ["no-shadow"], + + deprecated: true, + schema: [], + + messages: { + mutable: "Value of '{{name}}' may be overwritten in IE 8 and earlier." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the parameters are been shadowed + * @param {Object} scope current scope + * @param {string} name parameter name + * @returns {boolean} True is its been shadowed + */ + function paramIsShadowing(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "CatchClause[param!=null]"(node) { + let scope = context.getScope(); + + /* + * When ecmaVersion >= 6, CatchClause creates its own scope + * so start from one upper scope to exclude the current node + */ + if (scope.block === node) { + scope = scope.upper; + } + + if (paramIsShadowing(scope, node.param.name)) { + context.report({ node, messageId: "mutable", data: { name: node.param.name } }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-class-assign.js b/node_modules/eslint/lib/rules/no-class-assign.js new file mode 100644 index 0000000..887058b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-class-assign.js @@ -0,0 +1,61 @@ +/** + * @fileoverview A rule to disallow modifying variables of class declarations + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning class members", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-class-assign" + }, + + schema: [], + + messages: { + class: "'{{name}}' is a class." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "class", data: { name: reference.identifier.name } }); + + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check. + * @returns {void} + */ + function checkForClass(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + ClassDeclaration: checkForClass, + ClassExpression: checkForClass + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/node_modules/eslint/lib/rules/no-compare-neg-zero.js new file mode 100644 index 0000000..0c6865a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -0,0 +1,60 @@ +/** + * @fileoverview The rule should warn against code that tries to compare against -0. + * @author Aladdin-ADD + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow comparing against -0", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-compare-neg-zero" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Do not use the '{{operator}}' operator to compare against -0." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks a given node is -0 + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is -0. + */ + function isNegZero(node) { + return node.type === "UnaryExpression" && node.operator === "-" && node.argument.type === "Literal" && node.argument.value === 0; + } + const OPERATORS_TO_CHECK = new Set([">", ">=", "<", "<=", "==", "===", "!=", "!=="]); + + return { + BinaryExpression(node) { + if (OPERATORS_TO_CHECK.has(node.operator)) { + if (isNegZero(node.left) || isNegZero(node.right)) { + context.report({ + node, + messageId: "unexpected", + data: { operator: node.operator } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-cond-assign.js b/node_modules/eslint/lib/rules/no-cond-assign.js new file mode 100644 index 0000000..3843a7a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-cond-assign.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to flag assignment in a conditional statement's test expression + * @author Stephen Murray + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TEST_CONDITION_PARENT_TYPES = new Set(["IfStatement", "WhileStatement", "DoWhileStatement", "ForStatement", "ConditionalExpression"]); + +const NODE_DESCRIPTIONS = { + DoWhileStatement: "a 'do...while' statement", + ForStatement: "a 'for' statement", + IfStatement: "an 'if' statement", + WhileStatement: "a 'while' statement" +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignment operators in conditional expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-cond-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + unexpected: "Unexpected assignment within {{type}}.", + + // must match JSHint's error message + missing: "Expected a conditional expression and instead saw an assignment." + } + }, + + create(context) { + + const prohibitAssign = (context.options[0] || "except-parens"); + + const sourceCode = context.getSourceCode(); + + /** + * Check whether an AST node is the test expression for a conditional statement. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`. + */ + function isConditionalTestExpression(node) { + return node.parent && + TEST_CONDITION_PARENT_TYPES.has(node.parent.type) && + node === node.parent.test; + } + + /** + * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement. + * @param {!Object} node The node to use at the start of the search. + * @returns {?Object} The closest ancestor node that represents a conditional statement. + */ + function findConditionalAncestor(node) { + let currentAncestor = node; + + do { + if (isConditionalTestExpression(currentAncestor)) { + return currentAncestor.parent; + } + } while ((currentAncestor = currentAncestor.parent) && !astUtils.isFunction(currentAncestor)); + + return null; + } + + /** + * Check whether the code represented by an AST node is enclosed in two sets of parentheses. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return astUtils.isParenthesised(sourceCode, node) && + previousToken && astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + /** + * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses. + * @param {!Object} node The node for the conditional statement. + * @returns {void} + */ + function testForAssign(node) { + if (node.test && + (node.test.type === "AssignmentExpression") && + (node.type === "ForStatement" + ? !astUtils.isParenthesised(sourceCode, node.test) + : !isParenthesisedTwice(node.test) + ) + ) { + + context.report({ + node: node.test, + messageId: "missing" + }); + } + } + + /** + * Check whether an assignment expression is descended from a conditional statement's test expression. + * @param {!Object} node The node for the assignment expression. + * @returns {void} + */ + function testForConditionalAncestor(node) { + const ancestor = findConditionalAncestor(node); + + if (ancestor) { + context.report({ + node, + messageId: "unexpected", + data: { + type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type + } + }); + } + } + + if (prohibitAssign === "always") { + return { + AssignmentExpression: testForConditionalAncestor + }; + } + + return { + DoWhileStatement: testForAssign, + ForStatement: testForAssign, + IfStatement: testForAssign, + WhileStatement: testForAssign, + ConditionalExpression: testForAssign + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-confusing-arrow.js b/node_modules/eslint/lib/rules/no-confusing-arrow.js new file mode 100644 index 0000000..9009b64 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -0,0 +1,85 @@ +/** + * @fileoverview A rule to warn against using arrow functions when they could be + * confused with comparisons + * @author Jxck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a conditional expression. + * @param {ASTNode} node node to test + * @returns {boolean} `true` if the node is a conditional expression. + */ +function isConditional(node) { + return node && node.type === "ConditionalExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow arrow functions where they could be confused with comparisons", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-confusing-arrow" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + allowParens: { type: "boolean", default: true } + }, + additionalProperties: false + }], + + messages: { + confusing: "Arrow function used ambiguously with a conditional expression." + } + }, + + create(context) { + const config = context.options[0] || {}; + const allowParens = config.allowParens || (config.allowParens === void 0); + const sourceCode = context.getSourceCode(); + + + /** + * Reports if an arrow function contains an ambiguous conditional. + * @param {ASTNode} node A node to check and report. + * @returns {void} + */ + function checkArrowFunc(node) { + const body = node.body; + + if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) { + context.report({ + node, + messageId: "confusing", + fix(fixer) { + + // if `allowParens` is not set to true don't bother wrapping in parens + return allowParens && fixer.replaceText(node.body, `(${sourceCode.getText(node.body)})`); + } + }); + } + } + + return { + ArrowFunctionExpression: checkArrowFunc + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-console.js b/node_modules/eslint/lib/rules/no-console.js new file mode 100644 index 0000000..56dbbc3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-console.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Rule to flag use of console object + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `console`", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-console" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected console statement." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + /** + * Checks whether the given reference is 'console' or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is 'console'. + */ + function isConsole(reference) { + const id = reference.identifier; + + return id && id.name === "console"; + } + + /** + * Checks whether the property name of the given MemberExpression node + * is allowed by options or not. + * @param {ASTNode} node The MemberExpression node to check. + * @returns {boolean} `true` if the property name of the node is allowed. + */ + function isAllowed(node) { + const propertyName = astUtils.getStaticPropertyName(node); + + return propertyName && allowed.indexOf(propertyName) !== -1; + } + + /** + * Checks whether the given reference is a member access which is not + * allowed by options or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is a member access which + * is not allowed by options. + */ + function isMemberAccessExceptAllowed(reference) { + const node = reference.identifier; + const parent = node.parent; + + return ( + parent.type === "MemberExpression" && + parent.object === node && + !isAllowed(parent) + ); + } + + /** + * Reports the given reference as a violation. + * @param {eslint-scope.Reference} reference The reference to report. + * @returns {void} + */ + function report(reference) { + const node = reference.identifier.parent; + + context.report({ + node, + loc: node.loc, + messageId: "unexpected" + }); + } + + return { + "Program:exit"() { + const scope = context.getScope(); + const consoleVar = astUtils.getVariableByName(scope, "console"); + const shadowed = consoleVar && consoleVar.defs.length > 0; + + /* + * 'scope.through' includes all references to undefined + * variables. If the variable 'console' is not defined, it uses + * 'scope.through'. + */ + const references = consoleVar + ? consoleVar.references + : scope.through.filter(isConsole); + + if (!shadowed) { + references + .filter(isMemberAccessExceptAllowed) + .forEach(report); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-const-assign.js b/node_modules/eslint/lib/rules/no-const-assign.js new file mode 100644 index 0000000..e4ae891 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-const-assign.js @@ -0,0 +1,54 @@ +/** + * @fileoverview A rule to disallow modifying variables that are declared using `const` + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning `const` variables", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-const-assign" + }, + + schema: [], + + messages: { + const: "'{{name}}' is constant." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "const", data: { name: reference.identifier.name } }); + }); + } + + return { + VariableDeclaration(node) { + if (node.kind === "const") { + context.getDeclaredVariables(node).forEach(checkVariable); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-constant-condition.js b/node_modules/eslint/lib/rules/no-constant-condition.js new file mode 100644 index 0000000..5e58386 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constant-condition.js @@ -0,0 +1,253 @@ +/** + * @fileoverview Rule to flag use constant conditions + * @author Christian Schulz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const EQUALITY_OPERATORS = ["===", "!==", "==", "!="]; +const RELATIONAL_OPERATORS = [">", "<", ">=", "<=", "in", "instanceof"]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow constant expressions in conditions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-constant-condition" + }, + + schema: [ + { + type: "object", + properties: { + checkLoops: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected constant condition." + } + }, + + create(context) { + const options = context.options[0] || {}, + checkLoops = options.checkLoops !== false, + loopSetStack = []; + + let loopsInCurrentScope = new Set(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Checks if a branch node of LogicalExpression short circuits the whole condition + * @param {ASTNode} node The branch of main condition which needs to be checked + * @param {string} operator The operator of the main LogicalExpression. + * @returns {boolean} true when condition short circuits whole condition + */ + function isLogicalIdentity(node, operator) { + switch (node.type) { + case "Literal": + return (operator === "||" && node.value === true) || + (operator === "&&" && node.value === false); + + case "UnaryExpression": + return (operator === "&&" && node.operator === "void"); + + case "LogicalExpression": + return isLogicalIdentity(node.left, node.operator) || + isLogicalIdentity(node.right, node.operator); + + // no default + } + return false; + } + + /** + * Checks if a node has a constant truthiness value. + * @param {ASTNode} node The AST node to check. + * @param {boolean} inBooleanPosition `false` if checking branch of a condition. + * `true` in all other cases + * @returns {Bool} true when node's truthiness is constant + * @private + */ + function isConstant(node, inBooleanPosition) { + + // node.elements can return null values in the case of sparse arrays ex. [,] + if (!node) { + return true; + } + switch (node.type) { + case "Literal": + case "ArrowFunctionExpression": + case "FunctionExpression": + case "ObjectExpression": + return true; + case "TemplateLiteral": + return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) || + node.expressions.every(exp => isConstant(exp, inBooleanPosition)); + + case "ArrayExpression": { + if (node.parent.type === "BinaryExpression" && node.parent.operator === "+") { + return node.elements.every(element => isConstant(element, false)); + } + return true; + } + + case "UnaryExpression": + if (node.operator === "void") { + return true; + } + + return (node.operator === "typeof" && inBooleanPosition) || + isConstant(node.argument, true); + + case "BinaryExpression": + return isConstant(node.left, false) && + isConstant(node.right, false) && + node.operator !== "in"; + + case "LogicalExpression": { + const isLeftConstant = isConstant(node.left, inBooleanPosition); + const isRightConstant = isConstant(node.right, inBooleanPosition); + const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); + const isRightShortCircuit = (isRightConstant && isLogicalIdentity(node.right, node.operator)); + + return (isLeftConstant && isRightConstant) || + ( + + // in the case of an "OR", we need to know if the right constant value is truthy + node.operator === "||" && + isRightConstant && + node.right.value && + ( + !node.parent || + node.parent.type !== "BinaryExpression" || + !(EQUALITY_OPERATORS.includes(node.parent.operator) || RELATIONAL_OPERATORS.includes(node.parent.operator)) + ) + ) || + isLeftShortCircuit || + isRightShortCircuit; + } + + case "AssignmentExpression": + return (node.operator === "=") && isConstant(node.right, inBooleanPosition); + + case "SequenceExpression": + return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition); + + // no default + } + return false; + } + + /** + * Tracks when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function trackConstantConditionLoop(node) { + if (node.test && isConstant(node.test, true)) { + loopsInCurrentScope.add(node); + } + } + + /** + * Reports when the set contains the given constant condition node + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkConstantConditionLoopInSet(node) { + if (loopsInCurrentScope.has(node)) { + loopsInCurrentScope.delete(node); + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Reports when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function reportIfConstant(node) { + if (node.test && isConstant(node.test, true)) { + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Stores current set of constant loops in loopSetStack temporarily + * and uses a new set to track constant loops + * @returns {void} + * @private + */ + function enterFunction() { + loopSetStack.push(loopsInCurrentScope); + loopsInCurrentScope = new Set(); + } + + /** + * Reports when the set still contains stored constant conditions + * @returns {void} + * @private + */ + function exitFunction() { + loopsInCurrentScope = loopSetStack.pop(); + } + + /** + * Checks node when checkLoops option is enabled + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkLoop(node) { + if (checkLoops) { + trackConstantConditionLoop(node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression: reportIfConstant, + IfStatement: reportIfConstant, + WhileStatement: checkLoop, + "WhileStatement:exit": checkConstantConditionLoopInSet, + DoWhileStatement: checkLoop, + "DoWhileStatement:exit": checkConstantConditionLoopInSet, + ForStatement: checkLoop, + "ForStatement > .test": node => checkLoop(node.parent), + "ForStatement:exit": checkConstantConditionLoopInSet, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + YieldExpression: () => loopsInCurrentScope.clear() + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-constructor-return.js b/node_modules/eslint/lib/rules/no-constructor-return.js new file mode 100644 index 0000000..4757770 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constructor-return.js @@ -0,0 +1,62 @@ +/** + * @fileoverview Rule to disallow returning value from constructor. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning value from constructor", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-constructor-return" + }, + + schema: {}, + + fixable: null, + + messages: { + unexpected: "Unexpected return statement in constructor." + } + }, + + create(context) { + const stack = []; + + return { + onCodePathStart(_, node) { + stack.push(node); + }, + onCodePathEnd() { + stack.pop(); + }, + ReturnStatement(node) { + const last = stack[stack.length - 1]; + + if (!last.parent) { + return; + } + + if ( + last.parent.type === "MethodDefinition" && + last.parent.kind === "constructor" && + (node.parent.parent === last || node.argument) + ) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-continue.js b/node_modules/eslint/lib/rules/no-continue.js new file mode 100644 index 0000000..96718d1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-continue.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of continue statement + * @author Borislav Zhivkov + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `continue` statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-continue" + }, + + schema: [], + + messages: { + unexpected: "Unexpected use of continue statement." + } + }, + + create(context) { + + return { + ContinueStatement(node) { + context.report({ node, messageId: "unexpected" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-control-regex.js b/node_modules/eslint/lib/rules/no-control-regex.js new file mode 100644 index 0000000..146c4f2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-control-regex.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to forbid control characters from regular expressions. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const RegExpValidator = require("regexpp").RegExpValidator; +const collector = new (class { + constructor() { + this.ecmaVersion = 2018; + this._source = ""; + this._controlChars = []; + this._validator = new RegExpValidator(this); + } + + onPatternEnter() { + this._controlChars = []; + } + + onCharacter(start, end, cp) { + if (cp >= 0x00 && + cp <= 0x1F && + ( + this._source.codePointAt(start) === cp || + this._source.slice(start, end).startsWith("\\x") || + this._source.slice(start, end).startsWith("\\u") + ) + ) { + this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`); + } + } + + collectControlChars(regexpStr) { + try { + this._source = regexpStr; + this._validator.validatePattern(regexpStr); // Call onCharacter hook + } catch { + + // Ignore syntax errors in RegExp. + } + return this._controlChars; + } +})(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow control characters in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-control-regex" + }, + + schema: [], + + messages: { + unexpected: "Unexpected control character(s) in regular expression: {{controlChars}}." + } + }, + + create(context) { + + /** + * Get the regex expression + * @param {ASTNode} node node to evaluate + * @returns {RegExp|null} Regex if found else null + * @private + */ + function getRegExpPattern(node) { + if (node.regex) { + return node.regex.pattern; + } + if (typeof node.value === "string" && + (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") && + node.parent.callee.type === "Identifier" && + node.parent.callee.name === "RegExp" && + node.parent.arguments[0] === node + ) { + return node.value; + } + + return null; + } + + return { + Literal(node) { + const pattern = getRegExpPattern(node); + + if (pattern) { + const controlCharacters = collector.collectControlChars(pattern); + + if (controlCharacters.length > 0) { + context.report({ + node, + messageId: "unexpected", + data: { + controlChars: controlCharacters.join(", ") + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-debugger.js b/node_modules/eslint/lib/rules/no-debugger.js new file mode 100644 index 0000000..95a28a8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-debugger.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag use of a debugger statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of `debugger`", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-debugger" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Unexpected 'debugger' statement." + } + }, + + create(context) { + + return { + DebuggerStatement(node) { + context.report({ + node, + messageId: "unexpected" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-delete-var.js b/node_modules/eslint/lib/rules/no-delete-var.js new file mode 100644 index 0000000..aeab951 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-delete-var.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Rule to flag when deleting variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow deleting variables", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-delete-var" + }, + + schema: [], + + messages: { + unexpected: "Variables should not be deleted." + } + }, + + create(context) { + + return { + + UnaryExpression(node) { + if (node.operator === "delete" && node.argument.type === "Identifier") { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-div-regex.js b/node_modules/eslint/lib/rules/no-div-regex.js new file mode 100644 index 0000000..0ccabdc --- /dev/null +++ b/node_modules/eslint/lib/rules/no-div-regex.js @@ -0,0 +1,53 @@ +/** + * @fileoverview Rule to check for ambiguous div operator in regexes + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow division operators explicitly at the beginning of regular expressions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-div-regex" + }, + + fixable: "code", + + schema: [], + + messages: { + unexpected: "A regular expression literal can be confused with '/='." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && token.value[1] === "=") { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + return fixer.replaceTextRange([token.range[0] + 1, token.range[0] + 2], "[=]"); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-args.js b/node_modules/eslint/lib/rules/no-dupe-args.js new file mode 100644 index 0000000..817277f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-args.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag duplicate arguments + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate arguments in `function` definitions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-args" + }, + + schema: [], + + messages: { + unexpected: "Duplicate param '{{name}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether or not a given definition is a parameter's. + * @param {eslint-scope.DefEntry} def A definition to check. + * @returns {boolean} `true` if the definition is a parameter's. + */ + function isParameter(def) { + return def.type === "Parameter"; + } + + /** + * Determines if a given node has duplicate parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkParams(node) { + const variables = context.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Checks and reports duplications. + const defs = variable.defs.filter(isParameter); + + if (defs.length >= 2) { + context.report({ + node, + messageId: "unexpected", + data: { name: variable.name } + }); + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkParams, + FunctionExpression: checkParams + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-class-members.js b/node_modules/eslint/lib/rules/no-dupe-class-members.js new file mode 100644 index 0000000..b12939d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -0,0 +1,103 @@ +/** + * @fileoverview A rule to disallow duplicate name in class members. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate class members", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-class-members" + }, + + schema: [], + + messages: { + unexpected: "Duplicate name '{{name}}'." + } + }, + + create(context) { + let stack = []; + + /** + * Gets state of a given member name. + * @param {string} name A name of a member. + * @param {boolean} isStatic A flag which specifies that is a static member. + * @returns {Object} A state of a given member name. + * - retv.init {boolean} A flag which shows the name is declared as normal member. + * - retv.get {boolean} A flag which shows the name is declared as getter. + * - retv.set {boolean} A flag which shows the name is declared as setter. + */ + function getState(name, isStatic) { + const stateMap = stack[stack.length - 1]; + const key = `$${name}`; // to avoid "__proto__". + + if (!stateMap[key]) { + stateMap[key] = { + nonStatic: { init: false, get: false, set: false }, + static: { init: false, get: false, set: false } + }; + } + + return stateMap[key][isStatic ? "static" : "nonStatic"]; + } + + return { + + // Initializes the stack of state of member declarations. + Program() { + stack = []; + }, + + // Initializes state of member declarations for the class. + ClassBody() { + stack.push(Object.create(null)); + }, + + // Disposes the state for the class. + "ClassBody:exit"() { + stack.pop(); + }, + + // Reports the node if its name has been declared already. + MethodDefinition(node) { + const name = astUtils.getStaticPropertyName(node); + + if (name === null || node.kind === "constructor") { + return; + } + + const state = getState(name, node.static); + let isDuplicate = false; + + if (node.kind === "get") { + isDuplicate = (state.init || state.get); + state.get = true; + } else if (node.kind === "set") { + isDuplicate = (state.init || state.set); + state.set = true; + } else { + isDuplicate = (state.init || state.get || state.set); + state.init = true; + } + + if (isDuplicate) { + context.report({ node, messageId: "unexpected", data: { name } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-else-if.js b/node_modules/eslint/lib/rules/no-dupe-else-if.js new file mode 100644 index 0000000..cbeb437 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-else-if.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to disallow duplicate conditions in if-else-if chains + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the first given array is a subset of the second given array. + * @param {Function} comparator A function to compare two elements, should return `true` if they are equal. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {boolean} `true` if the array `arrA` is a subset of the array `arrB`. + */ +function isSubsetByComparator(comparator, arrA, arrB) { + return arrA.every(a => arrB.some(b => comparator(a, b))); +} + +/** + * Splits the given node by the given logical operator. + * @param {string} operator Logical operator `||` or `&&`. + * @param {ASTNode} node The node to split. + * @returns {ASTNode[]} Array of conditions that makes the node when joined by the operator. + */ +function splitByLogicalOperator(operator, node) { + if (node.type === "LogicalExpression" && node.operator === operator) { + return [...splitByLogicalOperator(operator, node.left), ...splitByLogicalOperator(operator, node.right)]; + } + return [node]; +} + +const splitByOr = splitByLogicalOperator.bind(null, "||"); +const splitByAnd = splitByLogicalOperator.bind(null, "&&"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate conditions in if-else-if chains", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-else-if" + }, + + schema: [], + + messages: { + unexpected: "This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes + * represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + if ( + a.type === "LogicalExpression" && + (a.operator === "||" || a.operator === "&&") && + a.operator === b.operator + ) { + return equal(a.left, b.left) && equal(a.right, b.right) || + equal(a.left, b.right) && equal(a.right, b.left); + } + + return astUtils.equalTokens(a, b, sourceCode); + } + + const isSubset = isSubsetByComparator.bind(null, equal); + + return { + IfStatement(node) { + const test = node.test, + conditionsToCheck = test.type === "LogicalExpression" && test.operator === "&&" + ? [test, ...splitByAnd(test)] + : [test]; + let current = node, + listToCheck = conditionsToCheck.map(c => splitByOr(c).map(splitByAnd)); + + while (current.parent && current.parent.type === "IfStatement" && current.parent.alternate === current) { + current = current.parent; + + const currentOrOperands = splitByOr(current.test).map(splitByAnd); + + listToCheck = listToCheck.map(orOperands => orOperands.filter( + orOperand => !currentOrOperands.some(currentOrOperand => isSubset(currentOrOperand, orOperand)) + )); + + if (listToCheck.some(orOperands => orOperands.length === 0)) { + context.report({ node: test, messageId: "unexpected" }); + break; + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-keys.js b/node_modules/eslint/lib/rules/no-dupe-keys.js new file mode 100644 index 0000000..89e1f2d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Rule to flag use of duplicate keys in an object. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const GET_KIND = /^(?:init|get)$/u; +const SET_KIND = /^(?:init|set)$/u; + +/** + * The class which stores properties' information of an object. + */ +class ObjectInfo { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ObjectInfo|null} upper The information of the outer object. + * @param {ASTNode} node The ObjectExpression node of this information. + */ + constructor(upper, node) { + this.upper = upper; + this.node = node; + this.properties = new Map(); + } + + /** + * Gets the information of the given Property node. + * @param {ASTNode} node The Property node to get. + * @returns {{get: boolean, set: boolean}} The information of the property. + */ + getPropertyInfo(node) { + const name = astUtils.getStaticPropertyName(node); + + if (!this.properties.has(name)) { + this.properties.set(name, { get: false, set: false }); + } + return this.properties.get(name); + } + + /** + * Checks whether the given property has been defined already or not. + * @param {ASTNode} node The Property node to check. + * @returns {boolean} `true` if the property has been defined. + */ + isPropertyDefined(node) { + const entry = this.getPropertyInfo(node); + + return ( + (GET_KIND.test(node.kind) && entry.get) || + (SET_KIND.test(node.kind) && entry.set) + ); + } + + /** + * Defines the given property. + * @param {ASTNode} node The Property node to define. + * @returns {void} + */ + defineProperty(node) { + const entry = this.getPropertyInfo(node); + + if (GET_KIND.test(node.kind)) { + entry.get = true; + } + if (SET_KIND.test(node.kind)) { + entry.set = true; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate keys in object literals", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-keys" + }, + + schema: [], + + messages: { + unexpected: "Duplicate key '{{name}}'." + } + }, + + create(context) { + let info = null; + + return { + ObjectExpression(node) { + info = new ObjectInfo(info, node); + }, + "ObjectExpression:exit"() { + info = info.upper; + }, + + Property(node) { + const name = astUtils.getStaticPropertyName(node); + + // Skip destructuring. + if (node.parent.type !== "ObjectExpression") { + return; + } + + // Skip if the name is not static. + if (name === null) { + return; + } + + // Reports if the name is defined already. + if (info.isPropertyDefined(node)) { + context.report({ + node: info.node, + loc: node.key.loc, + messageId: "unexpected", + data: { name } + }); + } + + // Update info. + info.defineProperty(node); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-duplicate-case.js b/node_modules/eslint/lib/rules/no-duplicate-case.js new file mode 100644 index 0000000..e2d9665 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to disallow a duplicate case label. + * @author Dieter Oberkofler + * @author Burak Yigit Kaya + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate case labels", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-duplicate-case" + }, + + schema: [], + + messages: { + unexpected: "Duplicate case label." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether the two given nodes are considered to be equal. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + return astUtils.equalTokens(a, b, sourceCode); + } + return { + SwitchStatement(node) { + const previousTests = []; + + for (const switchCase of node.cases) { + if (switchCase.test) { + const test = switchCase.test; + + if (previousTests.some(previousTest => equal(previousTest, test))) { + context.report({ node: switchCase, messageId: "unexpected" }); + } else { + previousTests.push(test); + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-duplicate-imports.js b/node_modules/eslint/lib/rules/no-duplicate-imports.js new file mode 100644 index 0000000..7218dc6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Restrict usage of duplicate imports. + * @author Simen Bekkhus + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the name of the module imported or re-exported. + * @param {ASTNode} node A node to get. + * @returns {string} the name of the module, or empty string if no name. + */ +function getValue(node) { + if (node && node.source && node.source.value) { + return node.source.value.trim(); + } + + return ""; +} + +/** + * Checks if the name of the import or export exists in the given array, and reports if so. + * @param {RuleContext} context The ESLint rule context object. + * @param {ASTNode} node A node to get. + * @param {string} value The name of the imported or exported module. + * @param {string[]} array The array containing other imports or exports in the file. + * @param {string} messageId A messageId to be reported after the name of the module + * + * @returns {void} No return value + */ +function checkAndReport(context, node, value, array, messageId) { + if (array.indexOf(value) !== -1) { + context.report({ + node, + messageId, + data: { + module: value + } + }); + } +} + +/** + * @callback nodeCallback + * @param {ASTNode} node A node to handle. + */ + +/** + * Returns a function handling the imports of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleImports(context, includeExports, importsInFile, exportsInFile) { + return function(node) { + const value = getValue(node); + + if (value) { + checkAndReport(context, node, value, importsInFile, "import"); + + if (includeExports) { + checkAndReport(context, node, value, exportsInFile, "importAs"); + } + + importsInFile.push(value); + } + }; +} + +/** + * Returns a function handling the exports of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleExports(context, importsInFile, exportsInFile) { + return function(node) { + const value = getValue(node); + + if (value) { + checkAndReport(context, node, value, exportsInFile, "export"); + checkAndReport(context, node, value, importsInFile, "exportAs"); + + exportsInFile.push(value); + } + }; +} + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate module imports", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-duplicate-imports" + }, + + schema: [{ + type: "object", + properties: { + includeExports: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + messages: { + import: "'{{module}}' import is duplicated.", + importAs: "'{{module}}' import is duplicated as export.", + export: "'{{module}}' export is duplicated.", + exportAs: "'{{module}}' export is duplicated as import." + } + }, + + create(context) { + const includeExports = (context.options[0] || {}).includeExports, + importsInFile = [], + exportsInFile = []; + + const handlers = { + ImportDeclaration: handleImports(context, includeExports, importsInFile, exportsInFile) + }; + + if (includeExports) { + handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile); + handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile); + } + + return handlers; + } +}; diff --git a/node_modules/eslint/lib/rules/no-else-return.js b/node_modules/eslint/lib/rules/no-else-return.js new file mode 100644 index 0000000..84409fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-else-return.js @@ -0,0 +1,404 @@ +/** + * @fileoverview Rule to flag `else` after a `return` in `if` + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `else` blocks after `return` statements in `if` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-else-return" + }, + + schema: [{ + type: "object", + properties: { + allowElseIf: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], + + fixable: "code", + + messages: { + unexpected: "Unnecessary 'else' after 'return'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether the given names can be safely used to declare block-scoped variables + * in the given scope. Name collisions can produce redeclaration syntax errors, + * or silently change references and modify behavior of the original code. + * + * This is not a generic function. In particular, it is assumed that the scope is a function scope or + * a function's inner scope, and that the names can be valid identifiers in the given scope. + * @param {string[]} names Array of variable names. + * @param {eslint-scope.Scope} scope Function scope or a function's inner scope. + * @returns {boolean} True if all names can be safely declared, false otherwise. + */ + function isSafeToDeclare(names, scope) { + + if (names.length === 0) { + return true; + } + + const functionScope = scope.variableScope; + + /* + * If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments", + * all function-scoped variables ('var'), and block-scoped variables defined in the scope. + * If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope. + * + * Redeclaring any of these would cause a syntax error, except for the implicit variables. + */ + const declaredVariables = scope.variables.filter(({ defs }) => defs.length > 0); + + if (declaredVariables.some(({ name }) => names.includes(name))) { + return false; + } + + // Redeclaring a catch variable would also cause a syntax error. + if (scope !== functionScope && scope.upper.type === "catch") { + if (scope.upper.variables.some(({ name }) => names.includes(name))) { + return false; + } + } + + /* + * Redeclaring an implicit variable, such as "arguments", would not cause a syntax error. + * However, if the variable was used, declaring a new one with the same name would change references + * and modify behavior. + */ + const usedImplicitVariables = scope.variables.filter(({ defs, references }) => + defs.length === 0 && references.length > 0); + + if (usedImplicitVariables.some(({ name }) => names.includes(name))) { + return false; + } + + /* + * Declaring a variable with a name that was already used to reference a variable from an upper scope + * would change references and modify behavior. + */ + if (scope.through.some(t => names.includes(t.identifier.name))) { + return false; + } + + /* + * If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside + * the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope. + * + * For example, this would be a syntax error "Identifier 'a' has already been declared": + * function foo() { if (bar) { let a; if (baz) { var a; } } } + */ + if (scope !== functionScope) { + const scopeNodeRange = scope.block.range; + const variablesToCheck = functionScope.variables.filter(({ name }) => names.includes(name)); + + if (variablesToCheck.some(v => v.defs.some(({ node: { range } }) => + scopeNodeRange[0] <= range[0] && range[1] <= scopeNodeRange[1]))) { + return false; + } + } + + return true; + } + + + /** + * Checks whether the removal of `else` and its braces is safe from variable name collisions. + * @param {Node} node The 'else' node. + * @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is. + * @returns {boolean} True if it is safe, false otherwise. + */ + function isSafeFromNameCollisions(node, scope) { + + if (node.type === "FunctionDeclaration") { + + // Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently. + return false; + } + + if (node.type !== "BlockStatement") { + return true; + } + + const elseBlockScope = scope.childScopes.find(({ block }) => block === node); + + if (!elseBlockScope) { + + // ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions. + return true; + } + + /* + * elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains + * only block-scoped variables (such as let and const variables or class and function declarations) + * defined directly in the elseBlockScope. These are exactly the only names that could cause collisions. + */ + const namesToCheck = elseBlockScope.variables.map(({ name }) => name); + + return isSafeToDeclare(namesToCheck, scope); + } + + /** + * Display the context report if rule is violated + * @param {Node} node The 'else' node + * @returns {void} + */ + function displayReport(node) { + const currentScope = context.getScope(); + + context.report({ + node, + messageId: "unexpected", + fix: fixer => { + + if (!isSafeFromNameCollisions(node, currentScope)) { + return null; + } + + const sourceCode = context.getSourceCode(); + const startToken = sourceCode.getFirstToken(node); + const elseToken = sourceCode.getTokenBefore(startToken); + const source = sourceCode.getText(node); + const lastIfToken = sourceCode.getTokenBefore(elseToken); + let fixedSource, firstTokenOfElseBlock; + + if (startToken.type === "Punctuator" && startToken.value === "{") { + firstTokenOfElseBlock = sourceCode.getTokenAfter(startToken); + } else { + firstTokenOfElseBlock = startToken; + } + + /* + * If the if block does not have curly braces and does not end in a semicolon + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else keyword, because ASI will not add a semicolon + * after the if block + */ + const ifBlockMaybeUnsafe = node.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; + const elseBlockUnsafe = /^[([/+`-]/u.test(firstTokenOfElseBlock.value); + + if (ifBlockMaybeUnsafe && elseBlockUnsafe) { + return null; + } + + const endToken = sourceCode.getLastToken(node); + const lastTokenOfElseBlock = sourceCode.getTokenBefore(endToken); + + if (lastTokenOfElseBlock.value !== ";") { + const nextToken = sourceCode.getTokenAfter(endToken); + + const nextTokenUnsafe = nextToken && /^[([/+`-]/u.test(nextToken.value); + const nextTokenOnSameLine = nextToken && nextToken.loc.start.line === lastTokenOfElseBlock.loc.start.line; + + /* + * If the else block contents does not end in a semicolon, + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else block, because ASI will not add a semicolon + * after the remaining else block contents + */ + if (nextTokenUnsafe || (nextTokenOnSameLine && nextToken.value !== "}")) { + return null; + } + } + + if (startToken.type === "Punctuator" && startToken.value === "{") { + fixedSource = source.slice(1, -1); + } else { + fixedSource = source; + } + + /* + * Extend the replacement range to include the entire + * function to avoid conflicting with no-useless-return. + * https://github.com/eslint/eslint/issues/8026 + * + * Also, to avoid name collisions between two else blocks. + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .replaceTextRange([elseToken.range[0], node.range[1]], fixedSource); + } + }); + } + + /** + * Check to see if the node is a ReturnStatement + * @param {Node} node The node being evaluated + * @returns {boolean} True if node is a return + */ + function checkForReturn(node) { + return node.type === "ReturnStatement"; + } + + /** + * Naive return checking, does not iterate through the whole + * BlockStatement because we make the assumption that the ReturnStatement + * will be the last node in the body of the BlockStatement. + * @param {Node} node The consequent/alternate node + * @returns {boolean} True if it has a return + */ + function naiveHasReturn(node) { + if (node.type === "BlockStatement") { + const body = node.body, + lastChildNode = body[body.length - 1]; + + return lastChildNode && checkForReturn(lastChildNode); + } + return checkForReturn(node); + } + + /** + * Check to see if the node is valid for evaluation, + * meaning it has an else. + * @param {Node} node The node being evaluated + * @returns {boolean} True if the node is valid + */ + function hasElse(node) { + return node.alternate && node.consequent; + } + + /** + * If the consequent is an IfStatement, check to see if it has an else + * and both its consequent and alternate path return, meaning this is + * a nested case of rule violation. If-Else not considered currently. + * @param {Node} node The consequent node + * @returns {boolean} True if this is a nested rule violation + */ + function checkForIf(node) { + return node.type === "IfStatement" && hasElse(node) && + naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent); + } + + /** + * Check the consequent/body node to make sure it is not + * a ReturnStatement or an IfStatement that returns on both + * code paths. + * @param {Node} node The consequent or body node + * @returns {boolean} `true` if it is a Return/If node that always returns. + */ + function checkForReturnOrIf(node) { + return checkForReturn(node) || checkForIf(node); + } + + + /** + * Check whether a node returns in every codepath. + * @param {Node} node The node to be checked + * @returns {boolean} `true` if it returns on every codepath. + */ + function alwaysReturns(node) { + if (node.type === "BlockStatement") { + + // If we have a BlockStatement, check each consequent body node. + return node.body.some(checkForReturnOrIf); + } + + /* + * If not a block statement, make sure the consequent isn't a + * ReturnStatement or an IfStatement with returns on both paths. + */ + return checkForReturnOrIf(node); + } + + + /** + * Check the if statement, but don't catch else-if blocks. + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithoutElse(node) { + const parent = node.parent; + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const consequents = []; + let alternate; + + for (let currentNode = node; currentNode.type === "IfStatement"; currentNode = currentNode.alternate) { + if (!currentNode.alternate) { + return; + } + consequents.push(currentNode.consequent); + alternate = currentNode.alternate; + } + + if (consequents.every(alwaysReturns)) { + displayReport(alternate); + } + } + + /** + * Check the if statement + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithElse(node) { + const parent = node.parent; + + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const alternate = node.alternate; + + if (alternate && alwaysReturns(node.consequent)) { + displayReport(alternate); + } + } + + const allowElseIf = !(context.options[0] && context.options[0].allowElseIf === false); + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "IfStatement:exit": allowElseIf ? checkIfWithoutElse : checkIfWithElse + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-character-class.js b/node_modules/eslint/lib/rules/no-empty-character-class.js new file mode 100644 index 0000000..7dc219f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-character-class.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag the use of empty character classes in regular expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* + * plain-English description of the following regexp: + * 0. `^` fix the match at the beginning of the string + * 1. `\/`: the `/` that begins the regexp + * 2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following + * 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) + * 2.1. `\\.`: an escape sequence + * 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty + * 3. `\/` the `/` that ends the regexp + * 4. `[gimuy]*`: optional regexp flags + * 5. `$`: fix the match at the end of the string + */ +const regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow empty character classes in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty-character-class" + }, + + schema: [], + + messages: { + unexpected: "Empty class." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && !regex.test(token.value)) { + context.report({ node, messageId: "unexpected" }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-function.js b/node_modules/eslint/lib/rules/no-empty-function.js new file mode 100644 index 0000000..c512f8c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-function.js @@ -0,0 +1,167 @@ +/** + * @fileoverview Rule to disallow empty functions. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ALLOW_OPTIONS = Object.freeze([ + "functions", + "arrowFunctions", + "generatorFunctions", + "methods", + "generatorMethods", + "getters", + "setters", + "constructors", + "asyncFunctions", + "asyncMethods" +]); + +/** + * Gets the kind of a given function node. + * @param {ASTNode} node A function node to get. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {string} The kind of the function. This is one of "functions", + * "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods", + * "generatorMethods", "asyncMethods", "getters", "setters", and + * "constructors". + */ +function getKind(node) { + const parent = node.parent; + let kind = ""; + + if (node.type === "ArrowFunctionExpression") { + return "arrowFunctions"; + } + + // Detects main kind. + if (parent.type === "Property") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + kind = parent.method ? "methods" : "functions"; + + } else if (parent.type === "MethodDefinition") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + if (parent.kind === "constructor") { + return "constructors"; + } + kind = "methods"; + + } else { + kind = "functions"; + } + + // Detects prefix. + let prefix = ""; + + if (node.generator) { + prefix = "generator"; + } else if (node.async) { + prefix = "async"; + } else { + return kind; + } + return prefix + kind[0].toUpperCase() + kind.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow empty functions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-empty-function" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { enum: ALLOW_OPTIONS }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected empty {{name}}." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + const sourceCode = context.getSourceCode(); + + /** + * Reports a given function node if the node matches the following patterns. + * + * - Not allowed by options. + * - The body is empty. + * - The body doesn't have any comments. + * @param {ASTNode} node A function node to report. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {void} + */ + function reportIfEmpty(node) { + const kind = getKind(node); + const name = astUtils.getFunctionNameWithKind(node); + const innerComments = sourceCode.getTokens(node.body, { + includeComments: true, + filter: astUtils.isCommentToken + }); + + if (allowed.indexOf(kind) === -1 && + node.body.type === "BlockStatement" && + node.body.body.length === 0 && + innerComments.length === 0 + ) { + context.report({ + node, + loc: node.body.loc, + messageId: "unexpected", + data: { name } + }); + } + } + + return { + ArrowFunctionExpression: reportIfEmpty, + FunctionDeclaration: reportIfEmpty, + FunctionExpression: reportIfEmpty + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-pattern.js b/node_modules/eslint/lib/rules/no-empty-pattern.js new file mode 100644 index 0000000..9f34bfd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-pattern.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to disallow an empty pattern + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow empty destructuring patterns", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty-pattern" + }, + + schema: [], + + messages: { + unexpected: "Unexpected empty {{type}} pattern." + } + }, + + create(context) { + return { + ObjectPattern(node) { + if (node.properties.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "object" } }); + } + }, + ArrayPattern(node) { + if (node.elements.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "array" } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty.js b/node_modules/eslint/lib/rules/no-empty.js new file mode 100644 index 0000000..45bf03c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty.js @@ -0,0 +1,86 @@ +/** + * @fileoverview Rule to flag use of an empty block statement + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow empty block statements", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty" + }, + + schema: [ + { + type: "object", + properties: { + allowEmptyCatch: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Empty {{type}} statement." + } + }, + + create(context) { + const options = context.options[0] || {}, + allowEmptyCatch = options.allowEmptyCatch || false; + + const sourceCode = context.getSourceCode(); + + return { + BlockStatement(node) { + + // if the body is not empty, we can just return immediately + if (node.body.length !== 0) { + return; + } + + // a function is generally allowed to be empty + if (astUtils.isFunction(node.parent)) { + return; + } + + if (allowEmptyCatch && node.parent.type === "CatchClause") { + return; + } + + // any other block is only allowed to be empty, if it contains a comment + if (sourceCode.getCommentsInside(node).length > 0) { + return; + } + + context.report({ node, messageId: "unexpected", data: { type: "block" } }); + }, + + SwitchStatement(node) { + + if (typeof node.cases === "undefined" || node.cases.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "switch" } }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-eq-null.js b/node_modules/eslint/lib/rules/no-eq-null.js new file mode 100644 index 0000000..b8dead9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-eq-null.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag comparisons to null without a type-checking + * operator. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `null` comparisons without type-checking operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-eq-null" + }, + + schema: [], + + messages: { + unexpected: "Use '===' to compare with null." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + const badOperator = node.operator === "==" || node.operator === "!="; + + if (node.right.type === "Literal" && node.right.raw === "null" && badOperator || + node.left.type === "Literal" && node.left.raw === "null" && badOperator) { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-eval.js b/node_modules/eslint/lib/rules/no-eval.js new file mode 100644 index 0000000..a020fde --- /dev/null +++ b/node_modules/eslint/lib/rules/no-eval.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to flag use of eval() statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const candidatesOfGlobalObject = Object.freeze([ + "global", + "window", + "globalThis" +]); + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isMember(node, name) { + return astUtils.isSpecificMemberAccess(node, null, name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `eval()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-eval" + }, + + schema: [ + { + type: "object", + properties: { + allowIndirect: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "eval can be harmful." + } + }, + + create(context) { + const allowIndirect = Boolean( + context.options[0] && + context.options[0].allowIndirect + ); + const sourceCode = context.getSourceCode(); + let funcInfo = null; + + /** + * Pushs a variable scope (Program or Function) information to the stack. + * + * This is used in order to check whether or not `this` binding is a + * reference to the global object. + * @param {ASTNode} node A node of the scope. This is one of Program, + * FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. + * @returns {void} + */ + function enterVarScope(node) { + const strict = context.getScope().isStrict; + + funcInfo = { + upper: funcInfo, + node, + strict, + defaultThis: false, + initialized: strict + }; + } + + /** + * Pops a variable scope from the stack. + * @returns {void} + */ + function exitVarScope() { + funcInfo = funcInfo.upper; + } + + /** + * Reports a given node. + * + * `node` is `Identifier` or `MemberExpression`. + * The parent of `node` might be `CallExpression`. + * + * The location of the report is always `eval` `Identifier` (or possibly + * `Literal`). The type of the report is `CallExpression` if the parent is + * `CallExpression`. Otherwise, it's the given node type. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function report(node) { + const parent = node.parent; + const locationNode = node.type === "MemberExpression" + ? node.property + : node; + + const reportNode = parent.type === "CallExpression" && parent.callee === node + ? parent + : node; + + context.report({ + node: reportNode, + loc: locationNode.loc, + messageId: "unexpected" + }); + } + + /** + * Reports accesses of `eval` via the global object. + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEvalViaGlobalObject(globalScope) { + for (let i = 0; i < candidatesOfGlobalObject.length; ++i) { + const name = candidatesOfGlobalObject[i]; + const variable = astUtils.getVariableByName(globalScope, name); + + if (!variable) { + continue; + } + + const references = variable.references; + + for (let j = 0; j < references.length; ++j) { + const identifier = references[j].identifier; + let node = identifier.parent; + + // To detect code like `window.window.eval`. + while (isMember(node, name)) { + node = node.parent; + } + + // Reports. + if (isMember(node, "eval")) { + report(node); + } + } + } + } + + /** + * Reports all accesses of `eval` (excludes direct calls to eval). + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEval(globalScope) { + const variable = astUtils.getVariableByName(globalScope, "eval"); + + if (!variable) { + return; + } + + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + const id = reference.identifier; + + if (id.name === "eval" && !astUtils.isCallee(id)) { + + // Is accessing to eval (excludes direct calls to eval) + report(id); + } + } + } + + if (allowIndirect) { + + // Checks only direct calls to eval. It's simple! + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + /* + * Optional call (`eval?.("code")`) is not direct eval. + * The direct eval is only step 6.a.vi of https://tc39.es/ecma262/#sec-function-calls-runtime-semantics-evaluation + * But the optional call is https://tc39.es/ecma262/#sec-optional-chaining-chain-evaluation + */ + if (!node.optional && astUtils.isSpecificId(callee, "eval")) { + report(callee); + } + } + }; + } + + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + if (astUtils.isSpecificId(callee, "eval")) { + report(callee); + } + }, + + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}, + strict = + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict); + + funcInfo = { + upper: null, + node, + strict, + defaultThis: true, + initialized: true + }; + }, + + "Program:exit"() { + const globalScope = context.getScope(); + + exitVarScope(); + reportAccessingEval(globalScope); + reportAccessingEvalViaGlobalObject(globalScope); + }, + + FunctionDeclaration: enterVarScope, + "FunctionDeclaration:exit": exitVarScope, + FunctionExpression: enterVarScope, + "FunctionExpression:exit": exitVarScope, + ArrowFunctionExpression: enterVarScope, + "ArrowFunctionExpression:exit": exitVarScope, + + ThisExpression(node) { + if (!isMember(node.parent, "eval")) { + return; + } + + /* + * `this.eval` is found. + * Checks whether or not the value of `this` is the global object. + */ + if (!funcInfo.initialized) { + funcInfo.initialized = true; + funcInfo.defaultThis = astUtils.isDefaultThisBinding( + funcInfo.node, + sourceCode + ); + } + + if (!funcInfo.strict && funcInfo.defaultThis) { + + // `this.eval` is possible built-in `eval`. + report(node.parent); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-ex-assign.js b/node_modules/eslint/lib/rules/no-ex-assign.js new file mode 100644 index 0000000..1163920 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-ex-assign.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag assignment of the exception parameter + * @author Stephen Murray + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning exceptions in `catch` clauses", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-ex-assign" + }, + + schema: [], + + messages: { + unexpected: "Do not assign to the exception parameter." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "unexpected" }); + }); + } + + return { + CatchClause(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extend-native.js b/node_modules/eslint/lib/rules/no-extend-native.js new file mode 100644 index 0000000..db365b5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extend-native.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Rule to flag adding properties to native object's prototypes. + * @author David Nelson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const globals = require("globals"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow extending native types", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extend-native" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "{{builtin}} prototype is read only, properties should not be added." + } + }, + + create(context) { + + const config = context.options[0] || {}; + const exceptions = new Set(config.exceptions || []); + const modifiedBuiltins = new Set( + Object.keys(globals.builtin) + .filter(builtin => builtin[0].toUpperCase() === builtin[0]) + .filter(builtin => !exceptions.has(builtin)) + ); + + /** + * Reports a lint error for the given node. + * @param {ASTNode} node The node to report. + * @param {string} builtin The name of the native builtin being extended. + * @returns {void} + */ + function reportNode(node, builtin) { + context.report({ + node, + messageId: "unexpected", + data: { + builtin + } + }); + } + + /** + * Check to see if the `prototype` property of the given object + * identifier node is being accessed. + * @param {ASTNode} identifierNode The Identifier representing the object + * to check. + * @returns {boolean} True if the identifier is the object of a + * MemberExpression and its `prototype` property is being accessed, + * false otherwise. + */ + function isPrototypePropertyAccessed(identifierNode) { + return Boolean( + identifierNode && + identifierNode.parent && + identifierNode.parent.type === "MemberExpression" && + identifierNode.parent.object === identifierNode && + astUtils.getStaticPropertyName(identifierNode.parent) === "prototype" + ); + } + + /** + * Check if it's an assignment to the property of the given node. + * Example: `*.prop = 0` // the `*` is the given node. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if an assignment to the property of the node. + */ + function isAssigningToPropertyOf(node) { + return ( + node.parent.type === "MemberExpression" && + node.parent.object === node && + node.parent.parent.type === "AssignmentExpression" && + node.parent.parent.left === node.parent + ); + } + + /** + * Checks if the given node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`. + */ + function isInDefinePropertyCall(node) { + return ( + node.parent.type === "CallExpression" && + node.parent.arguments[0] === node && + astUtils.isSpecificMemberAccess(node.parent.callee, "Object", /^definePropert(?:y|ies)$/u) + ); + } + + /** + * Check to see if object prototype access is part of a prototype + * extension. There are three ways a prototype can be extended: + * 1. Assignment to prototype property (Object.prototype.foo = 1) + * 2. Object.defineProperty()/Object.defineProperties() on a prototype + * If prototype extension is detected, report the AssignmentExpression + * or CallExpression node. + * @param {ASTNode} identifierNode The Identifier representing the object + * which prototype is being accessed and possibly extended. + * @returns {void} + */ + function checkAndReportPrototypeExtension(identifierNode) { + if (!isPrototypePropertyAccessed(identifierNode)) { + return; // This is not `*.prototype` access. + } + + /* + * `identifierNode.parent` is a MamberExpression `*.prototype`. + * If it's an optional member access, it may be wrapped by a `ChainExpression` node. + */ + const prototypeNode = + identifierNode.parent.parent.type === "ChainExpression" + ? identifierNode.parent.parent + : identifierNode.parent; + + if (isAssigningToPropertyOf(prototypeNode)) { + + // `*.prototype` -> MemberExpression -> AssignmentExpression + reportNode(prototypeNode.parent.parent, identifierNode.name); + } else if (isInDefinePropertyCall(prototypeNode)) { + + // `*.prototype` -> CallExpression + reportNode(prototypeNode.parent, identifierNode.name); + } + } + + return { + + "Program:exit"() { + const globalScope = context.getScope(); + + modifiedBuiltins.forEach(builtin => { + const builtinVar = globalScope.set.get(builtin); + + if (builtinVar && builtinVar.references) { + builtinVar.references + .map(ref => ref.identifier) + .forEach(checkAndReportPrototypeExtension); + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-bind.js b/node_modules/eslint/lib/rules/no-extra-bind.js new file mode 100644 index 0000000..2db440d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-bind.js @@ -0,0 +1,213 @@ +/** + * @fileoverview Rule to flag unnecessary bind calls + * @author Bence Dányi + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary calls to `.bind()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-bind" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "The function binding is unnecessary." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Checks if a node is free of side effects. + * + * This check is stricter than it needs to be, in order to keep the implementation simple. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is known to be side-effect free, false otherwise. + */ + function isSideEffectFree(node) { + return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type); + } + + /** + * Reports a given function node. + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {void} + */ + function report(node) { + const memberNode = node.parent; + const callNode = memberNode.parent.type === "ChainExpression" + ? memberNode.parent.parent + : memberNode.parent; + + context.report({ + node: callNode, + messageId: "unexpected", + loc: memberNode.property.loc, + + fix(fixer) { + if (!isSideEffectFree(callNode.arguments[0])) { + return null; + } + + /* + * The list of the first/last token pair of a removal range. + * This is two parts because closing parentheses may exist between the method name and arguments. + * E.g. `(function(){}.bind ) (obj)` + * ^^^^^ ^^^^^ < removal ranges + * E.g. `(function(){}?.['bind'] ) ?.(obj)` + * ^^^^^^^^^^ ^^^^^^^ < removal ranges + */ + const tokenPairs = [ + [ + + // `.`, `?.`, or `[` token. + sourceCode.getTokenAfter( + memberNode.object, + astUtils.isNotClosingParenToken + ), + + // property name or `]` token. + sourceCode.getLastToken(memberNode) + ], + [ + + // `?.` or `(` token of arguments. + sourceCode.getTokenAfter( + memberNode, + astUtils.isNotClosingParenToken + ), + + // `)` token of arguments. + sourceCode.getLastToken(callNode) + ] + ]; + const firstTokenToRemove = tokenPairs[0][0]; + const lastTokenToRemove = tokenPairs[1][1]; + + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return null; + } + + return tokenPairs.map(([start, end]) => + fixer.removeRange([start.range[0], end.range[1]])); + } + }); + } + + /** + * Checks whether or not a given function node is the callee of `.bind()` + * method. + * + * e.g. `(function() {}.bind(foo))` + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {boolean} `true` if the node is the callee of `.bind()` method. + */ + function isCalleeOfBindMethod(node) { + if (!astUtils.isSpecificMemberAccess(node.parent, null, "bind")) { + return false; + } + + // The node of `*.bind` member access. + const bindNode = node.parent.parent.type === "ChainExpression" + ? node.parent.parent + : node.parent; + + return ( + bindNode.parent.type === "CallExpression" && + bindNode.parent.callee === bindNode && + bindNode.parent.arguments.length === 1 && + bindNode.parent.arguments[0].type !== "SpreadElement" + ); + } + + /** + * Adds a scope information object to the stack. + * @param {ASTNode} node A node to add. This node is a FunctionExpression + * or a FunctionDeclaration node. + * @returns {void} + */ + function enterFunction(node) { + scopeInfo = { + isBound: isCalleeOfBindMethod(node), + thisFound: false, + upper: scopeInfo + }; + } + + /** + * Removes the scope information object from the top of the stack. + * At the same time, this reports the function node if the function has + * `.bind()` and the `this` keywords found. + * @param {ASTNode} node A node to remove. This node is a + * FunctionExpression or a FunctionDeclaration node. + * @returns {void} + */ + function exitFunction(node) { + if (scopeInfo.isBound && !scopeInfo.thisFound) { + report(node); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Reports a given arrow function if the function is callee of `.bind()` + * method. + * @param {ASTNode} node A node to report. This node is an + * ArrowFunctionExpression. + * @returns {void} + */ + function exitArrowFunction(node) { + if (isCalleeOfBindMethod(node)) { + report(node); + } + } + + /** + * Set the mark as the `this` keyword was found in this scope. + * @returns {void} + */ + function markAsThisFound() { + if (scopeInfo) { + scopeInfo.thisFound = true; + } + } + + return { + "ArrowFunctionExpression:exit": exitArrowFunction, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markAsThisFound + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js new file mode 100644 index 0000000..6ae3ea6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js @@ -0,0 +1,316 @@ +/** + * @fileoverview Rule to flag unnecessary double negation in Boolean contexts + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("eslint-utils"); + +const precedence = astUtils.getPrecedence; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary boolean casts", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-extra-boolean-cast" + }, + + schema: [{ + type: "object", + properties: { + enforceForLogicalOperands: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unexpectedCall: "Redundant Boolean call.", + unexpectedNegation: "Redundant double negation." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + // Node types which have a test which will coerce values to booleans. + const BOOLEAN_NODE_TYPES = [ + "IfStatement", + "DoWhileStatement", + "WhileStatement", + "ConditionalExpression", + "ForStatement" + ]; + + /** + * Check if a node is a Boolean function or constructor. + * @param {ASTNode} node the node + * @returns {boolean} If the node is Boolean function or constructor + */ + function isBooleanFunctionOrConstructorCall(node) { + + // Boolean() and new Boolean() + return (node.type === "CallExpression" || node.type === "NewExpression") && + node.callee.type === "Identifier" && + node.callee.name === "Boolean"; + } + + /** + * Checks whether the node is a logical expression and that the option is enabled + * @param {ASTNode} node the node + * @returns {boolean} if the node is a logical expression and option is enabled + */ + function isLogicalContext(node) { + return node.type === "LogicalExpression" && + (node.operator === "||" || node.operator === "&&") && + (context.options.length && context.options[0].enforceForLogicalOperands === true); + + } + + + /** + * Check if a node is in a context where its value would be coerced to a boolean at runtime. + * @param {ASTNode} node The node + * @returns {boolean} If it is in a boolean context + */ + function isInBooleanContext(node) { + return ( + (isBooleanFunctionOrConstructorCall(node.parent) && + node === node.parent.arguments[0]) || + + (BOOLEAN_NODE_TYPES.indexOf(node.parent.type) !== -1 && + node === node.parent.test) || + + // ! + (node.parent.type === "UnaryExpression" && + node.parent.operator === "!") + ); + } + + /** + * Checks whether the node is a context that should report an error + * Acts recursively if it is in a logical context + * @param {ASTNode} node the node + * @returns {boolean} If the node is in one of the flagged contexts + */ + function isInFlaggedContext(node) { + if (node.parent.type === "ChainExpression") { + return isInFlaggedContext(node.parent); + } + + return isInBooleanContext(node) || + (isLogicalContext(node.parent) && + + // For nested logical statements + isInFlaggedContext(node.parent) + ); + } + + + /** + * Check if a node has comments inside. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if it has comments inside. + */ + function hasCommentsInside(node) { + return Boolean(sourceCode.getCommentsInside(node).length); + } + + /** + * Checks if the given node is wrapped in grouping parentheses. Parentheses for constructs such as if() don't count. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is parenthesized. + * @private + */ + function isParenthesized(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Determines whether the given node needs to be parenthesized when replacing the previous node. + * It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list + * of possible parent node types. By the same assumption, the node's role in a particular parent is already known. + * For example, if the parent is `ConditionalExpression`, `previousNode` must be its `test` child. + * @param {ASTNode} previousNode Previous node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node needs to be parenthesized. + */ + function needsParens(previousNode, node) { + if (previousNode.parent.type === "ChainExpression") { + return needsParens(previousNode.parent, node); + } + if (isParenthesized(previousNode)) { + + // parentheses around the previous node will stay, so there is no need for an additional pair + return false; + } + + // parent of the previous node will become parent of the replacement node + const parent = previousNode.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + return node.type === "SequenceExpression"; + case "IfStatement": + case "DoWhileStatement": + case "WhileStatement": + case "ForStatement": + return false; + case "ConditionalExpression": + return precedence(node) <= precedence(parent); + case "UnaryExpression": + return precedence(node) < precedence(parent); + case "LogicalExpression": + if (astUtils.isMixedLogicalAndCoalesceExpressions(node, parent)) { + return true; + } + if (previousNode === parent.left) { + return precedence(node) < precedence(parent); + } + return precedence(node) <= precedence(parent); + + /* istanbul ignore next */ + default: + throw new Error(`Unexpected parent type: ${parent.type}`); + } + } + + return { + UnaryExpression(node) { + const parent = node.parent; + + + // Exit early if it's guaranteed not to match + if (node.operator !== "!" || + parent.type !== "UnaryExpression" || + parent.operator !== "!") { + return; + } + + + if (isInFlaggedContext(parent)) { + context.report({ + node: parent, + messageId: "unexpectedNegation", + fix(fixer) { + if (hasCommentsInside(parent)) { + return null; + } + + if (needsParens(parent, node.argument)) { + return fixer.replaceText(parent, `(${sourceCode.getText(node.argument)})`); + } + + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + const firstReplacementToken = sourceCode.getFirstToken(node.argument); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + sourceCode.getText(node.argument)); + } + }); + } + }, + + CallExpression(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") { + return; + } + + if (isInFlaggedContext(node)) { + context.report({ + node, + messageId: "unexpectedCall", + fix(fixer) { + const parent = node.parent; + + if (node.arguments.length === 0) { + if (parent.type === "UnaryExpression" && parent.operator === "!") { + + /* + * !Boolean() -> true + */ + + if (hasCommentsInside(parent)) { + return null; + } + + const replacement = "true"; + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + replacement); + } + + /* + * Boolean() -> false + */ + + if (hasCommentsInside(node)) { + return null; + } + + return fixer.replaceText(node, "false"); + } + + if (node.arguments.length === 1) { + const argument = node.arguments[0]; + + if (argument.type === "SpreadElement" || hasCommentsInside(node)) { + return null; + } + + /* + * Boolean(expression) -> expression + */ + + if (needsParens(node, argument)) { + return fixer.replaceText(node, `(${sourceCode.getText(argument)})`); + } + + return fixer.replaceText(node, sourceCode.getText(argument)); + } + + // two or more arguments + return null; + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-label.js b/node_modules/eslint/lib/rules/no-extra-label.js new file mode 100644 index 0000000..81406e7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-label.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Rule to disallow unnecessary labels + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary labels", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-label" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "This label '{{name}}' is unnecessary." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Creates a new scope with a breakable statement. + * @param {ASTNode} node A node to create. This is a BreakableStatement. + * @returns {void} + */ + function enterBreakableStatement(node) { + scopeInfo = { + label: node.parent.type === "LabeledStatement" ? node.parent.label : null, + breakable: true, + upper: scopeInfo + }; + } + + /** + * Removes the top scope of the stack. + * @returns {void} + */ + function exitBreakableStatement() { + scopeInfo = scopeInfo.upper; + } + + /** + * Creates a new scope with a labeled statement. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `enterBreakableStatement` function. + * @param {ASTNode} node A node to create. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = { + label: node.label, + breakable: false, + upper: scopeInfo + }; + } + } + + /** + * Removes the top scope of the stack. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `exitBreakableStatement` function. + * @param {ASTNode} node A node. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = scopeInfo.upper; + } + } + + /** + * Reports a given control node if it's unnecessary. + * @param {ASTNode} node A node. This is a BreakStatement or a + * ContinueStatement. + * @returns {void} + */ + function reportIfUnnecessary(node) { + if (!node.label) { + return; + } + + const labelNode = node.label; + + for (let info = scopeInfo; info !== null; info = info.upper) { + if (info.breakable || info.label && info.label.name === labelNode.name) { + if (info.breakable && info.label && info.label.name === labelNode.name) { + context.report({ + node: labelNode, + messageId: "unexpected", + data: labelNode, + fix(fixer) { + const breakOrContinueToken = sourceCode.getFirstToken(node); + + if (sourceCode.commentsExistBetween(breakOrContinueToken, labelNode)) { + return null; + } + + return fixer.removeRange([breakOrContinueToken.range[1], labelNode.range[1]]); + } + }); + } + return; + } + } + } + + return { + WhileStatement: enterBreakableStatement, + "WhileStatement:exit": exitBreakableStatement, + DoWhileStatement: enterBreakableStatement, + "DoWhileStatement:exit": exitBreakableStatement, + ForStatement: enterBreakableStatement, + "ForStatement:exit": exitBreakableStatement, + ForInStatement: enterBreakableStatement, + "ForInStatement:exit": exitBreakableStatement, + ForOfStatement: enterBreakableStatement, + "ForOfStatement:exit": exitBreakableStatement, + SwitchStatement: enterBreakableStatement, + "SwitchStatement:exit": exitBreakableStatement, + LabeledStatement: enterLabeledStatement, + "LabeledStatement:exit": exitLabeledStatement, + BreakStatement: reportIfUnnecessary, + ContinueStatement: reportIfUnnecessary + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-parens.js b/node_modules/eslint/lib/rules/no-extra-parens.js new file mode 100644 index 0000000..e9d394c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-parens.js @@ -0,0 +1,1177 @@ +/** + * @fileoverview Disallow parenthesising higher precedence subexpressions. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const { isParenthesized: isParenthesizedRaw } = require("eslint-utils"); +const astUtils = require("./utils/ast-utils.js"); + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow unnecessary parentheses", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-parens" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["functions"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["all"] + }, + { + type: "object", + properties: { + conditionalAssign: { type: "boolean" }, + nestedBinaryExpressions: { type: "boolean" }, + returnAssign: { type: "boolean" }, + ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, + enforceForArrowConditionals: { type: "boolean" }, + enforceForSequenceExpressions: { type: "boolean" }, + enforceForNewInMemberExpressions: { type: "boolean" }, + enforceForFunctionPrototypeMethods: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpected: "Unnecessary parentheses around expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const tokensToIgnore = new WeakSet(); + const precedence = astUtils.getPrecedence; + const ALL_NODES = context.options[0] !== "functions"; + const EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; + const NESTED_BINARY = ALL_NODES && context.options[1] && context.options[1].nestedBinaryExpressions === false; + const EXCEPT_RETURN_ASSIGN = ALL_NODES && context.options[1] && context.options[1].returnAssign === false; + const IGNORE_JSX = ALL_NODES && context.options[1] && context.options[1].ignoreJSX; + const IGNORE_ARROW_CONDITIONALS = ALL_NODES && context.options[1] && + context.options[1].enforceForArrowConditionals === false; + const IGNORE_SEQUENCE_EXPRESSIONS = ALL_NODES && context.options[1] && + context.options[1].enforceForSequenceExpressions === false; + const IGNORE_NEW_IN_MEMBER_EXPR = ALL_NODES && context.options[1] && + context.options[1].enforceForNewInMemberExpressions === false; + const IGNORE_FUNCTION_PROTOTYPE_METHODS = ALL_NODES && context.options[1] && + context.options[1].enforceForFunctionPrototypeMethods === false; + + const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); + const PRECEDENCE_OF_UPDATE_EXPR = precedence({ type: "UpdateExpression" }); + + let reportsBuffer; + + /** + * Determines whether the given node is a `call` or `apply` method call, invoked directly on a `FunctionExpression` node. + * Example: function(){}.call() + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is an immediate `call` or `apply` method call. + * @private + */ + function isImmediateFunctionPrototypeMethodCall(node) { + const callNode = astUtils.skipChainExpression(node); + + if (callNode.type !== "CallExpression") { + return false; + } + const callee = astUtils.skipChainExpression(callNode.callee); + + return ( + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + ["call", "apply"].includes(astUtils.getStaticPropertyName(callee)) + ); + } + + /** + * Determines if this rule should be enforced for a node given the current configuration. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the rule should be enforced for this node. + * @private + */ + function ruleApplies(node) { + if (node.type === "JSXElement" || node.type === "JSXFragment") { + const isSingleLine = node.loc.start.line === node.loc.end.line; + + switch (IGNORE_JSX) { + + // Exclude this JSX element from linting + case "all": + return false; + + // Exclude this JSX element if it is multi-line element + case "multi-line": + return isSingleLine; + + // Exclude this JSX element if it is single-line element + case "single-line": + return !isSingleLine; + + // Nothing special to be done for JSX elements + case "none": + break; + + // no default + } + } + + if (node.type === "SequenceExpression" && IGNORE_SEQUENCE_EXPRESSIONS) { + return false; + } + + if (isImmediateFunctionPrototypeMethodCall(node) && IGNORE_FUNCTION_PROTOTYPE_METHODS) { + return false; + } + + return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; + } + + /** + * Determines if a node is surrounded by parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ + function isParenthesised(node) { + return isParenthesizedRaw(1, node, sourceCode); + } + + /** + * Determines if a node is surrounded by parentheses twice. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is doubly parenthesised. + * @private + */ + function isParenthesisedTwice(node) { + return isParenthesizedRaw(2, node, sourceCode); + } + + /** + * Determines if a node is surrounded by (potentially) invalid parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParens(node) { + return ruleApplies(node) && isParenthesised(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasDoubleExcessParens(node) { + return ruleApplies(node) && isParenthesisedTwice(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses with considering precedence level of the node. + * If the preference level of the node is not higher or equal to precedence lower limit, it also checks + * whether the node is surrounded by parentheses twice or not. + * @param {ASTNode} node The node to be checked. + * @param {number} precedenceLowerLimit The lower limit of precedence. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasExcessParensWithPrecedence(node, precedenceLowerLimit) { + if (ruleApplies(node) && isParenthesised(node)) { + if ( + precedence(node) >= precedenceLowerLimit || + isParenthesisedTwice(node) + ) { + return true; + } + } + return false; + } + + /** + * Determines if a node test expression is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isCondAssignException(node) { + return EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"; + } + + /** + * Determines if a node is in a return statement + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is in a return statement. + * @private + */ + function isInReturnStatement(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if ( + currentNode.type === "ReturnStatement" || + (currentNode.type === "ArrowFunctionExpression" && currentNode.body.type !== "BlockStatement") + ) { + return true; + } + } + + return false; + } + + /** + * Determines if a constructor function is newed-up with parens + * @param {ASTNode} newExpression The NewExpression node to be checked. + * @returns {boolean} True if the constructor is called with parens. + * @private + */ + function isNewExpressionWithParens(newExpression) { + const lastToken = sourceCode.getLastToken(newExpression); + const penultimateToken = sourceCode.getTokenBefore(lastToken); + + return newExpression.arguments.length > 0 || + ( + + // The expression should end with its own parens, e.g., new new foo() is not a new expression with parens + astUtils.isOpeningParenToken(penultimateToken) && + astUtils.isClosingParenToken(lastToken) && + newExpression.callee.range[1] < newExpression.range[1] + ); + } + + /** + * Determines if a node is or contains an assignment expression + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is or contains an assignment expression. + * @private + */ + function containsAssignment(node) { + if (node.type === "AssignmentExpression") { + return true; + } + if (node.type === "ConditionalExpression" && + (node.consequent.type === "AssignmentExpression" || node.alternate.type === "AssignmentExpression")) { + return true; + } + if ((node.left && node.left.type === "AssignmentExpression") || + (node.right && node.right.type === "AssignmentExpression")) { + return true; + } + + return false; + } + + /** + * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isReturnAssignException(node) { + if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) { + return false; + } + + if (node.type === "ReturnStatement") { + return node.argument && containsAssignment(node.argument); + } + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + return containsAssignment(node.body); + } + return containsAssignment(node); + + } + + /** + * Determines if a node following a [no LineTerminator here] restriction is + * surrounded by (potentially) invalid extra parentheses. + * @param {Token} token The token preceding the [no LineTerminator here] restriction. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParensNoLineTerminator(token, node) { + if (token.loc.end.line === node.loc.start.line) { + return hasExcessParens(node); + } + + return hasDoubleExcessParens(node); + } + + /** + * Determines whether a node should be preceded by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted before the node + * @private + */ + function requiresLeadingSpace(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const tokenBeforeLeftParen = sourceCode.getTokenBefore(leftParenToken, { includeComments: true }); + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParenToken, { includeComments: true }); + + return tokenBeforeLeftParen && + tokenBeforeLeftParen.range[1] === leftParenToken.range[0] && + leftParenToken.range[1] === tokenAfterLeftParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftParen, tokenAfterLeftParen); + } + + /** + * Determines whether a node should be followed by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted after the node + * @private + */ + function requiresTrailingSpace(node) { + const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 }); + const rightParenToken = nextTwoTokens[0]; + const tokenAfterRightParen = nextTwoTokens[1]; + const tokenBeforeRightParen = sourceCode.getLastToken(node); + + return rightParenToken && tokenAfterRightParen && + !sourceCode.isSpaceBetweenTokens(rightParenToken, tokenAfterRightParen) && + !astUtils.canTokensBeAdjacent(tokenBeforeRightParen, tokenAfterRightParen); + } + + /** + * Determines if a given expression node is an IIFE + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the given node is an IIFE + */ + function isIIFE(node) { + const maybeCallNode = astUtils.skipChainExpression(node); + + return maybeCallNode.type === "CallExpression" && maybeCallNode.callee.type === "FunctionExpression"; + } + + /** + * Determines if the given node can be the assignment target in destructuring or the LHS of an assignment. + * This is to avoid an autofix that could change behavior because parsers mistakenly allow invalid syntax, + * such as `(a = b) = c` and `[(a = b) = c] = []`. Ideally, this function shouldn't be necessary. + * @param {ASTNode} [node] The node to check + * @returns {boolean} `true` if the given node can be a valid assignment target + */ + function canBeAssignmentTarget(node) { + return node && (node.type === "Identifier" || node.type === "MemberExpression"); + } + + /** + * Report the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function report(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const rightParenToken = sourceCode.getTokenAfter(node); + + if (!isParenthesisedTwice(node)) { + if (tokensToIgnore.has(sourceCode.getFirstToken(node))) { + return; + } + + if (isIIFE(node) && !isParenthesised(node.callee)) { + return; + } + } + + /** + * Finishes reporting + * @returns {void} + * @private + */ + function finishReport() { + context.report({ + node, + loc: leftParenToken.loc, + messageId: "unexpected", + fix(fixer) { + const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]); + + return fixer.replaceTextRange([ + leftParenToken.range[0], + rightParenToken.range[1] + ], (requiresLeadingSpace(node) ? " " : "") + parenthesizedSource + (requiresTrailingSpace(node) ? " " : "")); + } + }); + } + + if (reportsBuffer) { + reportsBuffer.reports.push({ node, finishReport }); + return; + } + + finishReport(); + } + + /** + * Evaluate a argument of the node. + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkArgumentWithPrecedence(node) { + if (hasExcessParensWithPrecedence(node.argument, precedence(node))) { + report(node.argument); + } + } + + /** + * Check if a member expression contains a call expression + * @param {ASTNode} node MemberExpression node to evaluate + * @returns {boolean} true if found, false if not + */ + function doesMemberExpressionContainCallExpression(node) { + let currentNode = node.object; + let currentNodeType = node.object.type; + + while (currentNodeType === "MemberExpression") { + currentNode = currentNode.object; + currentNodeType = currentNode.type; + } + + return currentNodeType === "CallExpression"; + } + + /** + * Evaluate a new call + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkCallNew(node) { + const callee = node.callee; + + if (hasExcessParensWithPrecedence(callee, precedence(node))) { + const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee); + + if ( + hasDoubleExcessParens(callee) || + !isIIFE(node) && + !hasNewParensException && + !( + + // Allow extra parens around a new expression if they are intervening parentheses. + node.type === "NewExpression" && + callee.type === "MemberExpression" && + doesMemberExpressionContainCallExpression(callee) + ) && + !(!node.optional && callee.type === "ChainExpression") + ) { + report(node.callee); + } + } + node.arguments + .filter(arg => hasExcessParensWithPrecedence(arg, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + } + + /** + * Evaluate binary logicals + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinaryLogical(node) { + const prec = precedence(node); + const leftPrecedence = precedence(node.left); + const rightPrecedence = precedence(node.right); + const isExponentiation = node.operator === "**"; + const shouldSkipLeft = NESTED_BINARY && (node.left.type === "BinaryExpression" || node.left.type === "LogicalExpression"); + const shouldSkipRight = NESTED_BINARY && (node.right.type === "BinaryExpression" || node.right.type === "LogicalExpression"); + + if (!shouldSkipLeft && hasExcessParens(node.left)) { + if ( + !(node.left.type === "UnaryExpression" && isExponentiation) && + !astUtils.isMixedLogicalAndCoalesceExpressions(node.left, node) && + (leftPrecedence > prec || (leftPrecedence === prec && !isExponentiation)) || + isParenthesisedTwice(node.left) + ) { + report(node.left); + } + } + + if (!shouldSkipRight && hasExcessParens(node.right)) { + if ( + !astUtils.isMixedLogicalAndCoalesceExpressions(node.right, node) && + (rightPrecedence > prec || (rightPrecedence === prec && isExponentiation)) || + isParenthesisedTwice(node.right) + ) { + report(node.right); + } + } + } + + /** + * Check the parentheses around the super class of the given class definition. + * @param {ASTNode} node The node of class declarations to check. + * @returns {void} + */ + function checkClass(node) { + if (!node.superClass) { + return; + } + + /* + * If `node.superClass` is a LeftHandSideExpression, parentheses are extra. + * Otherwise, parentheses are needed. + */ + const hasExtraParens = precedence(node.superClass) > PRECEDENCE_OF_UPDATE_EXPR + ? hasExcessParens(node.superClass) + : hasDoubleExcessParens(node.superClass); + + if (hasExtraParens) { + report(node.superClass); + } + } + + /** + * Check the parentheses around the argument of the given spread operator. + * @param {ASTNode} node The node of spread elements/properties to check. + * @returns {void} + */ + function checkSpreadOperator(node) { + if (hasExcessParensWithPrecedence(node.argument, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.argument); + } + } + + /** + * Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration + * @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node + * @returns {void} + */ + function checkExpressionOrExportStatement(node) { + const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node); + const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken); + const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null; + const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null; + + if ( + astUtils.isOpeningParenToken(firstToken) && + ( + astUtils.isOpeningBraceToken(secondToken) || + secondToken.type === "Keyword" && ( + secondToken.value === "function" || + secondToken.value === "class" || + secondToken.value === "let" && + tokenAfterClosingParens && + ( + astUtils.isOpeningBracketToken(tokenAfterClosingParens) || + tokenAfterClosingParens.type === "Identifier" + ) + ) || + secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function" + ) + ) { + tokensToIgnore.add(secondToken); + } + + const hasExtraParens = node.parent.type === "ExportDefaultDeclaration" + ? hasExcessParensWithPrecedence(node, PRECEDENCE_OF_ASSIGNMENT_EXPR) + : hasExcessParens(node); + + if (hasExtraParens) { + report(node); + } + } + + /** + * Finds the path from the given node to the specified ancestor. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} ancestor Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified ancestor. + */ + function pathToAncestor(node, ancestor) { + const path = [node]; + let currentNode = node; + + while (currentNode !== ancestor) { + + currentNode = currentNode.parent; + + /* istanbul ignore if */ + if (currentNode === null) { + throw new Error("Nodes are not in the ancestor-descendant relationship."); + } + + path.push(currentNode); + } + + return path; + } + + /** + * Finds the path from the given node to the specified descendant. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} descendant Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified descendant. + */ + function pathToDescendant(node, descendant) { + return pathToAncestor(descendant, node).reverse(); + } + + /** + * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer + * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop. + * @param {ASTNode} node Ancestor of an 'in' expression. + * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself. + * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis. + */ + function isSafelyEnclosingInExpression(node, child) { + switch (node.type) { + case "ArrayExpression": + case "ArrayPattern": + case "BlockStatement": + case "ObjectExpression": + case "ObjectPattern": + case "TemplateLiteral": + return true; + case "ArrowFunctionExpression": + case "FunctionExpression": + return node.params.includes(child); + case "CallExpression": + case "NewExpression": + return node.arguments.includes(child); + case "MemberExpression": + return node.computed && node.property === child; + case "ConditionalExpression": + return node.consequent === child; + default: + return false; + } + } + + /** + * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately. + * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings. + * @returns {void} + */ + function startNewReportsBuffering() { + reportsBuffer = { + upper: reportsBuffer, + inExpressionNodes: [], + reports: [] + }; + } + + /** + * Ends the current reports buffering. + * @returns {void} + */ + function endCurrentReportsBuffering() { + const { upper, inExpressionNodes, reports } = reportsBuffer; + + if (upper) { + upper.inExpressionNodes.push(...inExpressionNodes); + upper.reports.push(...reports); + } else { + + // flush remaining reports + reports.forEach(({ finishReport }) => finishReport()); + } + + reportsBuffer = upper; + } + + /** + * Checks whether the given node is in the current reports buffer. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is in the current buffer, false otherwise. + */ + function isInCurrentReportsBuffer(node) { + return reportsBuffer.reports.some(r => r.node === node); + } + + /** + * Removes the given node from the current reports buffer. + * @param {ASTNode} node Node to remove. + * @returns {void} + */ + function removeFromCurrentReportsBuffer(node) { + reportsBuffer.reports = reportsBuffer.reports.filter(r => r.node !== node); + } + + /** + * Checks whether a node is a MemberExpression at NewExpression's callee. + * @param {ASTNode} node node to check. + * @returns {boolean} True if the node is a MemberExpression at NewExpression's callee. false otherwise. + */ + function isMemberExpInNewCallee(node) { + if (node.type === "MemberExpression") { + return node.parent.type === "NewExpression" && node.parent.callee === node + ? true + : node.parent.object === node && isMemberExpInNewCallee(node.parent); + } + return false; + } + + return { + ArrayExpression(node) { + node.elements + .filter(e => e && hasExcessParensWithPrecedence(e, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + }, + + ArrayPattern(node) { + node.elements + .filter(e => canBeAssignmentTarget(e) && hasExcessParens(e)) + .forEach(report); + }, + + ArrowFunctionExpression(node) { + if (isReturnAssignException(node)) { + return; + } + + if (node.body.type === "ConditionalExpression" && + IGNORE_ARROW_CONDITIONALS + ) { + return; + } + + if (node.body.type !== "BlockStatement") { + const firstBodyToken = sourceCode.getFirstToken(node.body, astUtils.isNotOpeningParenToken); + const tokenBeforeFirst = sourceCode.getTokenBefore(firstBodyToken); + + if (astUtils.isOpeningParenToken(tokenBeforeFirst) && astUtils.isOpeningBraceToken(firstBodyToken)) { + tokensToIgnore.add(firstBodyToken); + } + if (hasExcessParensWithPrecedence(node.body, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.body); + } + } + }, + + AssignmentExpression(node) { + if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left)) { + report(node.left); + } + + if (!isReturnAssignException(node) && hasExcessParensWithPrecedence(node.right, precedence(node))) { + report(node.right); + } + }, + + BinaryExpression(node) { + if (reportsBuffer && node.operator === "in") { + reportsBuffer.inExpressionNodes.push(node); + } + + checkBinaryLogical(node); + }, + + CallExpression: checkCallNew, + + ClassBody(node) { + node.body + .filter(member => member.type === "MethodDefinition" && member.computed && member.key) + .filter(member => hasExcessParensWithPrecedence(member.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(member => report(member.key)); + }, + + ConditionalExpression(node) { + if (isReturnAssignException(node)) { + return; + } + if ( + !isCondAssignException(node) && + hasExcessParensWithPrecedence(node.test, precedence({ type: "LogicalExpression", operator: "||" })) + ) { + report(node.test); + } + + if (hasExcessParensWithPrecedence(node.consequent, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.consequent); + } + + if (hasExcessParensWithPrecedence(node.alternate, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.alternate); + } + }, + + DoWhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ExportDefaultDeclaration: node => checkExpressionOrExportStatement(node.declaration), + ExpressionStatement: node => checkExpressionOrExportStatement(node.expression), + + "ForInStatement, ForOfStatement"(node) { + if (node.left.type !== "VariableDeclarator") { + const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); + + if ( + firstLeftToken.value === "let" && ( + + /* + * If `let` is the only thing on the left side of the loop, it's the loop variable: `for ((let) of foo);` + * Removing it will cause a syntax error, because it will be parsed as the start of a VariableDeclarator. + */ + (firstLeftToken.range[1] === node.left.range[1] || /* + * If `let` is followed by a `[` token, it's a property access on the `let` value: `for ((let[foo]) of bar);` + * Removing it will cause the property access to be parsed as a destructuring declaration of `foo` instead. + */ + astUtils.isOpeningBracketToken( + sourceCode.getTokenAfter(firstLeftToken, astUtils.isNotClosingParenToken) + )) + ) + ) { + tokensToIgnore.add(firstLeftToken); + } + } + + if (node.type === "ForOfStatement") { + const hasExtraParens = node.right.type === "SequenceExpression" + ? hasDoubleExcessParens(node.right) + : hasExcessParens(node.right); + + if (hasExtraParens) { + report(node.right); + } + } else if (hasExcessParens(node.right)) { + report(node.right); + } + + if (hasExcessParens(node.left)) { + report(node.left); + } + }, + + ForStatement(node) { + if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + + if (node.update && hasExcessParens(node.update)) { + report(node.update); + } + + if (node.init) { + startNewReportsBuffering(); + + if (hasExcessParens(node.init)) { + report(node.init); + } + } + }, + + "ForStatement > *.init:exit"(node) { + + /* + * Removing parentheses around `in` expressions might change semantics and cause errors. + * + * For example, this valid for loop: + * for (let a = (b in c); ;); + * after removing parentheses would be treated as an invalid for-in loop: + * for (let a = b in c; ;); + */ + + if (reportsBuffer.reports.length) { + reportsBuffer.inExpressionNodes.forEach(inExpressionNode => { + const path = pathToDescendant(node, inExpressionNode); + let nodeToExclude; + + for (let i = 0; i < path.length; i++) { + const pathNode = path[i]; + + if (i < path.length - 1) { + const nextPathNode = path[i + 1]; + + if (isSafelyEnclosingInExpression(pathNode, nextPathNode)) { + + // The 'in' expression in safely enclosed by the syntax of its ancestor nodes (e.g. by '{}' or '[]'). + return; + } + } + + if (isParenthesised(pathNode)) { + if (isInCurrentReportsBuffer(pathNode)) { + + // This node was supposed to be reported, but parentheses might be necessary. + + if (isParenthesisedTwice(pathNode)) { + + /* + * This node is parenthesised twice, it certainly has at least one pair of `extra` parentheses. + * If the --fix option is on, the current fixing iteration will remove only one pair of parentheses. + * The remaining pair is safely enclosing the 'in' expression. + */ + return; + } + + // Exclude the outermost node only. + if (!nodeToExclude) { + nodeToExclude = pathNode; + } + + // Don't break the loop here, there might be some safe nodes or parentheses that will stay inside. + + } else { + + // This node will stay parenthesised, the 'in' expression in safely enclosed by '()'. + return; + } + } + } + + // Exclude the node from the list (i.e. treat parentheses as necessary) + removeFromCurrentReportsBuffer(nodeToExclude); + }); + } + + endCurrentReportsBuffering(); + }, + + IfStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ImportExpression(node) { + const { source } = node; + + if (source.type === "SequenceExpression") { + if (hasDoubleExcessParens(source)) { + report(source); + } + } else if (hasExcessParens(source)) { + report(source); + } + }, + + LogicalExpression: checkBinaryLogical, + + MemberExpression(node) { + const shouldAllowWrapOnce = isMemberExpInNewCallee(node) && + doesMemberExpressionContainCallExpression(node); + const nodeObjHasExcessParens = shouldAllowWrapOnce + ? hasDoubleExcessParens(node.object) + : hasExcessParens(node.object) && + !( + isImmediateFunctionPrototypeMethodCall(node.parent) && + node.parent.callee === node && + IGNORE_FUNCTION_PROTOTYPE_METHODS + ); + + if ( + nodeObjHasExcessParens && + precedence(node.object) >= precedence(node) && + ( + node.computed || + !( + astUtils.isDecimalInteger(node.object) || + + // RegExp literal is allowed to have parens (#1589) + (node.object.type === "Literal" && node.object.regex) + ) + ) + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.object.type === "CallExpression" + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + !IGNORE_NEW_IN_MEMBER_EXPR && + node.object.type === "NewExpression" && + isNewExpressionWithParens(node.object)) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.optional && + node.object.type === "ChainExpression" + ) { + report(node.object); + } + + if (node.computed && hasExcessParens(node.property)) { + report(node.property); + } + }, + + NewExpression: checkCallNew, + + ObjectExpression(node) { + node.properties + .filter(property => property.value && hasExcessParensWithPrecedence(property.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(property => report(property.value)); + }, + + ObjectPattern(node) { + node.properties + .filter(property => { + const value = property.value; + + return canBeAssignmentTarget(value) && hasExcessParens(value); + }).forEach(property => report(property.value)); + }, + + Property(node) { + if (node.computed) { + const { key } = node; + + if (key && hasExcessParensWithPrecedence(key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(key); + } + } + }, + + RestElement(node) { + const argument = node.argument; + + if (canBeAssignmentTarget(argument) && hasExcessParens(argument)) { + report(argument); + } + }, + + ReturnStatement(node) { + const returnToken = sourceCode.getFirstToken(node); + + if (isReturnAssignException(node)) { + return; + } + + if (node.argument && + hasExcessParensNoLineTerminator(returnToken, node.argument) && + + // RegExp literal is allowed to have parens (#1589) + !(node.argument.type === "Literal" && node.argument.regex)) { + report(node.argument); + } + }, + + SequenceExpression(node) { + const precedenceOfNode = precedence(node); + + node.expressions + .filter(e => hasExcessParensWithPrecedence(e, precedenceOfNode)) + .forEach(report); + }, + + SwitchCase(node) { + if (node.test && hasExcessParens(node.test)) { + report(node.test); + } + }, + + SwitchStatement(node) { + if (hasExcessParens(node.discriminant)) { + report(node.discriminant); + } + }, + + ThrowStatement(node) { + const throwToken = sourceCode.getFirstToken(node); + + if (hasExcessParensNoLineTerminator(throwToken, node.argument)) { + report(node.argument); + } + }, + + UnaryExpression: checkArgumentWithPrecedence, + UpdateExpression: checkArgumentWithPrecedence, + AwaitExpression: checkArgumentWithPrecedence, + + VariableDeclarator(node) { + if ( + node.init && hasExcessParensWithPrecedence(node.init, PRECEDENCE_OF_ASSIGNMENT_EXPR) && + + // RegExp literal is allowed to have parens (#1589) + !(node.init.type === "Literal" && node.init.regex) + ) { + report(node.init); + } + }, + + WhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + WithStatement(node) { + if (hasExcessParens(node.object)) { + report(node.object); + } + }, + + YieldExpression(node) { + if (node.argument) { + const yieldToken = sourceCode.getFirstToken(node); + + if ((precedence(node.argument) >= precedence(node) && + hasExcessParensNoLineTerminator(yieldToken, node.argument)) || + hasDoubleExcessParens(node.argument)) { + report(node.argument); + } + } + }, + + ClassDeclaration: checkClass, + ClassExpression: checkClass, + + SpreadElement: checkSpreadOperator, + SpreadProperty: checkSpreadOperator, + ExperimentalSpreadProperty: checkSpreadOperator, + + TemplateLiteral(node) { + node.expressions + .filter(e => e && hasExcessParens(e)) + .forEach(report); + }, + + AssignmentPattern(node) { + const { left, right } = node; + + if (canBeAssignmentTarget(left) && hasExcessParens(left)) { + report(left); + } + + if (right && hasExcessParensWithPrecedence(right, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(right); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-semi.js b/node_modules/eslint/lib/rules/no-extra-semi.js new file mode 100644 index 0000000..e0a8df0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-semi.js @@ -0,0 +1,126 @@ +/** + * @fileoverview Rule to flag use of unnecessary semicolons + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary semicolons", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-extra-semi" + }, + + fixable: "code", + schema: [], + + messages: { + unexpected: "Unnecessary semicolon." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports an unnecessary semicolon error. + * @param {Node|Token} nodeOrToken A node or a token to be reported. + * @returns {void} + */ + function report(nodeOrToken) { + context.report({ + node: nodeOrToken, + messageId: "unexpected", + fix(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, context.getSourceCode()) + .retainSurroundingTokens(nodeOrToken) + .remove(nodeOrToken); + } + }); + } + + /** + * Checks for a part of a class body. + * This checks tokens from a specified token to a next MethodDefinition or the end of class body. + * @param {Token} firstToken The first token to check. + * @returns {void} + */ + function checkForPartOfClassBody(firstToken) { + for (let token = firstToken; + token.type === "Punctuator" && !astUtils.isClosingBraceToken(token); + token = sourceCode.getTokenAfter(token) + ) { + if (astUtils.isSemicolonToken(token)) { + report(token); + } + } + } + + return { + + /** + * Reports this empty statement, except if the parent node is a loop. + * @param {Node} node A EmptyStatement node to be reported. + * @returns {void} + */ + EmptyStatement(node) { + const parent = node.parent, + allowedParentTypes = [ + "ForStatement", + "ForInStatement", + "ForOfStatement", + "WhileStatement", + "DoWhileStatement", + "IfStatement", + "LabeledStatement", + "WithStatement" + ]; + + if (allowedParentTypes.indexOf(parent.type) === -1) { + report(node); + } + }, + + /** + * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. + * @param {Node} node A ClassBody node to check. + * @returns {void} + */ + ClassBody(node) { + checkForPartOfClassBody(sourceCode.getFirstToken(node, 1)); // 0 is `{`. + }, + + /** + * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body. + * @param {Node} node A MethodDefinition node of the start point. + * @returns {void} + */ + MethodDefinition(node) { + checkForPartOfClassBody(sourceCode.getTokenAfter(node)); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-fallthrough.js b/node_modules/eslint/lib/rules/no-fallthrough.js new file mode 100644 index 0000000..dd1f3ed --- /dev/null +++ b/node_modules/eslint/lib/rules/no-fallthrough.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Rule to flag fall-through cases in switch statements. + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; + +/** + * Checks whether or not a given node has a fallthrough comment. + * @param {ASTNode} node A SwitchCase node to get comments. + * @param {RuleContext} context A rule context which stores comments. + * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. + * @returns {boolean} `true` if the node has a valid fallthrough comment. + */ +function hasFallthroughComment(node, context, fallthroughCommentPattern) { + const sourceCode = context.getSourceCode(); + const comment = lodash.last(sourceCode.getCommentsBefore(node)); + + return Boolean(comment && fallthroughCommentPattern.test(comment.value)); +} + +/** + * Checks whether or not a given code path segment is reachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks whether a node and a token are separated by blank lines + * @param {ASTNode} node The node to check + * @param {Token} token The token to compare against + * @returns {boolean} `true` if there are blank lines between node and token + */ +function hasBlankLinesBetween(node, token) { + return token.loc.start.line > node.loc.end.line + 1; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow fallthrough of `case` statements", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-fallthrough" + }, + + schema: [ + { + type: "object", + properties: { + commentPattern: { + type: "string", + default: "" + } + }, + additionalProperties: false + } + ], + messages: { + case: "Expected a 'break' statement before 'case'.", + default: "Expected a 'break' statement before 'default'." + } + }, + + create(context) { + const options = context.options[0] || {}; + let currentCodePath = null; + const sourceCode = context.getSourceCode(); + + /* + * We need to use leading comments of the next SwitchCase node because + * trailing comments is wrong if semicolons are omitted. + */ + let fallthroughCase = null; + let fallthroughCommentPattern = null; + + if (options.commentPattern) { + fallthroughCommentPattern = new RegExp(options.commentPattern, "u"); + } else { + fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT; + } + + return { + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + SwitchCase(node) { + + /* + * Checks whether or not there is a fallthrough comment. + * And reports the previous fallthrough node if that does not exist. + */ + if (fallthroughCase && !hasFallthroughComment(node, context, fallthroughCommentPattern)) { + context.report({ + messageId: node.test ? "case" : "default", + node + }); + } + fallthroughCase = null; + }, + + "SwitchCase:exit"(node) { + const nextToken = sourceCode.getTokenAfter(node); + + /* + * `reachable` meant fall through because statements preceded by + * `break`, `return`, or `throw` are unreachable. + * And allows empty cases and the last case. + */ + if (currentCodePath.currentSegments.some(isReachable) && + (node.consequent.length > 0 || hasBlankLinesBetween(node, nextToken)) && + lodash.last(node.parent.cases) !== node) { + fallthroughCase = node; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-floating-decimal.js b/node_modules/eslint/lib/rules/no-floating-decimal.js new file mode 100644 index 0000000..b1d8832 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow leading or trailing decimal points in numeric literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-floating-decimal" + }, + + schema: [], + fixable: "code", + messages: { + leading: "A leading decimal point can be confused with a dot.", + trailing: "A trailing decimal point can be confused with a dot." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Literal(node) { + + if (typeof node.value === "number") { + if (node.raw.startsWith(".")) { + context.report({ + node, + messageId: "leading", + fix(fixer) { + const tokenBefore = sourceCode.getTokenBefore(node); + const needsSpaceBefore = tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, `0${node.raw}`); + + return fixer.insertTextBefore(node, needsSpaceBefore ? " 0" : "0"); + } + }); + } + if (node.raw.indexOf(".") === node.raw.length - 1) { + context.report({ + node, + messageId: "trailing", + fix: fixer => fixer.insertTextAfter(node, "0") + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-func-assign.js b/node_modules/eslint/lib/rules/no-func-assign.js new file mode 100644 index 0000000..33d0ad9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-func-assign.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag use of function declaration identifiers as variables. + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning `function` declarations", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-func-assign" + }, + + schema: [], + + messages: { + isAFunction: "'{{name}}' is a function." + } + }, + + create(context) { + + /** + * Reports a reference if is non initializer and writable. + * @param {References} references Collection of reference to check. + * @returns {void} + */ + function checkReference(references) { + astUtils.getModifyingReferences(references).forEach(reference => { + context.report({ + node: reference.identifier, + messageId: "isAFunction", + data: { + name: reference.identifier.name + } + }); + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "FunctionName") { + checkReference(variable.references); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + FunctionDeclaration: checkForFunction, + FunctionExpression: checkForFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-global-assign.js b/node_modules/eslint/lib/rules/no-global-assign.js new file mode 100644 index 0000000..ea854c4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-global-assign.js @@ -0,0 +1,94 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignments to native objects or read-only global variables", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-global-assign" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + globalShouldNotBeModified: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "globalShouldNotBeModified", + data: { + name: identifier.name + } + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } + + return { + Program() { + const globalScope = context.getScope(); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-implicit-coercion.js b/node_modules/eslint/lib/rules/no-implicit-coercion.js new file mode 100644 index 0000000..a639711 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -0,0 +1,305 @@ +/** + * @fileoverview A rule to disallow the type conversions with shorter notations. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u; +const ALLOWABLE_OPERATORS = ["~", "!!", "+", "*"]; + +/** + * Parses and normalizes an option object. + * @param {Object} options An option object to parse. + * @returns {Object} The parsed and normalized option object. + */ +function parseOptions(options) { + return { + boolean: "boolean" in options ? options.boolean : true, + number: "number" in options ? options.number : true, + string: "string" in options ? options.string : true, + allow: options.allow || [] + }; +} + +/** + * Checks whether or not a node is a double logical nigating. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a double logical nigating. + */ +function isDoubleLogicalNegating(node) { + return ( + node.operator === "!" && + node.argument.type === "UnaryExpression" && + node.argument.operator === "!" + ); +} + +/** + * Checks whether or not a node is a binary negating of `.indexOf()` method calling. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. + */ +function isBinaryNegatingOfIndexOf(node) { + if (node.operator !== "~") { + return false; + } + const callNode = astUtils.skipChainExpression(node.argument); + + return ( + callNode.type === "CallExpression" && + astUtils.isSpecificMemberAccess(callNode.callee, null, INDEX_OF_PATTERN) + ); +} + +/** + * Checks whether or not a node is a multiplying by one. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a multiplying by one. + */ +function isMultiplyByOne(node) { + return node.operator === "*" && ( + node.left.type === "Literal" && node.left.value === 1 || + node.right.type === "Literal" && node.right.value === 1 + ); +} + +/** + * Checks whether the result of a node is numeric or not + * @param {ASTNode} node The node to test + * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call + */ +function isNumeric(node) { + return ( + node.type === "Literal" && typeof node.value === "number" || + node.type === "CallExpression" && ( + node.callee.name === "Number" || + node.callee.name === "parseInt" || + node.callee.name === "parseFloat" + ) + ); +} + +/** + * Returns the first non-numeric operand in a BinaryExpression. Designed to be + * used from bottom to up since it walks up the BinaryExpression trees using + * node.parent to find the result. + * @param {BinaryExpression} node The BinaryExpression node to be walked up on + * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null + */ +function getNonNumericOperand(node) { + const left = node.left, + right = node.right; + + if (right.type !== "BinaryExpression" && !isNumeric(right)) { + return right; + } + + if (left.type !== "BinaryExpression" && !isNumeric(left)) { + return left; + } + + return null; +} + +/** + * Checks whether a node is an empty string literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the passed in node is an + * empty string literal or not. + */ +function isEmptyString(node) { + return astUtils.isStringLiteral(node) && (node.value === "" || (node.type === "TemplateLiteral" && node.quasis.length === 1 && node.quasis[0].value.cooked === "")); +} + +/** + * Checks whether or not a node is a concatenating with an empty string. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a concatenating with an empty string. + */ +function isConcatWithEmptyString(node) { + return node.operator === "+" && ( + (isEmptyString(node.left) && !astUtils.isStringLiteral(node.right)) || + (isEmptyString(node.right) && !astUtils.isStringLiteral(node.left)) + ); +} + +/** + * Checks whether or not a node is appended with an empty string. + * @param {ASTNode} node An AssignmentExpression node to check. + * @returns {boolean} Whether or not the node is appended with an empty string. + */ +function isAppendEmptyString(node) { + return node.operator === "+=" && isEmptyString(node.right); +} + +/** + * Returns the operand that is not an empty string from a flagged BinaryExpression. + * @param {ASTNode} node The flagged BinaryExpression node to check. + * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression. + */ +function getNonEmptyOperand(node) { + return isEmptyString(node.left) ? node.right : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow shorthand type conversions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implicit-coercion" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + boolean: { + type: "boolean", + default: true + }, + number: { + type: "boolean", + default: true + }, + string: { + type: "boolean", + default: true + }, + allow: { + type: "array", + items: { + enum: ALLOWABLE_OPERATORS + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + useRecommendation: "use `{{recommendation}}` instead." + } + }, + + create(context) { + const options = parseOptions(context.options[0] || {}); + const sourceCode = context.getSourceCode(); + + /** + * Reports an error and autofixes the node + * @param {ASTNode} node An ast node to report the error on. + * @param {string} recommendation The recommended code for the issue + * @param {bool} shouldFix Whether this report should fix the node + * @returns {void} + */ + function report(node, recommendation, shouldFix) { + context.report({ + node, + messageId: "useRecommendation", + data: { + recommendation + }, + fix(fixer) { + if (!shouldFix) { + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, recommendation) + ) { + return fixer.replaceText(node, ` ${recommendation}`); + } + return fixer.replaceText(node, recommendation); + } + }); + } + + return { + UnaryExpression(node) { + let operatorAllowed; + + // !!foo + operatorAllowed = options.allow.indexOf("!!") >= 0; + if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { + const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`; + + report(node, recommendation, true); + } + + // ~foo.indexOf(bar) + operatorAllowed = options.allow.indexOf("~") >= 0; + if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) { + + // `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case. + const comparison = node.argument.type === "ChainExpression" ? ">= 0" : "!== -1"; + const recommendation = `${sourceCode.getText(node.argument)} ${comparison}`; + + report(node, recommendation, false); + } + + // +foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) { + const recommendation = `Number(${sourceCode.getText(node.argument)})`; + + report(node, recommendation, true); + } + }, + + // Use `:exit` to prevent double reporting + "BinaryExpression:exit"(node) { + let operatorAllowed; + + // 1 * foo + operatorAllowed = options.allow.indexOf("*") >= 0; + const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node); + + if (nonNumericOperand) { + const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`; + + report(node, recommendation, true); + } + + // "" + foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { + const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`; + + report(node, recommendation, true); + } + }, + + AssignmentExpression(node) { + + // foo += "" + const operatorAllowed = options.allow.indexOf("+") >= 0; + + if (!operatorAllowed && options.string && isAppendEmptyString(node)) { + const code = sourceCode.getText(getNonEmptyOperand(node)); + const recommendation = `${code} = String(${code})`; + + report(node, recommendation, true); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-implicit-globals.js b/node_modules/eslint/lib/rules/no-implicit-globals.js new file mode 100644 index 0000000..d4bfa3a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implicit-globals.js @@ -0,0 +1,140 @@ +/** + * @fileoverview Rule to check for implicit global variables, functions and classes. + * @author Joshua Peek + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow declarations in the global scope", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implicit-globals" + }, + + schema: [{ + type: "object", + properties: { + lexicalBindings: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + globalNonLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable.", + globalLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in a block or in an IIFE.", + globalVariableLeak: "Global variable leak, declare the variable if it is intended to be local.", + assignmentToReadonlyGlobal: "Unexpected assignment to read-only global variable.", + redeclarationOfReadonlyGlobal: "Unexpected redeclaration of read-only global variable." + } + }, + + create(context) { + + const checkLexicalBindings = context.options[0] && context.options[0].lexicalBindings === true; + + /** + * Reports the node. + * @param {ASTNode} node Node to report. + * @param {string} messageId Id of the message to report. + * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class. + * @returns {void} + */ + function report(node, messageId, kind) { + context.report({ + node, + messageId, + data: { + kind + } + }); + } + + return { + Program() { + const scope = context.getScope(); + + scope.variables.forEach(variable => { + + // Only ESLint global variables have the `writable` key. + const isReadonlyEslintGlobalVariable = variable.writeable === false; + const isWritableEslintGlobalVariable = variable.writeable === true; + + if (isWritableEslintGlobalVariable) { + + // Everything is allowed with writable ESLint global variables. + return; + } + + variable.defs.forEach(def => { + const defNode = def.node; + + if (def.type === "FunctionName" || (def.type === "Variable" && def.parent.kind === "var")) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalNonLexicalBinding", + def.type === "FunctionName" ? "function" : `'${def.parent.kind}'` + ); + } + } + + if (checkLexicalBindings) { + if (def.type === "ClassName" || + (def.type === "Variable" && (def.parent.kind === "let" || def.parent.kind === "const"))) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalLexicalBinding", + def.type === "ClassName" ? "class" : `'${def.parent.kind}'` + ); + } + } + } + }); + }); + + // Undeclared assigned variables. + scope.implicit.variables.forEach(variable => { + const scopeVariable = scope.set.get(variable.name); + let messageId; + + if (scopeVariable) { + + // ESLint global variable + if (scopeVariable.writeable) { + return; + } + messageId = "assignmentToReadonlyGlobal"; + + } else { + + // Reference to an unknown variable, possible global leak. + messageId = "globalVariableLeak"; + } + + // def.node is an AssignmentExpression, ForInStatement or ForOfStatement. + variable.defs.forEach(def => { + report(def.node, messageId); + }); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-implied-eval.js b/node_modules/eslint/lib/rules/no-implied-eval.js new file mode 100644 index 0000000..b8120a6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implied-eval.js @@ -0,0 +1,131 @@ +/** + * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { getStaticValue } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `eval()`-like methods", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implied-eval" + }, + + schema: [], + + messages: { + impliedEval: "Implied eval. Consider passing a function instead of a string." + } + }, + + create(context) { + const GLOBAL_CANDIDATES = Object.freeze(["global", "window", "globalThis"]); + const EVAL_LIKE_FUNC_PATTERN = /^(?:set(?:Interval|Timeout)|execScript)$/u; + + /** + * Checks whether a node is evaluated as a string or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is evaluated as a string. + */ + function isEvaluatedString(node) { + if ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ) { + return true; + } + if (node.type === "BinaryExpression" && node.operator === "+") { + return isEvaluatedString(node.left) || isEvaluatedString(node.right); + } + return false; + } + + /** + * Reports if the `CallExpression` node has evaluated argument. + * @param {ASTNode} node A CallExpression to check. + * @returns {void} + */ + function reportImpliedEvalCallExpression(node) { + const [firstArgument] = node.arguments; + + if (firstArgument) { + + const staticValue = getStaticValue(firstArgument, context.getScope()); + const isStaticString = staticValue && typeof staticValue.value === "string"; + const isString = isStaticString || isEvaluatedString(firstArgument); + + if (isString) { + context.report({ + node, + messageId: "impliedEval" + }); + } + } + + } + + /** + * Reports calls of `implied eval` via the global references. + * @param {Variable} globalVar A global variable to check. + * @returns {void} + */ + function reportImpliedEvalViaGlobal(globalVar) { + const { references, name } = globalVar; + + references.forEach(ref => { + const identifier = ref.identifier; + let node = identifier.parent; + + while (astUtils.isSpecificMemberAccess(node, null, name)) { + node = node.parent; + } + + if (astUtils.isSpecificMemberAccess(node, null, EVAL_LIKE_FUNC_PATTERN)) { + const calleeNode = node.parent.type === "ChainExpression" ? node.parent : node; + const parent = calleeNode.parent; + + if (parent.type === "CallExpression" && parent.callee === calleeNode) { + reportImpliedEvalCallExpression(parent); + } + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + if (astUtils.isSpecificId(node.callee, EVAL_LIKE_FUNC_PATTERN)) { + reportImpliedEvalCallExpression(node); + } + }, + "Program:exit"() { + const globalScope = context.getScope(); + + GLOBAL_CANDIDATES + .map(candidate => astUtils.getVariableByName(globalScope, candidate)) + .filter(globalVar => !!globalVar && globalVar.defs.length === 0) + .forEach(reportImpliedEvalViaGlobal); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-import-assign.js b/node_modules/eslint/lib/rules/no-import-assign.js new file mode 100644 index 0000000..7a349bb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-import-assign.js @@ -0,0 +1,239 @@ +/** + * @fileoverview Rule to flag updates of imported bindings. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const { findVariable } = require("eslint-utils"); +const astUtils = require("./utils/ast-utils"); + +const WellKnownMutationFunctions = { + Object: /^(?:assign|definePropert(?:y|ies)|freeze|setPrototypeOf)$/u, + Reflect: /^(?:(?:define|delete)Property|set(?:PrototypeOf)?)$/u +}; + +/** + * Check if a given node is LHS of an assignment node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is LHS. + */ +function isAssignmentLeft(node) { + const { parent } = node; + + return ( + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // Destructuring assignments + parent.type === "ArrayPattern" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + parent.type === "RestElement" || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is the operand of mutation unary operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the operand of mutation unary operator. + */ +function isOperandOfMutationUnaryOperator(node) { + const argumentNode = node.parent.type === "ChainExpression" + ? node.parent + : node; + const { parent } = argumentNode; + + return ( + ( + parent.type === "UpdateExpression" && + parent.argument === argumentNode + ) || + ( + parent.type === "UnaryExpression" && + parent.operator === "delete" && + parent.argument === argumentNode + ) + ); +} + +/** + * Check if a given node is the iteration variable of `for-in`/`for-of` syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the iteration variable. + */ +function isIterationVariable(node) { + const { parent } = node; + + return ( + ( + parent.type === "ForInStatement" && + parent.left === node + ) || + ( + parent.type === "ForOfStatement" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is at the first argument of a well-known mutation function. + * - `Object.assign` + * - `Object.defineProperty` + * - `Object.defineProperties` + * - `Object.freeze` + * - `Object.setPrototypeOf` + * - `Refrect.defineProperty` + * - `Refrect.deleteProperty` + * - `Refrect.set` + * - `Refrect.setPrototypeOf` + * @param {ASTNode} node The node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function. + */ +function isArgumentOfWellKnownMutationFunction(node, scope) { + const { parent } = node; + + if (parent.type !== "CallExpression" || parent.arguments[0] !== node) { + return false; + } + const callee = astUtils.skipChainExpression(parent.callee); + + if ( + !astUtils.isSpecificMemberAccess(callee, "Object", WellKnownMutationFunctions.Object) && + !astUtils.isSpecificMemberAccess(callee, "Reflect", WellKnownMutationFunctions.Reflect) + ) { + return false; + } + const variable = findVariable(scope, callee.object); + + return variable !== null && variable.scope.type === "global"; +} + +/** + * Check if the identifier node is placed at to update members. + * @param {ASTNode} id The Identifier node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the member of `id` was updated. + */ +function isMemberWrite(id, scope) { + const { parent } = id; + + return ( + ( + parent.type === "MemberExpression" && + parent.object === id && + ( + isAssignmentLeft(parent) || + isOperandOfMutationUnaryOperator(parent) || + isIterationVariable(parent) + ) + ) || + isArgumentOfWellKnownMutationFunction(id, scope) + ); +} + +/** + * Get the mutation node. + * @param {ASTNode} id The Identifier node to get. + * @returns {ASTNode} The mutation node. + */ +function getWriteNode(id) { + let node = id.parent; + + while ( + node && + node.type !== "AssignmentExpression" && + node.type !== "UpdateExpression" && + node.type !== "UnaryExpression" && + node.type !== "CallExpression" && + node.type !== "ForInStatement" && + node.type !== "ForOfStatement" + ) { + node = node.parent; + } + + return node || id; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assigning to imported bindings", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-import-assign" + }, + + schema: [], + + messages: { + readonly: "'{{name}}' is read-only.", + readonlyMember: "The members of '{{name}}' are read-only." + } + }, + + create(context) { + return { + ImportDeclaration(node) { + const scope = context.getScope(); + + for (const variable of context.getDeclaredVariables(node)) { + const shouldCheckMembers = variable.defs.some( + d => d.node.type === "ImportNamespaceSpecifier" + ); + let prevIdNode = null; + + for (const reference of variable.references) { + const idNode = reference.identifier; + + /* + * AssignmentPattern (e.g. `[a = 0] = b`) makes two write + * references for the same identifier. This should skip + * the one of the two in order to prevent redundant reports. + */ + if (idNode === prevIdNode) { + continue; + } + prevIdNode = idNode; + + if (reference.isWrite()) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonly", + data: { name: idNode.name } + }); + } else if (shouldCheckMembers && isMemberWrite(idNode, scope)) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonlyMember", + data: { name: idNode.name } + }); + } + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-inline-comments.js b/node_modules/eslint/lib/rules/no-inline-comments.js new file mode 100644 index 0000000..dec2786 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-inline-comments.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Enforces or disallows inline comments. + * @author Greg Cochard + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow inline comments after code", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-inline-comments" + }, + + schema: [ + { + type: "object", + properties: { + ignorePattern: { + type: "string" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedInlineComment: "Unexpected comment inline with code." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0]; + let customIgnoreRegExp; + + if (options && options.ignorePattern) { + customIgnoreRegExp = new RegExp(options.ignorePattern, "u"); + } + + /** + * Will check that comments are not on lines starting with or ending with code + * @param {ASTNode} node The comment node to check + * @private + * @returns {void} + */ + function testCodeAroundComment(node) { + + const startLine = String(sourceCode.lines[node.loc.start.line - 1]), + endLine = String(sourceCode.lines[node.loc.end.line - 1]), + preamble = startLine.slice(0, node.loc.start.column).trim(), + postamble = endLine.slice(node.loc.end.column).trim(), + isPreambleEmpty = !preamble, + isPostambleEmpty = !postamble; + + // Nothing on both sides + if (isPreambleEmpty && isPostambleEmpty) { + return; + } + + // Matches the ignore pattern + if (customIgnoreRegExp && customIgnoreRegExp.test(node.value)) { + return; + } + + // JSX Exception + if ( + (isPreambleEmpty || preamble === "{") && + (isPostambleEmpty || postamble === "}") + ) { + const enclosingNode = sourceCode.getNodeByRangeIndex(node.range[0]); + + if (enclosingNode && enclosingNode.type === "JSXEmptyExpression") { + return; + } + } + + // Don't report ESLint directive comments + if (astUtils.isDirectiveComment(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedInlineComment" + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + sourceCode.getAllComments() + .filter(token => token.type !== "Shebang") + .forEach(testCodeAroundComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-inner-declarations.js b/node_modules/eslint/lib/rules/no-inner-declarations.js new file mode 100644 index 0000000..0768bc6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-inner-declarations.js @@ -0,0 +1,88 @@ +/** + * @fileoverview Rule to enforce declarations in program or function body root. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validParent = new Set(["Program", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); +const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]); + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow variable or `function` declarations in nested blocks", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-inner-declarations" + }, + + schema: [ + { + enum: ["functions", "both"] + } + ], + + messages: { + moveDeclToRoot: "Move {{type}} declaration to {{body}} root." + } + }, + + create(context) { + + /** + * Ensure that a given node is at a program or function body's root. + * @param {ASTNode} node Declaration node to check. + * @returns {void} + */ + function check(node) { + const parent = node.parent; + + if ( + parent.type === "BlockStatement" && validBlockStatementParent.has(parent.parent.type) + ) { + return; + } + + if (validParent.has(parent.type)) { + return; + } + + const upperFunction = astUtils.getUpperFunction(parent); + + context.report({ + node, + messageId: "moveDeclToRoot", + data: { + type: (node.type === "FunctionDeclaration" ? "function" : "variable"), + body: (upperFunction === null ? "program" : "function body") + } + }); + } + + + return { + + FunctionDeclaration: check, + VariableDeclaration(node) { + if (context.options[0] === "both" && node.kind === "var") { + check(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-invalid-regexp.js b/node_modules/eslint/lib/rules/no-invalid-regexp.js new file mode 100644 index 0000000..48b7188 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -0,0 +1,130 @@ +/** + * @fileoverview Validate strings passed to the RegExp constructor + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const RegExpValidator = require("regexpp").RegExpValidator; +const validator = new RegExpValidator({ ecmaVersion: 2018 }); +const validFlags = /[gimuys]/gu; +const undefined1 = void 0; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow invalid regular expression strings in `RegExp` constructors", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-invalid-regexp" + }, + + schema: [{ + type: "object", + properties: { + allowConstructorFlags: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + regexMessage: "{{message}}." + } + }, + + create(context) { + + const options = context.options[0]; + let allowedFlags = null; + + if (options && options.allowConstructorFlags) { + const temp = options.allowConstructorFlags.join("").replace(validFlags, ""); + + if (temp) { + allowedFlags = new RegExp(`[${temp}]`, "giu"); + } + } + + /** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ + function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Check syntax error in a given pattern. + * @param {string} pattern The RegExp pattern to validate. + * @param {boolean} uFlag The Unicode flag. + * @returns {string|null} The syntax error. + */ + function validateRegExpPattern(pattern, uFlag) { + try { + validator.validatePattern(pattern, undefined1, undefined1, uFlag); + return null; + } catch (err) { + return err.message; + } + } + + /** + * Check syntax error in a given flags. + * @param {string} flags The RegExp flags to validate. + * @returns {string|null} The syntax error. + */ + function validateRegExpFlags(flags) { + try { + validator.validateFlags(flags); + return null; + } catch { + return `Invalid flags supplied to RegExp constructor '${flags}'`; + } + } + + return { + "CallExpression, NewExpression"(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp" || !isString(node.arguments[0])) { + return; + } + const pattern = node.arguments[0].value; + let flags = isString(node.arguments[1]) ? node.arguments[1].value : ""; + + if (allowedFlags) { + flags = flags.replace(allowedFlags, ""); + } + + // If flags are unknown, check both are errored or not. + const message = validateRegExpFlags(flags) || ( + flags + ? validateRegExpPattern(pattern, flags.indexOf("u") !== -1) + : validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) + ); + + if (message) { + context.report({ + node, + messageId: "regexMessage", + data: { message } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-invalid-this.js b/node_modules/eslint/lib/rules/no-invalid-this.js new file mode 100644 index 0000000..a79c586 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-invalid-this.js @@ -0,0 +1,145 @@ +/** + * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `this` keywords outside of classes or class-like objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-invalid-this" + }, + + schema: [ + { + type: "object", + properties: { + capIsConstructor: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedThis: "Unexpected 'this'." + } + }, + + create(context) { + const options = context.options[0] || {}; + const capIsConstructor = options.capIsConstructor !== false; + const stack = [], + sourceCode = context.getSourceCode(); + + /** + * Gets the current checking context. + * + * The return value has a flag that whether or not `this` keyword is valid. + * The flag is initialized when got at the first time. + * @returns {{valid: boolean}} + * an object which has a flag that whether or not `this` keyword is valid. + */ + stack.getCurrent = function() { + const current = this[this.length - 1]; + + if (!current.init) { + current.init = true; + current.valid = !astUtils.isDefaultThisBinding( + current.node, + sourceCode, + { capIsConstructor } + ); + } + return current; + }; + + /** + * Pushs new checking context into the stack. + * + * The checking context is not initialized yet. + * Because most functions don't have `this` keyword. + * When `this` keyword was found, the checking context is initialized. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + */ + function enterFunction(node) { + + // `this` can be invalid only under strict mode. + stack.push({ + init: !context.getScope().isStrict, + node, + valid: true + }); + } + + /** + * Pops the current checking context from the stack. + * @returns {void} + */ + function exitFunction() { + stack.pop(); + } + + return { + + /* + * `this` is invalid only under strict mode. + * Modules is always strict mode. + */ + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}; + + stack.push({ + init: true, + node, + valid: !( + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + }, + + "Program:exit"() { + stack.pop(); + }, + + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + + // Reports if `this` of the current context is invalid. + ThisExpression(node) { + const current = stack.getCurrent(); + + if (current && !current.valid) { + context.report({ + node, + messageId: "unexpectedThis" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/node_modules/eslint/lib/rules/no-irregular-whitespace.js new file mode 100644 index 0000000..0bf69b1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -0,0 +1,261 @@ +/** + * @fileoverview Rule to disallow whitespace that is not a tab or space, whitespace inside strings and comments are allowed + * @author Jonathan Kingston + * @author Christophe Porteneuve + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u; +const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mgu; +const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/mgu; +const LINE_BREAK = astUtils.createGlobalLinebreakMatcher(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow irregular whitespace", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-irregular-whitespace" + }, + + schema: [ + { + type: "object", + properties: { + skipComments: { + type: "boolean", + default: false + }, + skipStrings: { + type: "boolean", + default: true + }, + skipTemplates: { + type: "boolean", + default: false + }, + skipRegExps: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noIrregularWhitespace: "Irregular whitespace not allowed." + } + }, + + create(context) { + + // Module store of errors that we have found + let errors = []; + + // Lookup the `skipComments` option, which defaults to `false`. + const options = context.options[0] || {}; + const skipComments = !!options.skipComments; + const skipStrings = options.skipStrings !== false; + const skipRegExps = !!options.skipRegExps; + const skipTemplates = !!options.skipTemplates; + + const sourceCode = context.getSourceCode(); + const commentNodes = sourceCode.getAllComments(); + + /** + * Removes errors that occur inside a string node + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeWhitespaceError(node) { + const locStart = node.loc.start; + const locEnd = node.loc.end; + + errors = errors.filter(({ loc: { start: errorLoc } }) => { + if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) { + if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) { + return false; + } + } + return true; + }); + } + + /** + * Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInIdentifierOrLiteral(node) { + const shouldCheckStrings = skipStrings && (typeof node.value === "string"); + const shouldCheckRegExps = skipRegExps && Boolean(node.regex); + + if (shouldCheckStrings || shouldCheckRegExps) { + + // If we have irregular characters remove them from the errors list + if (ALL_IRREGULARS.test(node.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInTemplateLiteral(node) { + if (typeof node.value.raw === "string") { + if (ALL_IRREGULARS.test(node.value.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInComment(node) { + if (ALL_IRREGULARS.test(node.value)) { + removeWhitespaceError(node); + } + } + + /** + * Checks the program source for irregular whitespace + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularWhitespace(node) { + const sourceLines = sourceCode.lines; + + sourceLines.forEach((sourceLine, lineIndex) => { + const lineNumber = lineIndex + 1; + let match; + + while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) { + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: { + start: { + line: lineNumber, + column: match.index + }, + end: { + line: lineNumber, + column: match.index + match[0].length + } + } + }); + } + }); + } + + /** + * Checks the program source for irregular line terminators + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularLineTerminators(node) { + const source = sourceCode.getText(), + sourceLines = sourceCode.lines, + linebreaks = source.match(LINE_BREAK); + let lastLineIndex = -1, + match; + + while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) { + const lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0; + + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: { + start: { + line: lineIndex + 1, + column: sourceLines[lineIndex].length + }, + end: { + line: lineIndex + 2, + column: 0 + } + } + }); + + lastLineIndex = lineIndex; + } + } + + /** + * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`. + * @returns {void} + * @private + */ + function noop() {} + + const nodes = {}; + + if (ALL_IRREGULARS.test(sourceCode.getText())) { + nodes.Program = function(node) { + + /* + * As we can easily fire warnings for all white space issues with + * all the source its simpler to fire them here. + * This means we can check all the application code without having + * to worry about issues caused in the parser tokens. + * When writing this code also evaluating per node was missing out + * connecting tokens in some cases. + * We can later filter the errors when they are found to be not an + * issue in nodes we don't care about. + */ + checkForIrregularWhitespace(node); + checkForIrregularLineTerminators(node); + }; + + nodes.Identifier = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.Literal = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop; + nodes["Program:exit"] = function() { + if (skipComments) { + + // First strip errors occurring in comment nodes. + commentNodes.forEach(removeInvalidNodeErrorsInComment); + } + + // If we have any errors remaining report on them + errors.forEach(error => context.report(error)); + }; + } else { + nodes.Program = noop; + } + + return nodes; + } +}; diff --git a/node_modules/eslint/lib/rules/no-iterator.js b/node_modules/eslint/lib/rules/no-iterator.js new file mode 100644 index 0000000..9ba1e7a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-iterator.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag usage of __iterator__ property + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of the `__iterator__` property", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-iterator" + }, + + schema: [], + + messages: { + noIterator: "Reserved name '__iterator__'." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + + if (getStaticPropertyName(node) === "__iterator__") { + context.report({ + node, + messageId: "noIterator" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-label-var.js b/node_modules/eslint/lib/rules/no-label-var.js new file mode 100644 index 0000000..570db03 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-label-var.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Rule to flag labels that are the same as an identifier + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow labels that share a name with a variable", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-label-var" + }, + + schema: [], + + messages: { + identifierClashWithLabel: "Found identifier with same name as label." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the identifier is present inside current scope + * @param {Object} scope current scope + * @param {string} name To evaluate + * @returns {boolean} True if its present + * @private + */ + function findIdentifier(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + LabeledStatement(node) { + + // Fetch the innermost scope. + const scope = context.getScope(); + + /* + * Recursively find the identifier walking up the scope, starting + * with the innermost scope. + */ + if (findIdentifier(scope, node.label.name)) { + context.report({ + node, + messageId: "identifierClashWithLabel" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-labels.js b/node_modules/eslint/lib/rules/no-labels.js new file mode 100644 index 0000000..85760d8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-labels.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Disallow Labeled Statements + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow labeled statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-labels" + }, + + schema: [ + { + type: "object", + properties: { + allowLoop: { + type: "boolean", + default: false + }, + allowSwitch: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLabel: "Unexpected labeled statement.", + unexpectedLabelInBreak: "Unexpected label in break statement.", + unexpectedLabelInContinue: "Unexpected label in continue statement." + } + }, + + create(context) { + const options = context.options[0]; + const allowLoop = options && options.allowLoop; + const allowSwitch = options && options.allowSwitch; + let scopeInfo = null; + + /** + * Gets the kind of a given node. + * @param {ASTNode} node A node to get. + * @returns {string} The kind of the node. + */ + function getBodyKind(node) { + if (astUtils.isLoop(node)) { + return "loop"; + } + if (node.type === "SwitchStatement") { + return "switch"; + } + return "other"; + } + + /** + * Checks whether the label of a given kind is allowed or not. + * @param {string} kind A kind to check. + * @returns {boolean} `true` if the kind is allowed. + */ + function isAllowed(kind) { + switch (kind) { + case "loop": return allowLoop; + case "switch": return allowSwitch; + default: return false; + } + } + + /** + * Checks whether a given name is a label of a loop or not. + * @param {string} label A name of a label to check. + * @returns {boolean} `true` if the name is a label of a loop. + */ + function getKind(label) { + let info = scopeInfo; + + while (info) { + if (info.label === label) { + return info.kind; + } + info = info.upper; + } + + /* istanbul ignore next: syntax error */ + return "other"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + LabeledStatement(node) { + scopeInfo = { + label: node.label.name, + kind: getBodyKind(node.body), + upper: scopeInfo + }; + }, + + "LabeledStatement:exit"(node) { + if (!isAllowed(scopeInfo.kind)) { + context.report({ + node, + messageId: "unexpectedLabel" + }); + } + + scopeInfo = scopeInfo.upper; + }, + + BreakStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInBreak" + }); + } + }, + + ContinueStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInContinue" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-lone-blocks.js b/node_modules/eslint/lib/rules/no-lone-blocks.js new file mode 100644 index 0000000..290784b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -0,0 +1,128 @@ +/** + * @fileoverview Rule to flag blocks with no reason to exist + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary nested blocks", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-lone-blocks" + }, + + schema: [], + + messages: { + redundantBlock: "Block is redundant.", + redundantNestedBlock: "Nested block is redundant." + } + }, + + create(context) { + + // A stack of lone blocks to be checked for block-level bindings + const loneBlocks = []; + let ruleDef; + + /** + * Reports a node as invalid. + * @param {ASTNode} node The node to be reported. + * @returns {void} + */ + function report(node) { + const messageId = node.parent.type === "BlockStatement" ? "redundantNestedBlock" : "redundantBlock"; + + context.report({ + node, + messageId + }); + } + + /** + * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lone block. + */ + function isLoneBlock(node) { + return node.parent.type === "BlockStatement" || + node.parent.type === "Program" || + + // Don't report blocks in switch cases if the block is the only statement of the case. + node.parent.type === "SwitchCase" && !(node.parent.consequent[0] === node && node.parent.consequent.length === 1); + } + + /** + * Checks the enclosing block of the current node for block-level bindings, + * and "marks it" as valid if any. + * @returns {void} + */ + function markLoneBlock() { + if (loneBlocks.length === 0) { + return; + } + + const block = context.getAncestors().pop(); + + if (loneBlocks[loneBlocks.length - 1] === block) { + loneBlocks.pop(); + } + } + + // Default rule definition: report all lone blocks + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + report(node); + } + } + }; + + // ES6: report blocks without block-level bindings, or that's only child of another block + if (context.parserOptions.ecmaVersion >= 6) { + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + loneBlocks.push(node); + } + }, + "BlockStatement:exit"(node) { + if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) { + loneBlocks.pop(); + report(node); + } else if ( + node.parent.type === "BlockStatement" && + node.parent.body.length === 1 + ) { + report(node); + } + } + }; + + ruleDef.VariableDeclaration = function(node) { + if (node.kind === "let" || node.kind === "const") { + markLoneBlock(); + } + }; + + ruleDef.FunctionDeclaration = function() { + if (context.getScope().isStrict) { + markLoneBlock(); + } + }; + + ruleDef.ClassDeclaration = markLoneBlock; + } + + return ruleDef; + } +}; diff --git a/node_modules/eslint/lib/rules/no-lonely-if.js b/node_modules/eslint/lib/rules/no-lonely-if.js new file mode 100644 index 0000000..6552adc --- /dev/null +++ b/node_modules/eslint/lib/rules/no-lonely-if.js @@ -0,0 +1,89 @@ +/** + * @fileoverview Rule to disallow if as the only statement in an else block + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `if` statements as the only statement in `else` blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-lonely-if" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedLonelyIf: "Unexpected if as the only statement in an else block." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + IfStatement(node) { + const ancestors = context.getAncestors(), + parent = ancestors.pop(), + grandparent = ancestors.pop(); + + if (parent && parent.type === "BlockStatement" && + parent.body.length === 1 && grandparent && + grandparent.type === "IfStatement" && + parent === grandparent.alternate) { + context.report({ + node, + messageId: "unexpectedLonelyIf", + fix(fixer) { + const openingElseCurly = sourceCode.getFirstToken(parent); + const closingElseCurly = sourceCode.getLastToken(parent); + const elseKeyword = sourceCode.getTokenBefore(openingElseCurly); + const tokenAfterElseBlock = sourceCode.getTokenAfter(closingElseCurly); + const lastIfToken = sourceCode.getLastToken(node.consequent); + const sourceText = sourceCode.getText(); + + if (sourceText.slice(openingElseCurly.range[1], + node.range[0]).trim() || sourceText.slice(node.range[1], closingElseCurly.range[0]).trim()) { + + // Don't fix if there are any non-whitespace characters interfering (e.g. comments) + return null; + } + + if ( + node.consequent.type !== "BlockStatement" && lastIfToken.value !== ";" && tokenAfterElseBlock && + ( + node.consequent.loc.end.line === tokenAfterElseBlock.loc.start.line || + /^[([/+`-]/u.test(tokenAfterElseBlock.value) || + lastIfToken.value === "++" || + lastIfToken.value === "--" + ) + ) { + + /* + * If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing + * the issue would not change semantics due to ASI. If this would happen, don't do a fix. + */ + return null; + } + + return fixer.replaceTextRange( + [openingElseCurly.range[0], closingElseCurly.range[1]], + (elseKeyword.range[1] === openingElseCurly.range[0] ? " " : "") + sourceCode.getText(node) + ); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-loop-func.js b/node_modules/eslint/lib/rules/no-loop-func.js new file mode 100644 index 0000000..13ebd3e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-loop-func.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to flag creation of function inside a loop + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * @param {ASTNode} node An AST node to get. + * @returns {ASTNode|null} The containing loop node of the specified node, or + * `null`. + */ +function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + + switch (parent.type) { + case "WhileStatement": + case "DoWhileStatement": + return parent; + + case "ForStatement": + + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + + case "ForInStatement": + case "ForOfStatement": + + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + + case "ArrowFunctionExpression": + case "FunctionExpression": + case "FunctionDeclaration": + + // We don't need to check nested functions. + return null; + + default: + break; + } + } + + return null; +} + +/** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param {ASTNode} node A node to get. This is a loop node. + * @param {ASTNode|null} excludedNode A node that the result node should not + * include. + * @returns {ASTNode} The most outer loop node. + */ +function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + + return retv; +} + +/** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param {ASTNode} loopNode A containing loop node. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is safe or not. + */ +function isSafe(loopNode, reference) { + const variable = reference.resolved; + const definition = variable && variable.defs[0]; + const declaration = definition && definition.parent; + const kind = (declaration && declaration.type === "VariableDeclaration") + ? declaration.kind + : ""; + + // Variables which are declared by `const` is safe. + if (kind === "const") { + return true; + } + + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === "let" && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1] + ) { + return true; + } + + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode( + loopNode, + (kind === "let") ? declaration : null + ).range[0]; + + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safeafe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * @param {eslint-scope.Reference} upperRef A reference to check. + * @returns {boolean} `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + const id = upperRef.identifier; + + return ( + !upperRef.isWrite() || + variable.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border + ); + } + + return Boolean(variable) && variable.references.every(isSafeReference); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow function declarations that contain unsafe references inside loop statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-loop-func" + }, + + schema: [], + + messages: { + unsafeRefs: "Function declared in a loop contains unsafe references to variable(s) {{ varNames }}." + } + }, + + create(context) { + + /** + * Reports functions which match the following condition: + * + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} Whether or not the node is within a loop. + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + + if (!loopNode) { + return; + } + + const references = context.getScope().through; + const unsafeRefs = references.filter(r => !isSafe(loopNode, r)).map(r => r.identifier.name); + + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: "unsafeRefs", + data: { varNames: `'${unsafeRefs.join("', '")}'` } + }); + } + } + + return { + ArrowFunctionExpression: checkForLoops, + FunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-loss-of-precision.js b/node_modules/eslint/lib/rules/no-loss-of-precision.js new file mode 100644 index 0000000..9e28118 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-loss-of-precision.js @@ -0,0 +1,206 @@ +/** + * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime + * @author Jacob Moore + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow literal numbers that lose precision", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-loss-of-precision" + }, + schema: [], + messages: { + noLossOfPrecision: "This number literal will lose precision at runtime." + } + }, + + create(context) { + + /** + * Returns whether the node is number literal + * @param {Node} node the node literal being evaluated + * @returns {boolean} true if the node is a number literal + */ + function isNumber(node) { + return typeof node.value === "number"; + } + + /** + * Gets the source code of the given number literal. Removes `_` numeric separators from the result. + * @param {Node} node the number `Literal` node + * @returns {string} raw source code of the literal, without numeric separators + */ + function getRaw(node) { + return node.raw.replace(/_/gu, ""); + } + + /** + * Checks whether the number is base ten + * @param {ASTNode} node the node being evaluated + * @returns {boolean} true if the node is in base ten + */ + function isBaseTen(node) { + const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"]; + + return prefixes.every(prefix => !node.raw.startsWith(prefix)) && + !/^0[0-7]+$/u.test(node.raw); + } + + /** + * Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function notBaseTenLosesPrecision(node) { + const rawString = getRaw(node).toUpperCase(); + let base = 0; + + if (rawString.startsWith("0B")) { + base = 2; + } else if (rawString.startsWith("0X")) { + base = 16; + } else { + base = 8; + } + + return !rawString.endsWith(node.value.toString(base).toUpperCase()); + } + + /** + * Adds a decimal point to the numeric string at index 1 + * @param {string} stringNumber the numeric string without any decimal point + * @returns {string} the numeric string with a decimal point in the proper place + */ + function addDecimalPointToNumber(stringNumber) { + return `${stringNumber.slice(0, 1)}.${stringNumber.slice(1)}`; + } + + /** + * Returns the number stripped of leading zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeLeadingZeros(numberAsString) { + return numberAsString.replace(/^0*/u, ""); + } + + /** + * Returns the number stripped of trailing zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeTrailingZeros(numberAsString) { + return numberAsString.replace(/0*$/u, ""); + } + + /** + * Converts an integer to to an object containing the the integer's coefficient and order of magnitude + * @param {string} stringInteger the string representation of the integer being converted + * @returns {Object} the object containing the the integer's coefficient and order of magnitude + */ + function normalizeInteger(stringInteger) { + const significantDigits = removeTrailingZeros(removeLeadingZeros(stringInteger)); + + return { + magnitude: stringInteger.startsWith("0") ? stringInteger.length - 2 : stringInteger.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + } + + /** + * + * Converts a float to to an object containing the the floats's coefficient and order of magnitude + * @param {string} stringFloat the string representation of the float being converted + * @returns {Object} the object containing the the integer's coefficient and order of magnitude + */ + function normalizeFloat(stringFloat) { + const trimmedFloat = removeLeadingZeros(stringFloat); + + if (trimmedFloat.startsWith(".")) { + const decimalDigits = trimmedFloat.split(".").pop(); + const significantDigits = removeLeadingZeros(decimalDigits); + + return { + magnitude: significantDigits.length - decimalDigits.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + + } + return { + magnitude: trimmedFloat.indexOf(".") - 1, + coefficient: addDecimalPointToNumber(trimmedFloat.replace(".", "")) + + }; + } + + + /** + * Converts a base ten number to proper scientific notation + * @param {string} stringNumber the string representation of the base ten number to be converted + * @returns {string} the number converted to scientific notation + */ + function convertNumberToScientificNotation(stringNumber) { + const splitNumber = stringNumber.replace("E", "e").split("e"); + const originalCoefficient = splitNumber[0]; + const normalizedNumber = stringNumber.includes(".") ? normalizeFloat(originalCoefficient) + : normalizeInteger(originalCoefficient); + const normalizedCoefficient = normalizedNumber.coefficient; + const magnitude = splitNumber.length > 1 ? (parseInt(splitNumber[1], 10) + normalizedNumber.magnitude) + : normalizedNumber.magnitude; + + return `${normalizedCoefficient}e${magnitude}`; + + } + + /** + * Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function baseTenLosesPrecision(node) { + const normalizedRawNumber = convertNumberToScientificNotation(getRaw(node)); + const requestedPrecision = normalizedRawNumber.split("e")[0].replace(".", "").length; + + if (requestedPrecision > 100) { + return true; + } + const storedNumber = node.value.toPrecision(requestedPrecision); + const normalizedStoredNumber = convertNumberToScientificNotation(storedNumber); + + return normalizedRawNumber !== normalizedStoredNumber; + } + + + /** + * Checks that the user-intended number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function losesPrecision(node) { + return isBaseTen(node) ? baseTenLosesPrecision(node) : notBaseTenLosesPrecision(node); + } + + + return { + Literal(node) { + if (node.value && isNumber(node) && losesPrecision(node)) { + context.report({ + messageId: "noLossOfPrecision", + node + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-magic-numbers.js b/node_modules/eslint/lib/rules/no-magic-numbers.js new file mode 100644 index 0000000..510b3f9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) + * @author Vincent Lemeunier + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Maximum array length by the ECMAScript Specification. +const MAX_ARRAY_LENGTH = 2 ** 32 - 1; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Convert the value to bigint if it's a string. Otherwise return the value as-is. + * @param {bigint|number|string} x The value to normalize. + * @returns {bigint|number} The normalized value. + */ +function normalizeIgnoreValue(x) { + if (typeof x === "string") { + return BigInt(x.slice(0, -1)); + } + return x; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow magic numbers", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-magic-numbers" + }, + + schema: [{ + type: "object", + properties: { + detectObjects: { + type: "boolean", + default: false + }, + enforceConst: { + type: "boolean", + default: false + }, + ignore: { + type: "array", + items: { + anyOf: [ + { type: "number" }, + { type: "string", pattern: "^[+-]?(?:0|[1-9][0-9]*)n$" } + ] + }, + uniqueItems: true + }, + ignoreArrayIndexes: { + type: "boolean", + default: false + }, + ignoreDefaultValues: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + useConst: "Number constants declarations must use 'const'.", + noMagic: "No magic number: {{raw}}." + } + }, + + create(context) { + const config = context.options[0] || {}, + detectObjects = !!config.detectObjects, + enforceConst = !!config.enforceConst, + ignore = (config.ignore || []).map(normalizeIgnoreValue), + ignoreArrayIndexes = !!config.ignoreArrayIndexes, + ignoreDefaultValues = !!config.ignoreDefaultValues; + + const okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; + + /** + * Returns whether the rule is configured to ignore the given value + * @param {bigint|number} value The value to check + * @returns {boolean} true if the value is ignored + */ + function isIgnoredValue(value) { + return ignore.indexOf(value) !== -1; + } + + /** + * Returns whether the number is a default value assignment. + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the number is a default value + */ + function isDefaultValue(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "AssignmentPattern" && parent.right === fullNumberNode; + } + + /** + * Returns whether the given node is used as a radix within parseInt() or Number.parseInt() + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is radix + */ + function isParseIntRadix(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "CallExpression" && fullNumberNode === parent.arguments[1] && + ( + astUtils.isSpecificId(parent.callee, "parseInt") || + astUtils.isSpecificMemberAccess(parent.callee, "Number", "parseInt") + ); + } + + /** + * Returns whether the given node is a direct child of a JSX node. + * In particular, it aims to detect numbers used as prop values in JSX tags. + * Example: + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is a JSX number + */ + function isJSXNumber(fullNumberNode) { + return fullNumberNode.parent.type.indexOf("JSX") === 0; + } + + /** + * Returns whether the given node is used as an array index. + * Value must coerce to a valid array index name: "0", "1", "2" ... "4294967294". + * + * All other values, like "-1", "2.5", or "4294967295", are just "normal" object properties, + * which can be created and accessed on an array in addition to the array index properties, + * but they don't affect array's length and are not considered by methods such as .map(), .forEach() etc. + * + * The maximum array length by the specification is 2 ** 32 - 1 = 4294967295, + * thus the maximum valid index is 2 ** 32 - 2 = 4294967294. + * + * All notations are allowed, as long as the value coerces to one of "0", "1", "2" ... "4294967294". + * + * Valid examples: + * a[0], a[1], a[1.2e1], a[0xAB], a[0n], a[1n] + * a[-0] (same as a[0] because -0 coerces to "0") + * a[-0n] (-0n evaluates to 0n) + * + * Invalid examples: + * a[-1], a[-0xAB], a[-1n], a[2.5], a[1.23e1], a[12e-1] + * a[4294967295] (above the max index, it's an access to a regular property a["4294967295"]) + * a[999999999999999999999] (even if it wasn't above the max index, it would be a["1e+21"]) + * a[1e310] (same as a["Infinity"]) + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @param {bigint|number} value Value expressed by the fullNumberNode + * @returns {boolean} true if the node is a valid array index + */ + function isArrayIndex(fullNumberNode, value) { + const parent = fullNumberNode.parent; + + return parent.type === "MemberExpression" && parent.property === fullNumberNode && + (Number.isInteger(value) || typeof value === "bigint") && + value >= 0 && value < MAX_ARRAY_LENGTH; + } + + return { + Literal(node) { + if (!astUtils.isNumericLiteral(node)) { + return; + } + + let fullNumberNode; + let value; + let raw; + + // Treat unary minus as a part of the number + if (node.parent.type === "UnaryExpression" && node.parent.operator === "-") { + fullNumberNode = node.parent; + value = -node.value; + raw = `-${node.raw}`; + } else { + fullNumberNode = node; + value = node.value; + raw = node.raw; + } + + const parent = fullNumberNode.parent; + + // Always allow radix arguments and JSX props + if ( + isIgnoredValue(value) || + (ignoreDefaultValues && isDefaultValue(fullNumberNode)) || + isParseIntRadix(fullNumberNode) || + isJSXNumber(fullNumberNode) || + (ignoreArrayIndexes && isArrayIndex(fullNumberNode, value)) + ) { + return; + } + + if (parent.type === "VariableDeclarator") { + if (enforceConst && parent.parent.kind !== "const") { + context.report({ + node: fullNumberNode, + messageId: "useConst" + }); + } + } else if ( + okTypes.indexOf(parent.type) === -1 || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier") + ) { + context.report({ + node: fullNumberNode, + messageId: "noMagic", + data: { + raw + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-misleading-character-class.js b/node_modules/eslint/lib/rules/no-misleading-character-class.js new file mode 100644 index 0000000..3d00461 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -0,0 +1,200 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("regexpp"); +const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Iterate character sequences of a given nodes. + * + * CharacterClassRange syntax can steal a part of character sequence, + * so this function reverts CharacterClassRange syntax and restore the sequence. + * @param {regexpp.AST.CharacterClassElement[]} nodes The node list to iterate character sequences. + * @returns {IterableIterator} The list of character sequences. + */ +function *iterateCharacterSequence(nodes) { + let seq = []; + + for (const node of nodes) { + switch (node.type) { + case "Character": + seq.push(node.value); + break; + + case "CharacterClassRange": + seq.push(node.min.value); + yield seq; + seq = [node.max.value]; + break; + + case "CharacterSet": + if (seq.length > 0) { + yield seq; + seq = []; + } + break; + + // no default + } + } + + if (seq.length > 0) { + yield seq; + } +} + +const hasCharacterSequence = { + surrogatePairWithoutUFlag(chars) { + return chars.some((c, i) => i !== 0 && isSurrogatePair(chars[i - 1], c)); + }, + + combiningClass(chars) { + return chars.some((c, i) => ( + i !== 0 && + isCombiningCharacter(c) && + !isCombiningCharacter(chars[i - 1]) + )); + }, + + emojiModifier(chars) { + return chars.some((c, i) => ( + i !== 0 && + isEmojiModifier(c) && + !isEmojiModifier(chars[i - 1]) + )); + }, + + regionalIndicatorSymbol(chars) { + return chars.some((c, i) => ( + i !== 0 && + isRegionalIndicatorSymbol(c) && + isRegionalIndicatorSymbol(chars[i - 1]) + )); + }, + + zwj(chars) { + const lastIndex = chars.length - 1; + + return chars.some((c, i) => ( + i !== 0 && + i !== lastIndex && + c === 0x200d && + chars[i - 1] !== 0x200d && + chars[i + 1] !== 0x200d + )); + } +}; + +const kinds = Object.keys(hasCharacterSequence); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow characters which are made with multiple code points in character class syntax", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-misleading-character-class" + }, + + schema: [], + + messages: { + surrogatePairWithoutUFlag: "Unexpected surrogate pair in character class. Use 'u' flag.", + combiningClass: "Unexpected combined character in character class.", + emojiModifier: "Unexpected modified Emoji in character class.", + regionalIndicatorSymbol: "Unexpected national flag in character class.", + zwj: "Unexpected joined character sequence in character class." + } + }, + create(context) { + const parser = new RegExpParser(); + + /** + * Verify a given regular expression. + * @param {Node} node The node to report. + * @param {string} pattern The regular expression pattern to verify. + * @param {string} flags The flags of the regular expression. + * @returns {void} + */ + function verify(node, pattern, flags) { + const has = { + surrogatePairWithoutUFlag: false, + combiningClass: false, + variationSelector: false, + emojiModifier: false, + regionalIndicatorSymbol: false, + zwj: false + }; + let patternNode; + + try { + patternNode = parser.parsePattern( + pattern, + 0, + pattern.length, + flags.includes("u") + ); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(patternNode, { + onCharacterClassEnter(ccNode) { + for (const chars of iterateCharacterSequence(ccNode.elements)) { + for (const kind of kinds) { + has[kind] = has[kind] || hasCharacterSequence[kind](chars); + } + } + } + }); + + for (const kind of kinds) { + if (has[kind]) { + context.report({ node, messageId: kind }); + } + } + } + + return { + "Literal[regex]"(node) { + verify(node, node.regex.pattern, node.regex.flags); + }, + "Program"() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + + /* + * Iterate calls of RegExp. + * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`, + * `const {RegExp: a} = window; new a()`, etc... + */ + for (const { node } of tracker.iterateGlobalReferences({ + RegExp: { [CALL]: true, [CONSTRUCT]: true } + })) { + const [patternNode, flagsNode] = node.arguments; + const pattern = getStringIfConstant(patternNode, scope); + const flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + verify(node, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-operators.js b/node_modules/eslint/lib/rules/no-mixed-operators.js new file mode 100644 index 0000000..f0290e9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -0,0 +1,243 @@ +/** + * @fileoverview Rule to disallow mixed binary operators. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"]; +const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"]; +const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="]; +const LOGICAL_OPERATORS = ["&&", "||"]; +const RELATIONAL_OPERATORS = ["in", "instanceof"]; +const TERNARY_OPERATOR = ["?:"]; +const COALESCE_OPERATOR = ["??"]; +const ALL_OPERATORS = [].concat( + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS, + TERNARY_OPERATOR, + COALESCE_OPERATOR +); +const DEFAULT_GROUPS = [ + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS +]; +const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u; + +/** + * Normalizes options. + * @param {Object|undefined} options A options object to normalize. + * @returns {Object} Normalized option object. + */ +function normalizeOptions(options = {}) { + const hasGroups = options.groups && options.groups.length > 0; + const groups = hasGroups ? options.groups : DEFAULT_GROUPS; + const allowSamePrecedence = options.allowSamePrecedence !== false; + + return { + groups, + allowSamePrecedence + }; +} + +/** + * Checks whether any group which includes both given operator exists or not. + * @param {Array.} groups A list of groups to check. + * @param {string} left An operator. + * @param {string} right Another operator. + * @returns {boolean} `true` if such group existed. + */ +function includesBothInAGroup(groups, left, right) { + return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); +} + +/** + * Checks whether the given node is a conditional expression and returns the test node else the left node. + * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node. + * This parent node can be BinaryExpression, LogicalExpression + * , or a ConditionalExpression node + * @returns {ASTNode} node the appropriate node(left or test). + */ +function getChildNode(node) { + return node.type === "ConditionalExpression" ? node.test : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow mixed binary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-mixed-operators" + }, + + schema: [ + { + type: "object", + properties: { + groups: { + type: "array", + items: { + type: "array", + items: { enum: ALL_OPERATORS }, + minItems: 2, + uniqueItems: true + }, + uniqueItems: true + }, + allowSamePrecedence: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = normalizeOptions(context.options[0]); + + /** + * Checks whether a given node should be ignored by options or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node should be ignored. + */ + function shouldIgnore(node) { + const a = node; + const b = node.parent; + + return ( + !includesBothInAGroup(options.groups, a.operator, b.type === "ConditionalExpression" ? "?:" : b.operator) || + ( + options.allowSamePrecedence && + astUtils.getPrecedence(a) === astUtils.getPrecedence(b) + ) + ); + } + + /** + * Checks whether the operator of a given node is mixed with parent + * node's operator or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithParent(node) { + + return ( + node.operator !== node.parent.operator && + !astUtils.isParenthesised(sourceCode, node) + ); + } + + /** + * Checks whether the operator of a given node is mixed with a + * conditional expression. + * @param {ASTNode} node A node to check. This is a conditional + * expression node + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithConditionalParent(node) { + return !astUtils.isParenthesised(sourceCode, node) && !astUtils.isParenthesised(sourceCode, node.test); + } + + /** + * Gets the operator token of a given node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. + * @returns {Token} The operator token of the node. + */ + function getOperatorToken(node) { + return sourceCode.getTokenAfter(getChildNode(node), astUtils.isNotClosingParenToken); + } + + /** + * Reports both the operator of a given node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {void} + */ + function reportBothOperators(node) { + const parent = node.parent; + const left = (getChildNode(parent) === node) ? node : parent; + const right = (getChildNode(parent) !== node) ? node : parent; + const data = { + leftOperator: left.operator || "?:", + rightOperator: right.operator || "?:" + }; + + context.report({ + node: left, + loc: getOperatorToken(left).loc, + messageId: "unexpectedMixedOperator", + data + }); + context.report({ + node: right, + loc: getOperatorToken(right).loc, + messageId: "unexpectedMixedOperator", + data + }); + } + + /** + * Checks between the operator of this node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function check(node) { + if (TARGET_NODE_TYPE.test(node.parent.type)) { + if (node.parent.type === "ConditionalExpression" && !shouldIgnore(node) && isMixedWithConditionalParent(node.parent)) { + reportBothOperators(node); + } else { + if (TARGET_NODE_TYPE.test(node.parent.type) && + isMixedWithParent(node) && + !shouldIgnore(node) + ) { + reportBothOperators(node); + } + } + } + + } + + return { + BinaryExpression: check, + LogicalExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-requires.js b/node_modules/eslint/lib/rules/no-mixed-requires.js new file mode 100644 index 0000000..a02de91 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -0,0 +1,237 @@ +/** + * @fileoverview Rule to enforce grouped require statements for Node.JS + * @author Raphael Pigulla + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow `require` calls to be mixed with regular variable declarations", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-mixed-requires" + }, + + schema: [ + { + oneOf: [ + { + type: "boolean" + }, + { + type: "object", + properties: { + grouping: { + type: "boolean" + }, + allowCall: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + noMixRequire: "Do not mix 'require' and other declarations.", + noMixCoreModuleFileComputed: "Do not mix core, module, file and computed requires." + } + }, + + create(context) { + + const options = context.options[0]; + let grouping = false, + allowCall = false; + + if (typeof options === "object") { + grouping = options.grouping; + allowCall = options.allowCall; + } else { + grouping = !!options; + } + + /** + * Returns the list of built-in modules. + * @returns {string[]} An array of built-in Node.js modules. + */ + function getBuiltinModules() { + + /* + * This list is generated using: + * `require("repl")._builtinLibs.concat('repl').sort()` + * This particular list is as per nodejs v0.12.2 and iojs v0.7.1 + */ + return [ + "assert", "buffer", "child_process", "cluster", "crypto", + "dgram", "dns", "domain", "events", "fs", "http", "https", + "net", "os", "path", "punycode", "querystring", "readline", + "repl", "smalloc", "stream", "string_decoder", "tls", "tty", + "url", "util", "v8", "vm", "zlib" + ]; + } + + const BUILTIN_MODULES = getBuiltinModules(); + + const DECL_REQUIRE = "require", + DECL_UNINITIALIZED = "uninitialized", + DECL_OTHER = "other"; + + const REQ_CORE = "core", + REQ_FILE = "file", + REQ_MODULE = "module", + REQ_COMPUTED = "computed"; + + /** + * Determines the type of a declaration statement. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The type of declaration represented by the expression. + */ + function getDeclarationType(initExpression) { + if (!initExpression) { + + // "var x;" + return DECL_UNINITIALIZED; + } + + if (initExpression.type === "CallExpression" && + initExpression.callee.type === "Identifier" && + initExpression.callee.name === "require" + ) { + + // "var x = require('util');" + return DECL_REQUIRE; + } + if (allowCall && + initExpression.type === "CallExpression" && + initExpression.callee.type === "CallExpression" + ) { + + // "var x = require('diagnose')('sub-module');" + return getDeclarationType(initExpression.callee); + } + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return getDeclarationType(initExpression.object); + } + + // "var x = 42;" + return DECL_OTHER; + } + + /** + * Determines the type of module that is loaded via require. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The module type. + */ + function inferModuleType(initExpression) { + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return inferModuleType(initExpression.object); + } + if (initExpression.arguments.length === 0) { + + // "var x = require();" + return REQ_COMPUTED; + } + + const arg = initExpression.arguments[0]; + + if (arg.type !== "Literal" || typeof arg.value !== "string") { + + // "var x = require(42);" + return REQ_COMPUTED; + } + + if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { + + // "var fs = require('fs');" + return REQ_CORE; + } + if (/^\.{0,2}\//u.test(arg.value)) { + + // "var utils = require('./utils');" + return REQ_FILE; + } + + // "var async = require('async');" + return REQ_MODULE; + + } + + /** + * Check if the list of variable declarations is mixed, i.e. whether it + * contains both require and other declarations. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are mixed, false if not. + */ + function isMixed(declarations) { + const contains = {}; + + declarations.forEach(declaration => { + const type = getDeclarationType(declaration.init); + + contains[type] = true; + }); + + return !!( + contains[DECL_REQUIRE] && + (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER]) + ); + } + + /** + * Check if all require declarations in the given list are of the same + * type. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are grouped, false if not. + */ + function isGrouped(declarations) { + const found = {}; + + declarations.forEach(declaration => { + if (getDeclarationType(declaration.init) === DECL_REQUIRE) { + found[inferModuleType(declaration.init)] = true; + } + }); + + return Object.keys(found).length <= 1; + } + + + return { + + VariableDeclaration(node) { + + if (isMixed(node.declarations)) { + context.report({ + node, + messageId: "noMixRequire" + }); + } else if (grouping && !isGrouped(node.declarations)) { + context.report({ + node, + messageId: "noMixCoreModuleFileComputed" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js new file mode 100644 index 0000000..287cbda --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Disallow mixed spaces and tabs for indentation + * @author Jary Niebur + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow mixed spaces and tabs for indentation", + category: "Stylistic Issues", + recommended: true, + url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs" + }, + + schema: [ + { + enum: ["smart-tabs", true, false] + } + ], + + messages: { + mixedSpacesAndTabs: "Mixed spaces and tabs." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + let smartTabs; + + switch (context.options[0]) { + case true: // Support old syntax, maybe add deprecation warning here + case "smart-tabs": + smartTabs = true; + break; + default: + smartTabs = false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + "Program:exit"(node) { + const lines = sourceCode.lines, + comments = sourceCode.getAllComments(), + ignoredCommentLines = new Set(); + + // Add all lines except the first ones. + comments.forEach(comment => { + for (let i = comment.loc.start.line + 1; i <= comment.loc.end.line; i++) { + ignoredCommentLines.add(i); + } + }); + + /* + * At least one space followed by a tab + * or the reverse before non-tab/-space + * characters begin. + */ + let regex = /^(?=( +|\t+))\1(?:\t| )/u; + + if (smartTabs) { + + /* + * At least one space followed by a tab + * before non-tab/-space characters begin. + */ + regex = /^(?=(\t*))\1(?=( +))\2\t/u; + } + + lines.forEach((line, i) => { + const match = regex.exec(line); + + if (match) { + const lineNumber = i + 1; + const loc = { + start: { + line: lineNumber, + column: match[0].length - 2 + }, + end: { + line: lineNumber, + column: match[0].length + } + }; + + if (!ignoredCommentLines.has(lineNumber)) { + const containingNode = sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(loc.start)); + + if (!(containingNode && ["Literal", "TemplateElement"].includes(containingNode.type))) { + context.report({ + node, + loc, + messageId: "mixedSpacesAndTabs" + }); + } + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-assign.js b/node_modules/eslint/lib/rules/no-multi-assign.js new file mode 100644 index 0000000..ab6430c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-assign.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Rule to check use of chained assignment expressions + * @author Stewart Rand + */ + +"use strict"; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow use of chained assignment expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-assign" + }, + + schema: [], + + messages: { + unexpectedChain: "Unexpected chained assignment." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + AssignmentExpression(node) { + if (["AssignmentExpression", "VariableDeclarator"].indexOf(node.parent.type) !== -1) { + context.report({ + node, + messageId: "unexpectedChain" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-spaces.js b/node_modules/eslint/lib/rules/no-multi-spaces.js new file mode 100644 index 0000000..d43ed73 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Disallow use of multiple spaces. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow multiple spaces", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "object", + patternProperties: { + "^([A-Z][a-z]*)+$": { + type: "boolean" + } + }, + additionalProperties: false + }, + ignoreEOLComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + multipleSpaces: "Multiple spaces found before '{{displayValue}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const ignoreEOLComments = options.ignoreEOLComments; + const exceptions = Object.assign({ Property: true }, options.exceptions); + const hasExceptions = Object.keys(exceptions).filter(key => exceptions[key]).length > 0; + + /** + * Formats value of given comment token for error message by truncating its length. + * @param {Token} token comment token + * @returns {string} formatted value + * @private + */ + function formatReportedCommentValue(token) { + const valueLines = token.value.split("\n"); + const value = valueLines[0]; + const formattedValue = `${value.slice(0, 12)}...`; + + return valueLines.length === 1 && value.length <= 12 ? value : formattedValue; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + sourceCode.tokensAndComments.forEach((leftToken, leftIndex, tokensAndComments) => { + if (leftIndex === tokensAndComments.length - 1) { + return; + } + const rightToken = tokensAndComments[leftIndex + 1]; + + // Ignore tokens that don't have 2 spaces between them or are on different lines + if ( + !sourceCode.text.slice(leftToken.range[1], rightToken.range[0]).includes(" ") || + leftToken.loc.end.line < rightToken.loc.start.line + ) { + return; + } + + // Ignore comments that are the last token on their line if `ignoreEOLComments` is active. + if ( + ignoreEOLComments && + astUtils.isCommentToken(rightToken) && + ( + leftIndex === tokensAndComments.length - 2 || + rightToken.loc.end.line < tokensAndComments[leftIndex + 2].loc.start.line + ) + ) { + return; + } + + // Ignore tokens that are in a node in the "exceptions" object + if (hasExceptions) { + const parentNode = sourceCode.getNodeByRangeIndex(rightToken.range[0] - 1); + + if (parentNode && exceptions[parentNode.type]) { + return; + } + } + + let displayValue; + + if (rightToken.type === "Block") { + displayValue = `/*${formatReportedCommentValue(rightToken)}*/`; + } else if (rightToken.type === "Line") { + displayValue = `//${formatReportedCommentValue(rightToken)}`; + } else { + displayValue = rightToken.value; + } + + context.report({ + node: rightToken, + loc: { start: leftToken.loc.end, end: rightToken.loc.start }, + messageId: "multipleSpaces", + data: { displayValue }, + fix: fixer => fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ") + }); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-str.js b/node_modules/eslint/lib/rules/no-multi-str.js new file mode 100644 index 0000000..7cf1ae3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-str.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Rule to flag when using multiline strings + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow multiline strings", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-str" + }, + + schema: [], + + messages: { + multilineString: "Multiline support is limited to browsers supporting ES5 only." + } + }, + + create(context) { + + /** + * Determines if a given node is part of JSX syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a JSX node, false if not. + * @private + */ + function isJSXElement(node) { + return node.type.indexOf("JSX") === 0; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + Literal(node) { + if (astUtils.LINEBREAK_MATCHER.test(node.raw) && !isJSXElement(node.parent)) { + context.report({ + node, + messageId: "multilineString" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js new file mode 100644 index 0000000..9cccef3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Disallows multiple blank lines. + * implementation adapted from the no-trailing-spaces rule. + * @author Greg Cochard + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow multiple empty lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-multiple-empty-lines" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + maxEOF: { + type: "integer", + minimum: 0 + }, + maxBOF: { + type: "integer", + minimum: 0 + } + }, + required: ["max"], + additionalProperties: false + } + ], + + messages: { + blankBeginningOfFile: "Too many blank lines at the beginning of file. Max of {{max}} allowed.", + blankEndOfFile: "Too many blank lines at the end of file. Max of {{max}} allowed.", + consecutiveBlank: "More than {{max}} blank {{pluralizedLines}} not allowed." + } + }, + + create(context) { + + // Use options.max or 2 as default + let max = 2, + maxEOF = max, + maxBOF = max; + + if (context.options.length) { + max = context.options[0].max; + maxEOF = typeof context.options[0].maxEOF !== "undefined" ? context.options[0].maxEOF : max; + maxBOF = typeof context.options[0].maxBOF !== "undefined" ? context.options[0].maxBOF : max; + } + + const sourceCode = context.getSourceCode(); + + // Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue + const allLines = sourceCode.lines[sourceCode.lines.length - 1] === "" ? sourceCode.lines.slice(0, -1) : sourceCode.lines; + const templateLiteralLines = new Set(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + TemplateLiteral(node) { + node.quasis.forEach(literalPart => { + + // Empty lines have a semantic meaning if they're inside template literals. Don't count these as empty lines. + for (let ignoredLine = literalPart.loc.start.line; ignoredLine < literalPart.loc.end.line; ignoredLine++) { + templateLiteralLines.add(ignoredLine); + } + }); + }, + "Program:exit"(node) { + return allLines + + // Given a list of lines, first get a list of line numbers that are non-empty. + .reduce((nonEmptyLineNumbers, line, index) => { + if (line.trim() || templateLiteralLines.has(index + 1)) { + nonEmptyLineNumbers.push(index + 1); + } + return nonEmptyLineNumbers; + }, []) + + // Add a value at the end to allow trailing empty lines to be checked. + .concat(allLines.length + 1) + + // Given two line numbers of non-empty lines, report the lines between if the difference is too large. + .reduce((lastLineNumber, lineNumber) => { + let messageId, maxAllowed; + + if (lastLineNumber === 0) { + messageId = "blankBeginningOfFile"; + maxAllowed = maxBOF; + } else if (lineNumber === allLines.length + 1) { + messageId = "blankEndOfFile"; + maxAllowed = maxEOF; + } else { + messageId = "consecutiveBlank"; + maxAllowed = max; + } + + if (lineNumber - lastLineNumber - 1 > maxAllowed) { + context.report({ + node, + loc: { + start: { line: lastLineNumber + maxAllowed + 1, column: 0 }, + end: { line: lineNumber, column: 0 } + }, + messageId, + data: { + max: maxAllowed, + pluralizedLines: maxAllowed === 1 ? "line" : "lines" + }, + fix(fixer) { + const rangeStart = sourceCode.getIndexFromLoc({ line: lastLineNumber + 1, column: 0 }); + + /* + * The end of the removal range is usually the start index of the next line. + * However, at the end of the file there is no next line, so the end of the + * range is just the length of the text. + */ + const lineNumberAfterRemovedLines = lineNumber - maxAllowed; + const rangeEnd = lineNumberAfterRemovedLines <= allLines.length + ? sourceCode.getIndexFromLoc({ line: lineNumberAfterRemovedLines, column: 0 }) + : sourceCode.text.length; + + return fixer.removeRange([rangeStart, rangeEnd]); + } + }); + } + + return lineNumber; + }, 0); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-native-reassign.js b/node_modules/eslint/lib/rules/no-native-reassign.js new file mode 100644 index 0000000..833e3b7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-native-reassign.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignments to native objects or read-only global variables", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-native-reassign" + }, + + deprecated: true, + + replacedBy: ["no-global-assign"], + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + nativeReassign: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "nativeReassign", + data: identifier + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } + + return { + Program() { + const globalScope = context.getScope(); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-negated-condition.js b/node_modules/eslint/lib/rules/no-negated-condition.js new file mode 100644 index 0000000..8a9eba8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-negated-condition.js @@ -0,0 +1,95 @@ +/** + * @fileoverview Rule to disallow a negated condition + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow negated conditions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-negated-condition" + }, + + schema: [], + + messages: { + unexpectedNegated: "Unexpected negated condition." + } + }, + + create(context) { + + /** + * Determines if a given node is an if-else without a condition on the else + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has an else without an if. + * @private + */ + function hasElseWithoutCondition(node) { + return node.alternate && node.alternate.type !== "IfStatement"; + } + + /** + * Determines if a given node is a negated unary expression + * @param {Object} test The test object to check. + * @returns {boolean} True if the node is a negated unary expression. + * @private + */ + function isNegatedUnaryExpression(test) { + return test.type === "UnaryExpression" && test.operator === "!"; + } + + /** + * Determines if a given node is a negated binary expression + * @param {Test} test The test to check. + * @returns {boolean} True if the node is a negated binary expression. + * @private + */ + function isNegatedBinaryExpression(test) { + return test.type === "BinaryExpression" && + (test.operator === "!=" || test.operator === "!=="); + } + + /** + * Determines if a given node has a negated if expression + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has a negated if expression. + * @private + */ + function isNegatedIf(node) { + return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test); + } + + return { + IfStatement(node) { + if (!hasElseWithoutCondition(node)) { + return; + } + + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + }, + ConditionalExpression(node) { + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/node_modules/eslint/lib/rules/no-negated-in-lhs.js new file mode 100644 index 0000000..1229ced --- /dev/null +++ b/node_modules/eslint/lib/rules/no-negated-in-lhs.js @@ -0,0 +1,46 @@ +/** + * @fileoverview A rule to disallow negated left operands of the `in` operator + * @author Michael Ficarra + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow negating the left operand in `in` expressions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-negated-in-lhs" + }, + + replacedBy: ["no-unsafe-negation"], + + deprecated: true, + schema: [], + + messages: { + negatedLHS: "The 'in' expression's left operand is negated." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") { + context.report({ node, messageId: "negatedLHS" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-nested-ternary.js b/node_modules/eslint/lib/rules/no-nested-ternary.js new file mode 100644 index 0000000..383bb23 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-nested-ternary.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to flag nested ternary expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow nested ternary expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-nested-ternary" + }, + + schema: [], + + messages: { + noNestedTernary: "Do not nest ternary expressions." + } + }, + + create(context) { + + return { + ConditionalExpression(node) { + if (node.alternate.type === "ConditionalExpression" || + node.consequent.type === "ConditionalExpression") { + context.report({ + node, + messageId: "noNestedTernary" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-func.js b/node_modules/eslint/lib/rules/no-new-func.js new file mode 100644 index 0000000..9af4e31 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-func.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Rule to flag when using new Function + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators with the `Function` object", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-func" + }, + + schema: [], + + messages: { + noFunctionConstructor: "The Function constructor is eval." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const variable = globalScope.set.get("Function"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const { parent } = node; + + if ( + parent && + (parent.type === "NewExpression" || parent.type === "CallExpression") && + node === parent.callee + ) { + context.report({ + node: parent, + messageId: "noFunctionConstructor" + }); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-object.js b/node_modules/eslint/lib/rules/no-new-object.js new file mode 100644 index 0000000..e9f915d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-object.js @@ -0,0 +1,57 @@ +/** + * @fileoverview A rule to disallow calls to the Object constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `Object` constructors", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-object" + }, + + schema: [], + + messages: { + preferLiteral: "The object literal notation {} is preferrable." + } + }, + + create(context) { + return { + NewExpression(node) { + const variable = astUtils.getVariableByName( + context.getScope(), + node.callee.name + ); + + if (variable && variable.identifiers.length > 0) { + return; + } + + if (node.callee.name === "Object") { + context.report({ + node, + messageId: "preferLiteral" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-require.js b/node_modules/eslint/lib/rules/no-new-require.js new file mode 100644 index 0000000..063f783 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-require.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Rule to disallow use of new operator with the `require` function + * @author Wil Moore III + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow `new` operators with calls to `require`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-require" + }, + + schema: [], + + messages: { + noNewRequire: "Unexpected use of new with require." + } + }, + + create(context) { + + return { + + NewExpression(node) { + if (node.callee.type === "Identifier" && node.callee.name === "require") { + context.report({ + node, + messageId: "noNewRequire" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-symbol.js b/node_modules/eslint/lib/rules/no-new-symbol.js new file mode 100644 index 0000000..aeb509c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-symbol.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Rule to disallow use of the new operator with the `Symbol` object + * @author Alberto Rodríguez + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `new` operators with the `Symbol` object", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-new-symbol" + }, + + schema: [], + + messages: { + noNewSymbol: "`Symbol` cannot be called as a constructor." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const variable = globalScope.set.get("Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const parent = node.parent; + + if (parent && parent.type === "NewExpression" && parent.callee === node) { + context.report({ + node, + messageId: "noNewSymbol" + }); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-wrappers.js b/node_modules/eslint/lib/rules/no-new-wrappers.js new file mode 100644 index 0000000..d276c48 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-wrappers.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag when using constructor for wrapper objects + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-wrappers" + }, + + schema: [], + + messages: { + noConstructor: "Do not use {{fn}} as a constructor." + } + }, + + create(context) { + + return { + + NewExpression(node) { + const wrapperObjects = ["String", "Number", "Boolean"]; + + if (wrapperObjects.indexOf(node.callee.name) > -1) { + context.report({ + node, + messageId: "noConstructor", + data: { fn: node.callee.name } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new.js b/node_modules/eslint/lib/rules/no-new.js new file mode 100644 index 0000000..aa8a4e2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag statements with function invocation preceded by + * "new" and not part of assignment + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators outside of assignments or comparisons", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new" + }, + + schema: [], + + messages: { + noNewStatement: "Do not use 'new' for side effects." + } + }, + + create(context) { + + return { + "ExpressionStatement > NewExpression"(node) { + context.report({ + node: node.parent, + messageId: "noNewStatement" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-obj-calls.js b/node_modules/eslint/lib/rules/no-obj-calls.js new file mode 100644 index 0000000..6eb200c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-obj-calls.js @@ -0,0 +1,84 @@ +/** + * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker } = require("eslint-utils"); +const getPropertyName = require("./utils/ast-utils").getStaticPropertyName; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect"]; + +/** + * Returns the name of the node to report + * @param {ASTNode} node A node to report + * @returns {string} name to report + */ +function getReportNodeName(node) { + if (node.type === "ChainExpression") { + return getReportNodeName(node.expression); + } + if (node.type === "MemberExpression") { + return getPropertyName(node); + } + return node.name; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow calling global object properties as functions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-obj-calls" + }, + + schema: [], + + messages: { + unexpectedCall: "'{{name}}' is not a function.", + unexpectedRefCall: "'{{name}}' is reference to '{{ref}}', which is not a function." + } + }, + + create(context) { + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = {}; + + for (const g of nonCallableGlobals) { + traceMap[g] = { + [CALL]: true, + [CONSTRUCT]: true + }; + } + + for (const { node, path } of tracker.iterateGlobalReferences(traceMap)) { + const name = getReportNodeName(node.callee); + const ref = path[0]; + const messageId = name === ref ? "unexpectedCall" : "unexpectedRefCall"; + + context.report({ node, messageId, data: { name, ref } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-octal-escape.js b/node_modules/eslint/lib/rules/no-octal-escape.js new file mode 100644 index 0000000..5b4c7b2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-octal-escape.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Rule to flag octal escape sequences in string literals. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow octal escape sequences in string literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-octal-escape" + }, + + schema: [], + + messages: { + octalEscapeSequence: "Don't use octal: '\\{{sequence}}'. Use '\\u....' instead." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value !== "string") { + return; + } + + // \0 represents a valid NULL character if it isn't followed by a digit. + const match = node.raw.match( + /^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su + ); + + if (match) { + context.report({ + node, + messageId: "octalEscapeSequence", + data: { sequence: match[1] } + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-octal.js b/node_modules/eslint/lib/rules/no-octal.js new file mode 100644 index 0000000..e9940be --- /dev/null +++ b/node_modules/eslint/lib/rules/no-octal.js @@ -0,0 +1,45 @@ +/** + * @fileoverview Rule to flag when initializing octal literal + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow octal literals", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-octal" + }, + + schema: [], + + messages: { + noOcatal: "Octal literals should not be used." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value === "number" && /^0[0-9]/u.test(node.raw)) { + context.report({ + node, + messageId: "noOcatal" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-param-reassign.js b/node_modules/eslint/lib/rules/no-param-reassign.js new file mode 100644 index 0000000..6874af4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-param-reassign.js @@ -0,0 +1,229 @@ +/** + * @fileoverview Disallow reassignment of function parameters. + * @author Nat Burns + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/u; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow reassigning `function` parameters", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-param-reassign" + }, + + schema: [ + { + oneOf: [ + { + type: "object", + properties: { + props: { + enum: [false] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + props: { + enum: [true] + }, + ignorePropertyModificationsFor: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + ignorePropertyModificationsForRegex: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + assignmentToFunctionParam: "Assignment to function parameter '{{name}}'.", + assignmentToFunctionParamProp: "Assignment to property of function parameter '{{name}}'." + } + }, + + create(context) { + const props = context.options[0] && context.options[0].props; + const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; + const ignoredPropertyAssignmentsForRegex = context.options[0] && context.options[0].ignorePropertyModificationsForRegex || []; + + /** + * Checks whether or not the reference modifies properties of its variable. + * @param {Reference} reference A reference to check. + * @returns {boolean} Whether or not the reference modifies properties of its variable. + */ + function isModifyingProp(reference) { + let node = reference.identifier; + let parent = node.parent; + + while (parent && (!stopNodePattern.test(parent.type) || + parent.type === "ForInStatement" || parent.type === "ForOfStatement")) { + switch (parent.type) { + + // e.g. foo.a = 0; + case "AssignmentExpression": + return parent.left === node; + + // e.g. ++foo.a; + case "UpdateExpression": + return true; + + // e.g. delete foo.a; + case "UnaryExpression": + if (parent.operator === "delete") { + return true; + } + break; + + // e.g. for (foo.a in b) {} + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + return true; + } + + // this is a stop node for parent.right and parent.body + return false; + + // EXCLUDES: e.g. cache.get(foo.a).b = 0; + case "CallExpression": + if (parent.callee !== node) { + return false; + } + break; + + // EXCLUDES: e.g. cache[foo.a] = 0; + case "MemberExpression": + if (parent.property === node) { + return false; + } + break; + + // EXCLUDES: e.g. ({ [foo]: a }) = bar; + case "Property": + if (parent.key === node) { + return false; + } + + break; + + // EXCLUDES: e.g. (foo ? a : b).c = bar; + case "ConditionalExpression": + if (parent.test === node) { + return false; + } + + break; + + // no default + } + + node = parent; + parent = node.parent; + } + + return false; + } + + /** + * Tests that an identifier name matches any of the ignored property assignments. + * First we test strings in ignoredPropertyAssignmentsFor. + * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings. + * @param {string} identifierName A string that describes the name of an identifier to + * ignore property assignments for. + * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not. + */ + function isIgnoredPropertyAssignment(identifierName) { + return ignoredPropertyAssignmentsFor.includes(identifierName) || + ignoredPropertyAssignmentsForRegex.some(ignored => new RegExp(ignored, "u").test(identifierName)); + } + + /** + * Reports a reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (identifier && + !reference.init && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + if (reference.isWrite()) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParam", + data: { name: identifier.name } + }); + } else if (props && isModifyingProp(reference) && !isIgnoredPropertyAssignment(identifier.name)) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParamProp", + data: { name: identifier.name } + }); + } + } + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "Parameter") { + variable.references.forEach(checkReference); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + + // `:exit` is needed for the `node.parent` property of identifier nodes. + "FunctionDeclaration:exit": checkForFunction, + "FunctionExpression:exit": checkForFunction, + "ArrowFunctionExpression:exit": checkForFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-path-concat.js b/node_modules/eslint/lib/rules/no-path-concat.js new file mode 100644 index 0000000..fc1f894 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-path-concat.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Disallow string concatenation when using __dirname and __filename + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow string concatenation with `__dirname` and `__filename`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-path-concat" + }, + + schema: [], + + messages: { + usePathFunctions: "Use path.join() or path.resolve() instead of + to create paths." + } + }, + + create(context) { + + const MATCHER = /^__(?:dir|file)name$/u; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + BinaryExpression(node) { + + const left = node.left, + right = node.right; + + if (node.operator === "+" && + ((left.type === "Identifier" && MATCHER.test(left.name)) || + (right.type === "Identifier" && MATCHER.test(right.name))) + ) { + + context.report({ + node, + messageId: "usePathFunctions" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-plusplus.js b/node_modules/eslint/lib/rules/no-plusplus.js new file mode 100644 index 0000000..84d6c3e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-plusplus.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to flag use of unary increment and decrement operators. + * @author Ian Christian Myers + * @author Brody McKee (github.com/mrmckeb) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is the update node of a `ForStatement`. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `ForStatement` update. + */ +function isForStatementUpdate(node) { + const parent = node.parent; + + return parent.type === "ForStatement" && parent.update === node; +} + +/** + * Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule. + * In particular, it returns `true` if the given node is either: + * - The update node of a `ForStatement`: for (;; i++) {} + * - An operand of a sequence expression that is the update node: for (;; foo(), i++) {} + * - An operand of a sequence expression that is child of another sequence expression, etc., + * up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {} + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a for loop afterthought. + */ +function isForLoopAfterthought(node) { + const parent = node.parent; + + if (parent.type === "SequenceExpression") { + return isForLoopAfterthought(parent); + } + + return isForStatementUpdate(node); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the unary operators `++` and `--`", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-plusplus" + }, + + schema: [ + { + type: "object", + properties: { + allowForLoopAfterthoughts: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnaryOp: "Unary operator '{{operator}}' used." + } + }, + + create(context) { + + const config = context.options[0]; + let allowForLoopAfterthoughts = false; + + if (typeof config === "object") { + allowForLoopAfterthoughts = config.allowForLoopAfterthoughts === true; + } + + return { + + UpdateExpression(node) { + if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedUnaryOp", + data: { + operator: node.operator + } + }); + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-process-env.js b/node_modules/eslint/lib/rules/no-process-env.js new file mode 100644 index 0000000..49d1734 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-process-env.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Disallow the use of process.env() + * @author Vignesh Anand + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow the use of `process.env`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-process-env" + }, + + schema: [], + + messages: { + unexpectedProcessEnv: "Unexpected use of process.env." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "process" && !node.computed && propertyName && propertyName === "env") { + context.report({ node, messageId: "unexpectedProcessEnv" }); + } + + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-process-exit.js b/node_modules/eslint/lib/rules/no-process-exit.js new file mode 100644 index 0000000..77c9cfd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-process-exit.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Disallow the use of process.exit() + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow the use of `process.exit()`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-process-exit" + }, + + schema: [], + + messages: { + noProcessExit: "Don't use process.exit(); throw an error instead." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) { + context.report({ node: node.parent, messageId: "noProcessExit" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-promise-executor-return.js b/node_modules/eslint/lib/rules/no-promise-executor-return.js new file mode 100644 index 0000000..32ee6e1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-promise-executor-return.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to disallow returning values from Promise executor functions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const functionTypesToCheck = new Set(["ArrowFunctionExpression", "FunctionExpression"]); + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + return upper; +} + +/** + * Determines whether the given function node is used as a Promise executor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Function's own scope. + * @returns {boolean} `true` if the node is a Promise executor. + */ +function isPromiseExecutor(node, scope) { + const parent = node.parent; + + return parent.type === "NewExpression" && + parent.arguments[0] === node && + parent.callee.type === "Identifier" && + parent.callee.name === "Promise" && + isGlobalReference(parent.callee, getOuterScope(scope)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning values from Promise executor functions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-promise-executor-return" + }, + + schema: [], + + messages: { + returnsValue: "Return values from promise executor functions cannot be read." + } + }, + + create(context) { + + let funcInfo = null; + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + onCodePathStart(_, node) { + funcInfo = { + upper: funcInfo, + shouldCheck: functionTypesToCheck.has(node.type) && isPromiseExecutor(node, context.getScope()) + }; + + if (funcInfo.shouldCheck && node.type === "ArrowFunctionExpression" && node.expression) { + report(node.body); + } + }, + + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + ReturnStatement(node) { + if (funcInfo.shouldCheck && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-proto.js b/node_modules/eslint/lib/rules/no-proto.js new file mode 100644 index 0000000..82ce02f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-proto.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag usage of __proto__ property + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of the `__proto__` property", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-proto" + }, + + schema: [], + + messages: { + unexpectedProto: "The '__proto__' property is deprecated." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + if (getStaticPropertyName(node) === "__proto__") { + context.report({ node, messageId: "unexpectedProto" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-prototype-builtins.js b/node_modules/eslint/lib/rules/no-prototype-builtins.js new file mode 100644 index 0000000..ccec86c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-prototype-builtins.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to disallow use of Object.prototype builtins on objects + * @author Andrew Levine + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow calling some `Object.prototype` methods directly on objects", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-prototype-builtins" + }, + + schema: [], + + messages: { + prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object." + } + }, + + create(context) { + const DISALLOWED_PROPS = [ + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable" + ]; + + /** + * Reports if a disallowed property is used in a CallExpression + * @param {ASTNode} node The CallExpression node. + * @returns {void} + */ + function disallowBuiltIns(node) { + + // TODO: just use `astUtils.getStaticPropertyName(node.callee)` + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type !== "MemberExpression" || callee.computed) { + return; + } + const propName = callee.property.name; + + if (DISALLOWED_PROPS.indexOf(propName) > -1) { + context.report({ + messageId: "prototypeBuildIn", + loc: callee.property.loc, + data: { prop: propName }, + node + }); + } + } + + return { + CallExpression: disallowBuiltIns + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-redeclare.js b/node_modules/eslint/lib/rules/no-redeclare.js new file mode 100644 index 0000000..6ddb21c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-redeclare.js @@ -0,0 +1,172 @@ +/** + * @fileoverview Rule to flag when the same variable is declared more then once. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow variable redeclaration", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-redeclare" + }, + + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration." + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean", default: true } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const options = { + builtinGlobals: Boolean( + context.options.length === 0 || + context.options[0].builtinGlobals + ) + }; + const sourceCode = context.getSourceCode(); + + /** + * Iterate declarations of a given variable. + * @param {escope.variable} variable The variable object to iterate declarations. + * @returns {IterableIterator<{type:string,node:ASTNode,loc:SourceLocation}>} The declarations. + */ + function *iterateDeclarations(variable) { + if (options.builtinGlobals && ( + variable.eslintImplicitGlobalSetting === "readonly" || + variable.eslintImplicitGlobalSetting === "writable" + )) { + yield { type: "builtin" }; + } + + for (const id of variable.identifiers) { + yield { type: "syntax", node: id, loc: id.loc }; + } + + if (variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + type: "comment", + node: comment, + loc: astUtils.getNameLocationInGlobalDirectiveComment( + sourceCode, + comment, + variable.name + ) + }; + } + } + } + + /** + * Find variables in a given scope and flag redeclared ones. + * @param {Scope} scope An eslint-scope scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [ + declaration, + ...extraDeclarations + ] = iterateDeclarations(variable); + + if (extraDeclarations.length === 0) { + continue; + } + + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === "builtin" + ? "redeclaredAsBuiltin" + : "redeclaredBySyntax"; + const data = { id: variable.name }; + + // Report extra declarations. + for (const { type, node, loc } of extraDeclarations) { + const messageId = type === declaration.type + ? "redeclared" + : detailMessageId; + + context.report({ node, loc, messageId, data }); + } + } + } + + /** + * Find variables in the current scope. + * @param {ASTNode} node The node of the current scope. + * @returns {void} + * @private + */ + function checkForBlock(node) { + const scope = context.getScope(); + + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + + return { + Program() { + const scope = context.getScope(); + + findVariablesInScope(scope); + + // Node.js or ES modules has a special scope. + if ( + scope.type === "global" && + scope.childScopes[0] && + + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block + ) { + findVariablesInScope(scope.childScopes[0]); + } + }, + + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + ArrowFunctionExpression: checkForBlock, + + BlockStatement: checkForBlock, + ForStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + SwitchStatement: checkForBlock + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-regex-spaces.js b/node_modules/eslint/lib/rules/no-regex-spaces.js new file mode 100644 index 0000000..e6d4c9e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-regex-spaces.js @@ -0,0 +1,180 @@ +/** + * @fileoverview Rule to count multiple spaces in regular expressions + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const regexpp = require("regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const regExpParser = new regexpp.RegExpParser(); +const DOUBLE_SPACE = / {2}/u; + +/** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ +function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow multiple spaces in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-regex-spaces" + }, + + schema: [], + fixable: "code", + + messages: { + multipleSpaces: "Spaces are hard to count. Use {{{length}}}." + } + }, + + create(context) { + + /** + * Validate regular expression + * @param {ASTNode} nodeToReport Node to report. + * @param {string} pattern Regular expression pattern to validate. + * @param {string} rawPattern Raw representation of the pattern in the source code. + * @param {number} rawPatternStartRange Start range of the pattern in the source code. + * @param {string} flags Regular expression flags. + * @returns {void} + * @private + */ + function checkRegex(nodeToReport, pattern, rawPattern, rawPatternStartRange, flags) { + + // Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ '). + if (!DOUBLE_SPACE.test(rawPattern)) { + return; + } + + const characterClassNodes = []; + let regExpAST; + + try { + regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + regexpp.visitRegExpAST(regExpAST, { + onCharacterClassEnter(ccNode) { + characterClassNodes.push(ccNode); + } + }); + + const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu; + let match; + + while ((match = spacesPattern.exec(pattern))) { + const { 1: { length }, index } = match; + + // Report only consecutive spaces that are not in character classes. + if ( + characterClassNodes.every(({ start, end }) => index < start || end <= index) + ) { + context.report({ + node: nodeToReport, + messageId: "multipleSpaces", + data: { length }, + fix(fixer) { + if (pattern !== rawPattern) { + return null; + } + return fixer.replaceTextRange( + [rawPatternStartRange + index, rawPatternStartRange + index + length], + ` {${length}}` + ); + } + }); + + // Report only the first occurrence of consecutive spaces + return; + } + } + } + + /** + * Validate regular expression literals + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkLiteral(node) { + if (node.regex) { + const pattern = node.regex.pattern; + const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/")); + const rawPatternStartRange = node.range[0] + 1; + const flags = node.regex.flags; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + /** + * Validate strings passed to the RegExp constructor + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkFunction(node) { + const scope = context.getScope(); + const regExpVar = astUtils.getVariableByName(scope, "RegExp"); + const shadowed = regExpVar && regExpVar.defs.length > 0; + const patternNode = node.arguments[0]; + const flagsNode = node.arguments[1]; + + if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(patternNode) && !shadowed) { + const pattern = patternNode.value; + const rawPattern = patternNode.raw.slice(1, -1); + const rawPatternStartRange = patternNode.range[0] + 1; + const flags = isString(flagsNode) ? flagsNode.value : ""; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + return { + Literal: checkLiteral, + CallExpression: checkFunction, + NewExpression: checkFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-exports.js b/node_modules/eslint/lib/rules/no-restricted-exports.js new file mode 100644 index 0000000..6031e26 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Rule to disallow specified names in exports + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified names in exports", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-exports" + }, + + schema: [{ + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + restrictedNamed: "'{{name}}' is restricted from being used as an exported name." + } + }, + + create(context) { + + const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports); + + /** + * Checks and reports given exported identifier. + * @param {ASTNode} node exported `Identifer` node to check. + * @returns {void} + */ + function checkExportedName(node) { + const name = node.name; + + if (restrictedNames.has(name)) { + context.report({ + node, + messageId: "restrictedNamed", + data: { name } + }); + } + } + + return { + ExportAllDeclaration(node) { + if (node.exported) { + checkExportedName(node.exported); + } + }, + + ExportNamedDeclaration(node) { + const declaration = node.declaration; + + if (declaration) { + if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") { + checkExportedName(declaration.id); + } else if (declaration.type === "VariableDeclaration") { + context.getDeclaredVariables(declaration) + .map(v => v.defs.find(d => d.parent === declaration)) + .map(d => d.name) // Identifier nodes + .forEach(checkExportedName); + } + } else { + node.specifiers + .map(s => s.exported) + .forEach(checkExportedName); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-globals.js b/node_modules/eslint/lib/rules/no-restricted-globals.js new file mode 100644 index 0000000..2c932a7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-globals.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Restrict usage of specified globals. + * @author Benoît Zugmeyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified global variables", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-globals" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { type: "string" } + }, + required: ["name"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + defaultMessage: "Unexpected use of '{{name}}'.", + // eslint-disable-next-line eslint-plugin/report-message-format + customMessage: "Unexpected use of '{{name}}'. {{customMessage}}" + } + }, + + create(context) { + + // If no globals are restricted, we don't need to do anything + if (context.options.length === 0) { + return {}; + } + + const restrictedGlobalMessages = context.options.reduce((memo, option) => { + if (typeof option === "string") { + memo[option] = null; + } else { + memo[option.name] = option.message; + } + + return memo; + }, {}); + + /** + * Report a variable to be used as a restricted global. + * @param {Reference} reference the variable reference + * @returns {void} + * @private + */ + function reportReference(reference) { + const name = reference.identifier.name, + customMessage = restrictedGlobalMessages[name], + messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node: reference.identifier, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted global name. + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted global or not + * @private + */ + function isRestricted(name) { + return Object.prototype.hasOwnProperty.call(restrictedGlobalMessages, name); + } + + return { + Program() { + const scope = context.getScope(); + + // Report variables declared elsewhere (ex: variables defined as "global" by eslint) + scope.variables.forEach(variable => { + if (!variable.defs.length && isRestricted(variable.name)) { + variable.references.forEach(reportReference); + } + }); + + // Report variables not declared at all + scope.through.forEach(reference => { + if (isRestricted(reference.identifier.name)) { + reportReference(reference); + } + }); + + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-imports.js b/node_modules/eslint/lib/rules/no-restricted-imports.js new file mode 100644 index 0000000..c205dad --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -0,0 +1,268 @@ +/** + * @fileoverview Restrict usage of specified node imports. + * @author Guy Ellis + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + }, + importNames: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified modules when loaded by `import`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-imports" + }, + + messages: { + path: "'{{importSource}}' import is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format + pathWithCustomMessage: "'{{importSource}}' import is restricted from being used. {{customMessage}}", + + patterns: "'{{importSource}}' import is restricted from being used by a pattern.", + + everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format + everythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}", + + importName: "'{{importName}}' import from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format + importNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: [{ + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }], + additionalItems: false + } + ] + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + // if no imports are restricted we don"t need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + const restrictedPathMessages = restrictedPaths.reduce((memo, importSource) => { + if (typeof importSource === "string") { + memo[importSource] = { message: null }; + } else { + memo[importSource.name] = { + message: importSource.message, + importNames: importSource.importNames + }; + } + return memo; + }, {}); + + const restrictedPatternsMatcher = ignore().add(restrictedPatterns); + + /** + * Report a restricted path. + * @param {string} importSource path of the import + * @param {Map} importNames Map of import names that are being imported + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function checkRestrictedPathAndReport(importSource, importNames, node) { + if (!Object.prototype.hasOwnProperty.call(restrictedPathMessages, importSource)) { + return; + } + + const customMessage = restrictedPathMessages[importSource].message; + const restrictedImportNames = restrictedPathMessages[importSource].importNames; + + if (restrictedImportNames) { + if (importNames.has("*")) { + const specifierData = importNames.get("*")[0]; + + context.report({ + node, + messageId: customMessage ? "everythingWithCustomMessage" : "everything", + loc: specifierData.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } + + restrictedImportNames.forEach(importName => { + if (importNames.has(importName)) { + const specifiers = importNames.get(importName); + + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "importNameWithCustomMessage" : "importName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); + } + }); + } else { + context.report({ + node, + messageId: customMessage ? "pathWithCustomMessage" : "path", + data: { + importSource, + customMessage + } + }); + } + } + + /** + * Report a restricted path specifically for patterns. + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function reportPathForPatterns(node) { + const importSource = node.source.value.trim(); + + context.report({ + node, + messageId: "patterns", + data: { + importSource + } + }); + } + + /** + * Check if the given importSource is restricted by a pattern. + * @param {string} importSource path of the import + * @returns {boolean} whether the variable is a restricted pattern or not + * @private + */ + function isRestrictedPattern(importSource) { + return restrictedPatterns.length > 0 && restrictedPatternsMatcher.ignores(importSource); + } + + /** + * Checks a node to see if any problems should be reported. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkNode(node) { + const importSource = node.source.value.trim(); + const importNames = new Map(); + + if (node.type === "ExportAllDeclaration") { + const starToken = sourceCode.getFirstToken(node, 1); + + importNames.set("*", [{ loc: starToken.loc }]); + } else if (node.specifiers) { + for (const specifier of node.specifiers) { + let name; + const specifierData = { loc: specifier.loc }; + + if (specifier.type === "ImportDefaultSpecifier") { + name = "default"; + } else if (specifier.type === "ImportNamespaceSpecifier") { + name = "*"; + } else if (specifier.imported) { + name = specifier.imported.name; + } else if (specifier.local) { + name = specifier.local.name; + } + + if (name) { + if (importNames.has(name)) { + importNames.get(name).push(specifierData); + } else { + importNames.set(name, [specifierData]); + } + } + } + } + + checkRestrictedPathAndReport(importSource, importNames, node); + + if (isRestrictedPattern(importSource)) { + reportPathForPatterns(node); + } + } + + return { + ImportDeclaration: checkNode, + ExportNamedDeclaration(node) { + if (node.source) { + checkNode(node); + } + }, + ExportAllDeclaration: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-modules.js b/node_modules/eslint/lib/rules/no-restricted-modules.js new file mode 100644 index 0000000..d0b8a78 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-modules.js @@ -0,0 +1,214 @@ +/** + * @fileoverview Restrict usage of specified node modules. + * @author Christian Schulz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow specified modules when loaded by `require`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-modules" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: { + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }, + additionalItems: false + } + ] + }, + + messages: { + defaultMessage: "'{{name}}' module is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format + customMessage: "'{{name}}' module is restricted from being used. {{customMessage}}", + patternMessage: "'{{name}}' module is restricted from being used by a pattern." + } + }, + + create(context) { + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + const restrictedPathMessages = restrictedPaths.reduce((memo, importName) => { + if (typeof importName === "string") { + memo[importName] = null; + } else { + memo[importName.name] = importName.message; + } + return memo; + }, {}); + + // if no imports are restricted we don"t need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + const ig = ignore().add(restrictedPatterns); + + + /** + * Function to check if a node is a string literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string literal. + */ + function isStringLiteral(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Function to check if a node is a static string template literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string template literal. + */ + function isStaticTemplateLiteral(node) { + return node && node.type === "TemplateLiteral" && node.expressions.length === 0; + } + + /** + * Function to check if a node is a require call. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a require call. + */ + function isRequireCall(node) { + return node.callee.type === "Identifier" && node.callee.name === "require"; + } + + /** + * Extract string from Literal or TemplateLiteral node + * @param {ASTNode} node The node to extract from + * @returns {string|null} Extracted string or null if node doesn't represent a string + */ + function getFirstArgumentString(node) { + if (isStringLiteral(node)) { + return node.value.trim(); + } + + if (isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked.trim(); + } + + return null; + } + + /** + * Report a restricted path. + * @param {node} node representing the restricted path reference + * @param {string} name restricted path + * @returns {void} + * @private + */ + function reportPath(node, name) { + const customMessage = restrictedPathMessages[name]; + const messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted path name + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted path or not + * @private + */ + function isRestrictedPath(name) { + return Object.prototype.hasOwnProperty.call(restrictedPathMessages, name); + } + + return { + CallExpression(node) { + if (isRequireCall(node)) { + + // node has arguments + if (node.arguments.length) { + const name = getFirstArgumentString(node.arguments[0]); + + // if first argument is a string literal or a static string template literal + if (name) { + + // check if argument value is in restricted modules array + if (isRestrictedPath(name)) { + reportPath(node, name); + } + + if (restrictedPatterns.length > 0 && ig.ignores(name)) { + context.report({ + node, + messageId: "patternMessage", + data: { name } + }); + } + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-properties.js b/node_modules/eslint/lib/rules/no-restricted-properties.js new file mode 100644 index 0000000..7ab8399 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-properties.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to disallow certain object properties + * @author Will Klein & Eli White + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow certain properties on certain objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-properties" + }, + + schema: { + type: "array", + items: { + anyOf: [ // `object` and `property` are both optional, but at least one of them must be provided. + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["object"] + }, + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["property"] + } + ] + }, + uniqueItems: true + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedObjectProperty: "'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}", + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedProperty: "'{{propertyName}}' is restricted from being used.{{message}}" + } + }, + + create(context) { + const restrictedCalls = context.options; + + if (restrictedCalls.length === 0) { + return {}; + } + + const restrictedProperties = new Map(); + const globallyRestrictedObjects = new Map(); + const globallyRestrictedProperties = new Map(); + + restrictedCalls.forEach(option => { + const objectName = option.object; + const propertyName = option.property; + + if (typeof objectName === "undefined") { + globallyRestrictedProperties.set(propertyName, { message: option.message }); + } else if (typeof propertyName === "undefined") { + globallyRestrictedObjects.set(objectName, { message: option.message }); + } else { + if (!restrictedProperties.has(objectName)) { + restrictedProperties.set(objectName, new Map()); + } + + restrictedProperties.get(objectName).set(propertyName, { + message: option.message + }); + } + }); + + /** + * Checks to see whether a property access is restricted, and reports it if so. + * @param {ASTNode} node The node to report + * @param {string} objectName The name of the object + * @param {string} propertyName The name of the property + * @returns {undefined} + */ + function checkPropertyAccess(node, objectName, propertyName) { + if (propertyName === null) { + return; + } + const matchedObject = restrictedProperties.get(objectName); + const matchedObjectProperty = matchedObject ? matchedObject.get(propertyName) : globallyRestrictedObjects.get(objectName); + const globalMatchedProperty = globallyRestrictedProperties.get(propertyName); + + if (matchedObjectProperty) { + const message = matchedObjectProperty.message ? ` ${matchedObjectProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedObjectProperty", + data: { + objectName, + propertyName, + message + } + }); + } else if (globalMatchedProperty) { + const message = globalMatchedProperty.message ? ` ${globalMatchedProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedProperty", + data: { + propertyName, + message + } + }); + } + } + + /** + * Checks property accesses in a destructuring assignment expression, e.g. `var foo; ({foo} = bar);` + * @param {ASTNode} node An AssignmentExpression or AssignmentPattern node + * @returns {undefined} + */ + function checkDestructuringAssignment(node) { + if (node.right.type === "Identifier") { + const objectName = node.right.name; + + if (node.left.type === "ObjectPattern") { + node.left.properties.forEach(property => { + checkPropertyAccess(node.left, objectName, astUtils.getStaticPropertyName(property)); + }); + } + } + } + + return { + MemberExpression(node) { + checkPropertyAccess(node, node.object && node.object.name, astUtils.getStaticPropertyName(node)); + }, + VariableDeclarator(node) { + if (node.init && node.init.type === "Identifier") { + const objectName = node.init.name; + + if (node.id.type === "ObjectPattern") { + node.id.properties.forEach(property => { + checkPropertyAccess(node.id, objectName, astUtils.getStaticPropertyName(property)); + }); + } + } + }, + AssignmentExpression: checkDestructuringAssignment, + AssignmentPattern: checkDestructuringAssignment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-syntax.js b/node_modules/eslint/lib/rules/no-restricted-syntax.js new file mode 100644 index 0000000..9572603 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of certain node types + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified syntax", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-syntax" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + selector: { type: "string" }, + message: { type: "string" } + }, + required: ["selector"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedSyntax: "{{message}}" + } + }, + + create(context) { + return context.options.reduce((result, selectorOrObject) => { + const isStringFormat = (typeof selectorOrObject === "string"); + const hasCustomMessage = !isStringFormat && Boolean(selectorOrObject.message); + + const selector = isStringFormat ? selectorOrObject : selectorOrObject.selector; + const message = hasCustomMessage ? selectorOrObject.message : `Using '${selector}' is not allowed.`; + + return Object.assign(result, { + [selector](node) { + context.report({ + node, + messageId: "restrictedSyntax", + data: { message } + }); + } + }); + }, {}); + + } +}; diff --git a/node_modules/eslint/lib/rules/no-return-assign.js b/node_modules/eslint/lib/rules/no-return-assign.js new file mode 100644 index 0000000..4b57d42 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-return-assign.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag when return statement contains assignment + * @author Ilya Volodin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignment operators in `return` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-return-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + returnAssignment: "Return statement should not contain assignment.", + arrowAssignment: "Arrow function should not return assignment." + } + }, + + create(context) { + const always = (context.options[0] || "except-parens") !== "except-parens"; + const sourceCode = context.getSourceCode(); + + return { + AssignmentExpression(node) { + if (!always && astUtils.isParenthesised(sourceCode, node)) { + return; + } + + let currentChild = node; + let parent = currentChild.parent; + + // Find ReturnStatement or ArrowFunctionExpression in ancestors. + while (parent && !SENTINEL_TYPE.test(parent.type)) { + currentChild = parent; + parent = parent.parent; + } + + // Reports. + if (parent && parent.type === "ReturnStatement") { + context.report({ + node: parent, + messageId: "returnAssignment" + }); + } else if (parent && parent.type === "ArrowFunctionExpression" && parent.body === currentChild) { + context.report({ + node: parent, + messageId: "arrowAssignment" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-return-await.js b/node_modules/eslint/lib/rules/no-return-await.js new file mode 100644 index 0000000..d1d8982 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-return-await.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Disallows unnecessary `return await` + * @author Jordan Harband + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary `return await`", + category: "Best Practices", + + recommended: false, + + url: "https://eslint.org/docs/rules/no-return-await" + }, + + fixable: null, + + schema: [ + ], + + messages: { + redundantUseOfAwait: "Redundant use of `await` on a return value." + } + }, + + create(context) { + + /** + * Reports a found unnecessary `await` expression. + * @param {ASTNode} node The node representing the `await` expression to report + * @returns {void} + */ + function reportUnnecessaryAwait(node) { + context.report({ + node: context.getSourceCode().getFirstToken(node), + loc: node.loc, + messageId: "redundantUseOfAwait" + }); + } + + /** + * Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting + * this function. For example, a statement in a `try` block will always have an error handler. A statement in + * a `catch` block will only have an error handler if there is also a `finally` block. + * @param {ASTNode} node A node representing a location where an could be thrown + * @returns {boolean} `true` if a thrown error will be caught/handled in this function + */ + function hasErrorHandler(node) { + let ancestor = node; + + while (!astUtils.isFunction(ancestor) && ancestor.type !== "Program") { + if (ancestor.parent.type === "TryStatement" && (ancestor === ancestor.parent.block || ancestor === ancestor.parent.handler && ancestor.parent.finalizer)) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + + /** + * Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression, + * an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position. + * @param {ASTNode} node A node representing the `await` expression to check + * @returns {boolean} The checking result + */ + function isInTailCallPosition(node) { + if (node.parent.type === "ArrowFunctionExpression") { + return true; + } + if (node.parent.type === "ReturnStatement") { + return !hasErrorHandler(node.parent); + } + if (node.parent.type === "ConditionalExpression" && (node === node.parent.consequent || node === node.parent.alternate)) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "LogicalExpression" && node === node.parent.right) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "SequenceExpression" && node === node.parent.expressions[node.parent.expressions.length - 1]) { + return isInTailCallPosition(node.parent); + } + return false; + } + + return { + AwaitExpression(node) { + if (isInTailCallPosition(node) && !hasErrorHandler(node)) { + reportUnnecessaryAwait(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-script-url.js b/node_modules/eslint/lib/rules/no-script-url.js new file mode 100644 index 0000000..2078fc1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-script-url.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag when using javascript: urls + * @author Ilya Volodin + */ +/* jshint scripturl: true */ +/* eslint no-script-url: 0 */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `javascript:` urls", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-script-url" + }, + + schema: [], + + messages: { + unexpectedScriptURL: "Script URL is a form of eval." + } + }, + + create(context) { + + return { + + Literal(node) { + if (node.value && typeof node.value === "string") { + const value = node.value.toLowerCase(); + + if (value.indexOf("javascript:") === 0) { + context.report({ node, messageId: "unexpectedScriptURL" }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-self-assign.js b/node_modules/eslint/lib/rules/no-self-assign.js new file mode 100644 index 0000000..705be32 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-self-assign.js @@ -0,0 +1,183 @@ +/** + * @fileoverview Rule to disallow assignments where both sides are exactly the same + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SPACES = /\s+/gu; + +/** + * Traverses 2 Pattern nodes in parallel, then reports self-assignments. + * @param {ASTNode|null} left A left node to traverse. This is a Pattern or + * a Property. + * @param {ASTNode|null} right A right node to traverse. This is a Pattern or + * a Property. + * @param {boolean} props The flag to check member expressions as well. + * @param {Function} report A callback function to report. + * @returns {void} + */ +function eachSelfAssignment(left, right, props, report) { + if (!left || !right) { + + // do nothing + } else if ( + left.type === "Identifier" && + right.type === "Identifier" && + left.name === right.name + ) { + report(right); + } else if ( + left.type === "ArrayPattern" && + right.type === "ArrayExpression" + ) { + const end = Math.min(left.elements.length, right.elements.length); + + for (let i = 0; i < end; ++i) { + const leftElement = left.elements[i]; + const rightElement = right.elements[i]; + + // Avoid cases such as [...a] = [...a, 1] + if ( + leftElement && + leftElement.type === "RestElement" && + i < right.elements.length - 1 + ) { + break; + } + + eachSelfAssignment(leftElement, rightElement, props, report); + + // After a spread element, those indices are unknown. + if (rightElement && rightElement.type === "SpreadElement") { + break; + } + } + } else if ( + left.type === "RestElement" && + right.type === "SpreadElement" + ) { + eachSelfAssignment(left.argument, right.argument, props, report); + } else if ( + left.type === "ObjectPattern" && + right.type === "ObjectExpression" && + right.properties.length >= 1 + ) { + + /* + * Gets the index of the last spread property. + * It's possible to overwrite properties followed by it. + */ + let startJ = 0; + + for (let i = right.properties.length - 1; i >= 0; --i) { + const propType = right.properties[i].type; + + if (propType === "SpreadElement" || propType === "ExperimentalSpreadProperty") { + startJ = i + 1; + break; + } + } + + for (let i = 0; i < left.properties.length; ++i) { + for (let j = startJ; j < right.properties.length; ++j) { + eachSelfAssignment( + left.properties[i], + right.properties[j], + props, + report + ); + } + } + } else if ( + left.type === "Property" && + right.type === "Property" && + right.kind === "init" && + !right.method + ) { + const leftName = astUtils.getStaticPropertyName(left); + + if (leftName !== null && leftName === astUtils.getStaticPropertyName(right)) { + eachSelfAssignment(left.value, right.value, props, report); + } + } else if ( + props && + astUtils.skipChainExpression(left).type === "MemberExpression" && + astUtils.skipChainExpression(right).type === "MemberExpression" && + astUtils.isSameReference(left, right) + ) { + report(right); + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignments where both sides are exactly the same", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-self-assign" + }, + + schema: [ + { + type: "object", + properties: { + props: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + selfAssignment: "'{{name}}' is assigned to itself." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const [{ props = true } = {}] = context.options; + + /** + * Reports a given node as self assignments. + * @param {ASTNode} node A node to report. This is an Identifier node. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "selfAssignment", + data: { + name: sourceCode.getText(node).replace(SPACES, "") + } + }); + } + + return { + AssignmentExpression(node) { + if (node.operator === "=") { + eachSelfAssignment(node.left, node.right, props, report); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-self-compare.js b/node_modules/eslint/lib/rules/no-self-compare.js new file mode 100644 index 0000000..79b6ac7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-self-compare.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Rule to flag comparison where left part is the same as the right + * part. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow comparisons where both sides are exactly the same", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-self-compare" + }, + + schema: [], + + messages: { + comparingToSelf: "Comparing to itself is potentially pointless." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether two nodes are composed of the same tokens. + * @param {ASTNode} nodeA The first node + * @param {ASTNode} nodeB The second node + * @returns {boolean} true if the nodes have identical token representations + */ + function hasSameTokens(nodeA, nodeB) { + const tokensA = sourceCode.getTokens(nodeA); + const tokensB = sourceCode.getTokens(nodeB); + + return tokensA.length === tokensB.length && + tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value); + } + + return { + + BinaryExpression(node) { + const operators = new Set(["===", "==", "!==", "!=", ">", "<", ">=", "<="]); + + if (operators.has(node.operator) && hasSameTokens(node.left, node.right)) { + context.report({ node, messageId: "comparingToSelf" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sequences.js b/node_modules/eslint/lib/rules/no-sequences.js new file mode 100644 index 0000000..d67635d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sequences.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Rule to flag use of comma operator + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow comma operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-sequences" + }, + + schema: [], + + messages: { + unexpectedCommaExpression: "Unexpected use of comma operator." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Parts of the grammar that are required to have parens. + */ + const parenthesized = { + DoWhileStatement: "test", + IfStatement: "test", + SwitchStatement: "discriminant", + WhileStatement: "test", + WithStatement: "object", + ArrowFunctionExpression: "body" + + /* + * Omitting CallExpression - commas are parsed as argument separators + * Omitting NewExpression - commas are parsed as argument separators + * Omitting ForInStatement - parts aren't individually parenthesised + * Omitting ForStatement - parts aren't individually parenthesised + */ + }; + + /** + * Determines whether a node is required by the grammar to be wrapped in + * parens, e.g. the test of an if statement. + * @param {ASTNode} node The AST node + * @returns {boolean} True if parens around node belong to parent node. + */ + function requiresExtraParens(node) { + return node.parent && parenthesized[node.parent.type] && + node === node.parent[parenthesized[node.parent.type]]; + } + + /** + * Check if a node is wrapped in parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if the node has a paren on each side. + */ + function isParenthesised(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if a node is wrapped in two levels of parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if two parens surround the node on each side. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return isParenthesised(node) && previousToken && nextToken && + astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + return { + SequenceExpression(node) { + + // Always allow sequences in for statement update + if (node.parent.type === "ForStatement" && + (node === node.parent.init || node === node.parent.update)) { + return; + } + + // Wrapping a sequence in extra parens indicates intent + if (requiresExtraParens(node)) { + if (isParenthesisedTwice(node)) { + return; + } + } else { + if (isParenthesised(node)) { + return; + } + } + + const firstCommaToken = sourceCode.getTokenAfter(node.expressions[0], astUtils.isCommaToken); + + context.report({ node, loc: firstCommaToken.loc, messageId: "unexpectedCommaExpression" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-setter-return.js b/node_modules/eslint/lib/rules/no-setter-return.js new file mode 100644 index 0000000..9c79240 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-setter-return.js @@ -0,0 +1,224 @@ +/** + * @fileoverview Rule to disallow returning values from setters + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Determines whether the given node is an argument of the specified global method call, at the given `index` position. + * E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @param {string} objectName Name of the global object. + * @param {string} methodName Name of the method. + * @param {number} index The given position. + * @returns {boolean} `true` if the node is argument at the given position. + */ +function isArgumentOfGlobalMethodCall(node, scope, objectName, methodName, index) { + const callNode = node.parent; + + return callNode.type === "CallExpression" && + callNode.arguments[index] === node && + astUtils.isSpecificMemberAccess(callNode.callee, objectName, methodName) && + isGlobalReference(astUtils.skipChainExpression(callNode.callee).object, scope); +} + +/** + * Determines whether the given node is used as a property descriptor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node, scope) { + if ( + isArgumentOfGlobalMethodCall(node, scope, "Object", "defineProperty", 2) || + isArgumentOfGlobalMethodCall(node, scope, "Reflect", "defineProperty", 2) + ) { + return true; + } + + const parent = node.parent; + + if ( + parent.type === "Property" && + parent.value === node + ) { + const grandparent = parent.parent; + + if ( + grandparent.type === "ObjectExpression" && + ( + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "create", 1) || + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "defineProperties", 1) + ) + ) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given function node is used as a setter function. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a setter. + */ +function isSetter(node, scope) { + const parent = node.parent; + + if ( + parent.kind === "set" && + parent.value === node + ) { + + // Setter in an object literal or in a class + return true; + } + + if ( + parent.type === "Property" && + parent.value === node && + astUtils.getStaticPropertyName(parent) === "set" && + parent.parent.type === "ObjectExpression" && + isPropertyDescriptor(parent.parent, scope) + ) { + + // Setter in a property descriptor + return true; + } + + return false; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + + return upper; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning values from setters", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-setter-return" + }, + + schema: [], + + messages: { + returnsValue: "Setter cannot return a value." + } + }, + + create(context) { + let funcInfo = null; + + /** + * Creates and pushes to the stack a function info object for the given function node. + * @param {ASTNode} node The function node. + * @returns {void} + */ + function enterFunction(node) { + const outerScope = getOuterScope(context.getScope()); + + funcInfo = { + upper: funcInfo, + isSetter: isSetter(node, outerScope) + }; + } + + /** + * Pops the current function info object from the stack. + * @returns {void} + */ + function exitFunction() { + funcInfo = funcInfo.upper; + } + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + /* + * Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid + * false positives, because a ReturnStatement node can belong to a function declaration inside a setter. + * + * Note: A previously declared function can be referenced and actually used as a setter in a property descriptor, + * but that's out of scope for this rule. + */ + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression(node) { + enterFunction(node); + + if (funcInfo.isSetter && node.expression) { + + // { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement. + report(node.body); + } + }, + + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + ReturnStatement(node) { + + // Global returns (e.g., at the top level of a Node module) don't have `funcInfo`. + if (funcInfo && funcInfo.isSetter && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js new file mode 100644 index 0000000..9647e9a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1) + * @author Michael Ficarra + */ +"use strict"; + +/** + * Determines if a variable safely shadows undefined. + * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value + * as the global). + * @param {eslintScope.Variable} variable The variable to check + * @returns {boolean} true if this variable safely shadows `undefined` + */ +function safelyShadowsUndefined(variable) { + return variable.name === "undefined" && + variable.references.every(ref => !ref.isWrite()) && + variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow identifiers from shadowing restricted names", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-shadow-restricted-names" + }, + + schema: [], + + messages: { + shadowingRestrictedName: "Shadowing of global property '{{name}}'." + } + }, + + create(context) { + + + const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); + + return { + "VariableDeclaration, :function, CatchClause"(node) { + for (const variable of context.getDeclaredVariables(node)) { + if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { + context.report({ + node: variable.defs[0].name, + messageId: "shadowingRestrictedName", + data: { + name: variable.name + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-shadow.js b/node_modules/eslint/lib/rules/no-shadow.js new file mode 100644 index 0000000..1be8590 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-shadow.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Rule to flag on declaring variables already declared in the outer scope + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow variable declarations from shadowing variables declared in the outer scope", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-shadow" + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean", default: false }, + hoist: { enum: ["all", "functions", "never"], default: "functions" }, + allow: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + } + ], + + messages: { + noShadow: "'{{name}}' is already declared in the upper scope." + } + }, + + create(context) { + + const options = { + builtinGlobals: context.options[0] && context.options[0].builtinGlobals, + hoist: (context.options[0] && context.options[0].hoist) || "functions", + allow: (context.options[0] && context.options[0].allow) || [] + }; + + /** + * Check if variable name is allowed. + * @param {ASTNode} variable The variable to check. + * @returns {boolean} Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + return options.allow.indexOf(variable.name) !== -1; + } + + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param {Object} variable The variable to check. + * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + + return block.type === "ClassDeclaration" && block.id === variable.identifiers[0]; + } + + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The scope variable to look for. + * @returns {boolean} Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs[0]; + const outer = outerDef && outerDef.parent && outerDef.parent.range; + const innerScope = variable.scope; + const innerDef = variable.defs[0]; + const inner = innerDef && innerDef.name.range; + + return ( + outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && + outerScope === innerScope.upper + ); + } + + /** + * Get a range of a variable's identifier node. + * @param {Object} variable The variable to get. + * @returns {Array|undefined} The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs[0]; + + return def && def.name.range; + } + + /** + * Checks if a variable is in TDZ of scopeVar. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The variable of TDZ. + * @returns {boolean} Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs[0]; + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + + return ( + inner && + outer && + inner[1] < outer[0] && + + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") + ); + } + + /** + * Checks the current context for shadowed variables. + * @param {Scope} scope Fixme + * @returns {void} + */ + function checkForShadows(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. + if (variable.identifiers.length === 0 || + isDuplicatedClassNameVariable(variable) || + isAllowed(variable) + ) { + continue; + } + + // Gets shadowed variable. + const shadowed = astUtils.getVariableByName(scope.upper, variable.name); + + if (shadowed && + (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && + !isOnInitializer(variable, shadowed) && + !(options.hoist !== "all" && isInTdz(variable, shadowed)) + ) { + context.report({ + node: variable.identifiers[0], + messageId: "noShadow", + data: variable + }); + } + } + } + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const stack = globalScope.childScopes.slice(); + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkForShadows(scope); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-spaced-func.js b/node_modules/eslint/lib/rules/no-spaced-func.js new file mode 100644 index 0000000..961bc68 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-spaced-func.js @@ -0,0 +1,83 @@ +/** + * @fileoverview Rule to check that spaced function application + * @author Matt DuVall + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow spacing between function identifiers and their applications (deprecated)", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-spaced-func" + }, + + deprecated: true, + + replacedBy: ["func-call-spacing"], + + fixable: "whitespace", + schema: [], + + messages: { + noSpacedFunction: "Unexpected space between function name and paren." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function detectOpenSpaces(node) { + const lastCalleeToken = sourceCode.getLastToken(node.callee); + let prevToken = lastCalleeToken, + parenToken = sourceCode.getTokenAfter(lastCalleeToken); + + // advances to an open parenthesis. + while ( + parenToken && + parenToken.range[1] < node.range[1] && + parenToken.value !== "(" + ) { + prevToken = parenToken; + parenToken = sourceCode.getTokenAfter(parenToken); + } + + // look for a space between the callee and the open paren + if (parenToken && + parenToken.range[1] < node.range[1] && + sourceCode.isSpaceBetweenTokens(prevToken, parenToken) + ) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: "noSpacedFunction", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); + } + }); + } + } + + return { + CallExpression: detectOpenSpaces, + NewExpression: detectOpenSpaces + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sparse-arrays.js b/node_modules/eslint/lib/rules/no-sparse-arrays.js new file mode 100644 index 0000000..e8407c3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sparse-arrays.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Disallow sparse arrays + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow sparse arrays", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-sparse-arrays" + }, + + schema: [], + + messages: { + unexpectedSparseArray: "Unexpected comma in middle of array." + } + }, + + create(context) { + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + ArrayExpression(node) { + + const emptySpot = node.elements.indexOf(null) > -1; + + if (emptySpot) { + context.report({ node, messageId: "unexpectedSparseArray" }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sync.js b/node_modules/eslint/lib/rules/no-sync.js new file mode 100644 index 0000000..06424e0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sync.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Rule to check for properties whose identifier ends with the string Sync + * @author Matt DuVall + */ + +/* jshint node:true */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow synchronous methods", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-sync" + }, + + schema: [ + { + type: "object", + properties: { + allowAtRootLevel: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noSync: "Unexpected sync method: '{{propertyName}}'." + } + }, + + create(context) { + const selector = context.options[0] && context.options[0].allowAtRootLevel + ? ":function MemberExpression[property.name=/.*Sync$/]" + : "MemberExpression[property.name=/.*Sync$/]"; + + return { + [selector](node) { + context.report({ + node, + messageId: "noSync", + data: { + propertyName: node.property.name + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-tabs.js b/node_modules/eslint/lib/rules/no-tabs.js new file mode 100644 index 0000000..ca7be26 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-tabs.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to check for tabs inside a file + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const tabRegex = /\t+/gu; +const anyNonWhitespaceRegex = /\S/u; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow all tabs", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-tabs" + }, + schema: [{ + type: "object", + properties: { + allowIndentationTabs: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + unexpectedTab: "Unexpected tab character." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; + + return { + Program(node) { + sourceCode.getLines().forEach((line, index) => { + let match; + + while ((match = tabRegex.exec(line)) !== null) { + if (allowIndentationTabs && !anyNonWhitespaceRegex.test(line.slice(0, match.index))) { + continue; + } + + context.report({ + node, + loc: { + start: { + line: index + 1, + column: match.index + }, + end: { + line: index + 1, + column: match.index + match[0].length + } + }, + messageId: "unexpectedTab" + }); + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-template-curly-in-string.js b/node_modules/eslint/lib/rules/no-template-curly-in-string.js new file mode 100644 index 0000000..539cd5b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-template-curly-in-string.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Warn when using template string syntax in regular strings + * @author Jeroen Engels + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow template literal placeholder syntax in regular strings", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-template-curly-in-string" + }, + + schema: [], + + messages: { + unexpectedTemplateExpression: "Unexpected template string expression." + } + }, + + create(context) { + const regex = /\$\{[^}]+\}/u; + + return { + Literal(node) { + if (typeof node.value === "string" && regex.test(node.value)) { + context.report({ + node, + messageId: "unexpectedTemplateExpression" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-ternary.js b/node_modules/eslint/lib/rules/no-ternary.js new file mode 100644 index 0000000..b3ced86 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-ternary.js @@ -0,0 +1,41 @@ +/** + * @fileoverview Rule to flag use of ternary operators. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow ternary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-ternary" + }, + + schema: [], + + messages: { + noTernaryOperator: "Ternary operator used." + } + }, + + create(context) { + + return { + + ConditionalExpression(node) { + context.report({ node, messageId: "noTernaryOperator" }); + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-this-before-super.js b/node_modules/eslint/lib/rules/no-this-before-super.js new file mode 100644 index 0000000..44288c0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-this-before-super.js @@ -0,0 +1,304 @@ +/** + * @fileoverview A rule to disallow using `this`/`super` before `super()`. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `this`/`super` before calling `super()` in constructors", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-this-before-super" + }, + + schema: [], + + messages: { + noBeforeSuper: "'{{kind}}' is not allowed before 'super()'." + } + }, + + create(context) { + + /* + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether the owner class has a valid + * `extends` part. + * - scope: The scope of the owner class. + * - codePath: The code path of this constructor. + */ + let funcInfo = null; + + /* + * Information for each code path segment. + * Each key is the id of a code path segment. + * Each value is an object: + * - superCalled: The flag which shows `super()` called in all code paths. + * - invalidNodes: The array of invalid ThisExpression and Super nodes. + */ + let segInfoMap = Object.create(null); + + /** + * Gets whether or not `super()` is called in a given code path segment. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} `true` if `super()` is called. + */ + function isCalled(segment) { + return !segment.reachable || segInfoMap[segment.id].superCalled; + } + + /** + * Checks whether or not this is in a constructor. + * @returns {boolean} `true` if this is in a constructor. + */ + function isInConstructorOfDerivedClass() { + return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends); + } + + /** + * Checks whether or not this is before `super()` is called. + * @returns {boolean} `true` if this is before `super()` is called. + */ + function isBeforeCallOfSuper() { + return ( + isInConstructorOfDerivedClass() && + !funcInfo.codePath.currentSegments.every(isCalled) + ); + } + + /** + * Sets a given node as invalid. + * @param {ASTNode} node A node to set as invalid. This is one of + * a ThisExpression and a Super. + * @returns {void} + */ + function setInvalid(node) { + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + segInfoMap[segment.id].invalidNodes.push(node); + } + } + } + + /** + * Sets the current segment as `super` was called. + * @returns {void} + */ + function setSuperCalled() { + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + segInfoMap[segment.id].superCalled = true; + } + } + } + + return { + + /** + * Adds information of a constructor into the stack. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + codePath + }; + } + }, + + /** + * Removes the top of stack item. + * + * And this treverses all segments of this code path then reports every + * invalid node. + * @param {CodePath} codePath A code path which was ended. + * @returns {void} + */ + onCodePathEnd(codePath) { + const isDerivedClass = funcInfo.hasExtends; + + funcInfo = funcInfo.upper; + if (!isDerivedClass) { + return; + } + + codePath.traverseSegments((segment, controller) => { + const info = segInfoMap[segment.id]; + + for (let i = 0; i < info.invalidNodes.length; ++i) { + const invalidNode = info.invalidNodes[i]; + + context.report({ + messageId: "noBeforeSuper", + node: invalidNode, + data: { + kind: invalidNode.type === "Super" ? "super" : "this" + } + }); + } + + if (info.superCalled) { + controller.skip(); + } + }); + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Initialize info. + segInfoMap[segment.id] = { + superCalled: ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ), + invalidNodes: [] + }; + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Update information inside of the loop. + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + (segment, controller) => { + const info = segInfoMap[segment.id]; + + if (info.superCalled) { + info.invalidNodes = []; + controller.skip(); + } else if ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ) { + info.superCalled = true; + info.invalidNodes = []; + } + } + ); + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + ThisExpression(node) { + if (isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + Super(node) { + if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Marks `super()` called. + * @param {ASTNode} node A target node. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (node.callee.type === "Super" && isBeforeCallOfSuper()) { + setSuperCalled(); + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-throw-literal.js b/node_modules/eslint/lib/rules/no-throw-literal.js new file mode 100644 index 0000000..29fb371 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-throw-literal.js @@ -0,0 +1,51 @@ +/** + * @fileoverview Rule to restrict what can be thrown as an exception. + * @author Dieter Oberkofler + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow throwing literals as exceptions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-throw-literal" + }, + + schema: [], + + messages: { + object: "Expected an error object to be thrown.", + undef: "Do not throw undefined." + } + }, + + create(context) { + + return { + + ThrowStatement(node) { + if (!astUtils.couldBeError(node.argument)) { + context.report({ node, messageId: "object" }); + } else if (node.argument.type === "Identifier") { + if (node.argument.name === "undefined") { + context.report({ node, messageId: "undef" }); + } + } + + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-trailing-spaces.js b/node_modules/eslint/lib/rules/no-trailing-spaces.js new file mode 100644 index 0000000..98ae62c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Disallow trailing spaces at the end of lines. + * @author Nodeca Team + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow trailing whitespace at the end of lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-trailing-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + skipBlankLines: { + type: "boolean", + default: false + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + trailingSpace: "Trailing spaces not allowed." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]", + SKIP_BLANK = `^${BLANK_CLASS}*$`, + NONBLANK = `${BLANK_CLASS}+$`; + + const options = context.options[0] || {}, + skipBlankLines = options.skipBlankLines || false, + ignoreComments = options.ignoreComments || false; + + /** + * Report the error message + * @param {ASTNode} node node to report + * @param {int[]} location range information + * @param {int[]} fixRange Range based on the whole program + * @returns {void} + */ + function report(node, location, fixRange) { + + /* + * Passing node is a bit dirty, because message data will contain big + * text in `source`. But... who cares :) ? + * One more kludge will not make worse the bloody wizardry of this + * plugin. + */ + context.report({ + node, + loc: location, + messageId: "trailingSpace", + fix(fixer) { + return fixer.removeRange(fixRange); + } + }); + } + + /** + * Given a list of comment nodes, return the line numbers for those comments. + * @param {Array} comments An array of comment nodes. + * @returns {number[]} An array of line numbers containing comments. + */ + function getCommentLineNumbers(comments) { + const lines = new Set(); + + comments.forEach(comment => { + const endLine = comment.type === "Block" + ? comment.loc.end.line - 1 + : comment.loc.end.line; + + for (let i = comment.loc.start.line; i <= endLine; i++) { + lines.add(i); + } + }); + + return lines; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkTrailingSpaces(node) { + + /* + * Let's hack. Since Espree does not return whitespace nodes, + * fetch the source code and do matching via regexps. + */ + + const re = new RegExp(NONBLANK, "u"), + skipMatch = new RegExp(SKIP_BLANK, "u"), + lines = sourceCode.lines, + linebreaks = sourceCode.getText().match(astUtils.createGlobalLinebreakMatcher()), + comments = sourceCode.getAllComments(), + commentLineNumbers = getCommentLineNumbers(comments); + + let totalLength = 0, + fixRange = []; + + for (let i = 0, ii = lines.length; i < ii; i++) { + const lineNumber = i + 1; + + /* + * Always add linebreak length to line length to accommodate for line break (\n or \r\n) + * Because during the fix time they also reserve one spot in the array. + * Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF) + */ + const linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; + const lineLength = lines[i].length + linebreakLength; + + const matches = re.exec(lines[i]); + + if (matches) { + const location = { + start: { + line: lineNumber, + column: matches.index + }, + end: { + line: lineNumber, + column: lineLength - linebreakLength + } + }; + + const rangeStart = totalLength + location.start.column; + const rangeEnd = totalLength + location.end.column; + const containingNode = sourceCode.getNodeByRangeIndex(rangeStart); + + if (containingNode && containingNode.type === "TemplateElement" && + rangeStart > containingNode.parent.range[0] && + rangeEnd < containingNode.parent.range[1]) { + totalLength += lineLength; + continue; + } + + /* + * If the line has only whitespace, and skipBlankLines + * is true, don't report it + */ + if (skipBlankLines && skipMatch.test(lines[i])) { + totalLength += lineLength; + continue; + } + + fixRange = [rangeStart, rangeEnd]; + + if (!ignoreComments || !commentLineNumbers.has(lineNumber)) { + report(node, location, fixRange); + } + } + + totalLength += lineLength; + } + } + + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-undef-init.js b/node_modules/eslint/lib/rules/no-undef-init.js new file mode 100644 index 0000000..5c240fe --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undef-init.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Rule to flag when initializing to undefined + * @author Ilya Volodin + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow initializing variables to `undefined`", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-undef-init" + }, + + schema: [], + fixable: "code", + + messages: { + unnecessaryUndefinedInit: "It's not necessary to initialize '{{name}}' to undefined." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + return { + + VariableDeclarator(node) { + const name = sourceCode.getText(node.id), + init = node.init && node.init.name, + scope = context.getScope(), + undefinedVar = astUtils.getVariableByName(scope, "undefined"), + shadowed = undefinedVar && undefinedVar.defs.length > 0, + lastToken = sourceCode.getLastToken(node); + + if (init === "undefined" && node.parent.kind !== "const" && !shadowed) { + context.report({ + node, + messageId: "unnecessaryUndefinedInit", + data: { name }, + fix(fixer) { + if (node.parent.kind === "var") { + return null; + } + + if (node.id.type === "ArrayPattern" || node.id.type === "ObjectPattern") { + + // Don't fix destructuring assignment to `undefined`. + return null; + } + + if (sourceCode.commentsExistBetween(node.id, lastToken)) { + return null; + } + + return fixer.removeRange([node.id.range[1], node.range[1]]); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-undef.js b/node_modules/eslint/lib/rules/no-undef.js new file mode 100644 index 0000000..6b51408 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undef.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag references to undeclared variables. + * @author Mark Macdonald + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given node is the argument of a typeof operator. + * @param {ASTNode} node The AST node being checked. + * @returns {boolean} Whether or not the node is the argument of a typeof operator. + */ +function hasTypeOfOperator(node) { + const parent = node.parent; + + return parent.type === "UnaryExpression" && parent.operator === "typeof"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-undef" + }, + + schema: [ + { + type: "object", + properties: { + typeof: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + undef: "'{{name}}' is not defined." + } + }, + + create(context) { + const options = context.options[0]; + const considerTypeOf = options && options.typeof === true || false; + + return { + "Program:exit"(/* node */) { + const globalScope = context.getScope(); + + globalScope.through.forEach(ref => { + const identifier = ref.identifier; + + if (!considerTypeOf && hasTypeOfOperator(identifier)) { + return; + } + + context.report({ + node: identifier, + messageId: "undef", + data: identifier + }); + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-undefined.js b/node_modules/eslint/lib/rules/no-undefined.js new file mode 100644 index 0000000..a075d90 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undefined.js @@ -0,0 +1,84 @@ +/** + * @fileoverview Rule to flag references to the undefined variable. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `undefined` as an identifier", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-undefined" + }, + + schema: [], + + messages: { + unexpectedUndefined: "Unexpected use of undefined." + } + }, + + create(context) { + + /** + * Report an invalid "undefined" identifier node. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedUndefined" + }); + } + + /** + * Checks the given scope for references to `undefined` and reports + * all references found. + * @param {eslint-scope.Scope} scope The scope to check. + * @returns {void} + */ + function checkScope(scope) { + const undefinedVar = scope.set.get("undefined"); + + if (!undefinedVar) { + return; + } + + const references = undefinedVar.references; + + const defs = undefinedVar.defs; + + // Report non-initializing references (those are covered in defs below) + references + .filter(ref => !ref.init) + .forEach(ref => report(ref.identifier)); + + defs.forEach(def => report(def.name)); + } + + return { + "Program:exit"() { + const globalScope = context.getScope(); + + const stack = [globalScope]; + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkScope(scope); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-underscore-dangle.js b/node_modules/eslint/lib/rules/no-underscore-dangle.js new file mode 100644 index 0000000..87d2336 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to flag dangling underscores in variable declarations. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow dangling underscores in identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-underscore-dangle" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + } + }, + allowAfterThis: { + type: "boolean", + default: false + }, + allowAfterSuper: { + type: "boolean", + default: false + }, + allowAfterThisConstructor: { + type: "boolean", + default: false + }, + enforceInMethodNames: { + type: "boolean", + default: false + }, + allowFunctionParams: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnderscore: "Unexpected dangling '_' in '{{identifier}}'." + } + }, + + create(context) { + + const options = context.options[0] || {}; + const ALLOWED_VARIABLES = options.allow ? options.allow : []; + const allowAfterThis = typeof options.allowAfterThis !== "undefined" ? options.allowAfterThis : false; + const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false; + const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false; + const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false; + const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true; + + //------------------------------------------------------------------------- + // Helpers + //------------------------------------------------------------------------- + + /** + * Check if identifier is present inside the allowed option + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function isAllowed(identifier) { + return ALLOWED_VARIABLES.some(ident => ident === identifier); + } + + /** + * Check if identifier has a dangling underscore + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function hasDanglingUnderscore(identifier) { + const len = identifier.length; + + return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_"); + } + + /** + * Check if identifier is a special case member expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierForMemberExpression(identifier) { + return identifier === "__proto__"; + } + + /** + * Check if identifier is a special case variable expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierInVariableExpression(identifier) { + + // Checks for the underscore library usage here + return identifier === "_"; + } + + /** + * Check if a node is a member reference of this.constructor + * @param {ASTNode} node node to evaluate + * @returns {boolean} true if it is a reference on this.constructor + * @private + */ + function isThisConstructorReference(node) { + return node.object.type === "MemberExpression" && + node.object.property.name === "constructor" && + node.object.object.type === "ThisExpression"; + } + + /** + * Check if function parameter has a dangling underscore. + * @param {ASTNode} node function node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInFunctionParameters(node) { + if (!allowFunctionParams) { + node.params.forEach(param => { + const { type } = param; + let nodeToCheck; + + if (type === "RestElement") { + nodeToCheck = param.argument; + } else if (type === "AssignmentPattern") { + nodeToCheck = param.left; + } else { + nodeToCheck = param; + } + + if (nodeToCheck.type === "Identifier") { + const identifier = nodeToCheck.name; + + if (hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node: param, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + }); + } + } + + /** + * Check if function has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInFunction(node) { + if (node.type === "FunctionDeclaration" && node.id) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + checkForDanglingUnderscoreInFunctionParameters(node); + } + + /** + * Check if variable expression has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInVariableExpression(node) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if member expression has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInMemberExpression(node) { + const identifier = node.property.name, + isMemberOfThis = node.object.type === "ThisExpression", + isMemberOfSuper = node.object.type === "Super", + isMemberOfThisConstructor = isThisConstructorReference(node); + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + !(isMemberOfThis && allowAfterThis) && + !(isMemberOfSuper && allowAfterSuper) && + !(isMemberOfThisConstructor && allowAfterThisConstructor) && + !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if method declaration or method property has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInMethod(node) { + const identifier = node.key.name; + const isMethod = node.type === "MethodDefinition" || node.type === "Property" && node.method; + + if (typeof identifier !== "undefined" && enforceInMethodNames && isMethod && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkForDanglingUnderscoreInFunction, + VariableDeclarator: checkForDanglingUnderscoreInVariableExpression, + MemberExpression: checkForDanglingUnderscoreInMemberExpression, + MethodDefinition: checkForDanglingUnderscoreInMethod, + Property: checkForDanglingUnderscoreInMethod, + FunctionExpression: checkForDanglingUnderscoreInFunction, + ArrowFunctionExpression: checkForDanglingUnderscoreInFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/node_modules/eslint/lib/rules/no-unexpected-multiline.js new file mode 100644 index 0000000..7af3fe6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. + * @author Glen Mailer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow confusing multiline expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unexpected-multiline" + }, + + schema: [], + messages: { + function: "Unexpected newline between function and ( of function call.", + property: "Unexpected newline between object and [ of property access.", + taggedTemplate: "Unexpected newline between template tag and template literal.", + division: "Unexpected newline between numerator and division operator." + } + }, + + create(context) { + + const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u; + + const sourceCode = context.getSourceCode(); + + /** + * Check to see if there is a newline between the node and the following open bracket + * line's expression + * @param {ASTNode} node The node to check. + * @param {string} messageId The error messageId to use. + * @returns {void} + * @private + */ + function checkForBreakAfter(node, messageId) { + const openParen = sourceCode.getTokenAfter(node, astUtils.isNotClosingParenToken); + const nodeExpressionEnd = sourceCode.getTokenBefore(openParen); + + if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) { + context.report({ + node, + loc: openParen.loc, + messageId + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + MemberExpression(node) { + if (!node.computed || node.optional) { + return; + } + checkForBreakAfter(node.object, "property"); + }, + + TaggedTemplateExpression(node) { + const { quasi } = node; + + // handles common tags, parenthesized tags, and typescript's generic type arguments + const tokenBefore = sourceCode.getTokenBefore(quasi); + + if (tokenBefore.loc.end.line !== quasi.loc.start.line) { + context.report({ + node, + loc: { + start: quasi.loc.start, + end: { + line: quasi.loc.start.line, + column: quasi.loc.start.column + 1 + } + }, + messageId: "taggedTemplate" + }); + } + }, + + CallExpression(node) { + if (node.arguments.length === 0 || node.optional) { + return; + } + checkForBreakAfter(node.callee, "function"); + }, + + "BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(node) { + const secondSlash = sourceCode.getTokenAfter(node, token => token.value === "/"); + const tokenAfterOperator = sourceCode.getTokenAfter(secondSlash); + + if ( + tokenAfterOperator.type === "Identifier" && + REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) && + secondSlash.range[1] === tokenAfterOperator.range[0] + ) { + checkForBreakAfter(node.left, "division"); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js new file mode 100644 index 0000000..7031a4d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -0,0 +1,360 @@ +/** + * @fileoverview Rule to disallow use of unmodified expressions in loop conditions + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Traverser = require("../shared/traverser"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_PATTERN = /(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u; +const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property. +const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u; +const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u; +const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u; + +/** + * @typedef {Object} LoopConditionInfo + * @property {eslint-scope.Reference} reference - The reference. + * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes + * that the reference is belonging to. + * @property {Function} isInLoop - The predicate which checks a given reference + * is in this loop. + * @property {boolean} modified - The flag that the reference is modified in + * this loop. + */ + +/** + * Checks whether or not a given reference is a write reference. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is a write reference. + */ +function isWriteReference(reference) { + if (reference.init) { + const def = reference.resolved && reference.resolved.defs[0]; + + if (!def || def.type !== "Variable" || def.parent.kind !== "var") { + return false; + } + } + return reference.isWrite(); +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodified(condition) { + return !condition.modified; +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag and does not have the group this condition belongs to. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodifiedAndNotBelongToGroup(condition) { + return !(condition.modified || condition.group); +} + +/** + * Checks whether or not a given reference is inside of a given node. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the node. + */ +function isInRange(node, reference) { + const or = node.range; + const ir = reference.identifier.range; + + return or[0] <= ir[0] && ir[1] <= or[1]; +} + +/** + * Checks whether or not a given reference is inside of a loop node's condition. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the loop node's + * condition. + */ +const isInLoop = { + WhileStatement: isInRange, + DoWhileStatement: isInRange, + ForStatement(node, reference) { + return ( + isInRange(node, reference) && + !(node.init && isInRange(node.init, reference)) + ); + } +}; + +/** + * Gets the function which encloses a given reference. + * This supports only FunctionDeclaration. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} The function node or null. + */ +function getEncloseFunctionDeclaration(reference) { + let node = reference.identifier; + + while (node) { + if (node.type === "FunctionDeclaration") { + return node.id ? node : null; + } + + node = node.parent; + } + + return null; +} + +/** + * Updates the "modified" flags of given loop conditions with given modifiers. + * @param {LoopConditionInfo[]} conditions The loop conditions to be updated. + * @param {eslint-scope.Reference[]} modifiers The references to update. + * @returns {void} + */ +function updateModifiedFlag(conditions, modifiers) { + + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + for (let j = 0; !condition.modified && j < modifiers.length; ++j) { + const modifier = modifiers[j]; + let funcNode, funcVar; + + /* + * Besides checking for the condition being in the loop, we want to + * check the function that this modifier is belonging to is called + * in the loop. + * FIXME: This should probably be extracted to a function. + */ + const inLoop = condition.isInLoop(modifier) || Boolean( + (funcNode = getEncloseFunctionDeclaration(modifier)) && + (funcVar = astUtils.getVariableByName(modifier.from.upper, funcNode.id.name)) && + funcVar.references.some(condition.isInLoop) + ); + + condition.modified = inLoop; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unmodified loop conditions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-unmodified-loop-condition" + }, + + schema: [], + + messages: { + loopConditionNotModified: "'{{name}}' is not modified in this loop." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let groupMap = null; + + /** + * Reports a given condition info. + * @param {LoopConditionInfo} condition A loop condition info to report. + * @returns {void} + */ + function report(condition) { + const node = condition.reference.identifier; + + context.report({ + node, + messageId: "loopConditionNotModified", + data: node + }); + } + + /** + * Registers given conditions to the group the condition belongs to. + * @param {LoopConditionInfo[]} conditions A loop condition info to + * register. + * @returns {void} + */ + function registerConditionsToGroup(conditions) { + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + if (condition.group) { + let group = groupMap.get(condition.group); + + if (!group) { + group = []; + groupMap.set(condition.group, group); + } + group.push(condition); + } + } + } + + /** + * Reports references which are inside of unmodified groups. + * @param {LoopConditionInfo[]} conditions A loop condition info to report. + * @returns {void} + */ + function checkConditionsInGroup(conditions) { + if (conditions.every(isUnmodified)) { + conditions.forEach(report); + } + } + + /** + * Checks whether or not a given group node has any dynamic elements. + * @param {ASTNode} root A node to check. + * This node is one of BinaryExpression or ConditionalExpression. + * @returns {boolean} `true` if the node is dynamic. + */ + function hasDynamicExpressions(root) { + let retv = false; + + Traverser.traverse(root, { + visitorKeys: sourceCode.visitorKeys, + enter(node) { + if (DYNAMIC_PATTERN.test(node.type)) { + retv = true; + this.break(); + } else if (SKIP_PATTERN.test(node.type)) { + this.skip(); + } + } + }); + + return retv; + } + + /** + * Creates the loop condition information from a given reference. + * @param {eslint-scope.Reference} reference A reference to create. + * @returns {LoopConditionInfo|null} Created loop condition info, or null. + */ + function toLoopCondition(reference) { + if (reference.init) { + return null; + } + + let group = null; + let child = reference.identifier; + let node = child.parent; + + while (node) { + if (SENTINEL_PATTERN.test(node.type)) { + if (LOOP_PATTERN.test(node.type) && node.test === child) { + + // This reference is inside of a loop condition. + return { + reference, + group, + isInLoop: isInLoop[node.type].bind(null, node), + modified: false + }; + } + + // This reference is outside of a loop condition. + break; + } + + /* + * If it's inside of a group, OK if either operand is modified. + * So stores the group this reference belongs to. + */ + if (GROUP_PATTERN.test(node.type)) { + + // If this expression is dynamic, no need to check. + if (hasDynamicExpressions(node)) { + break; + } else { + group = node; + } + } + + child = node; + node = node.parent; + } + + return null; + } + + /** + * Finds unmodified references which are inside of a loop condition. + * Then reports the references which are outside of groups. + * @param {eslint-scope.Variable} variable A variable to report. + * @returns {void} + */ + function checkReferences(variable) { + + // Gets references that exist in loop conditions. + const conditions = variable + .references + .map(toLoopCondition) + .filter(Boolean); + + if (conditions.length === 0) { + return; + } + + // Registers the conditions to belonging groups. + registerConditionsToGroup(conditions); + + // Check the conditions are modified. + const modifiers = variable.references.filter(isWriteReference); + + if (modifiers.length > 0) { + updateModifiedFlag(conditions, modifiers); + } + + /* + * Reports the conditions which are not belonging to groups. + * Others will be reported after all variables are done. + */ + conditions + .filter(isUnmodifiedAndNotBelongToGroup) + .forEach(report); + } + + return { + "Program:exit"() { + const queue = [context.getScope()]; + + groupMap = new Map(); + + let scope; + + while ((scope = queue.pop())) { + queue.push(...scope.childScopes); + scope.variables.forEach(checkReferences); + } + + groupMap.forEach(checkConditionsInGroup); + groupMap = null; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/node_modules/eslint/lib/rules/no-unneeded-ternary.js new file mode 100644 index 0000000..06c615f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -0,0 +1,166 @@ +/** + * @fileoverview Rule to flag no-unneeded-ternary + * @author Gyandeep Singh + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Operators that always result in a boolean value +const BOOLEAN_OPERATORS = new Set(["==", "===", "!=", "!==", ">", ">=", "<", "<=", "in", "instanceof"]); +const OPERATOR_INVERSES = { + "==": "!=", + "!=": "==", + "===": "!==", + "!==": "===" + + // Operators like < and >= are not true inverses, since both will return false with NaN. +}; +const OR_PRECEDENCE = astUtils.getPrecedence({ type: "LogicalExpression", operator: "||" }); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow ternary operators when simpler alternatives exist", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-unneeded-ternary" + }, + + schema: [ + { + type: "object", + properties: { + defaultAssignment: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + unnecessaryConditionalExpression: "Unnecessary use of boolean literals in conditional expression.", + unnecessaryConditionalAssignment: "Unnecessary use of conditional expression for default assignment." + } + }, + + create(context) { + const options = context.options[0] || {}; + const defaultAssignment = options.defaultAssignment !== false; + const sourceCode = context.getSourceCode(); + + /** + * Test if the node is a boolean literal + * @param {ASTNode} node The node to report. + * @returns {boolean} True if the its a boolean literal + * @private + */ + function isBooleanLiteral(node) { + return node.type === "Literal" && typeof node.value === "boolean"; + } + + /** + * Creates an expression that represents the boolean inverse of the expression represented by the original node + * @param {ASTNode} node A node representing an expression + * @returns {string} A string representing an inverted expression + */ + function invertExpression(node) { + if (node.type === "BinaryExpression" && Object.prototype.hasOwnProperty.call(OPERATOR_INVERSES, node.operator)) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const text = sourceCode.getText(); + + return text.slice(node.range[0], + operatorToken.range[0]) + OPERATOR_INVERSES[node.operator] + text.slice(operatorToken.range[1], node.range[1]); + } + + if (astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression" })) { + return `!(${astUtils.getParenthesisedText(sourceCode, node)})`; + } + return `!${astUtils.getParenthesisedText(sourceCode, node)}`; + } + + /** + * Tests if a given node always evaluates to a boolean value + * @param {ASTNode} node An expression node + * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value + */ + function isBooleanExpression(node) { + return node.type === "BinaryExpression" && BOOLEAN_OPERATORS.has(node.operator) || + node.type === "UnaryExpression" && node.operator === "!"; + } + + /** + * Test if the node matches the pattern id ? id : expression + * @param {ASTNode} node The ConditionalExpression to check. + * @returns {boolean} True if the pattern is matched, and false otherwise + * @private + */ + function matchesDefaultAssignment(node) { + return node.test.type === "Identifier" && + node.consequent.type === "Identifier" && + node.test.name === node.consequent.name; + } + + return { + + ConditionalExpression(node) { + if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) { + context.report({ + node, + messageId: "unnecessaryConditionalExpression", + fix(fixer) { + if (node.consequent.value === node.alternate.value) { + + // Replace `foo ? true : true` with just `true`, but don't replace `foo() ? true : true` + return node.test.type === "Identifier" ? fixer.replaceText(node, node.consequent.value.toString()) : null; + } + if (node.alternate.value) { + + // Replace `foo() ? false : true` with `!(foo())` + return fixer.replaceText(node, invertExpression(node.test)); + } + + // Replace `foo ? true : false` with `foo` if `foo` is guaranteed to be a boolean, or `!!foo` otherwise. + + return fixer.replaceText(node, isBooleanExpression(node.test) ? astUtils.getParenthesisedText(sourceCode, node.test) : `!${invertExpression(node.test)}`); + } + }); + } else if (!defaultAssignment && matchesDefaultAssignment(node)) { + context.report({ + node, + messageId: "unnecessaryConditionalAssignment", + fix: fixer => { + const shouldParenthesizeAlternate = + ( + astUtils.getPrecedence(node.alternate) < OR_PRECEDENCE || + astUtils.isCoalesceExpression(node.alternate) + ) && + !astUtils.isParenthesised(sourceCode, node.alternate); + const alternateText = shouldParenthesizeAlternate + ? `(${sourceCode.getText(node.alternate)})` + : astUtils.getParenthesisedText(sourceCode, node.alternate); + const testText = astUtils.getParenthesisedText(sourceCode, node.test); + + return fixer.replaceText(node, `${testText} || ${alternateText}`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unreachable-loop.js b/node_modules/eslint/lib/rules/no-unreachable-loop.js new file mode 100644 index 0000000..868a6ff --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unreachable-loop.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Rule to disallow loops with a body that allows only one iteration + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const allLoopTypes = ["WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "ForOfStatement"]; + +/** + * Determines whether the given node is the first node in the code path to which a loop statement + * 'loops' for the next iteration. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a looping target. + */ +function isLoopingTarget(node) { + const parent = node.parent; + + if (parent) { + switch (parent.type) { + case "WhileStatement": + return node === parent.test; + case "DoWhileStatement": + return node === parent.body; + case "ForStatement": + return node === (parent.update || parent.test || parent.body); + case "ForInStatement": + case "ForOfStatement": + return node === parent.left; + + // no default + } + } + + return false; +} + +/** + * Creates an array with elements from the first given array that are not included in the second given array. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {Array} a new array that represents `arrA \ arrB`. + */ +function getDifference(arrA, arrB) { + return arrA.filter(a => !arrB.includes(a)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow loops with a body that allows only one iteration", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-unreachable-loop" + }, + + schema: [{ + type: "object", + properties: { + ignore: { + type: "array", + items: { + enum: allLoopTypes + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + invalid: "Invalid loop. Its body allows only one iteration." + } + }, + + create(context) { + const ignoredLoopTypes = context.options[0] && context.options[0].ignore || [], + loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes), + loopSelector = loopTypesToCheck.join(","), + loopsByTargetSegments = new Map(), + loopsToReport = new Set(); + + let currentCodePath = null; + + return { + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + [loopSelector](node) { + + /** + * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise. + * For unreachable segments, the code path analysis does not raise events required for this implementation. + */ + if (currentCodePath.currentSegments.some(segment => segment.reachable)) { + loopsToReport.add(node); + } + }, + + onCodePathSegmentStart(segment, node) { + if (isLoopingTarget(node)) { + const loop = node.parent; + + loopsByTargetSegments.set(segment, loop); + } + }, + + onCodePathSegmentLoop(_, toSegment, node) { + const loop = loopsByTargetSegments.get(toSegment); + + /** + * The second iteration is reachable, meaning that the loop is valid by the logic of this rule, + * only if there is at least one loop event with the appropriate target (which has been already + * determined in the `loopsByTargetSegments` map), raised from either: + * + * - the end of the loop's body (in which case `node === loop`) + * - a `continue` statement + * + * This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes. + */ + if (node === loop || node.type === "ContinueStatement") { + + // Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw. + loopsToReport.delete(loop); + } + }, + + "Program:exit"() { + loopsToReport.forEach( + node => context.report({ node, messageId: "invalid" }) + ); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unreachable.js b/node_modules/eslint/lib/rules/no-unreachable.js new file mode 100644 index 0000000..415631a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unreachable.js @@ -0,0 +1,218 @@ +/** + * @fileoverview Checks for unreachable code due to return, throws, break, and continue. + * @author Joel Feenstra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable declarator has the initializer. + * @param {ASTNode} node A VariableDeclarator node to check. + * @returns {boolean} `true` if the node has the initializer. + */ +function isInitialized(node) { + return Boolean(node.init); +} + +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} + +/** + * The class to distinguish consecutive unreachable statements. + */ +class ConsecutiveRange { + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.startNode = null; + this.endNode = null; + } + + /** + * The location object of this range. + * @type {Object} + */ + get location() { + return { + start: this.startNode.loc.start, + end: this.endNode.loc.end + }; + } + + /** + * `true` if this range is empty. + * @type {boolean} + */ + get isEmpty() { + return !(this.startNode && this.endNode); + } + + /** + * Checks whether the given node is inside of this range. + * @param {ASTNode|Token} node The node to check. + * @returns {boolean} `true` if the node is inside of this range. + */ + contains(node) { + return ( + node.range[0] >= this.startNode.range[0] && + node.range[1] <= this.endNode.range[1] + ); + } + + /** + * Checks whether the given node is consecutive to this range. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is consecutive to this range. + */ + isConsecutive(node) { + return this.contains(this.sourceCode.getTokenBefore(node)); + } + + /** + * Merges the given node to this range. + * @param {ASTNode} node The node to merge. + * @returns {void} + */ + merge(node) { + this.endNode = node; + } + + /** + * Resets this range by the given node or null. + * @param {ASTNode|null} node The node to reset, or null. + * @returns {void} + */ + reset(node) { + this.startNode = this.endNode = node; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unreachable" + }, + + schema: [], + + messages: { + unreachableCode: "Unreachable code." + } + }, + + create(context) { + let currentCodePath = null; + + const range = new ConsecutiveRange(context.getSourceCode()); + + /** + * Reports a given node if it's unreachable. + * @param {ASTNode} node A statement node to report. + * @returns {void} + */ + function reportIfUnreachable(node) { + let nextNode = null; + + if (node && currentCodePath.currentSegments.every(isUnreachable)) { + + // Store this statement to distinguish consecutive statements. + if (range.isEmpty) { + range.reset(node); + return; + } + + // Skip if this statement is inside of the current range. + if (range.contains(node)) { + return; + } + + // Merge if this statement is consecutive to the current range. + if (range.isConsecutive(node)) { + range.merge(node); + return; + } + + nextNode = node; + } + + /* + * Report the current range since this statement is reachable or is + * not consecutive to the current range. + */ + if (!range.isEmpty) { + context.report({ + messageId: "unreachableCode", + loc: range.location, + node: range.startNode + }); + } + + // Update the current range. + range.reset(nextNode); + } + + return { + + // Manages the current code path. + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + // Registers for all statement nodes (excludes FunctionDeclaration). + BlockStatement: reportIfUnreachable, + BreakStatement: reportIfUnreachable, + ClassDeclaration: reportIfUnreachable, + ContinueStatement: reportIfUnreachable, + DebuggerStatement: reportIfUnreachable, + DoWhileStatement: reportIfUnreachable, + ExpressionStatement: reportIfUnreachable, + ForInStatement: reportIfUnreachable, + ForOfStatement: reportIfUnreachable, + ForStatement: reportIfUnreachable, + IfStatement: reportIfUnreachable, + ImportDeclaration: reportIfUnreachable, + LabeledStatement: reportIfUnreachable, + ReturnStatement: reportIfUnreachable, + SwitchStatement: reportIfUnreachable, + ThrowStatement: reportIfUnreachable, + TryStatement: reportIfUnreachable, + + VariableDeclaration(node) { + if (node.kind !== "var" || node.declarations.some(isInitialized)) { + reportIfUnreachable(node); + } + }, + + WhileStatement: reportIfUnreachable, + WithStatement: reportIfUnreachable, + ExportNamedDeclaration: reportIfUnreachable, + ExportDefaultDeclaration: reportIfUnreachable, + ExportAllDeclaration: reportIfUnreachable, + + "Program:exit"() { + reportIfUnreachable(); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-finally.js b/node_modules/eslint/lib/rules/no-unsafe-finally.js new file mode 100644 index 0000000..11bf06e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Rule to flag unsafe statements in finally block + * @author Onur Temizkan + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_NODE_TYPE_RETURN_THROW = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const SENTINEL_NODE_TYPE_BREAK = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement|SwitchStatement)$/u; +const SENTINEL_NODE_TYPE_CONTINUE = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow control flow statements in `finally` blocks", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unsafe-finally" + }, + + schema: [], + + messages: { + unsafeUsage: "Unsafe usage of {{nodeType}}." + } + }, + create(context) { + + /** + * Checks if the node is the finalizer of a TryStatement + * @param {ASTNode} node node to check. + * @returns {boolean} - true if the node is the finalizer of a TryStatement + */ + function isFinallyBlock(node) { + return node.parent.type === "TryStatement" && node.parent.finalizer === node; + } + + /** + * Climbs up the tree if the node is not a sentinel node + * @param {ASTNode} node node to check. + * @param {string} label label of the break or continue statement + * @returns {boolean} - return whether the node is a finally block or a sentinel node + */ + function isInFinallyBlock(node, label) { + let labelInside = false; + let sentinelNodeType; + + if (node.type === "BreakStatement" && !node.label) { + sentinelNodeType = SENTINEL_NODE_TYPE_BREAK; + } else if (node.type === "ContinueStatement") { + sentinelNodeType = SENTINEL_NODE_TYPE_CONTINUE; + } else { + sentinelNodeType = SENTINEL_NODE_TYPE_RETURN_THROW; + } + + for ( + let currentNode = node; + currentNode && !sentinelNodeType.test(currentNode.type); + currentNode = currentNode.parent + ) { + if (currentNode.parent.label && label && (currentNode.parent.label.name === label.name)) { + labelInside = true; + } + if (isFinallyBlock(currentNode)) { + if (label && labelInside) { + return false; + } + return true; + } + } + return false; + } + + /** + * Checks whether the possibly-unsafe statement is inside a finally block. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + if (isInFinallyBlock(node, node.label)) { + context.report({ + messageId: "unsafeUsage", + data: { + nodeType: node.type + }, + node, + line: node.loc.line, + column: node.loc.column + }); + } + } + + return { + ReturnStatement: check, + ThrowStatement: check, + BreakStatement: check, + ContinueStatement: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-negation.js b/node_modules/eslint/lib/rules/no-unsafe-negation.js new file mode 100644 index 0000000..a9c2ee7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to disallow negating the left operand of relational operators + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given operator is `in` or `instanceof` + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is `in` or `instanceof` + */ +function isInOrInstanceOfOperator(op) { + return op === "in" || op === "instanceof"; +} + +/** + * Checks whether the given operator is an ordering relational operator or not. + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is an ordering relational operator. + */ +function isOrderingRelationalOperator(op) { + return op === "<" || op === ">" || op === ">=" || op === "<="; +} + +/** + * Checks whether the given node is a logical negation expression or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a logical negation expression. + */ +function isNegation(node) { + return node.type === "UnaryExpression" && node.operator === "!"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow negating the left operand of relational operators", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unsafe-negation", + suggestion: true + }, + + schema: [ + { + type: "object", + properties: { + enforceForOrderingRelations: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: null, + + messages: { + unexpected: "Unexpected negating the left operand of '{{operator}}' operator.", + suggestNegatedExpression: "Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.", + suggestParenthesisedNegation: "Wrap negation in '()' to make the intention explicit. This preserves the current behavior." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const enforceForOrderingRelations = options.enforceForOrderingRelations === true; + + return { + BinaryExpression(node) { + const operator = node.operator; + const orderingRelationRuleApplies = enforceForOrderingRelations && isOrderingRelationalOperator(operator); + + if ( + (isInOrInstanceOfOperator(operator) || orderingRelationRuleApplies) && + isNegation(node.left) && + !astUtils.isParenthesised(sourceCode, node.left) + ) { + context.report({ + node, + loc: node.left.loc, + messageId: "unexpected", + data: { operator }, + suggest: [ + { + messageId: "suggestNegatedExpression", + data: { operator }, + fix(fixer) { + const negationToken = sourceCode.getFirstToken(node.left); + const fixRange = [negationToken.range[1], node.range[1]]; + const text = sourceCode.text.slice(fixRange[0], fixRange[1]); + + return fixer.replaceTextRange(fixRange, `(${text})`); + } + }, + { + messageId: "suggestParenthesisedNegation", + fix(fixer) { + return fixer.replaceText(node.left, `(${sourceCode.getText(node.left)})`); + } + } + ] + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-expressions.js b/node_modules/eslint/lib/rules/no-unused-expressions.js new file mode 100644 index 0000000..882a0fd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -0,0 +1,172 @@ +/** + * @fileoverview Flag expressions in statement position that do not side effect + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns `true`. + * @returns {boolean} `true`. + */ +function alwaysTrue() { + return true; +} + +/** + * Returns `false`. + * @returns {boolean} `false`. + */ +function alwaysFalse() { + return false; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unused expressions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-unused-expressions" + }, + + schema: [ + { + type: "object", + properties: { + allowShortCircuit: { + type: "boolean", + default: false + }, + allowTernary: { + type: "boolean", + default: false + }, + allowTaggedTemplates: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unusedExpression: "Expected an assignment or function call and instead saw an expression." + } + }, + + create(context) { + const config = context.options[0] || {}, + allowShortCircuit = config.allowShortCircuit || false, + allowTernary = config.allowTernary || false, + allowTaggedTemplates = config.allowTaggedTemplates || false; + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {Function} predicate ([a] -> Boolean) the function used to make the determination + * @param {a[]} list the input list + * @returns {a[]} the leading sequence of members in the given list that pass the given predicate + */ + function takeWhile(predicate, list) { + for (let i = 0; i < list.length; ++i) { + if (!predicate(list[i])) { + return list.slice(0, i); + } + } + return list.slice(); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node a Program or BlockStatement node + * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body + */ + function directives(node) { + return takeWhile(looksLikeDirective, node.body); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @param {ASTNode[]} ancestors the given node's ancestors + * @returns {boolean} whether the given node is considered a directive in its current position + */ + function isDirective(node, ancestors) { + const parent = ancestors[ancestors.length - 1], + grandparent = ancestors[ancestors.length - 2]; + + return (parent.type === "Program" || parent.type === "BlockStatement" && + (/Function/u.test(grandparent.type))) && + directives(parent).indexOf(node) >= 0; + } + + /** + * The member functions return `true` if the type has no side-effects. + * Unknown nodes are handled as `false`, then this rule ignores those. + */ + const Checker = Object.assign(Object.create(null), { + isDisallowed(node) { + return (Checker[node.type] || alwaysFalse)(node); + }, + + ArrayExpression: alwaysTrue, + ArrowFunctionExpression: alwaysTrue, + BinaryExpression: alwaysTrue, + ChainExpression(node) { + return Checker.isDisallowed(node.expression); + }, + ClassExpression: alwaysTrue, + ConditionalExpression(node) { + if (allowTernary) { + return Checker.isDisallowed(node.consequent) || Checker.isDisallowed(node.alternate); + } + return true; + }, + FunctionExpression: alwaysTrue, + Identifier: alwaysTrue, + Literal: alwaysTrue, + LogicalExpression(node) { + if (allowShortCircuit) { + return Checker.isDisallowed(node.right); + } + return true; + }, + MemberExpression: alwaysTrue, + MetaProperty: alwaysTrue, + ObjectExpression: alwaysTrue, + SequenceExpression: alwaysTrue, + TaggedTemplateExpression() { + return !allowTaggedTemplates; + }, + TemplateLiteral: alwaysTrue, + ThisExpression: alwaysTrue, + UnaryExpression(node) { + return node.operator !== "void" && node.operator !== "delete"; + } + }); + + return { + ExpressionStatement(node) { + if (Checker.isDisallowed(node.expression) && !isDirective(node, context.getAncestors())) { + context.report({ node, messageId: "unusedExpression" }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-labels.js b/node_modules/eslint/lib/rules/no-unused-labels.js new file mode 100644 index 0000000..b33fcb7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-labels.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule to disallow unused labels. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unused labels", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-unused-labels" + }, + + schema: [], + + fixable: "code", + + messages: { + unused: "'{{name}}:' is defined but never used." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Adds a scope info to the stack. + * @param {ASTNode} node A node to add. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledScope(node) { + scopeInfo = { + label: node.label.name, + used: false, + upper: scopeInfo + }; + } + + /** + * Removes the top of the stack. + * At the same time, this reports the label if it's never used. + * @param {ASTNode} node A node to report. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledScope(node) { + if (!scopeInfo.used) { + context.report({ + node: node.label, + messageId: "unused", + data: node.label, + fix(fixer) { + + /* + * Only perform a fix if there are no comments between the label and the body. This will be the case + * when there is exactly one token/comment (the ":") between the label and the body. + */ + if (sourceCode.getTokenAfter(node.label, { includeComments: true }) === + sourceCode.getTokenBefore(node.body, { includeComments: true })) { + return fixer.removeRange([node.range[0], node.body.range[0]]); + } + + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Marks the label of a given node as used. + * @param {ASTNode} node A node to mark. This is a BreakStatement or + * ContinueStatement. + * @returns {void} + */ + function markAsUsed(node) { + if (!node.label) { + return; + } + + const label = node.label.name; + let info = scopeInfo; + + while (info) { + if (info.label === label) { + info.used = true; + break; + } + info = info.upper; + } + } + + return { + LabeledStatement: enterLabeledScope, + "LabeledStatement:exit": exitLabeledScope, + BreakStatement: markAsUsed, + ContinueStatement: markAsUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-vars.js b/node_modules/eslint/lib/rules/no-unused-vars.js new file mode 100644 index 0000000..4dc6dc2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-vars.js @@ -0,0 +1,648 @@ +/** + * @fileoverview Rule to flag declared but unused variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Bag of data used for formatting the `unusedVar` lint message. + * @typedef {Object} UnusedVarMessageData + * @property {string} varName The name of the unused var. + * @property {'defined'|'assigned a value'} action Description of the vars state. + * @property {string} additional Any additional info to be appended at the end. + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unused variables", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-unused-vars" + }, + + schema: [ + { + oneOf: [ + { + enum: ["all", "local"] + }, + { + type: "object", + properties: { + vars: { + enum: ["all", "local"] + }, + varsIgnorePattern: { + type: "string" + }, + args: { + enum: ["all", "after-used", "none"] + }, + ignoreRestSiblings: { + type: "boolean" + }, + argsIgnorePattern: { + type: "string" + }, + caughtErrors: { + enum: ["all", "none"] + }, + caughtErrorsIgnorePattern: { + type: "string" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u; + + const config = { + vars: "all", + args: "after-used", + ignoreRestSiblings: false, + caughtErrors: "none" + }; + + const firstOption = context.options[0]; + + if (firstOption) { + if (typeof firstOption === "string") { + config.vars = firstOption; + } else { + config.vars = firstOption.vars || config.vars; + config.args = firstOption.args || config.args; + config.ignoreRestSiblings = firstOption.ignoreRestSiblings || config.ignoreRestSiblings; + config.caughtErrors = firstOption.caughtErrors || config.caughtErrors; + + if (firstOption.varsIgnorePattern) { + config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, "u"); + } + + if (firstOption.argsIgnorePattern) { + config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, "u"); + } + + if (firstOption.caughtErrorsIgnorePattern) { + config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, "u"); + } + } + } + + /** + * Generates the message data about the variable being defined and unused, + * including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getDefinedMessageData(unusedVar) { + const defType = unusedVar.defs && unusedVar.defs[0] && unusedVar.defs[0].type; + let type; + let pattern; + + if (defType === "CatchClause" && config.caughtErrorsIgnorePattern) { + type = "args"; + pattern = config.caughtErrorsIgnorePattern.toString(); + } else if (defType === "Parameter" && config.argsIgnorePattern) { + type = "args"; + pattern = config.argsIgnorePattern.toString(); + } else if (defType !== "Parameter" && config.varsIgnorePattern) { + type = "vars"; + pattern = config.varsIgnorePattern.toString(); + } + + const additional = type ? `. Allowed unused ${type} must match ${pattern}` : ""; + + return { + varName: unusedVar.name, + action: "defined", + additional + }; + } + + /** + * Generate the warning message about the variable being + * assigned and unused, including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getAssignedMessageData(unusedVar) { + const additional = config.varsIgnorePattern ? `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}` : ""; + + return { + varName: unusedVar.name, + action: "assigned a value", + additional + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const STATEMENT_TYPE = /(?:Statement|Declaration)$/u; + + /** + * Determines if a given variable is being exported from a module. + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function isExported(variable) { + + const definition = variable.defs[0]; + + if (definition) { + + let node = definition.node; + + if (node.type === "VariableDeclarator") { + node = node.parent; + } else if (definition.type === "Parameter") { + return false; + } + + return node.parent.type.indexOf("Export") === 0; + } + return false; + + } + + /** + * Determines if a variable has a sibling rest property + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function hasRestSpreadSibling(variable) { + if (config.ignoreRestSiblings) { + return variable.defs.some(def => { + const propertyNode = def.name.parent; + const patternNode = propertyNode.parent; + + return ( + propertyNode.type === "Property" && + patternNode.type === "ObjectPattern" && + REST_PROPERTY_TYPE.test(patternNode.properties[patternNode.properties.length - 1].type) + ); + }); + } + + return false; + } + + /** + * Determines if a reference is a read operation. + * @param {Reference} ref An eslint-scope Reference + * @returns {boolean} whether the given reference represents a read operation + * @private + */ + function isReadRef(ref) { + return ref.isRead(); + } + + /** + * Determine if an identifier is referencing an enclosing function name. + * @param {Reference} ref The reference to check. + * @param {ASTNode[]} nodes The candidate function nodes. + * @returns {boolean} True if it's a self-reference, false if not. + * @private + */ + function isSelfReference(ref, nodes) { + let scope = ref.from; + + while (scope) { + if (nodes.indexOf(scope.block) >= 0) { + return true; + } + + scope = scope.upper; + } + + return false; + } + + /** + * Gets a list of function definitions for a specified variable. + * @param {Variable} variable eslint-scope variable object. + * @returns {ASTNode[]} Function nodes. + * @private + */ + function getFunctionDefinitions(variable) { + const functionDefinitions = []; + + variable.defs.forEach(def => { + const { type, node } = def; + + // FunctionDeclarations + if (type === "FunctionName") { + functionDefinitions.push(node); + } + + // FunctionExpressions + if (type === "Variable" && node.init && + (node.init.type === "FunctionExpression" || node.init.type === "ArrowFunctionExpression")) { + functionDefinitions.push(node.init); + } + }); + return functionDefinitions; + } + + /** + * Checks the position of given nodes. + * @param {ASTNode} inner A node which is expected as inside. + * @param {ASTNode} outer A node which is expected as outside. + * @returns {boolean} `true` if the `inner` node exists in the `outer` node. + * @private + */ + function isInside(inner, outer) { + return ( + inner.range[0] >= outer.range[0] && + inner.range[1] <= outer.range[1] + ); + } + + /** + * If a given reference is left-hand side of an assignment, this gets + * the right-hand side node of the assignment. + * + * In the following cases, this returns null. + * + * - The reference is not the LHS of an assignment expression. + * - The reference is inside of a loop. + * - The reference is inside of a function scope which is different from + * the declaration. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} prevRhsNode The previous RHS node. + * @returns {ASTNode|null} The RHS node or null. + * @private + */ + function getRhsNode(ref, prevRhsNode) { + const id = ref.identifier; + const parent = id.parent; + const grandparent = parent.parent; + const refScope = ref.from.variableScope; + const varScope = ref.resolved.scope.variableScope; + const canBeUsedLater = refScope !== varScope || astUtils.isInLoop(id); + + /* + * Inherits the previous node if this reference is in the node. + * This is for `a = a + a`-like code. + */ + if (prevRhsNode && isInside(id, prevRhsNode)) { + return prevRhsNode; + } + + if (parent.type === "AssignmentExpression" && + grandparent.type === "ExpressionStatement" && + id === parent.left && + !canBeUsedLater + ) { + return parent.right; + } + return null; + } + + /** + * Checks whether a given function node is stored to somewhere or not. + * If the function node is stored, the function can be used later. + * @param {ASTNode} funcNode A function node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if under the following conditions: + * - the funcNode is assigned to a variable. + * - the funcNode is bound as an argument of a function call. + * - the function is bound to a property and the object satisfies above conditions. + * @private + */ + function isStorableFunction(funcNode, rhsNode) { + let node = funcNode; + let parent = funcNode.parent; + + while (parent && isInside(parent, rhsNode)) { + switch (parent.type) { + case "SequenceExpression": + if (parent.expressions[parent.expressions.length - 1] !== node) { + return false; + } + break; + + case "CallExpression": + case "NewExpression": + return parent.callee !== node; + + case "AssignmentExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + return true; + + default: + if (STATEMENT_TYPE.test(parent.type)) { + + /* + * If it encountered statements, this is a complex pattern. + * Since analyzing complex patterns is hard, this returns `true` to avoid false positive. + */ + return true; + } + } + + node = parent; + parent = parent.parent; + } + + return false; + } + + /** + * Checks whether a given Identifier node exists inside of a function node which can be used later. + * + * "can be used later" means: + * - the function is assigned to a variable. + * - the function is bound to a property and the object can be used later. + * - the function is bound as an argument of a function call. + * + * If a reference exists in a function which can be used later, the reference is read when the function is called. + * @param {ASTNode} id An Identifier node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later. + * @private + */ + function isInsideOfStorableFunction(id, rhsNode) { + const funcNode = astUtils.getUpperFunction(id); + + return ( + funcNode && + isInside(funcNode, rhsNode) && + isStorableFunction(funcNode, rhsNode) + ); + } + + /** + * Checks whether a given reference is a read to update itself or not. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} The reference is a read to update itself. + * @private + */ + function isReadForItself(ref, rhsNode) { + const id = ref.identifier; + const parent = id.parent; + const grandparent = parent.parent; + + return ref.isRead() && ( + + // self update. e.g. `a += 1`, `a++` + (// in RHS of an assignment for itself. e.g. `a = a + 1` + (( + parent.type === "AssignmentExpression" && + grandparent.type === "ExpressionStatement" && + parent.left === id + ) || + ( + parent.type === "UpdateExpression" && + grandparent.type === "ExpressionStatement" + ) || rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode))) + ); + } + + /** + * Determine if an identifier is used either in for-in loops. + * @param {Reference} ref The reference to check. + * @returns {boolean} whether reference is used in the for-in loops + * @private + */ + function isForInRef(ref) { + let target = ref.identifier.parent; + + + // "for (var ...) { return; }" + if (target.type === "VariableDeclarator") { + target = target.parent.parent; + } + + if (target.type !== "ForInStatement") { + return false; + } + + // "for (...) { return; }" + if (target.body.type === "BlockStatement") { + target = target.body.body[0]; + + // "for (...) return;" + } else { + target = target.body; + } + + // For empty loop body + if (!target) { + return false; + } + + return target.type === "ReturnStatement"; + } + + /** + * Determines if the variable is used. + * @param {Variable} variable The variable to check. + * @returns {boolean} True if the variable is used + * @private + */ + function isUsedVariable(variable) { + const functionNodes = getFunctionDefinitions(variable), + isFunctionDefinition = functionNodes.length > 0; + let rhsNode = null; + + return variable.references.some(ref => { + if (isForInRef(ref)) { + return true; + } + + const forItself = isReadForItself(ref, rhsNode); + + rhsNode = getRhsNode(ref, rhsNode); + + return ( + isReadRef(ref) && + !forItself && + !(isFunctionDefinition && isSelfReference(ref, functionNodes)) + ); + }); + } + + /** + * Checks whether the given variable is after the last used parameter. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is defined after the last + * used parameter. + */ + function isAfterLastUsedArg(variable) { + const def = variable.defs[0]; + const params = context.getDeclaredVariables(def.node); + const posteriorParams = params.slice(params.indexOf(variable) + 1); + + // If any used parameters occur after this parameter, do not report. + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); + } + + /** + * Gets an array of variables without read references. + * @param {Scope} scope an eslint-scope Scope object. + * @param {Variable[]} unusedVars an array that saving result. + * @returns {Variable[]} unused variables of the scope and descendant scopes. + * @private + */ + function collectUnusedVariables(scope, unusedVars) { + const variables = scope.variables; + const childScopes = scope.childScopes; + let i, l; + + if (scope.type !== "global" || config.vars === "all") { + for (i = 0, l = variables.length; i < l; ++i) { + const variable = variables[i]; + + // skip a variable of class itself name in the class scope + if (scope.type === "class" && scope.block.id === variable.identifiers[0]) { + continue; + } + + // skip function expression names and variables marked with markVariableAsUsed() + if (scope.functionExpressionScope || variable.eslintUsed) { + continue; + } + + // skip implicit "arguments" variable + if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { + continue; + } + + // explicit global variables don't have definitions. + const def = variable.defs[0]; + + if (def) { + const type = def.type; + + // skip catch variables + if (type === "CatchClause") { + if (config.caughtErrors === "none") { + continue; + } + + // skip ignored parameters + if (config.caughtErrorsIgnorePattern && config.caughtErrorsIgnorePattern.test(def.name.name)) { + continue; + } + } + + if (type === "Parameter") { + + // skip any setter argument + if ((def.node.parent.type === "Property" || def.node.parent.type === "MethodDefinition") && def.node.parent.kind === "set") { + continue; + } + + // if "args" option is "none", skip any parameter + if (config.args === "none") { + continue; + } + + // skip ignored parameters + if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { + continue; + } + + // if "args" option is "after-used", skip used variables + if (config.args === "after-used" && astUtils.isFunction(def.name.parent) && !isAfterLastUsedArg(variable)) { + continue; + } + } else { + + // skip ignored variables + if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) { + continue; + } + } + } + + if (!isUsedVariable(variable) && !isExported(variable) && !hasRestSpreadSibling(variable)) { + unusedVars.push(variable); + } + } + } + + for (i = 0, l = childScopes.length; i < l; ++i) { + collectUnusedVariables(childScopes[i], unusedVars); + } + + return unusedVars; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"(programNode) { + const unusedVars = collectUnusedVariables(context.getScope(), []); + + for (let i = 0, l = unusedVars.length; i < l; ++i) { + const unusedVar = unusedVars[i]; + + // Report the first declaration. + if (unusedVar.defs.length > 0) { + context.report({ + node: unusedVar.references.length ? unusedVar.references[ + unusedVar.references.length - 1 + ].identifier : unusedVar.identifiers[0], + messageId: "unusedVar", + data: unusedVar.references.some(ref => ref.isWrite()) + ? getAssignedMessageData(unusedVar) + : getDefinedMessageData(unusedVar) + }); + + // If there are no regular declaration, report the first `/*globals*/` comment directive. + } else if (unusedVar.eslintExplicitGlobalComments) { + const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; + + context.report({ + node: programNode, + loc: astUtils.getNameLocationInGlobalDirectiveComment(sourceCode, directiveComment, unusedVar.name), + messageId: "unusedVar", + data: getDefinedMessageData(unusedVar) + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-use-before-define.js b/node_modules/eslint/lib/rules/no-use-before-define.js new file mode 100644 index 0000000..c730056 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-use-before-define.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Rule to flag use of variables before they are defined + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; +const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; + +/** + * Parses a given value as options. + * @param {any} options A value to parse. + * @returns {Object} The parsed options. + */ +function parseOptions(options) { + let functions = true; + let classes = true; + let variables = true; + + if (typeof options === "string") { + functions = (options !== "nofunc"); + } else if (typeof options === "object" && options !== null) { + functions = options.functions !== false; + classes = options.classes !== false; + variables = options.variables !== false; + } + + return { functions, classes, variables }; +} + +/** + * Checks whether or not a given variable is a function declaration. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the variable is a class declaration. + */ +function isOuterClass(variable, reference) { + return ( + variable.defs[0].type === "ClassName" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given variable is a variable declaration in an upper function scope. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the variable is a variable declaration. + */ +function isOuterVariable(variable, reference) { + return ( + variable.defs[0].type === "Variable" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ +function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; +} + +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * This returns `true` in the following cases: + * + * var a = a + * var [a = a] = list + * var {a = a} = obj + * for (var a in a) {} + * for (var a of a) {} + * @param {Variable} variable A variable to check. + * @param {Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the initializers. + */ +function isInInitializer(variable, reference) { + if (variable.scope !== reference.from) { + return false; + } + + let node = variable.identifiers[0].parent; + const location = reference.identifier.range[1]; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + if (FOR_IN_OF_TYPE.test(node.parent.parent.type) && + isInRange(node.parent.parent.right, location) + ) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of variables before they are defined", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-use-before-define" + }, + + schema: [ + { + oneOf: [ + { + enum: ["nofunc"] + }, + { + type: "object", + properties: { + functions: { type: "boolean" }, + classes: { type: "boolean" }, + variables: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + usedBeforeDefined: "'{{name}}' was used before it was defined." + } + }, + + create(context) { + const options = parseOptions(context.options[0]); + + /** + * Determines whether a given use-before-define case should be reported according to the options. + * @param {eslint-scope.Variable} variable The variable that gets used before being defined + * @param {eslint-scope.Reference} reference The reference to the variable + * @returns {boolean} `true` if the usage should be reported + */ + function isForbidden(variable, reference) { + if (isFunction(variable)) { + return options.functions; + } + if (isOuterClass(variable, reference)) { + return options.classes; + } + if (isOuterVariable(variable, reference)) { + return options.variables; + } + return true; + } + + /** + * Finds and validates all variables in a given scope. + * @param {Scope} scope The scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + scope.references.forEach(reference => { + const variable = reference.resolved; + + /* + * Skips when the reference is: + * - initialization's. + * - referring to an undefined variable. + * - referring to a global environment variable (there're no identifiers). + * - located preceded by the variable (except in initializers). + * - allowed by options. + */ + if (reference.init || + !variable || + variable.identifiers.length === 0 || + (variable.identifiers[0].range[1] < reference.identifier.range[1] && !isInInitializer(variable, reference)) || + !isForbidden(variable, reference) + ) { + return; + } + + // Reports. + context.report({ + node: reference.identifier, + messageId: "usedBeforeDefined", + data: reference.identifier + }); + }); + + scope.childScopes.forEach(findVariablesInScope); + } + + return { + Program() { + findVariablesInScope(context.getScope()); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-backreference.js b/node_modules/eslint/lib/rules/no-useless-backreference.js new file mode 100644 index 0000000..958e3d5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-backreference.js @@ -0,0 +1,193 @@ +/** + * @fileoverview Rule to disallow useless backreferences in regular expressions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("regexpp"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new RegExpParser(); + +/** + * Finds the path from the given `regexpp` AST node to the root node. + * @param {regexpp.Node} node Node. + * @returns {regexpp.Node[]} Array that starts with the given node and ends with the root node. + */ +function getPathToRoot(node) { + const path = []; + let current = node; + + do { + path.push(current); + current = current.parent; + } while (current); + + return path; +} + +/** + * Determines whether the given `regexpp` AST node is a lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a lookaround node. + */ +function isLookaround(node) { + return node.type === "Assertion" && + (node.kind === "lookahead" || node.kind === "lookbehind"); +} + +/** + * Determines whether the given `regexpp` AST node is a negative lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a negative lookaround node. + */ +function isNegativeLookaround(node) { + return isLookaround(node) && node.negate; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow useless backreferences in regular expressions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-backreference" + }, + + schema: [], + + messages: { + nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' from within that group.", + forward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears later in the pattern.", + backward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears before in the same lookbehind.", + disjunctive: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in another alternative.", + intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in a negative lookaround." + } + }, + + create(context) { + + /** + * Checks and reports useless backreferences in the given regular expression. + * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call. + * @param {string} pattern Regular expression pattern. + * @param {string} flags Regular expression flags. + * @returns {void} + */ + function checkRegex(node, pattern, flags) { + let regExpAST; + + try { + regExpAST = parser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(regExpAST, { + onBackreferenceEnter(bref) { + const group = bref.resolved, + brefPath = getPathToRoot(bref), + groupPath = getPathToRoot(group); + let messageId = null; + + if (brefPath.includes(group)) { + + // group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match. + messageId = "nested"; + } else { + + // Start from the root to find the lowest common ancestor. + let i = brefPath.length - 1, + j = groupPath.length - 1; + + do { + i--; + j--; + } while (brefPath[i] === groupPath[j]); + + const indexOfLowestCommonAncestor = j + 1, + groupCut = groupPath.slice(0, indexOfLowestCommonAncestor), + commonPath = groupPath.slice(indexOfLowestCommonAncestor), + lowestCommonLookaround = commonPath.find(isLookaround), + isMatchingBackward = lowestCommonLookaround && lowestCommonLookaround.kind === "lookbehind"; + + if (!isMatchingBackward && bref.end <= group.start) { + + // bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match. + messageId = "forward"; + } else if (isMatchingBackward && group.end <= bref.start) { + + // the opposite of the previous when the regex is matching backward in a lookbehind context. + messageId = "backward"; + } else if (lodash.last(groupCut).type === "Alternative") { + + // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive. + messageId = "disjunctive"; + } else if (groupCut.some(isNegativeLookaround)) { + + // group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match. + messageId = "intoNegativeLookaround"; + } + } + + if (messageId) { + context.report({ + node, + messageId, + data: { + bref: bref.raw, + group: group.raw + } + }); + } + } + }); + } + + return { + "Literal[regex]"(node) { + const { pattern, flags } = node.regex; + + checkRegex(node, pattern, flags); + }, + Program() { + const scope = context.getScope(), + tracker = new ReferenceTracker(scope), + traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const [patternNode, flagsNode] = node.arguments, + pattern = getStringIfConstant(patternNode, scope), + flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + checkRegex(node, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-call.js b/node_modules/eslint/lib/rules/no-useless-call.js new file mode 100644 index 0000000..b1382a2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-call.js @@ -0,0 +1,90 @@ +/** + * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.call()`/`.apply()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. + */ +function isCallOrNonVariadicApply(node) { + const callee = astUtils.skipChainExpression(node.callee); + + return ( + callee.type === "MemberExpression" && + callee.property.type === "Identifier" && + callee.computed === false && + ( + (callee.property.name === "call" && node.arguments.length >= 1) || + (callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression") + ) + ); +} + + +/** + * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, sourceCode) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, sourceCode); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary calls to `.call()` and `.apply()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-call" + }, + + schema: [], + + messages: { + unnecessaryCall: "Unnecessary '.{{name}}()'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + CallExpression(node) { + if (!isCallOrNonVariadicApply(node)) { + return; + } + + const callee = astUtils.skipChainExpression(node.callee); + const applied = astUtils.skipChainExpression(callee.object); + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ node, messageId: "unnecessaryCall", data: { name: callee.property.name } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-catch.js b/node_modules/eslint/lib/rules/no-useless-catch.js new file mode 100644 index 0000000..f303c27 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-catch.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Reports useless `catch` clauses that just rethrow their error. + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary `catch` clauses", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-useless-catch" + }, + + schema: [], + + messages: { + unnecessaryCatchClause: "Unnecessary catch clause.", + unnecessaryCatch: "Unnecessary try/catch wrapper." + } + }, + + create(context) { + return { + CatchClause(node) { + if ( + node.param && + node.param.type === "Identifier" && + node.body.body.length && + node.body.body[0].type === "ThrowStatement" && + node.body.body[0].argument.type === "Identifier" && + node.body.body[0].argument.name === node.param.name + ) { + if (node.parent.finalizer) { + context.report({ + node, + messageId: "unnecessaryCatchClause" + }); + } else { + context.report({ + node: node.parent, + messageId: "unnecessaryCatch" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-computed-key.js b/node_modules/eslint/lib/rules/no-useless-computed-key.js new file mode 100644 index 0000000..e0505a3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-computed-key.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to disallow unnecessary computed property keys in object literals + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary computed property keys in objects and classes", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-computed-key" + }, + + schema: [{ + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unnecessarilyComputedProperty: "Unnecessarily computed property [{{property}}] found." + } + }, + create(context) { + const sourceCode = context.getSourceCode(); + const enforceForClassMembers = context.options[0] && context.options[0].enforceForClassMembers; + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function check(node) { + if (!node.computed) { + return; + } + + const key = node.key, + nodeType = typeof key.value; + + let allowedKey; + + if (node.type === "MethodDefinition") { + allowedKey = node.static ? "prototype" : "constructor"; + } else { + allowedKey = "__proto__"; + } + + if (key.type === "Literal" && (nodeType === "string" || nodeType === "number") && key.value !== allowedKey) { + context.report({ + node, + messageId: "unnecessarilyComputedProperty", + data: { property: sourceCode.getText(key) }, + fix(fixer) { + const leftSquareBracket = sourceCode.getTokenBefore(key, astUtils.isOpeningBracketToken); + const rightSquareBracket = sourceCode.getTokenAfter(key, astUtils.isClosingBracketToken); + + // If there are comments between the brackets and the property name, don't do a fix. + if (sourceCode.commentsExistBetween(leftSquareBracket, rightSquareBracket)) { + return null; + } + + const tokenBeforeLeftBracket = sourceCode.getTokenBefore(leftSquareBracket); + + // Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} }) + const needsSpaceBeforeKey = tokenBeforeLeftBracket.range[1] === leftSquareBracket.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftBracket, sourceCode.getFirstToken(key)); + + const replacementKey = (needsSpaceBeforeKey ? " " : "") + key.raw; + + return fixer.replaceTextRange([leftSquareBracket.range[0], rightSquareBracket.range[1]], replacementKey); + } + }); + } + } + + return { + Property: check, + MethodDefinition: enforceForClassMembers ? check : lodash.noop + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-concat.js b/node_modules/eslint/lib/rules/no-useless-concat.js new file mode 100644 index 0000000..cfc60c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-concat.js @@ -0,0 +1,115 @@ +/** + * @fileoverview disallow unnecessary concatenation of template strings + * @author Henry Zhu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Checks if the given token is a `+` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `+` token. + */ +function isConcatOperatorToken(token) { + return token.value === "+" && token.type === "Punctuator"; +} + +/** + * Get's the right most node on the left side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getLeft(node) { + let left = node.left; + + while (isConcatenation(left)) { + left = left.right; + } + return left; +} + +/** + * Get's the left most node on the right side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getRight(node) { + let right = node.right; + + while (isConcatenation(right)) { + right = right.left; + } + return right; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary concatenation of literals or template literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-concat" + }, + + schema: [], + + messages: { + unexpectedConcat: "Unexpected string concatenation of literals." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + BinaryExpression(node) { + + // check if not concatenation + if (node.operator !== "+") { + return; + } + + // account for the `foo + "a" + "b"` case + const left = getLeft(node); + const right = getRight(node); + + if (astUtils.isStringLiteral(left) && + astUtils.isStringLiteral(right) && + astUtils.isTokenOnSameLine(left, right) + ) { + const operatorToken = sourceCode.getFirstTokenBetween(left, right, isConcatOperatorToken); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpectedConcat" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-constructor.js b/node_modules/eslint/lib/rules/no-useless-constructor.js new file mode 100644 index 0000000..4c34aed --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to flag the use of redundant constructors in classes. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given array of statements is a single call of `super`. + * @param {ASTNode[]} body An array of statements to check. + * @returns {boolean} `true` if the body is a single call of `super`. + */ +function isSingleSuperCall(body) { + return ( + body.length === 1 && + body[0].type === "ExpressionStatement" && + body[0].expression.type === "CallExpression" && + body[0].expression.callee.type === "Super" + ); +} + +/** + * Checks whether a given node is a pattern which doesn't have any side effects. + * Default parameters and Destructuring parameters can have side effects. + * @param {ASTNode} node A pattern node. + * @returns {boolean} `true` if the node doesn't have any side effects. + */ +function isSimple(node) { + return node.type === "Identifier" || node.type === "RestElement"; +} + +/** + * Checks whether a given array of expressions is `...arguments` or not. + * `super(...arguments)` passes all arguments through. + * @param {ASTNode[]} superArgs An array of expressions to check. + * @returns {boolean} `true` if the superArgs is `...arguments`. + */ +function isSpreadArguments(superArgs) { + return ( + superArgs.length === 1 && + superArgs[0].type === "SpreadElement" && + superArgs[0].argument.type === "Identifier" && + superArgs[0].argument.name === "arguments" + ); +} + +/** + * Checks whether given 2 nodes are identifiers which have the same name or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are identifiers which have the same + * name. + */ +function isValidIdentifierPair(ctorParam, superArg) { + return ( + ctorParam.type === "Identifier" && + superArg.type === "Identifier" && + ctorParam.name === superArg.name + ); +} + +/** + * Checks whether given 2 nodes are a rest/spread pair which has the same values. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are a rest/spread pair which has the + * same values. + */ +function isValidRestSpreadPair(ctorParam, superArg) { + return ( + ctorParam.type === "RestElement" && + superArg.type === "SpreadElement" && + isValidIdentifierPair(ctorParam.argument, superArg.argument) + ); +} + +/** + * Checks whether given 2 nodes have the same value or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes have the same value or not. + */ +function isValidPair(ctorParam, superArg) { + return ( + isValidIdentifierPair(ctorParam, superArg) || + isValidRestSpreadPair(ctorParam, superArg) + ); +} + +/** + * Checks whether the parameters of a constructor and the arguments of `super()` + * have the same values or not. + * @param {ASTNode} ctorParams The parameters of a constructor to check. + * @param {ASTNode} superArgs The arguments of `super()` to check. + * @returns {boolean} `true` if those have the same values. + */ +function isPassingThrough(ctorParams, superArgs) { + if (ctorParams.length !== superArgs.length) { + return false; + } + + for (let i = 0; i < ctorParams.length; ++i) { + if (!isValidPair(ctorParams[i], superArgs[i])) { + return false; + } + } + + return true; +} + +/** + * Checks whether the constructor body is a redundant super call. + * @param {Array} body constructor body content. + * @param {Array} ctorParams The params to check against super call. + * @returns {boolean} true if the constructor body is redundant + */ +function isRedundantSuperCall(body, ctorParams) { + return ( + isSingleSuperCall(body) && + ctorParams.every(isSimple) && + ( + isSpreadArguments(body[0].expression.arguments) || + isPassingThrough(ctorParams, body[0].expression.arguments) + ) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary constructors", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-constructor" + }, + + schema: [], + + messages: { + noUselessConstructor: "Useless constructor." + } + }, + + create(context) { + + /** + * Checks whether a node is a redundant constructor + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkForConstructor(node) { + if (node.kind !== "constructor") { + return; + } + + const body = node.value.body.body; + const ctorParams = node.value.params; + const superClass = node.parent.parent.superClass; + + if (superClass ? isRedundantSuperCall(body, ctorParams) : (body.length === 0)) { + context.report({ + node, + messageId: "noUselessConstructor" + }); + } + } + + return { + MethodDefinition: checkForConstructor + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-escape.js b/node_modules/eslint/lib/rules/no-useless-escape.js new file mode 100644 index 0000000..8057e44 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-escape.js @@ -0,0 +1,252 @@ +/** + * @fileoverview Look for useless escapes in strings and regexes + * @author Onur Temizkan + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the union of two sets. + * @param {Set} setA The first set + * @param {Set} setB The second set + * @returns {Set} The union of the two sets + */ +function union(setA, setB) { + return new Set(function *() { + yield* setA; + yield* setB; + }()); +} + +const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS); +const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]"); +const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+?[{}|()Bk")); + +/** + * Parses a regular expression into a list of characters with character class info. + * @param {string} regExpText The raw text used to create the regular expression + * @returns {Object[]} A list of characters, each with info on escaping and whether they're in a character class. + * @example + * + * parseRegExp('a\\b[cd-]') + * + * returns: + * [ + * {text: 'a', index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false}, + * {text: 'b', index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false}, + * {text: 'c', index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false}, + * {text: 'd', index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false}, + * {text: '-', index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false} + * ] + */ +function parseRegExp(regExpText) { + const charList = []; + + regExpText.split("").reduce((state, char, index) => { + if (!state.escapeNextChar) { + if (char === "\\") { + return Object.assign(state, { escapeNextChar: true }); + } + if (char === "[" && !state.inCharClass) { + return Object.assign(state, { inCharClass: true, startingCharClass: true }); + } + if (char === "]" && state.inCharClass) { + if (charList.length && charList[charList.length - 1].inCharClass) { + charList[charList.length - 1].endsCharClass = true; + } + return Object.assign(state, { inCharClass: false, startingCharClass: false }); + } + } + charList.push({ + text: char, + index, + escaped: state.escapeNextChar, + inCharClass: state.inCharClass, + startsCharClass: state.startingCharClass, + endsCharClass: false + }); + return Object.assign(state, { escapeNextChar: false, startingCharClass: false }); + }, { escapeNextChar: false, inCharClass: false, startingCharClass: false }); + + return charList; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary escape characters", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-useless-escape", + suggestion: true + }, + + messages: { + unnecessaryEscape: "Unnecessary escape character: \\{{character}}.", + removeEscape: "Remove the `\\`. This maintains the current functionality.", + escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character." + }, + + schema: [] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports a node + * @param {ASTNode} node The node to report + * @param {number} startOffset The backslash's offset from the start of the node + * @param {string} character The uselessly escaped character (not including the backslash) + * @returns {void} + */ + function report(node, startOffset, character) { + const start = sourceCode.getLocFromIndex(sourceCode.getIndexFromLoc(node.loc.start) + startOffset); + const rangeStart = sourceCode.getIndexFromLoc(node.loc.start) + startOffset; + const range = [rangeStart, rangeStart + 1]; + + context.report({ + node, + loc: { + start, + end: { line: start.line, column: start.column + 1 } + }, + messageId: "unnecessaryEscape", + data: { character }, + suggest: [ + { + messageId: "removeEscape", + fix(fixer) { + return fixer.removeRange(range); + } + }, + { + messageId: "escapeBackslash", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\\"); + } + } + ] + }); + } + + /** + * Checks if the escape character in given string slice is unnecessary. + * @private + * @param {ASTNode} node node to validate. + * @param {string} match string slice to validate. + * @returns {void} + */ + function validateString(node, match) { + const isTemplateElement = node.type === "TemplateElement"; + const escapedChar = match[0][1]; + let isUnnecessaryEscape = !VALID_STRING_ESCAPES.has(escapedChar); + let isQuoteEscape; + + if (isTemplateElement) { + isQuoteEscape = escapedChar === "`"; + + if (escapedChar === "$") { + + // Warn if `\$` is not followed by `{` + isUnnecessaryEscape = match.input[match.index + 2] !== "{"; + } else if (escapedChar === "{") { + + /* + * Warn if `\{` is not preceded by `$`. If preceded by `$`, escaping + * is necessary and the rule should not warn. If preceded by `/$`, the rule + * will warn for the `/$` instead, as it is the first unnecessarily escaped character. + */ + isUnnecessaryEscape = match.input[match.index - 1] !== "$"; + } + } else { + isQuoteEscape = escapedChar === node.raw[0]; + } + + if (isUnnecessaryEscape && !isQuoteEscape) { + report(node, match.index + 1, match[0].slice(1)); + } + } + + /** + * Checks if a node has an escape. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + const isTemplateElement = node.type === "TemplateElement"; + + if ( + isTemplateElement && + node.parent && + node.parent.parent && + node.parent.parent.type === "TaggedTemplateExpression" && + node.parent === node.parent.parent.quasi + ) { + + // Don't report tagged template literals, because the backslash character is accessible to the tag function. + return; + } + + if (typeof node.value === "string" || isTemplateElement) { + + /* + * JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/. + * In addition, backticks are not supported by JSX yet: https://github.com/facebook/jsx/issues/25. + */ + if (node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment") { + return; + } + + const value = isTemplateElement ? node.value.raw : node.raw.slice(1, -1); + const pattern = /\\[^\d]/gu; + let match; + + while ((match = pattern.exec(value))) { + validateString(node, match); + } + } else if (node.regex) { + parseRegExp(node.regex.pattern) + + /* + * The '-' character is a special case, because it's only valid to escape it if it's in a character + * class, and is not at either edge of the character class. To account for this, don't consider '-' + * characters to be valid in general, and filter out '-' characters that appear in the middle of a + * character class. + */ + .filter(charInfo => !(charInfo.text === "-" && charInfo.inCharClass && !charInfo.startsCharClass && !charInfo.endsCharClass)) + + /* + * The '^' character is also a special case; it must always be escaped outside of character classes, but + * it only needs to be escaped in character classes if it's at the beginning of the character class. To + * account for this, consider it to be a valid escape character outside of character classes, and filter + * out '^' characters that appear at the start of a character class. + */ + .filter(charInfo => !(charInfo.text === "^" && charInfo.startsCharClass)) + + // Filter out characters that aren't escaped. + .filter(charInfo => charInfo.escaped) + + // Filter out characters that are valid to escape, based on their position in the regular expression. + .filter(charInfo => !(charInfo.inCharClass ? REGEX_GENERAL_ESCAPES : REGEX_NON_CHARCLASS_ESCAPES).has(charInfo.text)) + + // Report all the remaining characters. + .forEach(charInfo => report(node, charInfo.index, charInfo.text)); + } + + } + + return { + Literal: check, + TemplateElement: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-rename.js b/node_modules/eslint/lib/rules/no-useless-rename.js new file mode 100644 index 0000000..fa88f37 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-rename.js @@ -0,0 +1,168 @@ +/** + * @fileoverview Disallow renaming import, export, and destructured assignments to the same name. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow renaming import, export, and destructured assignments to the same name", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-rename" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { type: "boolean", default: false }, + ignoreImport: { type: "boolean", default: false }, + ignoreExport: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + options = context.options[0] || {}, + ignoreDestructuring = options.ignoreDestructuring === true, + ignoreImport = options.ignoreImport === true, + ignoreExport = options.ignoreExport === true; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports error for unnecessarily renamed assignments + * @param {ASTNode} node node to report + * @param {ASTNode} initial node with initial name value + * @param {ASTNode} result node with new name value + * @param {string} type the type of the offending node + * @returns {void} + */ + function reportError(node, initial, result, type) { + const name = initial.type === "Identifier" ? initial.name : initial.value; + + return context.report({ + node, + messageId: "unnecessarilyRenamed", + data: { + name, + type + }, + fix(fixer) { + if (sourceCode.commentsExistBetween(initial, result)) { + return null; + } + + const replacementText = result.type === "AssignmentPattern" + ? sourceCode.getText(result) + : name; + + return fixer.replaceTextRange([ + initial.range[0], + result.range[1] + ], replacementText); + } + }); + } + + /** + * Checks whether a destructured assignment is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDestructured(node) { + if (ignoreDestructuring) { + return; + } + + for (const property of node.properties) { + + /* + * TODO: Remove after babel-eslint removes ExperimentalRestProperty + * https://github.com/eslint/eslint/issues/12335 + */ + if (property.type === "ExperimentalRestProperty") { + continue; + } + + /** + * Properties using shorthand syntax and rest elements can not be renamed. + * If the property is computed, we have no idea if a rename is useless or not. + */ + if (property.shorthand || property.type === "RestElement" || property.computed) { + continue; + } + + const key = (property.key.type === "Identifier" && property.key.name) || (property.key.type === "Literal" && property.key.value); + const renamedKey = property.value.type === "AssignmentPattern" ? property.value.left.name : property.value.name; + + if (key === renamedKey) { + reportError(property, property.key, property.value, "Destructuring assignment"); + } + } + } + + /** + * Checks whether an import is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkImport(node) { + if (ignoreImport) { + return; + } + + if (node.imported.name === node.local.name && + node.imported.range[0] !== node.local.range[0]) { + reportError(node, node.imported, node.local, "Import"); + } + } + + /** + * Checks whether an export is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkExport(node) { + if (ignoreExport) { + return; + } + + if (node.local.name === node.exported.name && + node.local.range[0] !== node.exported.range[0]) { + reportError(node, node.local, node.exported, "Export"); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ObjectPattern: checkDestructured, + ImportSpecifier: checkImport, + ExportSpecifier: checkExport + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-return.js b/node_modules/eslint/lib/rules/no-useless-return.js new file mode 100644 index 0000000..111cb21 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-return.js @@ -0,0 +1,305 @@ +/** + * @fileoverview Disallow redundant return statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Removes the given element from the array. + * @param {Array} array The source array to remove. + * @param {any} element The target item to remove. + * @returns {void} + */ +function remove(array, element) { + const index = array.indexOf(element); + + if (index !== -1) { + array.splice(index, 1); + } +} + +/** + * Checks whether it can remove the given return statement or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is removable. + */ +function isRemovable(node) { + return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); +} + +/** + * Checks whether the given return statement is in a `finally` block or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is in a `finally` block. + */ +function isInFinally(node) { + for ( + let currentNode = node; + currentNode && currentNode.parent && !astUtils.isFunction(currentNode); + currentNode = currentNode.parent + ) { + if (currentNode.parent.type === "TryStatement" && currentNode.parent.finalizer === currentNode) { + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow redundant return statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-return" + }, + + fixable: "code", + schema: [], + + messages: { + unnecessaryReturn: "Unnecessary return statement." + } + }, + + create(context) { + const segmentInfoMap = new WeakMap(); + const usedUnreachableSegments = new WeakSet(); + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Checks whether the given segment is terminated by a return statement or not. + * @param {CodePathSegment} segment The segment to check. + * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable. + */ + function isReturned(segment) { + const info = segmentInfoMap.get(segment); + + return !info || info.returned; + } + + /** + * Collects useless return statements from the given previous segments. + * + * A previous segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {ASTNode[]} uselessReturns The collected return statements. + * @param {CodePathSegment[]} prevSegments The previous segments to traverse. + * @param {WeakSet} [providedTraversedSegments] A set of segments that have already been traversed in this call + * @returns {ASTNode[]} `uselessReturns`. + */ + function getUselessReturns(uselessReturns, prevSegments, providedTraversedSegments) { + const traversedSegments = providedTraversedSegments || new WeakSet(); + + for (const segment of prevSegments) { + if (!segment.reachable) { + if (!traversedSegments.has(segment)) { + traversedSegments.add(segment); + getUselessReturns( + uselessReturns, + segment.allPrevSegments.filter(isReturned), + traversedSegments + ); + } + continue; + } + + uselessReturns.push(...segmentInfoMap.get(segment).uselessReturns); + } + + return uselessReturns; + } + + /** + * Removes the return statements on the given segment from the useless return + * statement list. + * + * This segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {CodePathSegment} segment The segment to get return statements. + * @returns {void} + */ + function markReturnStatementsOnSegmentAsUsed(segment) { + if (!segment.reachable) { + usedUnreachableSegments.add(segment); + segment.allPrevSegments + .filter(isReturned) + .filter(prevSegment => !usedUnreachableSegments.has(prevSegment)) + .forEach(markReturnStatementsOnSegmentAsUsed); + return; + } + + const info = segmentInfoMap.get(segment); + + for (const node of info.uselessReturns) { + remove(scopeInfo.uselessReturns, node); + } + info.uselessReturns = []; + } + + /** + * Removes the return statements on the current segments from the useless + * return statement list. + * + * This function will be called at every statement except FunctionDeclaration, + * BlockStatement, and BreakStatement. + * + * - FunctionDeclarations are always executed whether it's returned or not. + * - BlockStatements do nothing. + * - BreakStatements go the next merely. + * @returns {void} + */ + function markReturnStatementsOnCurrentSegmentsAsUsed() { + scopeInfo + .codePath + .currentSegments + .forEach(markReturnStatementsOnSegmentAsUsed); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Makes and pushs a new scope information. + onCodePathStart(codePath) { + scopeInfo = { + upper: scopeInfo, + uselessReturns: [], + codePath + }; + }, + + // Reports useless return statements if exist. + onCodePathEnd() { + for (const node of scopeInfo.uselessReturns) { + context.report({ + node, + loc: node.loc, + messageId: "unnecessaryReturn", + fix(fixer) { + if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) { + + /* + * Extend the replacement range to include the + * entire function to avoid conflicting with + * no-else-return. + * https://github.com/eslint/eslint/issues/8026 + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .remove(node); + } + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + }, + + /* + * Initializes segments. + * NOTE: This event is notified for only reachable segments. + */ + onCodePathSegmentStart(segment) { + const info = { + uselessReturns: getUselessReturns([], segment.allPrevSegments), + returned: false + }; + + // Stores the info. + segmentInfoMap.set(segment, info); + }, + + // Adds ReturnStatement node to check whether it's useless or not. + ReturnStatement(node) { + if (node.argument) { + markReturnStatementsOnCurrentSegmentsAsUsed(); + } + if ( + node.argument || + astUtils.isInLoop(node) || + isInFinally(node) || + + // Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647). + !scopeInfo.codePath.currentSegments.some(s => s.reachable) + ) { + return; + } + + for (const segment of scopeInfo.codePath.currentSegments) { + const info = segmentInfoMap.get(segment); + + if (info) { + info.uselessReturns.push(node); + info.returned = true; + } + } + scopeInfo.uselessReturns.push(node); + }, + + /* + * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement. + * Removes return statements of the current segments from the useless return statement list. + */ + ClassDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ContinueStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DebuggerStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DoWhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + EmptyStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExpressionStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForInStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForOfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + IfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ImportDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + LabeledStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + SwitchStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ThrowStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + TryStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + VariableDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + WhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + WithStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportNamedDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportDefaultDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-var.js b/node_modules/eslint/lib/rules/no-var.js new file mode 100644 index 0000000..f2cb96b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-var.js @@ -0,0 +1,334 @@ +/** + * @fileoverview Rule to check for the usage of var. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Check whether a given variable is a global variable or not. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is a global variable. + */ +function isGlobal(variable) { + return Boolean(variable.scope) && variable.scope.type === "global"; +} + +/** + * Finds the nearest function scope or global scope walking up the scope + * hierarchy. + * @param {eslint-scope.Scope} scope The scope to traverse. + * @returns {eslint-scope.Scope} a function scope or global scope containing the given + * scope. + */ +function getEnclosingFunctionScope(scope) { + let currentScope = scope; + + while (currentScope.type !== "function" && currentScope.type !== "global") { + currentScope = currentScope.upper; + } + return currentScope; +} + +/** + * Checks whether the given variable has any references from a more specific + * function expression (i.e. a closure). + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is used from a closure. + */ +function isReferencedInClosure(variable) { + const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope); + + return variable.references.some(reference => + getEnclosingFunctionScope(reference.from) !== enclosingFunctionScope); +} + +/** + * Checks whether the given node is the assignee of a loop. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration is assigned as part of loop + * iteration. + */ +function isLoopAssignee(node) { + return (node.parent.type === "ForOfStatement" || node.parent.type === "ForInStatement") && + node === node.parent.left; +} + +/** + * Checks whether the given variable declaration is immediately initialized. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration has an initializer. + */ +function isDeclarationInitialized(node) { + return node.declarations.every(declarator => declarator.init !== null); +} + +const SCOPE_NODE_TYPE = /^(?:Program|BlockStatement|SwitchStatement|ForStatement|ForInStatement|ForOfStatement)$/u; + +/** + * Gets the scope node which directly contains a given node. + * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or + * an `Identifier`. + * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`, + * `SwitchStatement`, `ForStatement`, `ForInStatement`, and + * `ForOfStatement`. + */ +function getScopeNode(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (SCOPE_NODE_TYPE.test(currentNode.type)) { + return currentNode; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +/** + * Checks whether a given variable is redeclared or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is redeclared. + */ +function isRedeclared(variable) { + return variable.defs.length >= 2; +} + +/** + * Checks whether a given variable is used from outside of the specified scope. + * @param {ASTNode} scopeNode A scope node to check. + * @returns {Function} The predicate function which checks whether a given + * variable is used from outside of the specified scope. + */ +function isUsedFromOutsideOf(scopeNode) { + + /** + * Checks whether a given reference is inside of the specified scope or not. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the specified + * scope. + */ + function isOutsideOfScope(reference) { + const scope = scopeNode.range; + const id = reference.identifier.range; + + return id[0] < scope[0] || id[1] > scope[1]; + } + + return function(variable) { + return variable.references.some(isOutsideOfScope); + }; +} + +/** + * Creates the predicate function which checks whether a variable has their references in TDZ. + * + * The predicate function would return `true`: + * + * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};) + * - if a reference is in the expression of their default value. E.g. (var {a = a} = {};) + * - if a reference is in the expression of their initializer. E.g. (var a = a;) + * @param {ASTNode} node The initializer node of VariableDeclarator. + * @returns {Function} The predicate function. + * @private + */ +function hasReferenceInTDZ(node) { + const initStart = node.range[0]; + const initEnd = node.range[1]; + + return variable => { + const id = variable.defs[0].name; + const idStart = id.range[0]; + const defaultValue = (id.parent.type === "AssignmentPattern" ? id.parent.right : null); + const defaultStart = defaultValue && defaultValue.range[0]; + const defaultEnd = defaultValue && defaultValue.range[1]; + + return variable.references.some(reference => { + const start = reference.identifier.range[0]; + const end = reference.identifier.range[1]; + + return !reference.init && ( + start < idStart || + (defaultValue !== null && start >= defaultStart && end <= defaultEnd) || + (start >= initStart && end <= initEnd) + ); + }); + }; +} + +/** + * Checks whether a given variable has name that is allowed for 'var' declarations, + * but disallowed for `let` declarations. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable has a disallowed name. + */ +function hasNameDisallowedForLetDeclarations(variable) { + return variable.name === "let"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `let` or `const` instead of `var`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-var" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedVar: "Unexpected var, use let or const instead." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Checks whether the variables which are defined by the given declarator node have their references in TDZ. + * @param {ASTNode} declarator The VariableDeclarator node to check. + * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ. + */ + function hasSelfReferenceInTDZ(declarator) { + if (!declarator.init) { + return false; + } + const variables = context.getDeclaredVariables(declarator); + + return variables.some(hasReferenceInTDZ(declarator.init)); + } + + /** + * Checks whether it can fix a given variable declaration or not. + * It cannot fix if the following cases: + * + * - A variable is a global variable. + * - A variable is declared on a SwitchCase node. + * - A variable is redeclared. + * - A variable is used from outside the scope. + * - A variable is used from a closure within a loop. + * - A variable might be used before it is assigned within a loop. + * - A variable might be used in TDZ. + * - A variable is declared in statement position (e.g. a single-line `IfStatement`) + * - A variable has name that is disallowed for `let` declarations. + * + * ## A variable is declared on a SwitchCase node. + * + * If this rule modifies 'var' declarations on a SwitchCase node, it + * would generate the warnings of 'no-case-declarations' rule. And the + * 'eslint:recommended' preset includes 'no-case-declarations' rule, so + * this rule doesn't modify those declarations. + * + * ## A variable is redeclared. + * + * The language spec disallows redeclarations of `let` declarations. + * Those variables would cause syntax errors. + * + * ## A variable is used from outside the scope. + * + * The language spec disallows accesses from outside of the scope for + * `let` declarations. Those variables would cause reference errors. + * + * ## A variable is used from a closure within a loop. + * + * A `var` declaration within a loop shares the same variable instance + * across all loop iterations, while a `let` declaration creates a new + * instance for each iteration. This means if a variable in a loop is + * referenced by any closure, changing it from `var` to `let` would + * change the behavior in a way that is generally unsafe. + * + * ## A variable might be used before it is assigned within a loop. + * + * Within a loop, a `let` declaration without an initializer will be + * initialized to null, while a `var` declaration will retain its value + * from the previous iteration, so it is only safe to change `var` to + * `let` if we can statically determine that the variable is always + * assigned a value before its first access in the loop body. To keep + * the implementation simple, we only convert `var` to `let` within + * loops when the variable is a loop assignee or the declaration has an + * initializer. + * @param {ASTNode} node A variable declaration node to check. + * @returns {boolean} `true` if it can fix the node. + */ + function canFix(node) { + const variables = context.getDeclaredVariables(node); + const scopeNode = getScopeNode(node); + + if (node.parent.type === "SwitchCase" || + node.declarations.some(hasSelfReferenceInTDZ) || + variables.some(isGlobal) || + variables.some(isRedeclared) || + variables.some(isUsedFromOutsideOf(scopeNode)) || + variables.some(hasNameDisallowedForLetDeclarations) + ) { + return false; + } + + if (astUtils.isInLoop(node)) { + if (variables.some(isReferencedInClosure)) { + return false; + } + if (!isLoopAssignee(node) && !isDeclarationInitialized(node)) { + return false; + } + } + + if ( + !isLoopAssignee(node) && + !(node.parent.type === "ForStatement" && node.parent.init === node) && + !astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type) + ) { + + // If the declaration is not in a block, e.g. `if (foo) var bar = 1;`, then it can't be fixed. + return false; + } + + return true; + } + + /** + * Reports a given variable declaration node. + * @param {ASTNode} node A variable declaration node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedVar", + + fix(fixer) { + const varToken = sourceCode.getFirstToken(node, { filter: t => t.value === "var" }); + + return canFix(node) + ? fixer.replaceText(varToken, "let") + : null; + } + }); + } + + return { + "VariableDeclaration:exit"(node) { + if (node.kind === "var") { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-void.js b/node_modules/eslint/lib/rules/no-void.js new file mode 100644 index 0000000..99c8378 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-void.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to disallow use of void operator. + * @author Mike Sidorov + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `void` operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-void" + }, + + messages: { + noVoid: "Expected 'undefined' and instead saw 'void'." + }, + + schema: [ + { + type: "object", + properties: { + allowAsStatement: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const allowAsStatement = + context.options[0] && context.options[0].allowAsStatement; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + 'UnaryExpression[operator="void"]'(node) { + if ( + allowAsStatement && + node.parent && + node.parent.type === "ExpressionStatement" + ) { + return; + } + context.report({ + node, + messageId: "noVoid" + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-warning-comments.js b/node_modules/eslint/lib/rules/no-warning-comments.js new file mode 100644 index 0000000..0691a31 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-warning-comments.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Rule that warns about used warning comments + * @author Alexander Schmidt + */ + +"use strict"; + +const { escapeRegExp } = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +const CHAR_LIMIT = 40; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified warning terms in comments", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-warning-comments" + }, + + schema: [ + { + type: "object", + properties: { + terms: { + type: "array", + items: { + type: "string" + } + }, + location: { + enum: ["start", "anywhere"] + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedComment: "Unexpected '{{matchedTerm}}' comment: '{{comment}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + configuration = context.options[0] || {}, + warningTerms = configuration.terms || ["todo", "fixme", "xxx"], + location = configuration.location || "start", + selfConfigRegEx = /\bno-warning-comments\b/u; + + /** + * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified + * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not + * require word boundaries on that side. + * @param {string} term A term to convert to a RegExp + * @returns {RegExp} The term converted to a RegExp + */ + function convertToRegExp(term) { + const escaped = escapeRegExp(term); + const wordBoundary = "\\b"; + const eitherOrWordBoundary = `|${wordBoundary}`; + let prefix; + + /* + * If the term ends in a word character (a-z0-9_), ensure a word + * boundary at the end, so that substrings do not get falsely + * matched. eg "todo" in a string such as "mastodon". + * If the term ends in a non-word character, then \b won't match on + * the boundary to the next non-word character, which would likely + * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. + * In these cases, use no bounding match. Same applies for the + * prefix, handled below. + */ + const suffix = /\w$/u.test(term) ? "\\b" : ""; + + if (location === "start") { + + /* + * When matching at the start, ignore leading whitespace, and + * there's no need to worry about word boundaries. + */ + prefix = "^\\s*"; + } else if (/^\w/u.test(term)) { + prefix = wordBoundary; + } else { + prefix = ""; + } + + if (location === "start") { + + /* + * For location "start" the regex should be + * ^\s*TERM\b. This checks the word boundary + * at the beginning of the comment. + */ + return new RegExp(prefix + escaped + suffix, "iu"); + } + + /* + * For location "anywhere" the regex should be + * \bTERM\b|\bTERM\b, this checks the entire comment + * for the term. + */ + return new RegExp( + prefix + + escaped + + suffix + + eitherOrWordBoundary + + term + + wordBoundary, + "iu" + ); + } + + const warningRegExps = warningTerms.map(convertToRegExp); + + /** + * Checks the specified comment for matches of the configured warning terms and returns the matches. + * @param {string} comment The comment which is checked. + * @returns {Array} All matched warning terms for this comment. + */ + function commentContainsWarningTerm(comment) { + const matches = []; + + warningRegExps.forEach((regex, index) => { + if (regex.test(comment)) { + matches.push(warningTerms[index]); + } + }); + + return matches; + } + + /** + * Checks the specified node for matching warning comments and reports them. + * @param {ASTNode} node The AST node being checked. + * @returns {void} undefined. + */ + function checkComment(node) { + const comment = node.value; + + if ( + astUtils.isDirectiveComment(node) && + selfConfigRegEx.test(comment) + ) { + return; + } + + const matches = commentContainsWarningTerm(comment); + + matches.forEach(matchedTerm => { + let commentToDisplay = ""; + let truncated = false; + + for (const c of comment.trim().split(/\s+/u)) { + const tmp = commentToDisplay ? `${commentToDisplay} ${c}` : c; + + if (tmp.length <= CHAR_LIMIT) { + commentToDisplay = tmp; + } else { + truncated = true; + break; + } + } + + context.report({ + node, + messageId: "unexpectedComment", + data: { + matchedTerm, + comment: `${commentToDisplay}${ + truncated ? "..." : "" + }` + } + }); + }); + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments + .filter(token => token.type !== "Shebang") + .forEach(checkComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/node_modules/eslint/lib/rules/no-whitespace-before-property.js new file mode 100644 index 0000000..226f873 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to disallow whitespace before properties + * @author Kai Cataldo + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow whitespace before properties", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-whitespace-before-property" + }, + + fixable: "whitespace", + schema: [], + + messages: { + unexpectedWhitespace: "Unexpected whitespace before property {{propName}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports whitespace before property token + * @param {ASTNode} node the node to report in the event of an error + * @param {Token} leftToken the left token + * @param {Token} rightToken the right token + * @returns {void} + * @private + */ + function reportError(node, leftToken, rightToken) { + context.report({ + node, + messageId: "unexpectedWhitespace", + data: { + propName: sourceCode.getText(node.property) + }, + fix(fixer) { + let replacementText = ""; + + if (!node.computed && !node.optional && astUtils.isDecimalInteger(node.object)) { + + /* + * If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError. + * Don't fix this case. + */ + return null; + } + + // Don't fix if comments exist. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + if (node.optional) { + replacementText = "?."; + } else if (!node.computed) { + replacementText = "."; + } + + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], replacementText); + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + MemberExpression(node) { + let rightToken; + let leftToken; + + if (!astUtils.isTokenOnSameLine(node.object, node.property)) { + return; + } + + if (node.computed) { + rightToken = sourceCode.getTokenBefore(node.property, astUtils.isOpeningBracketToken); + leftToken = sourceCode.getTokenBefore(rightToken, node.optional ? 1 : 0); + } else { + rightToken = sourceCode.getFirstToken(node.property); + leftToken = sourceCode.getTokenBefore(rightToken, 1); + } + + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { + reportError(node, leftToken, rightToken); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-with.js b/node_modules/eslint/lib/rules/no-with.js new file mode 100644 index 0000000..d3e52e0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-with.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of with statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `with` statements", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-with" + }, + + schema: [], + + messages: { + unexpectedWith: "Unexpected use of 'with' statement." + } + }, + + create(context) { + + return { + WithStatement(node) { + context.report({ node, messageId: "unexpectedWith" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/nonblock-statement-body-position.js b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js new file mode 100644 index 0000000..34e6eea --- /dev/null +++ b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js @@ -0,0 +1,124 @@ +/** + * @fileoverview enforce the location of single-line statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the location of single-line statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/nonblock-statement-body-position" + }, + + fixable: "whitespace", + + schema: [ + POSITION_SCHEMA, + { + properties: { + overrides: { + properties: { + if: POSITION_SCHEMA, + else: POSITION_SCHEMA, + while: POSITION_SCHEMA, + do: POSITION_SCHEMA, + for: POSITION_SCHEMA + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectNoLinebreak: "Expected no linebreak before this statement.", + expectLinebreak: "Expected a linebreak before this statement." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Gets the applicable preference for a particular keyword + * @param {string} keywordName The name of a keyword, e.g. 'if' + * @returns {string} The applicable option for the keyword, e.g. 'beside' + */ + function getOption(keywordName) { + return context.options[1] && context.options[1].overrides && context.options[1].overrides[keywordName] || + context.options[0] || + "beside"; + } + + /** + * Validates the location of a single-line statement + * @param {ASTNode} node The single-line statement + * @param {string} keywordName The applicable keyword name for the single-line statement + * @returns {void} + */ + function validateStatement(node, keywordName) { + const option = getOption(keywordName); + + if (node.type === "BlockStatement" || option === "any") { + return; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if (tokenBefore.loc.end.line === node.loc.start.line && option === "below") { + context.report({ + node, + messageId: "expectLinebreak", + fix: fixer => fixer.insertTextBefore(node, "\n") + }); + } else if (tokenBefore.loc.end.line !== node.loc.start.line && option === "beside") { + context.report({ + node, + messageId: "expectNoLinebreak", + fix(fixer) { + if (sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim()) { + return null; + } + return fixer.replaceTextRange([tokenBefore.range[1], node.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + IfStatement(node) { + validateStatement(node.consequent, "if"); + + // Check the `else` node, but don't check 'else if' statements. + if (node.alternate && node.alternate.type !== "IfStatement") { + validateStatement(node.alternate, "else"); + } + }, + WhileStatement: node => validateStatement(node.body, "while"), + DoWhileStatement: node => validateStatement(node.body, "do"), + ForStatement: node => validateStatement(node.body, "for"), + ForInStatement: node => validateStatement(node.body, "for"), + ForOfStatement: node => validateStatement(node.body, "for") + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-curly-newline.js b/node_modules/eslint/lib/rules/object-curly-newline.js new file mode 100644 index 0000000..616d598 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-curly-newline.js @@ -0,0 +1,306 @@ +/** + * @fileoverview Rule to require or disallow line breaks inside braces. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Schema objects. +const OPTION_VALUE = { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minProperties: { + type: "integer", + minimum: 0 + }, + consistent: { + type: "boolean" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] +}; + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} value An option value to parse. + * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object. + */ +function normalizeOptionValue(value) { + let multiline = false; + let minProperties = Number.POSITIVE_INFINITY; + let consistent = false; + + if (value) { + if (value === "always") { + minProperties = 0; + } else if (value === "never") { + minProperties = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(value.multiline); + minProperties = value.minProperties || Number.POSITIVE_INFINITY; + consistent = Boolean(value.consistent); + } + } else { + consistent = true; + } + + return { multiline, minProperties, consistent }; +} + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ + * ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean}, + * ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean}, + * ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean}, + * ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean} + * }} Normalized option object. + */ +function normalizeOptions(options) { + const isNodeSpecificOption = lodash.overSome([lodash.isPlainObject, lodash.isString]); + + if (lodash.isPlainObject(options) && lodash.some(options, isNodeSpecificOption)) { + return { + ObjectExpression: normalizeOptionValue(options.ObjectExpression), + ObjectPattern: normalizeOptionValue(options.ObjectPattern), + ImportDeclaration: normalizeOptionValue(options.ImportDeclaration), + ExportNamedDeclaration: normalizeOptionValue(options.ExportDeclaration) + }; + } + + const value = normalizeOptionValue(options); + + return { ObjectExpression: value, ObjectPattern: value, ImportDeclaration: value, ExportNamedDeclaration: value }; +} + +/** + * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration + * node needs to be checked for missing line breaks + * @param {ASTNode} node Node under inspection + * @param {Object} options option specific to node type + * @param {Token} first First object property + * @param {Token} last Last object property + * @returns {boolean} `true` if node needs to be checked for missing line breaks + */ +function areLineBreaksRequired(node, options, first, last) { + let objectProperties; + + if (node.type === "ObjectExpression" || node.type === "ObjectPattern") { + objectProperties = node.properties; + } else { + + // is ImportDeclaration or ExportNamedDeclaration + objectProperties = node.specifiers + .filter(s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier"); + } + + return objectProperties.length >= options.minProperties || + ( + options.multiline && + objectProperties.length > 0 && + first.loc.start.line !== last.loc.end.line + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent line breaks inside braces", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-curly-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + OPTION_VALUE, + { + type: "object", + properties: { + ObjectExpression: OPTION_VALUE, + ObjectPattern: OPTION_VALUE, + ImportDeclaration: OPTION_VALUE, + ExportDeclaration: OPTION_VALUE + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ], + + messages: { + unexpectedLinebreakBeforeClosingBrace: "Unexpected line break before this closing brace.", + unexpectedLinebreakAfterOpeningBrace: "Unexpected line break after this opening brace.", + expectedLinebreakBeforeClosingBrace: "Expected a line break before this closing brace.", + expectedLinebreakAfterOpeningBrace: "Expected a line break after this opening brace." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const normalizedOptions = normalizeOptions(context.options[0]); + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. + * @returns {void} + */ + function check(node) { + const options = normalizedOptions[node.type]; + + if ( + (node.type === "ImportDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) || + (node.type === "ExportNamedDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ExportSpecifier")) + ) { + return; + } + + const openBrace = sourceCode.getFirstToken(node, token => token.value === "{"); + + let closeBrace; + + if (node.typeAnnotation) { + closeBrace = sourceCode.getTokenBefore(node.typeAnnotation); + } else { + closeBrace = sourceCode.getLastToken(node, token => token.value === "}"); + } + + let first = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + let last = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + const needsLineBreaks = areLineBreaksRequired(node, options, first, last); + + const hasCommentsFirstToken = astUtils.isCommentToken(first); + const hasCommentsLastToken = astUtils.isCommentToken(last); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether line breaks are needed. + * This allows: + * var obj = { // eslint-disable-line foo + * a: 1 + * } + */ + first = sourceCode.getTokenAfter(openBrace); + last = sourceCode.getTokenBefore(closeBrace); + + if (needsLineBreaks) { + if (astUtils.isTokenOnSameLine(openBrace, first)) { + context.report({ + messageId: "expectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.insertTextAfter(openBrace, "\n"); + } + }); + } + if (astUtils.isTokenOnSameLine(last, closeBrace)) { + context.report({ + messageId: "expectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.insertTextBefore(closeBrace, "\n"); + } + }); + } + } else { + const consistent = options.consistent; + const hasLineBreakBetweenOpenBraceAndFirst = !astUtils.isTokenOnSameLine(openBrace, first); + const hasLineBreakBetweenCloseBraceAndLast = !astUtils.isTokenOnSameLine(last, closeBrace); + + if ( + (!consistent && hasLineBreakBetweenOpenBraceAndFirst) || + (consistent && hasLineBreakBetweenOpenBraceAndFirst && !hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.removeRange([ + openBrace.range[1], + first.range[0] + ]); + } + }); + } + if ( + (!consistent && hasLineBreakBetweenCloseBraceAndLast) || + (consistent && !hasLineBreakBetweenOpenBraceAndFirst && hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.removeRange([ + last.range[1], + closeBrace.range[0] + ]); + } + }); + } + } + } + + return { + ObjectExpression: check, + ObjectPattern: check, + ImportDeclaration: check, + ExportNamedDeclaration: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-curly-spacing.js b/node_modules/eslint/lib/rules/object-curly-spacing.js new file mode 100644 index 0000000..c0044f5 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -0,0 +1,308 @@ +/** + * @fileoverview Disallows or enforces spaces inside of object literals. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside braces", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + arraysInObjects: { + type: "boolean" + }, + objectsInObjects: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + requireSpaceBefore: "A space is required before '{{token}}'.", + requireSpaceAfter: "A space is required after '{{token}}'.", + unexpectedSpaceBefore: "There should be no space before '{{token}}'.", + unexpectedSpaceAfter: "There should be no space after '{{token}}'." + } + }, + + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + arraysInObjectsException: isOptionSet("arraysInObjects"), + objectsInObjectsException: isOptionSet("objectsInObjects") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = context.getSourceCode().getTokenAfter(token, { includeComments: true }); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = context.getSourceCode().getTokenBefore(token, { includeComments: true }); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @param {Token} first The first token to check (should be the opening brace) + * @param {Token} second The second token to check (should be first after the opening brace) + * @param {Token} penultimate The penultimate token to check (should be last before closing brace) + * @param {Token} last The last token to check (should be closing brace) + * @returns {void} + */ + function validateBraceSpacing(node, first, second, penultimate, last) { + if (astUtils.isTokenOnSameLine(first, second)) { + const firstSpaced = sourceCode.isSpaceBetweenTokens(first, second); + + if (options.spaced && !firstSpaced) { + reportRequiredBeginningSpace(node, first); + } + if (!options.spaced && firstSpaced && second.type !== "Line") { + reportNoBeginningSpace(node, first); + } + } + + if (astUtils.isTokenOnSameLine(penultimate, last)) { + const shouldCheckPenultimate = ( + options.arraysInObjectsException && astUtils.isClosingBracketToken(penultimate) || + options.objectsInObjectsException && astUtils.isClosingBraceToken(penultimate) + ); + const penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.range[0]).type; + + const closingCurlyBraceMustBeSpaced = ( + options.arraysInObjectsException && penultimateType === "ArrayExpression" || + options.objectsInObjectsException && (penultimateType === "ObjectExpression" || penultimateType === "ObjectPattern") + ) ? !options.spaced : options.spaced; + + const lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last); + + if (closingCurlyBraceMustBeSpaced && !lastSpaced) { + reportRequiredEndingSpace(node, last); + } + if (!closingCurlyBraceMustBeSpaced && lastSpaced) { + reportNoEndingSpace(node, last); + } + } + } + + /** + * Gets '}' token of an object node. + * + * Because the last token of object patterns might be a type annotation, + * this traverses tokens preceded by the last property, then returns the + * first '}' token. + * @param {ASTNode} node The node to get. This node is an + * ObjectExpression or an ObjectPattern. And this node has one or + * more properties. + * @returns {Token} '}' token. + */ + function getClosingBraceOfObject(node) { + const lastProperty = node.properties[node.properties.length - 1]; + + return sourceCode.getTokenAfter(lastProperty, astUtils.isClosingBraceToken); + } + + /** + * Reports a given object node if spacing in curly braces is invalid. + * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check. + * @returns {void} + */ + function checkForObject(node) { + if (node.properties.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + last = getClosingBraceOfObject(node), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given import node if spacing in curly braces is invalid. + * @param {ASTNode} node An ImportDeclaration node to check. + * @returns {void} + */ + function checkForImport(node) { + if (node.specifiers.length === 0) { + return; + } + + let firstSpecifier = node.specifiers[0]; + const lastSpecifier = node.specifiers[node.specifiers.length - 1]; + + if (lastSpecifier.type !== "ImportSpecifier") { + return; + } + if (firstSpecifier.type !== "ImportSpecifier") { + firstSpecifier = node.specifiers[1]; + } + + const first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given export node if spacing in curly braces is invalid. + * @param {ASTNode} node An ExportNamedDeclaration node to check. + * @returns {void} + */ + function checkForExport(node) { + if (node.specifiers.length === 0) { + return; + } + + const firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // var {x} = y; + ObjectPattern: checkForObject, + + // var y = {x: 'y'} + ObjectExpression: checkForObject, + + // import {y} from 'x'; + ImportDeclaration: checkForImport, + + // export {name} from 'yo'; + ExportNamedDeclaration: checkForExport + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/object-property-newline.js b/node_modules/eslint/lib/rules/object-property-newline.js new file mode 100644 index 0000000..0c7f800 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-property-newline.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to enforce placing object properties on separate lines. + * @author Vitor Balocco + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce placing object properties on separate lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-property-newline" + }, + + schema: [ + { + type: "object", + properties: { + allowAllPropertiesOnSameLine: { + type: "boolean", + default: false + }, + allowMultiplePropertiesPerLine: { // Deprecated + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + propertiesOnNewlineAll: "Object properties must go on a new line if they aren't all on the same line.", + propertiesOnNewline: "Object properties must go on a new line." + } + }, + + create(context) { + const allowSameLine = context.options[0] && ( + (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine /* Deprecated */) + ); + const messageId = allowSameLine + ? "propertiesOnNewlineAll" + : "propertiesOnNewline"; + + const sourceCode = context.getSourceCode(); + + return { + ObjectExpression(node) { + if (allowSameLine) { + if (node.properties.length > 1) { + const firstTokenOfFirstProperty = sourceCode.getFirstToken(node.properties[0]); + const lastTokenOfLastProperty = sourceCode.getLastToken(node.properties[node.properties.length - 1]); + + if (firstTokenOfFirstProperty.loc.end.line === lastTokenOfLastProperty.loc.start.line) { + + // All keys and values are on the same line + return; + } + } + } + + for (let i = 1; i < node.properties.length; i++) { + const lastTokenOfPreviousProperty = sourceCode.getLastToken(node.properties[i - 1]); + const firstTokenOfCurrentProperty = sourceCode.getFirstToken(node.properties[i]); + + if (lastTokenOfPreviousProperty.loc.end.line === firstTokenOfCurrentProperty.loc.start.line) { + context.report({ + node, + loc: firstTokenOfCurrentProperty.loc, + messageId, + fix(fixer) { + const comma = sourceCode.getTokenBefore(firstTokenOfCurrentProperty); + const rangeAfterComma = [comma.range[1], firstTokenOfCurrentProperty.range[0]]; + + // Don't perform a fix if there are any comments between the comma and the next property. + if (sourceCode.text.slice(rangeAfterComma[0], rangeAfterComma[1]).trim()) { + return null; + } + + return fixer.replaceTextRange(rangeAfterComma, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-shorthand.js b/node_modules/eslint/lib/rules/object-shorthand.js new file mode 100644 index 0000000..3999ff8 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-shorthand.js @@ -0,0 +1,508 @@ +/** + * @fileoverview Rule to enforce concise object methods and properties. + * @author Jamund Ferguson + */ + +"use strict"; + +const OPTIONS = { + always: "always", + never: "never", + methods: "methods", + properties: "properties", + consistent: "consistent", + consistentAsNeeded: "consistent-as-needed" +}; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow method and property shorthand syntax for object literals", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/object-shorthand" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties", "never", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties"] + }, + { + type: "object", + properties: { + avoidQuotes: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods"] + }, + { + type: "object", + properties: { + ignoreConstructors: { + type: "boolean" + }, + avoidQuotes: { + type: "boolean" + }, + avoidExplicitReturnArrows: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + expectedAllPropertiesShorthanded: "Expected shorthand for all properties.", + expectedLiteralMethodLongform: "Expected longform method syntax for string literal keys.", + expectedPropertyShorthand: "Expected property shorthand.", + expectedPropertyLongform: "Expected longform property syntax.", + expectedMethodShorthand: "Expected method shorthand.", + expectedMethodLongform: "Expected longform method syntax.", + unexpectedMix: "Unexpected mix of shorthand and non-shorthand properties." + } + }, + + create(context) { + const APPLY = context.options[0] || OPTIONS.always; + const APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; + const APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; + const APPLY_NEVER = APPLY === OPTIONS.never; + const APPLY_CONSISTENT = APPLY === OPTIONS.consistent; + const APPLY_CONSISTENT_AS_NEEDED = APPLY === OPTIONS.consistentAsNeeded; + + const PARAMS = context.options[1] || {}; + const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors; + const AVOID_QUOTES = PARAMS.avoidQuotes; + const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const CTOR_PREFIX_REGEX = /[^_$0-9]/u; + + /** + * Determines if the first character of the name is a capital letter. + * @param {string} name The name of the node to evaluate. + * @returns {boolean} True if the first character of the property name is a capital letter, false if not. + * @private + */ + function isConstructor(name) { + const match = CTOR_PREFIX_REGEX.exec(name); + + // Not a constructor if name has no characters apart from '_', '$' and digits e.g. '_', '$$', '_8' + if (!match) { + return false; + } + + const firstChar = name.charAt(match.index); + + return firstChar === firstChar.toUpperCase(); + } + + /** + * Determines if the property can have a shorthand form. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property can have a shorthand form + * @private + * + */ + function canHaveShorthand(property) { + return (property.kind !== "set" && property.kind !== "get" && property.type !== "SpreadElement" && property.type !== "SpreadProperty" && property.type !== "ExperimentalSpreadProperty"); + } + + /** + * Checks whether a node is a string literal. + * @param {ASTNode} node Any AST node. + * @returns {boolean} `true` if it is a string literal. + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Determines if the property is a shorthand or not. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property is considered shorthand, false if not. + * @private + * + */ + function isShorthand(property) { + + // property.method is true when `{a(){}}`. + return (property.shorthand || property.method); + } + + /** + * Determines if the property's key and method or value are named equally. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the key and value are named equally, false if not. + * @private + * + */ + function isRedundant(property) { + const value = property.value; + + if (value.type === "FunctionExpression") { + return !value.id; // Only anonymous should be shorthand method. + } + if (value.type === "Identifier") { + return astUtils.getStaticPropertyName(property) === value.name; + } + + return false; + } + + /** + * Ensures that an object's properties are consistently shorthand, or not shorthand at all. + * @param {ASTNode} node Property AST node + * @param {boolean} checkRedundancy Whether to check longform redundancy + * @returns {void} + * + */ + function checkConsistency(node, checkRedundancy) { + + // We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand. + const properties = node.properties.filter(canHaveShorthand); + + // Do we still have properties left after filtering the getters and setters? + if (properties.length > 0) { + const shorthandProperties = properties.filter(isShorthand); + + /* + * If we do not have an equal number of longform properties as + * shorthand properties, we are using the annotations inconsistently + */ + if (shorthandProperties.length !== properties.length) { + + // We have at least 1 shorthand property + if (shorthandProperties.length > 0) { + context.report({ node, messageId: "unexpectedMix" }); + } else if (checkRedundancy) { + + /* + * If all properties of the object contain a method or value with a name matching it's key, + * all the keys are redundant. + */ + const canAlwaysUseShorthand = properties.every(isRedundant); + + if (canAlwaysUseShorthand) { + context.report({ node, messageId: "expectedAllPropertiesShorthanded" }); + } + } + } + } + } + + /** + * Fixes a FunctionExpression node by making it into a shorthand property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` or `ArrowFunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionShorthand(fixer, node) { + const firstKeyToken = node.computed + ? sourceCode.getFirstToken(node, astUtils.isOpeningBracketToken) + : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed + ? sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isClosingBracketToken) + : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let keyPrefix = ""; + + // key: /* */ () => {} + if (sourceCode.commentsExistBetween(lastKeyToken, node.value)) { + return null; + } + + if (node.value.async) { + keyPrefix += "async "; + } + if (node.value.generator) { + keyPrefix += "*"; + } + + const fixRange = [firstKeyToken.range[0], node.range[1]]; + const methodPrefix = keyPrefix + keyText; + + if (node.value.type === "FunctionExpression") { + const functionToken = sourceCode.getTokens(node.value).find(token => token.type === "Keyword" && token.value === "function"); + const tokenBeforeParams = node.value.generator ? sourceCode.getTokenAfter(functionToken) : functionToken; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + sourceCode.text.slice(tokenBeforeParams.range[1], node.value.range[1]) + ); + } + + const arrowToken = sourceCode.getTokenBefore(node.value.body, astUtils.isArrowToken); + const fnBody = sourceCode.text.slice(arrowToken.range[1], node.value.range[1]); + + let shouldAddParensAroundParameters = false; + let tokenBeforeParams; + + if (node.value.params.length === 0) { + tokenBeforeParams = sourceCode.getFirstToken(node.value, astUtils.isOpeningParenToken); + } else { + tokenBeforeParams = sourceCode.getTokenBefore(node.value.params[0]); + } + + if (node.value.params.length === 1) { + const hasParen = astUtils.isOpeningParenToken(tokenBeforeParams); + const isTokenOutsideNode = tokenBeforeParams.range[0] < node.range[0]; + + shouldAddParensAroundParameters = !hasParen || isTokenOutsideNode; + } + + const sliceStart = shouldAddParensAroundParameters + ? node.value.params[0].range[0] + : tokenBeforeParams.range[0]; + const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1]; + + const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd); + const newParamText = shouldAddParensAroundParameters ? `(${oldParamText})` : oldParamText; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + newParamText + fnBody + ); + + } + + /** + * Fixes a FunctionExpression node by making it into a longform property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionLongform(fixer, node) { + const firstKeyToken = node.computed ? sourceCode.getTokens(node).find(token => token.value === "[") : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed ? sourceCode.getTokensBetween(node.key, node.value).find(token => token.value === "]") : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let functionHeader = "function"; + + if (node.value.async) { + functionHeader = `async ${functionHeader}`; + } + if (node.value.generator) { + functionHeader = `${functionHeader}*`; + } + + return fixer.replaceTextRange([node.range[0], lastKeyToken.range[1]], `${keyText}: ${functionHeader}`); + } + + /* + * To determine whether a given arrow function has a lexical identifier (`this`, `arguments`, `super`, or `new.target`), + * create a stack of functions that define these identifiers (i.e. all functions except arrow functions) as the AST is + * traversed. Whenever a new function is encountered, create a new entry on the stack (corresponding to a different lexical + * scope of `this`), and whenever a function is exited, pop that entry off the stack. When an arrow function is entered, + * keep a reference to it on the current stack entry, and remove that reference when the arrow function is exited. + * When a lexical identifier is encountered, mark all the arrow functions on the current stack entry by adding them + * to an `arrowsWithLexicalIdentifiers` set. Any arrow function in that set will not be reported by this rule, + * because converting it into a method would change the value of one of the lexical identifiers. + */ + const lexicalScopeStack = []; + const arrowsWithLexicalIdentifiers = new WeakSet(); + const argumentsIdentifiers = new WeakSet(); + + /** + * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack. + * Also, this marks all `arguments` identifiers so that they can be detected later. + * @returns {void} + */ + function enterFunction() { + lexicalScopeStack.unshift(new Set()); + context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => { + variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier)); + }); + } + + /** + * Exits a function. This pops the current set of arrow functions off the lexical scope stack. + * @returns {void} + */ + function exitFunction() { + lexicalScopeStack.shift(); + } + + /** + * Marks the current function as having a lexical keyword. This implies that all arrow functions + * in the current lexical scope contain a reference to this lexical keyword. + * @returns {void} + */ + function reportLexicalIdentifier() { + lexicalScopeStack[0].forEach(arrowFunction => arrowsWithLexicalIdentifiers.add(arrowFunction)); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: enterFunction, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + "Program:exit": exitFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + + ArrowFunctionExpression(node) { + lexicalScopeStack[0].add(node); + }, + "ArrowFunctionExpression:exit"(node) { + lexicalScopeStack[0].delete(node); + }, + + ThisExpression: reportLexicalIdentifier, + Super: reportLexicalIdentifier, + MetaProperty(node) { + if (node.meta.name === "new" && node.property.name === "target") { + reportLexicalIdentifier(); + } + }, + Identifier(node) { + if (argumentsIdentifiers.has(node)) { + reportLexicalIdentifier(); + } + }, + + ObjectExpression(node) { + if (APPLY_CONSISTENT) { + checkConsistency(node, false); + } else if (APPLY_CONSISTENT_AS_NEEDED) { + checkConsistency(node, true); + } + }, + + "Property:exit"(node) { + const isConciseProperty = node.method || node.shorthand; + + // Ignore destructuring assignment + if (node.parent.type === "ObjectPattern") { + return; + } + + // getters and setters are ignored + if (node.kind === "get" || node.kind === "set") { + return; + } + + // only computed methods can fail the following checks + if (node.computed && node.value.type !== "FunctionExpression" && node.value.type !== "ArrowFunctionExpression") { + return; + } + + //-------------------------------------------------------------- + // Checks for property/method shorthand. + if (isConciseProperty) { + if (node.method && (APPLY_NEVER || AVOID_QUOTES && isStringLiteral(node.key))) { + const messageId = APPLY_NEVER ? "expectedMethodLongform" : "expectedLiteralMethodLongform"; + + // { x() {} } should be written as { x: function() {} } + context.report({ + node, + messageId, + fix: fixer => makeFunctionLongform(fixer, node) + }); + } else if (APPLY_NEVER) { + + // { x } should be written as { x: x } + context.report({ + node, + messageId: "expectedPropertyLongform", + fix: fixer => fixer.insertTextAfter(node.key, `: ${node.key.name}`) + }); + } + } else if (APPLY_TO_METHODS && !node.value.id && (node.value.type === "FunctionExpression" || node.value.type === "ArrowFunctionExpression")) { + if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) { + return; + } + if (AVOID_QUOTES && isStringLiteral(node.key)) { + return; + } + + // {[x]: function(){}} should be written as {[x]() {}} + if (node.value.type === "FunctionExpression" || + node.value.type === "ArrowFunctionExpression" && + node.value.body.type === "BlockStatement" && + AVOID_EXPLICIT_RETURN_ARROWS && + !arrowsWithLexicalIdentifiers.has(node.value) + ) { + context.report({ + node, + messageId: "expectedMethodShorthand", + fix: fixer => makeFunctionShorthand(fixer, node) + }); + } + } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) { + + // {x: x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + return fixer.replaceText(node, node.value.name); + } + }); + } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) { + if (AVOID_QUOTES) { + return; + } + + // {"x": x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + return fixer.replaceText(node, node.value.name); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js new file mode 100644 index 0000000..db46747 --- /dev/null +++ b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js @@ -0,0 +1,92 @@ +/** + * @fileoverview Rule to check multiple var declarations per line + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow newlines around variable declarations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/one-var-declaration-per-line" + }, + + schema: [ + { + enum: ["always", "initializations"] + } + ], + + fixable: "whitespace", + + messages: { + expectVarOnNewline: "Expected variable declaration to be on a new line." + } + }, + + create(context) { + + const always = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Checks newlines around variable declarations. + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForNewLine(node) { + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + const declarations = node.declarations; + let prev; + + declarations.forEach(current => { + if (prev && prev.loc.end.line === current.loc.start.line) { + if (always || prev.init || current.init) { + context.report({ + node, + messageId: "expectVarOnNewline", + loc: current.loc, + fix: fixer => fixer.insertTextBefore(current, "\n") + }); + } + } + prev = current; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForNewLine + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/one-var.js b/node_modules/eslint/lib/rules/one-var.js new file mode 100644 index 0000000..c31a0d2 --- /dev/null +++ b/node_modules/eslint/lib/rules/one-var.js @@ -0,0 +1,535 @@ +/** + * @fileoverview A rule to control the use of single variable declarations. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce variables to be declared either together or separately in functions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/one-var" + }, + + fixable: "code", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consecutive"] + }, + { + type: "object", + properties: { + separateRequires: { + type: "boolean" + }, + var: { + enum: ["always", "never", "consecutive"] + }, + let: { + enum: ["always", "never", "consecutive"] + }, + const: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + initialized: { + enum: ["always", "never", "consecutive"] + }, + uninitialized: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + combineUninitialized: "Combine this with the previous '{{type}}' statement with uninitialized variables.", + combineInitialized: "Combine this with the previous '{{type}}' statement with initialized variables.", + splitUninitialized: "Split uninitialized '{{type}}' declarations into multiple statements.", + splitInitialized: "Split initialized '{{type}}' declarations into multiple statements.", + splitRequires: "Split requires to be separated into a single block.", + combine: "Combine this with the previous '{{type}}' statement.", + split: "Split '{{type}}' declarations into multiple statements." + } + }, + + create(context) { + const MODE_ALWAYS = "always"; + const MODE_NEVER = "never"; + const MODE_CONSECUTIVE = "consecutive"; + const mode = context.options[0] || MODE_ALWAYS; + + const options = {}; + + if (typeof mode === "string") { // simple options configuration with just a string + options.var = { uninitialized: mode, initialized: mode }; + options.let = { uninitialized: mode, initialized: mode }; + options.const = { uninitialized: mode, initialized: mode }; + } else if (typeof mode === "object") { // options configuration is an object + options.separateRequires = !!mode.separateRequires; + options.var = { uninitialized: mode.var, initialized: mode.var }; + options.let = { uninitialized: mode.let, initialized: mode.let }; + options.const = { uninitialized: mode.const, initialized: mode.const }; + if (Object.prototype.hasOwnProperty.call(mode, "uninitialized")) { + options.var.uninitialized = mode.uninitialized; + options.let.uninitialized = mode.uninitialized; + options.const.uninitialized = mode.uninitialized; + } + if (Object.prototype.hasOwnProperty.call(mode, "initialized")) { + options.var.initialized = mode.initialized; + options.let.initialized = mode.initialized; + options.const.initialized = mode.initialized; + } + } + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = []; + const blockStack = []; + + /** + * Increments the blockStack counter. + * @returns {void} + * @private + */ + function startBlock() { + blockStack.push({ + let: { initialized: false, uninitialized: false }, + const: { initialized: false, uninitialized: false } + }); + } + + /** + * Increments the functionStack counter. + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push({ initialized: false, uninitialized: false }); + startBlock(); + } + + /** + * Decrements the blockStack counter. + * @returns {void} + * @private + */ + function endBlock() { + blockStack.pop(); + } + + /** + * Decrements the functionStack counter. + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + endBlock(); + } + + /** + * Check if a variable declaration is a require. + * @param {ASTNode} decl variable declaration Node + * @returns {bool} if decl is a require, return true; else return false. + * @private + */ + function isRequire(decl) { + return decl.init && decl.init.type === "CallExpression" && decl.init.callee.name === "require"; + } + + /** + * Records whether initialized/uninitialized/required variables are defined in current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @param {Object} currentScope The scope being investigated + * @returns {void} + * @private + */ + function recordTypes(statementType, declarations, currentScope) { + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) { + currentScope.uninitialized = true; + } + } else { + if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) { + if (options.separateRequires && isRequire(declarations[i])) { + currentScope.required = true; + } else { + currentScope.initialized = true; + } + } + } + } + } + + /** + * Determines the current scope (function or block) + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @returns {Object} The scope associated with statementType + */ + function getCurrentScope(statementType) { + let currentScope; + + if (statementType === "var") { + currentScope = functionStack[functionStack.length - 1]; + } else if (statementType === "let") { + currentScope = blockStack[blockStack.length - 1].let; + } else if (statementType === "const") { + currentScope = blockStack[blockStack.length - 1].const; + } + return currentScope; + } + + /** + * Counts the number of initialized and uninitialized declarations in a list of declarations + * @param {ASTNode[]} declarations List of declarations + * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations + * @private + */ + function countDeclarations(declarations) { + const counts = { uninitialized: 0, initialized: 0 }; + + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + counts.uninitialized++; + } else { + counts.initialized++; + } + } + return counts; + } + + /** + * Determines if there is more than one var statement in the current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @returns {boolean} Returns true if it is the first var declaration, false if not. + * @private + */ + function hasOnlyOneStatement(statementType, declarations) { + + const declarationCounts = countDeclarations(declarations); + const currentOptions = options[statementType] || {}; + const currentScope = getCurrentScope(statementType); + const hasRequires = declarations.some(isRequire); + + if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { + if (currentScope.uninitialized || currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + + if (declarationCounts.uninitialized > 0) { + if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { + return false; + } + } + if (declarationCounts.initialized > 0) { + if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + if (currentScope.required && hasRequires) { + return false; + } + recordTypes(statementType, declarations, currentScope); + return true; + } + + /** + * Fixer to join VariableDeclaration's into a single declaration + * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join + * @returns {Function} The fixer function + */ + function joinDeclarations(declarations) { + const declaration = declarations[0]; + const body = Array.isArray(declaration.parent.parent.body) ? declaration.parent.parent.body : []; + const currentIndex = body.findIndex(node => node.range[0] === declaration.parent.range[0]); + const previousNode = body[currentIndex - 1]; + + return fixer => { + const type = sourceCode.getTokenBefore(declaration); + const prevSemi = sourceCode.getTokenBefore(type); + const res = []; + + if (previousNode && previousNode.kind === sourceCode.getText(type)) { + if (prevSemi.value === ";") { + res.push(fixer.replaceText(prevSemi, ",")); + } else { + res.push(fixer.insertTextAfter(prevSemi, ",")); + } + res.push(fixer.replaceText(type, "")); + } + + return res; + }; + } + + /** + * Fixer to split a VariableDeclaration into individual declarations + * @param {VariableDeclaration} declaration The `VariableDeclaration` to split + * @returns {Function} The fixer function + */ + function splitDeclarations(declaration) { + return fixer => declaration.declarations.map(declarator => { + const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator); + + if (tokenAfterDeclarator === null) { + return null; + } + + const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true }); + + if (tokenAfterDeclarator.value !== ",") { + return null; + } + + /* + * `var x,y` + * tokenAfterDeclarator ^^ afterComma + */ + if (afterComma.range[0] === tokenAfterDeclarator.range[1]) { + return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind} `); + } + + /* + * `var x, + * tokenAfterDeclarator ^ + * y` + * ^ afterComma + */ + if ( + afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line || + afterComma.type === "Line" || + afterComma.type === "Block" + ) { + let lastComment = afterComma; + + while (lastComment.type === "Line" || lastComment.type === "Block") { + lastComment = sourceCode.getTokenAfter(lastComment, { includeComments: true }); + } + + return fixer.replaceTextRange( + [tokenAfterDeclarator.range[0], lastComment.range[0]], + `;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${declaration.kind} ` + ); + } + + return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind}`); + }).filter(x => x); + } + + /** + * Checks a given VariableDeclaration node for errors. + * @param {ASTNode} node The VariableDeclaration node to check + * @returns {void} + * @private + */ + function checkVariableDeclaration(node) { + const parent = node.parent; + const type = node.kind; + + if (!options[type]) { + return; + } + + const declarations = node.declarations; + const declarationCounts = countDeclarations(declarations); + const mixedRequires = declarations.some(isRequire) && !declarations.every(isRequire); + + if (options[type].initialized === MODE_ALWAYS) { + if (options.separateRequires && mixedRequires) { + context.report({ + node, + messageId: "splitRequires" + }); + } + } + + // consecutive + const nodeIndex = (parent.body && parent.body.length > 0 && parent.body.indexOf(node)) || 0; + + if (nodeIndex > 0) { + const previousNode = parent.body[nodeIndex - 1]; + const isPreviousNodeDeclaration = previousNode.type === "VariableDeclaration"; + const declarationsWithPrevious = declarations.concat(previousNode.declarations || []); + + if ( + isPreviousNodeDeclaration && + previousNode.kind === type && + !(declarationsWithPrevious.some(isRequire) && !declarationsWithPrevious.every(isRequire)) + ) { + const previousDeclCounts = countDeclarations(previousNode.declarations); + + if (options[type].initialized === MODE_CONSECUTIVE && options[type].uninitialized === MODE_CONSECUTIVE) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].initialized === MODE_CONSECUTIVE && declarationCounts.initialized > 0 && previousDeclCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].uninitialized === MODE_CONSECUTIVE && + declarationCounts.uninitialized > 0 && + previousDeclCounts.uninitialized > 0) { + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // always + if (!hasOnlyOneStatement(type, declarations)) { + if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else { + if (options[type].initialized === MODE_ALWAYS && declarationCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + if (options[type].uninitialized === MODE_ALWAYS && declarationCounts.uninitialized > 0) { + if (node.parent.left === node && (node.parent.type === "ForInStatement" || node.parent.type === "ForOfStatement")) { + return; + } + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // never + if (parent.type !== "ForStatement" || parent.init !== node) { + const totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized; + + if (totalDeclarations > 1) { + if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) { + + // both initialized and uninitialized + context.report({ + node, + messageId: "split", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) { + + // initialized + context.report({ + node, + messageId: "splitInitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) { + + // uninitialized + context.report({ + node, + messageId: "splitUninitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + BlockStatement: startBlock, + ForStatement: startBlock, + ForInStatement: startBlock, + ForOfStatement: startBlock, + SwitchStatement: startBlock, + VariableDeclaration: checkVariableDeclaration, + "ForStatement:exit": endBlock, + "ForOfStatement:exit": endBlock, + "ForInStatement:exit": endBlock, + "SwitchStatement:exit": endBlock, + "BlockStatement:exit": endBlock, + "Program:exit": endFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/operator-assignment.js b/node_modules/eslint/lib/rules/operator-assignment.js new file mode 100644 index 0000000..fdb0884 --- /dev/null +++ b/node_modules/eslint/lib/rules/operator-assignment.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to replace assignment expressions with operator assignment + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether an operator is commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is commutative and has a + * shorthand form. + */ +function isCommutativeOperatorWithShorthand(operator) { + return ["*", "&", "^", "|"].indexOf(operator) >= 0; +} + +/** + * Checks whether an operator is not commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is not commutative and has + * a shorthand form. + */ +function isNonCommutativeOperatorWithShorthand(operator) { + return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].indexOf(operator) >= 0; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and) + * toString calls regardless of whether assignment shorthand is used) + * @param {ASTNode} node The node on the left side of the expression + * @returns {boolean} `true` if the node can be fixed + */ +function canBeFixed(node) { + return ( + node.type === "Identifier" || + ( + node.type === "MemberExpression" && + (node.object.type === "Identifier" || node.object.type === "ThisExpression") && + (!node.computed || node.property.type === "Literal") + ) + ); +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow assignment operator shorthand where possible", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/operator-assignment" + }, + + schema: [ + { + enum: ["always", "never"] + } + ], + + fixable: "code", + messages: { + replaced: "Assignment can be replaced with operator assignment.", + unexpected: "Unexpected operator assignment shorthand." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Returns the operator token of an AssignmentExpression or BinaryExpression + * @param {ASTNode} node An AssignmentExpression or BinaryExpression node + * @returns {Token} The operator token in the node + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + + /** + * Ensures that an assignment uses the shorthand form where possible. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function verify(node) { + if (node.operator !== "=" || node.right.type !== "BinaryExpression") { + return; + } + + const left = node.left; + const expr = node.right; + const operator = expr.operator; + + if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) { + if (astUtils.isSameReference(left, expr.left, true)) { + context.report({ + node, + messageId: "replaced", + fix(fixer) { + if (canBeFixed(left) && canBeFixed(expr.left)) { + const equalsToken = getOperatorToken(node); + const operatorToken = getOperatorToken(expr); + const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]); + const rightText = sourceCode.getText().slice(operatorToken.range[1], node.right.range[1]); + + // Check for comments that would be removed. + if (sourceCode.commentsExistBetween(equalsToken, operatorToken)) { + return null; + } + + return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`); + } + return null; + } + }); + } else if (astUtils.isSameReference(left, expr.right, true) && isCommutativeOperatorWithShorthand(operator)) { + + /* + * This case can't be fixed safely. + * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would + * change the execution order of the valueOf() functions. + */ + context.report({ + node, + messageId: "replaced" + }); + } + } + } + + /** + * Warns if an assignment expression uses operator assignment shorthand. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function prohibit(node) { + if (node.operator !== "=" && !astUtils.isLogicalAssignmentOperator(node.operator)) { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + if (canBeFixed(node.left)) { + const firstToken = sourceCode.getFirstToken(node); + const operatorToken = getOperatorToken(node); + const leftText = sourceCode.getText().slice(node.range[0], operatorToken.range[0]); + const newOperator = node.operator.slice(0, -1); + let rightText; + + // Check for comments that would be duplicated. + if (sourceCode.commentsExistBetween(firstToken, operatorToken)) { + return null; + } + + // If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side. + if ( + astUtils.getPrecedence(node.right) <= astUtils.getPrecedence({ type: "BinaryExpression", operator: newOperator }) && + !astUtils.isParenthesised(sourceCode, node.right) + ) { + rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`; + } else { + const tokenAfterOperator = sourceCode.getTokenAfter(operatorToken, { includeComments: true }); + let rightTextPrefix = ""; + + if ( + operatorToken.range[1] === tokenAfterOperator.range[0] && + !astUtils.canTokensBeAdjacent({ type: "Punctuator", value: newOperator }, tokenAfterOperator) + ) { + rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar + } + + rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`; + } + + return fixer.replaceText(node, `${leftText}= ${leftText}${newOperator}${rightText}`); + } + return null; + } + }); + } + } + + return { + AssignmentExpression: context.options[0] !== "never" ? verify : prohibit + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/operator-linebreak.js b/node_modules/eslint/lib/rules/operator-linebreak.js new file mode 100644 index 0000000..18da5c5 --- /dev/null +++ b/node_modules/eslint/lib/rules/operator-linebreak.js @@ -0,0 +1,247 @@ +/** + * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before + * @author Benoît Zugmeyer + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent linebreak style for operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/operator-linebreak" + }, + + schema: [ + { + enum: ["after", "before", "none", null] + }, + { + type: "object", + properties: { + overrides: { + type: "object", + additionalProperties: { + enum: ["after", "before", "none", "ignore"] + } + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + operatorAtBeginning: "'{{operator}}' should be placed at the beginning of the line.", + operatorAtEnd: "'{{operator}}' should be placed at the end of the line.", + badLinebreak: "Bad line breaking before and after '{{operator}}'.", + noLinebreak: "There should be no line break before or after '{{operator}}'." + } + }, + + create(context) { + + const usedDefaultGlobal = !context.options[0]; + const globalStyle = context.options[0] || "after"; + const options = context.options[1] || {}; + const styleOverrides = options.overrides ? Object.assign({}, options.overrides) : {}; + + if (usedDefaultGlobal && !styleOverrides["?"]) { + styleOverrides["?"] = "before"; + } + + if (usedDefaultGlobal && !styleOverrides[":"]) { + styleOverrides[":"] = "before"; + } + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a fixer function to fix rule issues + * @param {Token} operatorToken The operator token of an expression + * @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none' + * @returns {Function} A fixer function + */ + function getFixer(operatorToken, desiredStyle) { + return fixer => { + const tokenBefore = sourceCode.getTokenBefore(operatorToken); + const tokenAfter = sourceCode.getTokenAfter(operatorToken); + const textBefore = sourceCode.text.slice(tokenBefore.range[1], operatorToken.range[0]); + const textAfter = sourceCode.text.slice(operatorToken.range[1], tokenAfter.range[0]); + const hasLinebreakBefore = !astUtils.isTokenOnSameLine(tokenBefore, operatorToken); + const hasLinebreakAfter = !astUtils.isTokenOnSameLine(operatorToken, tokenAfter); + let newTextBefore, newTextAfter; + + if (hasLinebreakBefore !== hasLinebreakAfter && desiredStyle !== "none") { + + // If there is a comment before and after the operator, don't do a fix. + if (sourceCode.getTokenBefore(operatorToken, { includeComments: true }) !== tokenBefore && + sourceCode.getTokenAfter(operatorToken, { includeComments: true }) !== tokenAfter) { + + return null; + } + + /* + * If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator. + * foo && + * bar + * would get fixed to + * foo + * && bar + */ + newTextBefore = textAfter; + newTextAfter = textBefore; + } else { + const LINEBREAK_REGEX = astUtils.createGlobalLinebreakMatcher(); + + // Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings. + newTextBefore = desiredStyle === "before" || textBefore.trim() ? textBefore : textBefore.replace(LINEBREAK_REGEX, ""); + newTextAfter = desiredStyle === "after" || textAfter.trim() ? textAfter : textAfter.replace(LINEBREAK_REGEX, ""); + + // If there was no change (due to interfering comments), don't output a fix. + if (newTextBefore === textBefore && newTextAfter === textAfter) { + return null; + } + } + + if (newTextAfter === "" && tokenAfter.type === "Punctuator" && "+-".includes(operatorToken.value) && tokenAfter.value === operatorToken.value) { + + // To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-. + newTextAfter += " "; + } + + return fixer.replaceTextRange([tokenBefore.range[1], tokenAfter.range[0]], newTextBefore + operatorToken.value + newTextAfter); + }; + } + + /** + * Checks the operator placement + * @param {ASTNode} node The node to check + * @param {ASTNode} leftSide The node that comes before the operator in `node` + * @private + * @returns {void} + */ + function validateNode(node, leftSide) { + + /* + * When the left part of a binary expression is a single expression wrapped in + * parentheses (ex: `(a) + b`), leftToken will be the last token of the expression + * and operatorToken will be the closing parenthesis. + * The leftToken should be the last closing parenthesis, and the operatorToken + * should be the token right after that. + */ + const operatorToken = sourceCode.getTokenAfter(leftSide, astUtils.isNotClosingParenToken); + const leftToken = sourceCode.getTokenBefore(operatorToken); + const rightToken = sourceCode.getTokenAfter(operatorToken); + const operator = operatorToken.value; + const operatorStyleOverride = styleOverrides[operator]; + const style = operatorStyleOverride || globalStyle; + const fix = getFixer(operatorToken, style); + + // if single line + if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && + astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // do nothing. + + } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) && + !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // lone operator + context.report({ + node, + loc: operatorToken.loc, + messageId: "badLinebreak", + data: { + operator + }, + fix + }); + + } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtBeginning", + data: { + operator + }, + fix + }); + + } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtEnd", + data: { + operator + }, + fix + }); + + } else if (style === "none") { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "noLinebreak", + data: { + operator + }, + fix + }); + + } + } + + /** + * Validates a binary expression using `validateNode` + * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated + * @returns {void} + */ + function validateBinaryExpression(node) { + validateNode(node, node.left); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression: validateBinaryExpression, + LogicalExpression: validateBinaryExpression, + AssignmentExpression: validateBinaryExpression, + VariableDeclarator(node) { + if (node.init) { + validateNode(node, node.id); + } + }, + ConditionalExpression(node) { + validateNode(node, node.test); + validateNode(node, node.consequent); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/padded-blocks.js b/node_modules/eslint/lib/rules/padded-blocks.js new file mode 100644 index 0000000..f8b5bd9 --- /dev/null +++ b/node_modules/eslint/lib/rules/padded-blocks.js @@ -0,0 +1,298 @@ +/** + * @fileoverview A rule to ensure blank lines within blocks. + * @author Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow padding within blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/padded-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + blocks: { + enum: ["always", "never"] + }, + switches: { + enum: ["always", "never"] + }, + classes: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + }, + { + type: "object", + properties: { + allowSingleLineBlocks: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + alwaysPadBlock: "Block must be padded by blank lines.", + neverPadBlock: "Block must not be padded by blank lines." + } + }, + + create(context) { + const options = {}; + const typeOptions = context.options[0] || "always"; + const exceptOptions = context.options[1] || {}; + + if (typeof typeOptions === "string") { + const shouldHavePadding = typeOptions === "always"; + + options.blocks = shouldHavePadding; + options.switches = shouldHavePadding; + options.classes = shouldHavePadding; + } else { + if (Object.prototype.hasOwnProperty.call(typeOptions, "blocks")) { + options.blocks = typeOptions.blocks === "always"; + } + if (Object.prototype.hasOwnProperty.call(typeOptions, "switches")) { + options.switches = typeOptions.switches === "always"; + } + if (Object.prototype.hasOwnProperty.call(typeOptions, "classes")) { + options.classes = typeOptions.classes === "always"; + } + } + + if (Object.prototype.hasOwnProperty.call(exceptOptions, "allowSingleLineBlocks")) { + options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true; + } + + const sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getFirstToken(node); + } + + /** + * Checks if the given parameter is a comment node + * @param {ASTNode|Token} node An AST node or token + * @returns {boolean} True if node is a comment + */ + function isComment(node) { + return node.type === "Line" || node.type === "Block"; + } + + /** + * Checks if there is padding between two tokens + * @param {Token} first The first token + * @param {Token} second The second token + * @returns {boolean} True if there is at least a line between the tokens + */ + function isPaddingBetweenTokens(first, second) { + return second.loc.start.line - first.loc.end.line >= 2; + } + + + /** + * Checks if the given token has a blank line after it. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is followed by a blank line. + */ + function getFirstBlockToken(token) { + let prev, + first = token; + + do { + prev = first; + first = sourceCode.getTokenAfter(first, { includeComments: true }); + } while (isComment(first) && first.loc.start.line === prev.loc.end.line); + + return first; + } + + /** + * Checks if the given token is preceded by a blank line. + * @param {Token} token The token to check + * @returns {boolean} Whether or not the token is preceded by a blank line + */ + function getLastBlockToken(token) { + let last = token, + next; + + do { + next = last; + last = sourceCode.getTokenBefore(last, { includeComments: true }); + } while (isComment(last) && last.loc.end.line === next.loc.start.line); + + return last; + } + + /** + * Checks if a node should be padded, according to the rule config. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} True if the node should be padded, false otherwise. + */ + function requirePaddingFor(node) { + switch (node.type) { + case "BlockStatement": + return options.blocks; + case "SwitchStatement": + return options.switches; + case "ClassBody": + return options.classes; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + } + + /** + * Checks the given BlockStatement node to be padded if the block is not empty. + * @param {ASTNode} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPadding(node) { + const openBrace = getOpenBrace(node), + firstBlockToken = getFirstBlockToken(openBrace), + tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, { includeComments: true }), + closeBrace = sourceCode.getLastToken(node), + lastBlockToken = getLastBlockToken(closeBrace), + tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, { includeComments: true }), + blockHasTopPadding = isPaddingBetweenTokens(tokenBeforeFirst, firstBlockToken), + blockHasBottomPadding = isPaddingBetweenTokens(lastBlockToken, tokenAfterLast); + + if (options.allowSingleLineBlocks && astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)) { + return; + } + + if (requirePaddingFor(node)) { + + if (!blockHasTopPadding) { + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.insertTextAfter(tokenBeforeFirst, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + if (!blockHasBottomPadding) { + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + fix(fixer) { + return fixer.insertTextBefore(tokenAfterLast, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + } else { + if (blockHasTopPadding) { + + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.replaceTextRange([tokenBeforeFirst.range[1], firstBlockToken.range[0] - firstBlockToken.loc.start.column], "\n"); + }, + messageId: "neverPadBlock" + }); + } + + if (blockHasBottomPadding) { + + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + messageId: "neverPadBlock", + fix(fixer) { + return fixer.replaceTextRange([lastBlockToken.range[1], tokenAfterLast.range[0] - tokenAfterLast.loc.start.column], "\n"); + } + }); + } + } + } + + const rule = {}; + + if (Object.prototype.hasOwnProperty.call(options, "switches")) { + rule.SwitchStatement = function(node) { + if (node.cases.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.prototype.hasOwnProperty.call(options, "blocks")) { + rule.BlockStatement = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.prototype.hasOwnProperty.call(options, "classes")) { + rule.ClassBody = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + return rule; + } +}; diff --git a/node_modules/eslint/lib/rules/padding-line-between-statements.js b/node_modules/eslint/lib/rules/padding-line-between-statements.js new file mode 100644 index 0000000..c97b995 --- /dev/null +++ b/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -0,0 +1,632 @@ +/** + * @fileoverview Rule to require or disallow newlines between statements + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const LT = `[${Array.from(astUtils.LINEBREAKS).join("")}]`; +const PADDING_LINE_SEQUENCE = new RegExp( + String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`, + "u" +); +const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u; +const CJS_IMPORT = /^require\(/u; + +/** + * Creates tester which check if a node starts with specific keyword. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newKeywordTester(keyword) { + return { + test: (node, sourceCode) => + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans a single line. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newSinglelineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line === node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans multiple lines. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newMultilineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node is specific type. + * @param {string} type The node type to test. + * @returns {Object} the created tester. + * @private + */ +function newNodeTypeTester(type) { + return { + test: node => + node.type === type + }; +} + +/** + * Checks the given node is an expression statement of IIFE. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is an expression statement of IIFE. + * @private + */ +function isIIFEStatement(node) { + if (node.type === "ExpressionStatement") { + let call = astUtils.skipChainExpression(node.expression); + + if (call.type === "UnaryExpression") { + call = astUtils.skipChainExpression(call.argument); + } + return call.type === "CallExpression" && astUtils.isFunction(call.callee); + } + return false; +} + +/** + * Checks whether the given node is a block-like statement. + * This checks the last token of the node is the closing brace of a block. + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a block-like statement. + * @private + */ +function isBlockLikeStatement(sourceCode, node) { + + // do-while with a block is a block-like statement. + if (node.type === "DoWhileStatement" && node.body.type === "BlockStatement") { + return true; + } + + /* + * IIFE is a block-like statement specially from + * JSCS#disallowPaddingNewLinesAfterBlocks. + */ + if (isIIFEStatement(node)) { + return true; + } + + // Checks the last token is a closing brace of blocks. + const lastToken = sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + const belongingNode = lastToken && astUtils.isClosingBraceToken(lastToken) + ? sourceCode.getNodeByRangeIndex(lastToken.range[0]) + : null; + + return Boolean(belongingNode) && ( + belongingNode.type === "BlockStatement" || + belongingNode.type === "SwitchStatement" + ); +} + +/** + * Check whether the given node is a directive or not. + * @param {ASTNode} node The node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is a directive. + */ +function isDirective(node, sourceCode) { + return ( + node.type === "ExpressionStatement" && + ( + node.parent.type === "Program" || + ( + node.parent.type === "BlockStatement" && + astUtils.isFunction(node.parent.parent) + ) + ) && + node.expression.type === "Literal" && + typeof node.expression.value === "string" && + !astUtils.isParenthesised(sourceCode, node.expression) + ); +} + +/** + * Check whether the given node is a part of directive prologue or not. + * @param {ASTNode} node The node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is a part of directive prologue. + */ +function isDirectivePrologue(node, sourceCode) { + if (isDirective(node, sourceCode)) { + for (const sibling of node.parent.body) { + if (sibling === node) { + break; + } + if (!isDirective(sibling, sourceCode)) { + return false; + } + } + return true; + } + return false; +} + +/** + * Gets the actual last token. + * + * If a semicolon is semicolon-less style's semicolon, this ignores it. + * For example: + * + * foo() + * ;[1, 2, 3].forEach(bar) + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to get. + * @returns {Token} The actual last token. + * @private + */ +function getActualLastToken(sourceCode, node) { + const semiToken = sourceCode.getLastToken(node); + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const isSemicolonLessStyle = Boolean( + prevToken && + nextToken && + prevToken.range[0] >= node.range[0] && + astUtils.isSemicolonToken(semiToken) && + semiToken.loc.start.line !== prevToken.loc.end.line && + semiToken.loc.end.line === nextToken.loc.start.line + ); + + return isSemicolonLessStyle ? prevToken : semiToken; +} + +/** + * This returns the concatenation of the first 2 captured strings. + * @param {string} _ Unused. Whole matched string. + * @param {string} trailingSpaces The trailing spaces of the first line. + * @param {string} indentSpaces The indentation spaces of the last line. + * @returns {string} The concatenation of trailingSpaces and indentSpaces. + * @private + */ +function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) { + return trailingSpaces + indentSpaces; +} + +/** + * Check and report statements for `any` configuration. + * It does nothing. + * @returns {void} + * @private + */ +function verifyForAny() { +} + +/** + * Check and report statements for `never` configuration. + * This autofix removes blank lines between the given 2 statements. + * However, if comments exist between 2 blank lines, it does not remove those + * blank lines automatically. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} _ Unused. The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForNever(context, _, nextNode, paddingLines) { + if (paddingLines.length === 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "unexpectedBlankLine", + fix(fixer) { + if (paddingLines.length >= 2) { + return null; + } + + const prevToken = paddingLines[0][0]; + const nextToken = paddingLines[0][1]; + const start = prevToken.range[1]; + const end = nextToken.range[0]; + const text = context.getSourceCode().text + .slice(start, end) + .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines); + + return fixer.replaceTextRange([start, end], text); + } + }); +} + +/** + * Check and report statements for `always` configuration. + * This autofix inserts a blank line between the given 2 statements. + * If the `prevNode` has trailing comments, it inserts a blank line after the + * trailing comments. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} prevNode The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForAlways(context, prevNode, nextNode, paddingLines) { + if (paddingLines.length > 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "expectedBlankLine", + fix(fixer) { + const sourceCode = context.getSourceCode(); + let prevToken = getActualLastToken(sourceCode, prevNode); + const nextToken = sourceCode.getFirstTokenBetween( + prevToken, + nextNode, + { + includeComments: true, + + /** + * Skip the trailing comments of the previous node. + * This inserts a blank line after the last trailing comment. + * + * For example: + * + * foo(); // trailing comment. + * // comment. + * bar(); + * + * Get fixed to: + * + * foo(); // trailing comment. + * + * // comment. + * bar(); + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is not a trailing comment. + * @private + */ + filter(token) { + if (astUtils.isTokenOnSameLine(prevToken, token)) { + prevToken = token; + return false; + } + return true; + } + } + ) || nextNode; + const insertText = astUtils.isTokenOnSameLine(prevToken, nextToken) + ? "\n\n" + : "\n"; + + return fixer.insertTextAfter(prevToken, insertText); + } + }); +} + +/** + * Types of blank lines. + * `any`, `never`, and `always` are defined. + * Those have `verify` method to check and report statements. + * @private + */ +const PaddingTypes = { + any: { verify: verifyForAny }, + never: { verify: verifyForNever }, + always: { verify: verifyForAlways } +}; + +/** + * Types of statements. + * Those have `test` method to check it matches to the given statement. + * @private + */ +const StatementTypes = { + "*": { test: () => true }, + "block-like": { + test: (node, sourceCode) => isBlockLikeStatement(sourceCode, node) + }, + "cjs-export": { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + node.expression.type === "AssignmentExpression" && + CJS_EXPORT.test(sourceCode.getText(node.expression.left)) + }, + "cjs-import": { + test: (node, sourceCode) => + node.type === "VariableDeclaration" && + node.declarations.length > 0 && + Boolean(node.declarations[0].init) && + CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)) + }, + directive: { + test: isDirectivePrologue + }, + expression: { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + !isDirectivePrologue(node, sourceCode) + }, + iife: { + test: isIIFEStatement + }, + "multiline-block-like": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + isBlockLikeStatement(sourceCode, node) + }, + "multiline-expression": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + node.type === "ExpressionStatement" && + !isDirectivePrologue(node, sourceCode) + }, + + "multiline-const": newMultilineKeywordTester("const"), + "multiline-let": newMultilineKeywordTester("let"), + "multiline-var": newMultilineKeywordTester("var"), + "singleline-const": newSinglelineKeywordTester("const"), + "singleline-let": newSinglelineKeywordTester("let"), + "singleline-var": newSinglelineKeywordTester("var"), + + block: newNodeTypeTester("BlockStatement"), + empty: newNodeTypeTester("EmptyStatement"), + function: newNodeTypeTester("FunctionDeclaration"), + + break: newKeywordTester("break"), + case: newKeywordTester("case"), + class: newKeywordTester("class"), + const: newKeywordTester("const"), + continue: newKeywordTester("continue"), + debugger: newKeywordTester("debugger"), + default: newKeywordTester("default"), + do: newKeywordTester("do"), + export: newKeywordTester("export"), + for: newKeywordTester("for"), + if: newKeywordTester("if"), + import: newKeywordTester("import"), + let: newKeywordTester("let"), + return: newKeywordTester("return"), + switch: newKeywordTester("switch"), + throw: newKeywordTester("throw"), + try: newKeywordTester("try"), + var: newKeywordTester("var"), + while: newKeywordTester("while"), + with: newKeywordTester("with") +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow padding lines between statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/padding-line-between-statements" + }, + + fixable: "whitespace", + + schema: { + definitions: { + paddingType: { + enum: Object.keys(PaddingTypes) + }, + statementType: { + anyOf: [ + { enum: Object.keys(StatementTypes) }, + { + type: "array", + items: { enum: Object.keys(StatementTypes) }, + minItems: 1, + uniqueItems: true, + additionalItems: false + } + ] + } + }, + type: "array", + items: { + type: "object", + properties: { + blankLine: { $ref: "#/definitions/paddingType" }, + prev: { $ref: "#/definitions/statementType" }, + next: { $ref: "#/definitions/statementType" } + }, + additionalProperties: false, + required: ["blankLine", "prev", "next"] + }, + additionalItems: false + }, + + messages: { + unexpectedBlankLine: "Unexpected blank line before this statement.", + expectedBlankLine: "Expected blank line before this statement." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const configureList = context.options || []; + let scopeInfo = null; + + /** + * Processes to enter to new scope. + * This manages the current previous statement. + * @returns {void} + * @private + */ + function enterScope() { + scopeInfo = { + upper: scopeInfo, + prevNode: null + }; + } + + /** + * Processes to exit from the current scope. + * @returns {void} + * @private + */ + function exitScope() { + scopeInfo = scopeInfo.upper; + } + + /** + * Checks whether the given node matches the given type. + * @param {ASTNode} node The statement node to check. + * @param {string|string[]} type The statement type to check. + * @returns {boolean} `true` if the statement node matched the type. + * @private + */ + function match(node, type) { + let innerStatementNode = node; + + while (innerStatementNode.type === "LabeledStatement") { + innerStatementNode = innerStatementNode.body; + } + if (Array.isArray(type)) { + return type.some(match.bind(null, innerStatementNode)); + } + return StatementTypes[type].test(innerStatementNode, sourceCode); + } + + /** + * Finds the last matched configure from configureList. + * @param {ASTNode} prevNode The previous statement to match. + * @param {ASTNode} nextNode The current statement to match. + * @returns {Object} The tester of the last matched configure. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + const matched = + match(prevNode, configure.prev) && + match(nextNode, configure.next); + + if (matched) { + return PaddingTypes[configure.blankLine]; + } + } + return PaddingTypes.any; + } + + /** + * Gets padding line sequences between the given 2 statements. + * Comments are separators of the padding line sequences. + * @param {ASTNode} prevNode The previous statement to count. + * @param {ASTNode} nextNode The current statement to count. + * @returns {Array} The array of token pairs. + * @private + */ + function getPaddingLineSequences(prevNode, nextNode) { + const pairs = []; + let prevToken = getActualLastToken(sourceCode, prevNode); + + if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) { + do { + const token = sourceCode.getTokenAfter( + prevToken, + { includeComments: true } + ); + + if (token.loc.start.line - prevToken.loc.end.line >= 2) { + pairs.push([prevToken, token]); + } + prevToken = token; + + } while (prevToken.range[0] < nextNode.range[0]); + } + + return pairs; + } + + /** + * Verify padding lines between the given node and the previous node. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verify(node) { + const parentType = node.parent.type; + const validParent = + astUtils.STATEMENT_LIST_PARENTS.has(parentType) || + parentType === "SwitchStatement"; + + if (!validParent) { + return; + } + + // Save this node as the current previous statement. + const prevNode = scopeInfo.prevNode; + + // Verify. + if (prevNode) { + const type = getPaddingType(prevNode, node); + const paddingLines = getPaddingLineSequences(prevNode, node); + + type.verify(context, prevNode, node, paddingLines); + } + + scopeInfo.prevNode = node; + } + + /** + * Verify padding lines between the given node and the previous node. + * Then process to enter to new scope. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verifyThenEnterScope(node) { + verify(node); + enterScope(); + } + + return { + Program: enterScope, + BlockStatement: enterScope, + SwitchStatement: enterScope, + "Program:exit": exitScope, + "BlockStatement:exit": exitScope, + "SwitchStatement:exit": exitScope, + + ":statement": verify, + + SwitchCase: verifyThenEnterScope, + "SwitchCase:exit": exitScope + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/node_modules/eslint/lib/rules/prefer-arrow-callback.js new file mode 100644 index 0000000..ee5cfe3 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -0,0 +1,379 @@ +/** + * @fileoverview A rule to suggest using arrow functions as callbacks. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given MetaProperty node equals to a given value. + * @param {ASTNode} node A MetaProperty node to check. + * @param {string} metaName The name of `MetaProperty.meta`. + * @param {string} propertyName The name of `MetaProperty.property`. + * @returns {boolean} `true` if the node is the specific value. + */ +function checkMetaProperty(node, metaName, propertyName) { + return node.meta.name === metaName && node.property.name === propertyName; +} + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the + * implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next */ + return null; +} + +/** + * Checks whether or not a given node is a callback. + * @param {ASTNode} node A node to check. + * @returns {Object} + * {boolean} retv.isCallback - `true` if the node is a callback. + * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. + */ +function getCallbackInfo(node) { + const retv = { isCallback: false, isLexicalThis: false }; + let currentNode = node; + let parent = node.parent; + let bound = false; + + while (currentNode) { + switch (parent.type) { + + // Checks parents recursively. + + case "LogicalExpression": + case "ChainExpression": + case "ConditionalExpression": + break; + + // Checks whether the parent node is `.bind(this)` call. + case "MemberExpression": + if ( + parent.object === currentNode && + !parent.property.computed && + parent.property.type === "Identifier" && + parent.property.name === "bind" + ) { + const maybeCallee = parent.parent.type === "ChainExpression" + ? parent.parent + : parent; + + if (astUtils.isCallee(maybeCallee)) { + if (!bound) { + bound = true; // Use only the first `.bind()` to make `isLexicalThis` value. + retv.isLexicalThis = ( + maybeCallee.parent.arguments.length === 1 && + maybeCallee.parent.arguments[0].type === "ThisExpression" + ); + } + parent = maybeCallee.parent; + } else { + return retv; + } + } else { + return retv; + } + break; + + // Checks whether the node is a callback. + case "CallExpression": + case "NewExpression": + if (parent.callee !== currentNode) { + retv.isCallback = true; + } + return retv; + + default: + return retv; + } + + currentNode = parent; + parent = parent.parent; + } + + /* istanbul ignore next */ + throw new Error("unreachable"); +} + +/** + * Checks whether a simple list of parameters contains any duplicates. This does not handle complex + * parameter lists (e.g. with destructuring), since complex parameter lists are a SyntaxError with duplicate + * parameter names anyway. Instead, it always returns `false` for complex parameter lists. + * @param {ASTNode[]} paramsList The list of parameters for a function + * @returns {boolean} `true` if the list of parameters contains any duplicates + */ +function hasDuplicateParams(paramsList) { + return paramsList.every(param => param.type === "Identifier") && paramsList.length !== new Set(paramsList.map(param => param.name)).size; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require using arrow functions for callbacks", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-arrow-callback" + }, + + schema: [ + { + type: "object", + properties: { + allowNamedFunctions: { + type: "boolean", + default: false + }, + allowUnboundThis: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + preferArrowCallback: "Unexpected function expression." + } + }, + + create(context) { + const options = context.options[0] || {}; + + const allowUnboundThis = options.allowUnboundThis !== false; // default to true + const allowNamedFunctions = options.allowNamedFunctions; + const sourceCode = context.getSourceCode(); + + /* + * {Array<{this: boolean, super: boolean, meta: boolean}>} + * - this - A flag which shows there are one or more ThisExpression. + * - super - A flag which shows there are one or more Super. + * - meta - A flag which shows there are one or more MethProperty. + */ + let stack = []; + + /** + * Pushes new function scope with all `false` flags. + * @returns {void} + */ + function enterScope() { + stack.push({ this: false, super: false, meta: false }); + } + + /** + * Pops a function scope from the stack. + * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. + */ + function exitScope() { + return stack.pop(); + } + + return { + + // Reset internal state. + Program() { + stack = []; + }, + + // If there are below, it cannot replace with arrow functions merely. + ThisExpression() { + const info = stack[stack.length - 1]; + + if (info) { + info.this = true; + } + }, + + Super() { + const info = stack[stack.length - 1]; + + if (info) { + info.super = true; + } + }, + + MetaProperty(node) { + const info = stack[stack.length - 1]; + + if (info && checkMetaProperty(node, "new", "target")) { + info.meta = true; + } + }, + + // To skip nested scopes. + FunctionDeclaration: enterScope, + "FunctionDeclaration:exit": exitScope, + + // Main. + FunctionExpression: enterScope, + "FunctionExpression:exit"(node) { + const scopeInfo = exitScope(); + + // Skip named function expressions + if (allowNamedFunctions && node.id && node.id.name) { + return; + } + + // Skip generators. + if (node.generator) { + return; + } + + // Skip recursive functions. + const nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + // Skip if it's using arguments. + const variable = getVariableOfArguments(context.getScope()); + + if (variable && variable.references.length > 0) { + return; + } + + // Reports if it's a callback which can replace with arrows. + const callbackInfo = getCallbackInfo(node); + + if (callbackInfo.isCallback && + (!allowUnboundThis || !scopeInfo.this || callbackInfo.isLexicalThis) && + !scopeInfo.super && + !scopeInfo.meta + ) { + context.report({ + node, + messageId: "preferArrowCallback", + *fix(fixer) { + if ((!callbackInfo.isLexicalThis && scopeInfo.this) || hasDuplicateParams(node.params)) { + + /* + * If the callback function does not have .bind(this) and contains a reference to `this`, there + * is no way to determine what `this` should be, so don't perform any fixes. + * If the callback function has duplicates in its list of parameters (possible in sloppy mode), + * don't replace it with an arrow function, because this is a SyntaxError with arrow functions. + */ + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Remove `.bind(this)` if exists. + if (callbackInfo.isLexicalThis) { + const memberNode = node.parent; + + /* + * If `.bind(this)` exists but the parent is not `.bind(this)`, don't remove it automatically. + * E.g. `(foo || function(){}).bind(this)` + */ + if (memberNode.type !== "MemberExpression") { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + const callNode = memberNode.parent; + const firstTokenToRemove = sourceCode.getTokenAfter(memberNode.object, astUtils.isNotClosingParenToken); + const lastTokenToRemove = sourceCode.getLastToken(callNode); + + /* + * If the member expression is parenthesized, don't remove the right paren. + * E.g. `(function(){}.bind)(this)` + * ^^^^^^^^^^^^ + */ + if (astUtils.isParenthesised(sourceCode, memberNode)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // If comments exist in the `.bind(this)`, don't remove those. + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + yield fixer.removeRange([firstTokenToRemove.range[0], lastTokenToRemove.range[1]]); + } + + // Convert the function expression to an arrow function. + const functionToken = sourceCode.getFirstToken(node, node.async ? 1 : 0); + const leftParenToken = sourceCode.getTokenAfter(functionToken, astUtils.isOpeningParenToken); + + if (sourceCode.commentsExistBetween(functionToken, leftParenToken)) { + + // Remove only extra tokens to keep comments. + yield fixer.remove(functionToken); + if (node.id) { + yield fixer.remove(node.id); + } + } else { + + // Remove extra tokens and spaces. + yield fixer.removeRange([functionToken.range[0], leftParenToken.range[0]]); + } + yield fixer.insertTextBefore(node.body, "=> "); + + // Get the node that will become the new arrow function. + let replacedNode = callbackInfo.isLexicalThis ? node.parent.parent : node; + + if (replacedNode.type === "ChainExpression") { + replacedNode = replacedNode.parent; + } + + /* + * If the replaced node is part of a BinaryExpression, LogicalExpression, or MemberExpression, then + * the arrow function needs to be parenthesized, because `foo || () => {}` is invalid syntax even + * though `foo || function() {}` is valid. + */ + if ( + replacedNode.parent.type !== "CallExpression" && + replacedNode.parent.type !== "ConditionalExpression" && + !astUtils.isParenthesised(sourceCode, replacedNode) && + !astUtils.isParenthesised(sourceCode, node) + ) { + yield fixer.insertTextBefore(replacedNode, "("); + yield fixer.insertTextAfter(replacedNode, ")"); + } + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-const.js b/node_modules/eslint/lib/rules/prefer-const.js new file mode 100644 index 0000000..439a4db --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-const.js @@ -0,0 +1,476 @@ +/** + * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PATTERN_TYPE = /^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u; +const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|SwitchCase)$/u; +const DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/u; + +/** + * Checks whether a given node is located at `ForStatement.init` or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is located at `ForStatement.init`. + */ +function isInitOfForStatement(node) { + return node.parent.type === "ForStatement" && node.parent.init === node; +} + +/** + * Checks whether a given Identifier node becomes a VariableDeclaration or not. + * @param {ASTNode} identifier An Identifier node to check. + * @returns {boolean} `true` if the node can become a VariableDeclaration. + */ +function canBecomeVariableDeclaration(identifier) { + let node = identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + return ( + node.type === "VariableDeclarator" || + ( + node.type === "AssignmentExpression" && + node.parent.type === "ExpressionStatement" && + DECLARATION_HOST_TYPE.test(node.parent.parent.type) + ) + ); +} + +/** + * Checks if an property or element is from outer scope or function parameters + * in destructing pattern. + * @param {string} name A variable name to be checked. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @returns {boolean} Indicates if the variable is from outer scope or function parameters. + */ +function isOuterVariableInDestructing(name, initScope) { + + if (initScope.through.find(ref => ref.resolved && ref.resolved.name === name)) { + return true; + } + + const variable = astUtils.getVariableByName(initScope, name); + + if (variable !== null) { + return variable.defs.some(def => def.type === "Parameter"); + } + + return false; +} + +/** + * Gets the VariableDeclarator/AssignmentExpression node that a given reference + * belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or + * null. + */ +function getDestructuringHost(reference) { + if (!reference.isWrite()) { + return null; + } + let node = reference.identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + if (!DESTRUCTURING_HOST_TYPE.test(node.type)) { + return null; + } + return node; +} + +/** + * Determines if a destructuring assignment node contains + * any MemberExpression nodes. This is used to determine if a + * variable that is only written once using destructuring can be + * safely converted into a const declaration. + * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check. + * @returns {boolean} True if the destructuring pattern contains + * a MemberExpression, false if not. + */ +function hasMemberExpressionAssignment(node) { + switch (node.type) { + case "ObjectPattern": + return node.properties.some(prop => { + if (prop) { + + /* + * Spread elements have an argument property while + * others have a value property. Because different + * parsers use different node types for spread elements, + * we just check if there is an argument property. + */ + return hasMemberExpressionAssignment(prop.argument || prop.value); + } + + return false; + }); + + case "ArrayPattern": + return node.elements.some(element => { + if (element) { + return hasMemberExpressionAssignment(element); + } + + return false; + }); + + case "AssignmentPattern": + return hasMemberExpressionAssignment(node.left); + + case "MemberExpression": + return true; + + // no default + } + + return false; +} + +/** + * Gets an identifier node of a given variable. + * + * If the initialization exists or one or more reading references exist before + * the first assignment, the identifier node is the node of the declaration. + * Otherwise, the identifier node is the node of the first assignment. + * + * If the variable should not change to const, this function returns null. + * - If the variable is reassigned. + * - If the variable is never initialized nor assigned. + * - If the variable is initialized in a different scope from the declaration. + * - If the unique assignment of the variable cannot change to a declaration. + * e.g. `if (a) b = 1` / `return (b = 1)` + * - If the variable is declared in the global scope and `eslintUsed` is `true`. + * `/*exported foo` directive comment makes such variables. This rule does not + * warn such variables because this rule cannot distinguish whether the + * exported variables are reassigned or not. + * @param {eslint-scope.Variable} variable A variable to get. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {ASTNode|null} + * An Identifier node if the variable should change to const. + * Otherwise, null. + */ +function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { + if (variable.eslintUsed && variable.scope.type === "global") { + return null; + } + + // Finds the unique WriteReference. + let writer = null; + let isReadBeforeInit = false; + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + + if (reference.isWrite()) { + const isReassigned = ( + writer !== null && + writer.identifier !== reference.identifier + ); + + if (isReassigned) { + return null; + } + + const destructuringHost = getDestructuringHost(reference); + + if (destructuringHost !== null && destructuringHost.left !== void 0) { + const leftNode = destructuringHost.left; + let hasOuterVariables = false, + hasNonIdentifiers = false; + + if (leftNode.type === "ObjectPattern") { + const properties = leftNode.properties; + + hasOuterVariables = properties + .filter(prop => prop.value) + .map(prop => prop.value.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + + } else if (leftNode.type === "ArrayPattern") { + const elements = leftNode.elements; + + hasOuterVariables = elements + .map(element => element && element.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + } + + if (hasOuterVariables || hasNonIdentifiers) { + return null; + } + + } + + writer = reference; + + } else if (reference.isRead() && writer === null) { + if (ignoreReadBeforeAssign) { + return null; + } + isReadBeforeInit = true; + } + } + + /* + * If the assignment is from a different scope, ignore it. + * If the assignment cannot change to a declaration, ignore it. + */ + const shouldBeConst = ( + writer !== null && + writer.from === variable.scope && + canBecomeVariableDeclaration(writer.identifier) + ); + + if (!shouldBeConst) { + return null; + } + + if (isReadBeforeInit) { + return variable.defs[0].name; + } + + return writer.identifier; +} + +/** + * Groups by the VariableDeclarator/AssignmentExpression node that each + * reference of given variables belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Variable[]} variables Variables to group by destructuring. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {Map} Grouped identifier nodes. + */ +function groupByDestructuring(variables, ignoreReadBeforeAssign) { + const identifierMap = new Map(); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + const references = variable.references; + const identifier = getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign); + let prevId = null; + + for (let j = 0; j < references.length; ++j) { + const reference = references[j]; + const id = reference.identifier; + + /* + * Avoid counting a reference twice or more for default values of + * destructuring. + */ + if (id === prevId) { + continue; + } + prevId = id; + + // Add the identifier node into the destructuring group. + const group = getDestructuringHost(reference); + + if (group) { + if (identifierMap.has(group)) { + identifierMap.get(group).push(identifier); + } else { + identifierMap.set(group, [identifier]); + } + } + } + } + + return identifierMap; +} + +/** + * Finds the nearest parent of node with a given type. + * @param {ASTNode} node The node to search from. + * @param {string} type The type field of the parent node. + * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise. + * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists. + */ +function findUp(node, type, shouldStop) { + if (!node || shouldStop(node)) { + return null; + } + if (node.type === type) { + return node; + } + return findUp(node.parent, type, shouldStop); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `const` declarations for variables that are never reassigned after declared", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-const" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + destructuring: { enum: ["any", "all"], default: "any" }, + ignoreReadBeforeAssign: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + messages: { + useConst: "'{{name}}' is never reassigned. Use 'const' instead." + } + }, + + create(context) { + const options = context.options[0] || {}; + const sourceCode = context.getSourceCode(); + const shouldMatchAnyDestructuredVariable = options.destructuring !== "all"; + const ignoreReadBeforeAssign = options.ignoreReadBeforeAssign === true; + const variables = []; + let reportCount = 0; + let checkedId = null; + let checkedName = ""; + + + /** + * Reports given identifier nodes if all of the nodes should be declared + * as const. + * + * The argument 'nodes' is an array of Identifier nodes. + * This node is the result of 'getIdentifierIfShouldBeConst()', so it's + * nullable. In simple declaration or assignment cases, the length of + * the array is 1. In destructuring cases, the length of the array can + * be 2 or more. + * @param {(eslint-scope.Reference|null)[]} nodes + * References which are grouped by destructuring to report. + * @returns {void} + */ + function checkGroup(nodes) { + const nodesToReport = nodes.filter(Boolean); + + if (nodes.length && (shouldMatchAnyDestructuredVariable || nodesToReport.length === nodes.length)) { + const varDeclParent = findUp(nodes[0], "VariableDeclaration", parentNode => parentNode.type.endsWith("Statement")); + const isVarDecParentNull = varDeclParent === null; + + if (!isVarDecParentNull && varDeclParent.declarations.length > 0) { + const firstDeclaration = varDeclParent.declarations[0]; + + if (firstDeclaration.init) { + const firstDecParent = firstDeclaration.init.parent; + + /* + * First we check the declaration type and then depending on + * if the type is a "VariableDeclarator" or its an "ObjectPattern" + * we compare the name and id from the first identifier, if the names are different + * we assign the new name, id and reset the count of reportCount and nodeCount in + * order to check each block for the number of reported errors and base our fix + * based on comparing nodes.length and nodesToReport.length. + */ + + if (firstDecParent.type === "VariableDeclarator") { + + if (firstDecParent.id.name !== checkedName) { + checkedName = firstDecParent.id.name; + reportCount = 0; + } + + if (firstDecParent.id.type === "ObjectPattern") { + if (firstDecParent.init.name !== checkedName) { + checkedName = firstDecParent.init.name; + reportCount = 0; + } + } + + if (firstDecParent.id !== checkedId) { + checkedId = firstDecParent.id; + reportCount = 0; + } + } + } + } + + let shouldFix = varDeclParent && + + // Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop) + (varDeclParent.parent.type === "ForInStatement" || varDeclParent.parent.type === "ForOfStatement" || + varDeclParent.declarations.every(declaration => declaration.init)) && + + /* + * If options.destructuring is "all", then this warning will not occur unless + * every assignment in the destructuring should be const. In that case, it's safe + * to apply the fix. + */ + nodesToReport.length === nodes.length; + + if (!isVarDecParentNull && varDeclParent.declarations && varDeclParent.declarations.length !== 1) { + + if (varDeclParent && varDeclParent.declarations && varDeclParent.declarations.length >= 1) { + + /* + * Add nodesToReport.length to a count, then comparing the count to the length + * of the declarations in the current block. + */ + + reportCount += nodesToReport.length; + + shouldFix = shouldFix && (reportCount === varDeclParent.declarations.length); + } + } + + nodesToReport.forEach(node => { + context.report({ + node, + messageId: "useConst", + data: node, + fix: shouldFix + ? fixer => fixer.replaceText( + sourceCode.getFirstToken(varDeclParent, t => t.value === varDeclParent.kind), + "const" + ) + : null + }); + }); + } + } + + return { + "Program:exit"() { + groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(checkGroup); + }, + + VariableDeclaration(node) { + if (node.kind === "let" && !isInitOfForStatement(node)) { + variables.push(...context.getDeclaredVariables(node)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-destructuring.js b/node_modules/eslint/lib/rules/prefer-destructuring.js new file mode 100644 index 0000000..66e412f --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -0,0 +1,279 @@ +/** + * @fileoverview Prefer destructuring from arrays and objects + * @author Alex LaFroscia + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require destructuring from arrays and/or objects", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-destructuring" + }, + + fixable: "code", + + schema: [ + { + + /* + * old support {array: Boolean, object: Boolean} + * new support {VariableDeclarator: {}, AssignmentExpression: {}} + */ + oneOf: [ + { + type: "object", + properties: { + VariableDeclarator: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + }, + AssignmentExpression: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + enforceForRenamedProperties: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + preferDestructuring: "Use {{type}} destructuring." + } + }, + create(context) { + + const enabledTypes = context.options[0]; + const enforceForRenamedProperties = context.options[1] && context.options[1].enforceForRenamedProperties; + let normalizedOptions = { + VariableDeclarator: { array: true, object: true }, + AssignmentExpression: { array: true, object: true } + }; + + if (enabledTypes) { + normalizedOptions = typeof enabledTypes.array !== "undefined" || typeof enabledTypes.object !== "undefined" + ? { VariableDeclarator: enabledTypes, AssignmentExpression: enabledTypes } + : enabledTypes; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator" + * @param {string} destructuringType "array" or "object" + * @returns {boolean} `true` if the destructuring type should be checked for the given node + */ + function shouldCheck(nodeType, destructuringType) { + return normalizedOptions && + normalizedOptions[nodeType] && + normalizedOptions[nodeType][destructuringType]; + } + + /** + * Determines if the given node is accessing an array index + * + * This is used to differentiate array index access from object property + * access. + * @param {ASTNode} node the node to evaluate + * @returns {boolean} whether or not the node is an integer + */ + function isArrayIndexAccess(node) { + return Number.isInteger(node.property.value); + } + + /** + * Report that the given node should use destructuring + * @param {ASTNode} reportNode the node to report + * @param {string} type the type of destructuring that should have been done + * @param {Function|null} fix the fix function or null to pass to context.report + * @returns {void} + */ + function report(reportNode, type, fix) { + context.report({ + node: reportNode, + messageId: "preferDestructuring", + data: { type }, + fix + }); + } + + /** + * Determines if a node should be fixed into object destructuring + * + * The fixer only fixes the simplest case of object destructuring, + * like: `let x = a.x`; + * + * Assignment expression is not fixed. + * Array destructuring is not fixed. + * Renamed property is not fixed. + * @param {ASTNode} node the the node to evaluate + * @returns {boolean} whether or not the node should be fixed + */ + function shouldFix(node) { + return node.type === "VariableDeclarator" && + node.id.type === "Identifier" && + node.init.type === "MemberExpression" && + !node.init.computed && + node.init.property.type === "Identifier" && + node.id.name === node.init.property.name; + } + + /** + * Fix a node into object destructuring. + * This function only handles the simplest case of object destructuring, + * see {@link shouldFix}. + * @param {SourceCodeFixer} fixer the fixer object + * @param {ASTNode} node the node to be fixed. + * @returns {Object} a fix for the node + */ + function fixIntoObjectDestructuring(fixer, node) { + const rightNode = node.init; + const sourceCode = context.getSourceCode(); + + // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved. + if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) { + return null; + } + + return fixer.replaceText( + node, + `{${rightNode.property.name}} = ${sourceCode.getText(rightNode.object)}` + ); + } + + /** + * Check that the `prefer-destructuring` rules are followed based on the + * given left- and right-hand side of the assignment. + * + * Pulled out into a separate method so that VariableDeclarators and + * AssignmentExpressions can share the same verification logic. + * @param {ASTNode} leftNode the left-hand side of the assignment + * @param {ASTNode} rightNode the right-hand side of the assignment + * @param {ASTNode} reportNode the node to report the error on + * @returns {void} + */ + function performCheck(leftNode, rightNode, reportNode) { + if (rightNode.type !== "MemberExpression" || rightNode.object.type === "Super") { + return; + } + + if (isArrayIndexAccess(rightNode)) { + if (shouldCheck(reportNode.type, "array")) { + report(reportNode, "array", null); + } + return; + } + + const fix = shouldFix(reportNode) + ? fixer => fixIntoObjectDestructuring(fixer, reportNode) + : null; + + if (shouldCheck(reportNode.type, "object") && enforceForRenamedProperties) { + report(reportNode, "object", fix); + return; + } + + if (shouldCheck(reportNode.type, "object")) { + const property = rightNode.property; + + if ( + (property.type === "Literal" && leftNode.name === property.value) || + (property.type === "Identifier" && leftNode.name === property.name && !rightNode.computed) + ) { + report(reportNode, "object", fix); + } + } + } + + /** + * Check if a given variable declarator is coming from an property access + * that should be using destructuring instead + * @param {ASTNode} node the variable declarator to check + * @returns {void} + */ + function checkVariableDeclarator(node) { + + // Skip if variable is declared without assignment + if (!node.init) { + return; + } + + // We only care about member expressions past this point + if (node.init.type !== "MemberExpression") { + return; + } + + performCheck(node.id, node.init, node); + } + + /** + * Run the `prefer-destructuring` check on an AssignmentExpression + * @param {ASTNode} node the AssignmentExpression node + * @returns {void} + */ + function checkAssigmentExpression(node) { + if (node.operator === "=") { + performCheck(node.left, node.right, node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator: checkVariableDeclarator, + AssignmentExpression: checkAssigmentExpression + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js new file mode 100644 index 0000000..d1a00d6 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js @@ -0,0 +1,189 @@ +/** + * @fileoverview Rule to disallow Math.pow in favor of the ** operator + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, ReferenceTracker } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({ type: "BinaryExpression", operator: "**" }); + +/** + * Determines whether the given node needs parens if used as the base in an exponentiation binary expression. + * @param {ASTNode} base The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesBaseNeedParens(base) { + return ( + + // '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c + astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR || + + // An unary operator cannot be used immediately before an exponentiation expression + base.type === "UnaryExpression" + ); +} + +/** + * Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression. + * @param {ASTNode} exponent The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesExponentNeedParens(exponent) { + + // '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c + return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR; +} + +/** + * Determines whether an exponentiation binary expression at the place of the given node would need parens. + * @param {ASTNode} node A node that would be replaced by an exponentiation binary expression. + * @param {SourceCode} sourceCode A SourceCode object. + * @returns {boolean} `true` if the expression needs to be parenthesised. + */ +function doesExponentiationExpressionNeedParens(node, sourceCode) { + const parent = node.parent.type === "ChainExpression" ? node.parent.parent : node.parent; + + const needsParens = ( + parent.type === "ClassDeclaration" || + ( + parent.type.endsWith("Expression") && + astUtils.getPrecedence(parent) >= PRECEDENCE_OF_EXPONENTIATION_EXPR && + !(parent.type === "BinaryExpression" && parent.operator === "**" && parent.right === node) && + !((parent.type === "CallExpression" || parent.type === "NewExpression") && parent.arguments.includes(node)) && + !(parent.type === "MemberExpression" && parent.computed && parent.property === node) && + !(parent.type === "ArrayExpression") + ) + ); + + return needsParens && !astUtils.isParenthesised(sourceCode, node); +} + +/** + * Optionally parenthesizes given text. + * @param {string} text The text to parenthesize. + * @param {boolean} shouldParenthesize If `true`, the text will be parenthesised. + * @returns {string} parenthesised or unchanged text. + */ +function parenthesizeIfShould(text, shouldParenthesize) { + return shouldParenthesize ? `(${text})` : text; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `Math.pow` in favor of the `**` operator", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-exponentiation-operator" + }, + + schema: [], + fixable: "code", + + messages: { + useExponentiation: "Use the '**' operator instead of 'Math.pow'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports the given node. + * @param {ASTNode} node 'Math.pow()' node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "useExponentiation", + fix(fixer) { + if ( + node.arguments.length !== 2 || + node.arguments.some(arg => arg.type === "SpreadElement") || + sourceCode.getCommentsInside(node).length > 0 + ) { + return null; + } + + const base = node.arguments[0], + exponent = node.arguments[1], + baseText = sourceCode.getText(base), + exponentText = sourceCode.getText(exponent), + shouldParenthesizeBase = doesBaseNeedParens(base), + shouldParenthesizeExponent = doesExponentNeedParens(exponent), + shouldParenthesizeAll = doesExponentiationExpressionNeedParens(node, sourceCode); + + let prefix = "", + suffix = ""; + + if (!shouldParenthesizeAll) { + if (!shouldParenthesizeBase) { + const firstReplacementToken = sourceCode.getFirstToken(base), + tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c + } + } + if (!shouldParenthesizeExponent) { + const lastReplacementToken = sourceCode.getLastToken(exponent), + tokenAfter = sourceCode.getTokenAfter(node); + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(lastReplacementToken, tokenAfter) + ) { + suffix = " "; // Math.pow(a, b)in c -> a**b in c + } + } + } + + const baseReplacement = parenthesizeIfShould(baseText, shouldParenthesizeBase), + exponentReplacement = parenthesizeIfShould(exponentText, shouldParenthesizeExponent), + replacement = parenthesizeIfShould(`${baseReplacement}**${exponentReplacement}`, shouldParenthesizeAll); + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Math: { + pow: { [CALL]: true } + } + }; + + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/node_modules/eslint/lib/rules/prefer-named-capture-group.js new file mode 100644 index 0000000..7d0aa3f --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-named-capture-group.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule to enforce requiring named capture groups in regular expression. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("eslint-utils"); +const regexpp = require("regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new regexpp.RegExpParser(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce using named capture group in regular expression", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-named-capture-group" + }, + + schema: [], + + messages: { + required: "Capture group '{{group}}' should be converted to a named or non-capturing group." + } + }, + + create(context) { + + /** + * Function to check regular expression. + * @param {string} pattern The regular expression pattern to be check. + * @param {ASTNode} node AST node which contains regular expression. + * @param {boolean} uFlag Flag indicates whether unicode mode is enabled or not. + * @returns {void} + */ + function checkRegex(pattern, node, uFlag) { + let ast; + + try { + ast = parser.parsePattern(pattern, 0, pattern.length, uFlag); + } catch { + + // ignore regex syntax errors + return; + } + + regexpp.visitRegExpAST(ast, { + onCapturingGroupEnter(group) { + if (!group.name) { + context.report({ + node, + messageId: "required", + data: { + group: group.raw + } + }); + } + } + }); + } + + return { + Literal(node) { + if (node.regex) { + checkRegex(node.regex.pattern, node, node.regex.flags.includes("u")); + } + }, + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const regex = getStringIfConstant(node.arguments[0]); + const flags = getStringIfConstant(node.arguments[1]); + + if (regex) { + checkRegex(regex, node, flags && flags.includes("u")); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/node_modules/eslint/lib/rules/prefer-numeric-literals.js new file mode 100644 index 0000000..cc82e66 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -0,0 +1,148 @@ +/** + * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals + * @author Annie Zhang, Henry Zhu + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const radixMap = new Map([ + [2, { system: "binary", literalPrefix: "0b" }], + [8, { system: "octal", literalPrefix: "0o" }], + [16, { system: "hexadecimal", literalPrefix: "0x" }] +]); + +/** + * Checks to see if a CallExpression's callee node is `parseInt` or + * `Number.parseInt`. + * @param {ASTNode} calleeNode The callee node to evaluate. + * @returns {boolean} True if the callee is `parseInt` or `Number.parseInt`, + * false otherwise. + */ +function isParseInt(calleeNode) { + return ( + astUtils.isSpecificId(calleeNode, "parseInt") || + astUtils.isSpecificMemberAccess(calleeNode, "Number", "parseInt") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-numeric-literals" + }, + + schema: [], + + messages: { + useLiteral: "Use {{system}} literals instead of {{functionName}}()." + }, + + fixable: "code" + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + "CallExpression[arguments.length=2]"(node) { + const [strNode, radixNode] = node.arguments, + str = astUtils.getStaticStringValue(strNode), + radix = radixNode.value; + + if ( + str !== null && + astUtils.isStringLiteral(strNode) && + radixNode.type === "Literal" && + typeof radix === "number" && + radixMap.has(radix) && + isParseInt(node.callee) + ) { + + const { system, literalPrefix } = radixMap.get(radix); + + context.report({ + node, + messageId: "useLiteral", + data: { + system, + functionName: sourceCode.getText(node.callee) + }, + fix(fixer) { + if (sourceCode.getCommentsInside(node).length) { + return null; + } + + const replacement = `${literalPrefix}${str}`; + + if (+replacement !== parseInt(str, radix)) { + + /* + * If the newly-produced literal would be invalid, (e.g. 0b1234), + * or it would yield an incorrect parseInt result for some other reason, don't make a fix. + * + * If `str` had numeric separators, `+replacement` will evaluate to `NaN` because unary `+` + * per the specification doesn't support numeric separators. Thus, the above condition will be `true` + * (`NaN !== anything` is always `true`) regardless of the `parseInt(str, radix)` value. + * Consequently, no autofixes will be made. This is correct behavior because `parseInt` also + * doesn't support numeric separators, but it does parse part of the string before the first `_`, + * so the autofix would be invalid: + * + * parseInt("1_1", 2) // === 1 + * 0b1_1 // === 3 + */ + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node), + tokenAfter = sourceCode.getTokenAfter(node); + let prefix = "", + suffix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(replacement, tokenAfter) + ) { + suffix = " "; + } + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-object-spread.js b/node_modules/eslint/lib/rules/prefer-object-spread.js new file mode 100644 index 0000000..ab252c7 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -0,0 +1,299 @@ +/** + * @fileoverview Prefers object spread property over Object.assign + * @author Sharmila Jesupaul + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +const { CALL, ReferenceTracker } = require("eslint-utils"); +const { + isCommaToken, + isOpeningParenToken, + isClosingParenToken, + isParenthesised +} = require("./utils/ast-utils"); + +const ANY_SPACE = /\s/u; + +/** + * Helper that checks if the Object.assign call has array spread + * @param {ASTNode} node The node that the rule warns on + * @returns {boolean} - Returns true if the Object.assign call has array spread + */ +function hasArraySpread(node) { + return node.arguments.some(arg => arg.type === "SpreadElement"); +} + +/** + * Determines whether the given node is an accessor property (getter/setter). + * @param {ASTNode} node Node to check. + * @returns {boolean} `true` if the node is a getter or a setter. + */ +function isAccessorProperty(node) { + return node.type === "Property" && + (node.kind === "get" || node.kind === "set"); +} + +/** + * Determines whether the given object expression node has accessor properties (getters/setters). + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {boolean} `true` if the node has at least one getter/setter. + */ +function hasAccessors(node) { + return node.properties.some(isAccessorProperty); +} + +/** + * Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters). + * @param {ASTNode} node `CallExpression` node to check. + * @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter. + */ +function hasArgumentsWithAccessors(node) { + return node.arguments + .filter(arg => arg.type === "ObjectExpression") + .some(hasAccessors); +} + +/** + * Helper that checks if the node needs parentheses to be valid JS. + * The default is to wrap the node in parentheses to avoid parsing errors. + * @param {ASTNode} node The node that the rule warns on + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} - Returns true if the node needs parentheses + */ +function needsParens(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "VariableDeclarator": + case "ArrayExpression": + case "ReturnStatement": + case "CallExpression": + case "Property": + return false; + case "AssignmentExpression": + return parent.left === node && !isParenthesised(sourceCode, node); + default: + return !isParenthesised(sourceCode, node); + } +} + +/** + * Determines if an argument needs parentheses. The default is to not add parens. + * @param {ASTNode} node The node to be checked. + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} True if the node needs parentheses + */ +function argNeedsParens(node, sourceCode) { + switch (node.type) { + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "ConditionalExpression": + return !isParenthesised(sourceCode, node); + default: + return false; + } +} + +/** + * Get the parenthesis tokens of a given ObjectExpression node. + * This includes the braces of the object literal and enclosing parentheses. + * @param {ASTNode} node The node to get. + * @param {Token} leftArgumentListParen The opening paren token of the argument list. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location. + */ +function getParenTokens(node, leftArgumentListParen, sourceCode) { + const parens = [sourceCode.getFirstToken(node), sourceCode.getLastToken(node)]; + let leftNext = sourceCode.getTokenBefore(node); + let rightNext = sourceCode.getTokenAfter(node); + + // Note: don't include the parens of the argument list. + while ( + leftNext && + rightNext && + leftNext.range[0] > leftArgumentListParen.range[0] && + isOpeningParenToken(leftNext) && + isClosingParenToken(rightNext) + ) { + parens.push(leftNext, rightNext); + leftNext = sourceCode.getTokenBefore(leftNext); + rightNext = sourceCode.getTokenAfter(rightNext); + } + + return parens.sort((a, b) => a.range[0] - b.range[0]); +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The end of the range of the token and around whitespaces. + */ +function getStartWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let start = token.range[0]; + + // If the previous token is a line comment then skip this step to avoid commenting this token out. + { + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (prevToken && prevToken.type === "Line") { + return start; + } + } + + // Detect spaces before the token. + while (ANY_SPACE.test(text[start - 1] || "")) { + start -= 1; + } + + return start; +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The start of the range of the token and around whitespaces. + */ +function getEndWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let end = token.range[1]; + + // Detect spaces after the token. + while (ANY_SPACE.test(text[end] || "")) { + end += 1; + } + + return end; +} + +/** + * Autofixes the Object.assign call to use an object spread instead. + * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call + * @param {string} sourceCode sourceCode of the Object.assign call + * @returns {Function} autofixer - replaces the Object.assign with a spread object. + */ +function defineFixer(node, sourceCode) { + return function *(fixer) { + const leftParen = sourceCode.getTokenAfter(node.callee, isOpeningParenToken); + const rightParen = sourceCode.getLastToken(node); + + // Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren. + yield fixer.removeRange([node.range[0], leftParen.range[0]]); + + // Replace the parens of argument list to braces. + if (needsParens(node, sourceCode)) { + yield fixer.replaceText(leftParen, "({"); + yield fixer.replaceText(rightParen, "})"); + } else { + yield fixer.replaceText(leftParen, "{"); + yield fixer.replaceText(rightParen, "}"); + } + + // Process arguments. + for (const argNode of node.arguments) { + const innerParens = getParenTokens(argNode, leftParen, sourceCode); + const left = innerParens.shift(); + const right = innerParens.pop(); + + if (argNode.type === "ObjectExpression") { + const maybeTrailingComma = sourceCode.getLastToken(argNode, 1); + const maybeArgumentComma = sourceCode.getTokenAfter(right); + + /* + * Make bare this object literal. + * And remove spaces inside of the braces for better formatting. + */ + for (const innerParen of innerParens) { + yield fixer.remove(innerParen); + } + const leftRange = [left.range[0], getEndWithSpaces(left, sourceCode)]; + const rightRange = [ + Math.max(getStartWithSpaces(right, sourceCode), leftRange[1]), // Ensure ranges don't overlap + right.range[1] + ]; + + yield fixer.removeRange(leftRange); + yield fixer.removeRange(rightRange); + + // Remove the comma of this argument if it's duplication. + if ( + (argNode.properties.length === 0 || isCommaToken(maybeTrailingComma)) && + isCommaToken(maybeArgumentComma) + ) { + yield fixer.remove(maybeArgumentComma); + } + } else { + + // Make spread. + if (argNeedsParens(argNode, sourceCode)) { + yield fixer.insertTextBefore(left, "...("); + yield fixer.insertTextAfter(right, ")"); + } else { + yield fixer.insertTextBefore(left, "..."); + } + } + } + }; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: + "disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-object-spread" + }, + + schema: [], + fixable: "code", + + messages: { + useSpreadMessage: "Use an object spread instead of `Object.assign` eg: `{ ...foo }`.", + useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Object: { + assign: { [CALL]: true } + } + }; + + // Iterate all calls of `Object.assign` (only of the global variable `Object`). + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + if ( + node.arguments.length >= 1 && + node.arguments[0].type === "ObjectExpression" && + !hasArraySpread(node) && + !( + node.arguments.length > 1 && + hasArgumentsWithAccessors(node) + ) + ) { + const messageId = node.arguments.length === 1 + ? "useLiteralMessage" + : "useSpreadMessage"; + const fix = defineFixer(node, sourceCode); + + context.report({ node, messageId, fix }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js new file mode 100644 index 0000000..ec16e44 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -0,0 +1,131 @@ +/** + * @fileoverview restrict values that can be used as Promise rejection reasons + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require using Error objects as Promise rejection reasons", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-promise-reject-errors" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowEmptyReject: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + rejectAnError: "Expected the Promise rejection reason to be an Error." + } + }, + + create(context) { + + const ALLOW_EMPTY_REJECT = context.options.length && context.options[0].allowEmptyReject; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error + * @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise + * @returns {void} + */ + function checkRejectCall(callExpression) { + if (!callExpression.arguments.length && ALLOW_EMPTY_REJECT) { + return; + } + if ( + !callExpression.arguments.length || + !astUtils.couldBeError(callExpression.arguments[0]) || + callExpression.arguments[0].type === "Identifier" && callExpression.arguments[0].name === "undefined" + ) { + context.report({ + node: callExpression, + messageId: "rejectAnError" + }); + } + } + + /** + * Determines whether a function call is a Promise.reject() call + * @param {ASTNode} node A CallExpression node + * @returns {boolean} `true` if the call is a Promise.reject() call + */ + function isPromiseRejectCall(node) { + return astUtils.isSpecificMemberAccess(node.callee, "Promise", "reject"); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Check `Promise.reject(value)` calls. + CallExpression(node) { + if (isPromiseRejectCall(node)) { + checkRejectCall(node); + } + }, + + /* + * Check for `new Promise((resolve, reject) => {})`, and check for reject() calls. + * This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that + * the nodes in the expression already have the `parent` property. + */ + "NewExpression:exit"(node) { + if ( + node.callee.type === "Identifier" && node.callee.name === "Promise" && + node.arguments.length && astUtils.isFunction(node.arguments[0]) && + node.arguments[0].params.length > 1 && node.arguments[0].params[1].type === "Identifier" + ) { + context.getDeclaredVariables(node.arguments[0]) + + /* + * Find the first variable that matches the second parameter's name. + * If the first parameter has the same name as the second parameter, then the variable will actually + * be "declared" when the first parameter is evaluated, but then it will be immediately overwritten + * by the second parameter. It's not possible for an expression with the variable to be evaluated before + * the variable is overwritten, because functions with duplicate parameters cannot have destructuring or + * default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for + * this case. + */ + .find(variable => variable.name === node.arguments[0].params[1].name) + + // Get the references to that variable. + .references + + // Only check the references that read the parameter's value. + .filter(ref => ref.isRead()) + + // Only check the references that are used as the callee in a function call, e.g. `reject(foo)`. + .filter(ref => ref.identifier.parent.type === "CallExpression" && ref.identifier === ref.identifier.parent.callee) + + // Check the argument of the function call to determine whether it's an Error. + .forEach(ref => checkRejectCall(ref.identifier.parent)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-reflect.js b/node_modules/eslint/lib/rules/prefer-reflect.js new file mode 100644 index 0000000..fb2de92 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-reflect.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods + * @author Keith Cirkel + * @deprecated in ESLint v3.9.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `Reflect` methods where applicable", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-reflect" + }, + + deprecated: true, + + replacedBy: [], + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: [ + "apply", + "call", + "delete", + "defineProperty", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "setPrototypeOf", + "isExtensible", + "getOwnPropertyNames", + "preventExtensions" + ] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + preferReflect: "Avoid using {{existing}}, instead use {{substitute}}." + } + }, + + create(context) { + const existingNames = { + apply: "Function.prototype.apply", + call: "Function.prototype.call", + defineProperty: "Object.defineProperty", + getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor", + getPrototypeOf: "Object.getPrototypeOf", + setPrototypeOf: "Object.setPrototypeOf", + isExtensible: "Object.isExtensible", + getOwnPropertyNames: "Object.getOwnPropertyNames", + preventExtensions: "Object.preventExtensions" + }; + + const reflectSubstitutes = { + apply: "Reflect.apply", + call: "Reflect.apply", + defineProperty: "Reflect.defineProperty", + getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor", + getPrototypeOf: "Reflect.getPrototypeOf", + setPrototypeOf: "Reflect.setPrototypeOf", + isExtensible: "Reflect.isExtensible", + getOwnPropertyNames: "Reflect.getOwnPropertyNames", + preventExtensions: "Reflect.preventExtensions" + }; + + const exceptions = (context.options[0] || {}).exceptions || []; + + /** + * Reports the Reflect violation based on the `existing` and `substitute` + * @param {Object} node The node that violates the rule. + * @param {string} existing The existing method name that has been used. + * @param {string} substitute The Reflect substitute that should be used. + * @returns {void} + */ + function report(node, existing, substitute) { + context.report({ + node, + messageId: "preferReflect", + data: { + existing, + substitute + } + }); + } + + return { + CallExpression(node) { + const methodName = (node.callee.property || {}).name; + const isReflectCall = (node.callee.object || {}).name === "Reflect"; + const hasReflectSubsitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); + const userConfiguredException = exceptions.indexOf(methodName) !== -1; + + if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { + report(node, existingNames[methodName], reflectSubstitutes[methodName]); + } + }, + UnaryExpression(node) { + const isDeleteOperator = node.operator === "delete"; + const targetsIdentifier = node.argument.type === "Identifier"; + const userConfiguredException = exceptions.indexOf("delete") !== -1; + + if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { + report(node, "the delete keyword", "Reflect.deleteProperty"); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-regex-literals.js b/node_modules/eslint/lib/rules/prefer-regex-literals.js new file mode 100644 index 0000000..9e8ce02 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-regex-literals.js @@ -0,0 +1,180 @@ +/** + * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is a string literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a string literal. + */ +function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; +} + +/** + * Determines whether the given node is a regex literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a regex literal. + */ +function isRegexLiteral(node) { + return node.type === "Literal" && Object.prototype.hasOwnProperty.call(node, "regex"); +} + +/** + * Determines whether the given node is a template literal without expressions. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a template literal without expressions. + */ +function isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; +} + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow use of the `RegExp` constructor in favor of regular expression literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-regex-literals" + }, + + schema: [ + { + type: "object", + properties: { + disallowRedundantWrapping: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.", + unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.", + unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor." + } + }, + + create(context) { + const [{ disallowRedundantWrapping = false } = {}] = context.options; + + /** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ + function isGlobalReference(node) { + const scope = context.getScope(); + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; + } + + /** + * Determines whether the given node is a String.raw`` tagged template expression + * with a static template literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is String.raw`` with a static template. + */ + function isStringRawTaggedStaticTemplateLiteral(node) { + return node.type === "TaggedTemplateExpression" && + astUtils.isSpecificMemberAccess(node.tag, "String", "raw") && + isGlobalReference(astUtils.skipChainExpression(node.tag).object) && + isStaticTemplateLiteral(node.quasi); + } + + /** + * Determines whether the given node is considered to be a static string by the logic of this rule. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a static string. + */ + function isStaticString(node) { + return isStringLiteral(node) || + isStaticTemplateLiteral(node) || + isStringRawTaggedStaticTemplateLiteral(node); + } + + /** + * Determines whether the relevant arguments of the given are all static string literals. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if all arguments are static strings. + */ + function hasOnlyStaticStringArguments(node) { + const args = node.arguments; + + if ((args.length === 1 || args.length === 2) && args.every(isStaticString)) { + return true; + } + + return false; + } + + /** + * Determines whether the arguments of the given node indicate that a regex literal is unnecessarily wrapped. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node already contains a regex literal argument. + */ + function isUnnecessarilyWrappedRegexLiteral(node) { + const args = node.arguments; + + if (args.length === 1 && isRegexLiteral(args[0])) { + return true; + } + + if (args.length === 2 && isRegexLiteral(args[0]) && isStaticString(args[1])) { + return true; + } + + return false; + } + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(node)) { + if (node.arguments.length === 2) { + context.report({ node, messageId: "unexpectedRedundantRegExpWithFlags" }); + } else { + context.report({ node, messageId: "unexpectedRedundantRegExp" }); + } + } else if (hasOnlyStaticStringArguments(node)) { + context.report({ node, messageId: "unexpectedRegExp" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-rest-params.js b/node_modules/eslint/lib/rules/prefer-rest-params.js new file mode 100644 index 0000000..3ecea73 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-rest-params.js @@ -0,0 +1,115 @@ +/** + * @fileoverview Rule to + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +/** + * Checks if the given reference is not normal member access. + * + * - arguments .... true // not member access + * - arguments[i] .... true // computed member access + * - arguments[0] .... true // computed member access + * - arguments.length .... false // normal member access + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is not normal member access. + */ +function isNotNormalMemberAccess(reference) { + const id = reference.identifier; + const parent = id.parent; + + return !( + parent.type === "MemberExpression" && + parent.object === id && + !parent.computed + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require rest parameters instead of `arguments`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-rest-params" + }, + + schema: [], + + messages: { + preferRestParams: "Use the rest parameters instead of 'arguments'." + } + }, + + create(context) { + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @returns {void} + */ + function report(reference) { + context.report({ + node: reference.identifier, + loc: reference.identifier.loc, + messageId: "preferRestParams" + }); + } + + /** + * Reports references of the implicit `arguments` variable if exist. + * @returns {void} + */ + function checkForArguments() { + const argumentsVar = getVariableOfArguments(context.getScope()); + + if (argumentsVar) { + argumentsVar + .references + .filter(isNotNormalMemberAccess) + .forEach(report); + } + } + + return { + "FunctionDeclaration:exit": checkForArguments, + "FunctionExpression:exit": checkForArguments + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-spread.js b/node_modules/eslint/lib/rules/prefer-spread.js new file mode 100644 index 0000000..d3c3c4d --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-spread.js @@ -0,0 +1,87 @@ +/** + * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.apply()` for variadic. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.apply()` for variadic. + */ +function isVariadicApplyCalling(node) { + return ( + astUtils.isSpecificMemberAccess(node.callee, null, "apply") && + node.arguments.length === 2 && + node.arguments[1].type !== "ArrayExpression" && + node.arguments[1].type !== "SpreadElement" + ); +} + +/** + * Checks whether or not `thisArg` is not changed by `.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`. + * @param {RuleContext} context The ESLint rule context object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, context) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, context); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require spread operators instead of `.apply()`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-spread" + }, + + schema: [], + fixable: null, + + messages: { + preferSpread: "Use the spread operator instead of '.apply()'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + CallExpression(node) { + if (!isVariadicApplyCalling(node)) { + return; + } + + const applied = astUtils.skipChainExpression(astUtils.skipChainExpression(node.callee).object); + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ + node, + messageId: "preferSpread" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-template.js b/node_modules/eslint/lib/rules/prefer-template.js new file mode 100644 index 0000000..e8f980e --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-template.js @@ -0,0 +1,283 @@ +/** + * @fileoverview A rule to suggest using template literals instead of string concatenation. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Gets the top binary expression node for concatenation in parents of a given node. + * @param {ASTNode} node A node to get. + * @returns {ASTNode} the top binary expression node in parents of a given node. + */ +function getTopConcatBinaryExpression(node) { + let currentNode = node; + + while (isConcatenation(currentNode.parent)) { + currentNode = currentNode.parent; + } + return currentNode; +} + +/** + * Determines whether a given node is a octal escape sequence + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is an octal escape sequence + */ +function isOctalEscapeSequence(node) { + + // No need to check TemplateLiterals – would throw error with octal escape + const isStringLiteral = node.type === "Literal" && typeof node.value === "string"; + + if (!isStringLiteral) { + return false; + } + + return astUtils.hasOctalEscapeSequence(node.raw); +} + +/** + * Checks whether or not a node contains a octal escape sequence + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node contains an octal escape sequence + */ +function hasOctalEscapeSequence(node) { + if (isConcatenation(node)) { + return hasOctalEscapeSequence(node.left) || hasOctalEscapeSequence(node.right); + } + + return isOctalEscapeSequence(node); +} + +/** + * Checks whether or not a given binary expression has string literals. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node has string literals. + */ +function hasStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasStringLiteral(node.right) || hasStringLiteral(node.left); + } + return astUtils.isStringLiteral(node); +} + +/** + * Checks whether or not a given binary expression has non string literals. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node has non string literals. + */ +function hasNonStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left); + } + return !astUtils.isStringLiteral(node); +} + +/** + * Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal. + * @param {ASTNode} node The node that will be fixed to a template literal + * @returns {boolean} `true` if the node will start with a template curly. + */ +function startsWithTemplateCurly(node) { + if (node.type === "BinaryExpression") { + return startsWithTemplateCurly(node.left); + } + if (node.type === "TemplateLiteral") { + return node.expressions.length && node.quasis.length && node.quasis[0].range[0] === node.quasis[0].range[1]; + } + return node.type !== "Literal" || typeof node.value !== "string"; +} + +/** + * Determines whether a given node end with a template curly expression (`${}`) when being converted to a template literal. + * @param {ASTNode} node The node that will be fixed to a template literal + * @returns {boolean} `true` if the node will end with a template curly. + */ +function endsWithTemplateCurly(node) { + if (node.type === "BinaryExpression") { + return startsWithTemplateCurly(node.right); + } + if (node.type === "TemplateLiteral") { + return node.expressions.length && node.quasis.length && node.quasis[node.quasis.length - 1].range[0] === node.quasis[node.quasis.length - 1].range[1]; + } + return node.type !== "Literal" || typeof node.value !== "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require template literals instead of string concatenation", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-template" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedStringConcatenation: "Unexpected string concatenation." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let done = Object.create(null); + + /** + * Gets the non-token text between two nodes, ignoring any other tokens that appear between the two tokens. + * @param {ASTNode} node1 The first node + * @param {ASTNode} node2 The second node + * @returns {string} The text between the nodes, excluding other tokens + */ + function getTextBetween(node1, node2) { + const allTokens = [node1].concat(sourceCode.getTokensBetween(node1, node2)).concat(node2); + const sourceText = sourceCode.getText(); + + return allTokens.slice(0, -1).reduce((accumulator, token, index) => accumulator + sourceText.slice(token.range[1], allTokens[index + 1].range[0]), ""); + } + + /** + * Returns a template literal form of the given node. + * @param {ASTNode} currentNode A node that should be converted to a template literal + * @param {string} textBeforeNode Text that should appear before the node + * @param {string} textAfterNode Text that should appear after the node + * @returns {string} A string form of this node, represented as a template literal + */ + function getTemplateLiteral(currentNode, textBeforeNode, textAfterNode) { + if (currentNode.type === "Literal" && typeof currentNode.value === "string") { + + /* + * If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted + * as a template placeholder. However, if the code already contains a backslash before the ${ or ` + * for some reason, don't add another backslash, because that would change the meaning of the code (it would cause + * an actual backslash character to appear before the dollar sign). + */ + return `\`${currentNode.raw.slice(1, -1).replace(/\\*(\$\{|`)/gu, matched => { + if (matched.lastIndexOf("\\") % 2) { + return `\\${matched}`; + } + return matched; + + // Unescape any quotes that appear in the original Literal that no longer need to be escaped. + }).replace(new RegExp(`\\\\${currentNode.raw[0]}`, "gu"), currentNode.raw[0])}\``; + } + + if (currentNode.type === "TemplateLiteral") { + return sourceCode.getText(currentNode); + } + + if (isConcatenation(currentNode) && hasStringLiteral(currentNode) && hasNonStringLiteral(currentNode)) { + const plusSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "+"); + const textBeforePlus = getTextBetween(currentNode.left, plusSign); + const textAfterPlus = getTextBetween(plusSign, currentNode.right); + const leftEndsWithCurly = endsWithTemplateCurly(currentNode.left); + const rightStartsWithCurly = startsWithTemplateCurly(currentNode.right); + + if (leftEndsWithCurly) { + + // If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket. + // `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */ }${baz}` + return getTemplateLiteral(currentNode.left, textBeforeNode, textBeforePlus + textAfterPlus).slice(0, -1) + + getTemplateLiteral(currentNode.right, null, textAfterNode).slice(1); + } + if (rightStartsWithCurly) { + + // Otherwise, if the right side of the expression starts with a template curly, add the text there. + // 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */ bar}baz` + return getTemplateLiteral(currentNode.left, textBeforeNode, null).slice(0, -1) + + getTemplateLiteral(currentNode.right, textBeforePlus + textAfterPlus, textAfterNode).slice(1); + } + + /* + * Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put + * the text between them. + */ + return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`; + } + + return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``; + } + + /** + * Returns a fixer object that converts a non-string binary expression to a template literal + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A node that should be converted to a template literal + * @returns {Object} A fix for this binary expression + */ + function fixNonStringBinaryExpression(fixer, node) { + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + if (hasOctalEscapeSequence(topBinaryExpr)) { + return null; + } + + return fixer.replaceText(topBinaryExpr, getTemplateLiteral(topBinaryExpr, null, null)); + } + + /** + * Reports if a given node is string concatenation with non string literals. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkForStringConcat(node) { + if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) { + return; + } + + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + // Checks whether or not this node had been checked already. + if (done[topBinaryExpr.range[0]]) { + return; + } + done[topBinaryExpr.range[0]] = true; + + if (hasNonStringLiteral(topBinaryExpr)) { + context.report({ + node: topBinaryExpr, + messageId: "unexpectedStringConcatenation", + fix: fixer => fixNonStringBinaryExpression(fixer, node) + }); + } + } + + return { + Program() { + done = Object.create(null); + }, + + Literal: checkForStringConcat, + TemplateLiteral: checkForStringConcat + }; + } +}; diff --git a/node_modules/eslint/lib/rules/quote-props.js b/node_modules/eslint/lib/rules/quote-props.js new file mode 100644 index 0000000..fab7bdc --- /dev/null +++ b/node_modules/eslint/lib/rules/quote-props.js @@ -0,0 +1,307 @@ +/** + * @fileoverview Rule to flag non-quoted property names in object literals. + * @author Mathias Bynens + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const espree = require("espree"); +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require quotes around object literal property names", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/quote-props" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + }, + { + type: "object", + properties: { + keywords: { + type: "boolean" + }, + unnecessary: { + type: "boolean" + }, + numbers: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + messages: { + requireQuotesDueToReservedWord: "Properties should be quoted as '{{property}}' is a reserved word.", + inconsistentlyQuotedProperty: "Inconsistently quoted property '{{key}}' found.", + unnecessarilyQuotedProperty: "Unnecessarily quoted property '{{property}}' found.", + unquotedReservedProperty: "Unquoted reserved word '{{property}}' used as key.", + unquotedNumericProperty: "Unquoted number literal '{{property}}' used as key.", + unquotedPropertyFound: "Unquoted property '{{property}}' found.", + redundantQuoting: "Properties shouldn't be quoted as all quotes are redundant." + } + }, + + create(context) { + + const MODE = context.options[0], + KEYWORDS = context.options[1] && context.options[1].keywords, + CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, + NUMBERS = context.options[1] && context.options[1].numbers, + + sourceCode = context.getSourceCode(); + + + /** + * Checks whether a certain string constitutes an ES3 token + * @param {string} tokenStr The string to be checked. + * @returns {boolean} `true` if it is an ES3 token. + */ + function isKeyword(tokenStr) { + return keywords.indexOf(tokenStr) >= 0; + } + + /** + * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @returns {boolean} Whether or not a key has redundant quotes. + * @private + */ + function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) { + return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length && + (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || + (tokens[0].type === "Numeric" && !skipNumberLiterals && String(+tokens[0].value) === tokens[0].value)); + } + + /** + * Returns a string representation of a property node with quotes removed + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getUnquotedKey(key) { + return key.type === "Identifier" ? key.name : key.value; + } + + /** + * Returns a string representation of a property node with quotes added + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getQuotedKey(key) { + if (key.type === "Literal" && typeof key.value === "string") { + + // If the key is already a string literal, don't replace the quotes with double quotes. + return sourceCode.getText(key); + } + + // Otherwise, the key is either an identifier or a number literal. + return `"${key.type === "Identifier" ? key.name : key.value}"`; + } + + /** + * Ensures that a property's key is quoted only when necessary + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkUnnecessaryQuotes(node) { + const key = node.key; + + if (node.method || node.computed || node.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + return; + } + + if (tokens.length !== 1) { + return; + } + + const isKeywordToken = isKeyword(tokens[0].value); + + if (isKeywordToken && KEYWORDS) { + return; + } + + if (CHECK_UNNECESSARY && areQuotesRedundant(key.value, tokens, NUMBERS)) { + context.report({ + node, + messageId: "unnecessarilyQuotedProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getUnquotedKey(key)) + }); + } + } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) { + context.report({ + node, + messageId: "unquotedReservedProperty", + data: { property: key.name }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } else if (NUMBERS && key.type === "Literal" && astUtils.isNumericLiteral(key)) { + context.report({ + node, + messageId: "unquotedNumericProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that a property's key is quoted + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkOmittedQuotes(node) { + const key = node.key; + + if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) { + context.report({ + node, + messageId: "unquotedPropertyFound", + data: { property: key.name || key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @returns {void} + */ + function checkConsistency(node, checkQuotesRedundancy) { + const quotedProps = [], + unquotedProps = []; + let keywordKeyName = null, + necessaryQuotes = false; + + node.properties.forEach(property => { + const key = property.key; + + if (!key || property.method || property.computed || property.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + + quotedProps.push(property); + + if (checkQuotesRedundancy) { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + necessaryQuotes = true; + return; + } + + necessaryQuotes = necessaryQuotes || !areQuotesRedundant(key.value, tokens) || KEYWORDS && isKeyword(tokens[0].value); + } + } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) { + unquotedProps.push(property); + necessaryQuotes = true; + keywordKeyName = key.name; + } else { + unquotedProps.push(property); + } + }); + + if (checkQuotesRedundancy && quotedProps.length && !necessaryQuotes) { + quotedProps.forEach(property => { + context.report({ + node: property, + messageId: "redundantQuoting", + fix: fixer => fixer.replaceText(property.key, getUnquotedKey(property.key)) + }); + }); + } else if (unquotedProps.length && keywordKeyName) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "requireQuotesDueToReservedWord", + data: { property: keywordKeyName }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } else if (quotedProps.length && unquotedProps.length) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "inconsistentlyQuotedProperty", + data: { key: property.key.name || property.key.value }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } + } + + return { + Property(node) { + if (MODE === "always" || !MODE) { + checkOmittedQuotes(node); + } + if (MODE === "as-needed") { + checkUnnecessaryQuotes(node); + } + }, + ObjectExpression(node) { + if (MODE === "consistent") { + checkConsistency(node, false); + } + if (MODE === "consistent-as-needed") { + checkConsistency(node, true); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/quotes.js b/node_modules/eslint/lib/rules/quotes.js new file mode 100644 index 0000000..d1f4443 --- /dev/null +++ b/node_modules/eslint/lib/rules/quotes.js @@ -0,0 +1,332 @@ +/** + * @fileoverview A rule to choose between single and double quote marks + * @author Matt DuVall , Brandon Payton + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + double: { + quote: "\"", + alternateQuote: "'", + description: "doublequote" + }, + single: { + quote: "'", + alternateQuote: "\"", + description: "singlequote" + }, + backtick: { + quote: "`", + alternateQuote: "\"", + description: "backtick" + } +}; + +// An unescaped newline is a newline preceded by an even number of backslashes. +const UNESCAPED_LINEBREAK_PATTERN = new RegExp(String.raw`(^|[^\\])(\\\\)*[${Array.from(astUtils.LINEBREAKS).join("")}]`, "u"); + +/** + * Switches quoting of javascript string between ' " and ` + * escaping and unescaping as necessary. + * Only escaping of the minimal set of characters is changed. + * Note: escaping of newlines when switching from backtick to other quotes is not handled. + * @param {string} str A string to convert. + * @returns {string} The string with changed quotes. + * @private + */ +QUOTE_SETTINGS.double.convert = +QUOTE_SETTINGS.single.convert = +QUOTE_SETTINGS.backtick.convert = function(str) { + const newQuote = this.quote; + const oldQuote = str[0]; + + if (newQuote === oldQuote) { + return str; + } + return newQuote + str.slice(1, -1).replace(/\\(\$\{|\r\n?|\n|.)|["'`]|\$\{|(\r\n?|\n)/gu, (match, escaped, newline) => { + if (escaped === oldQuote || oldQuote === "`" && escaped === "${") { + return escaped; // unescape + } + if (match === newQuote || newQuote === "`" && match === "${") { + return `\\${match}`; // escape + } + if (newline && oldQuote === "`") { + return "\\n"; // escape newlines + } + return match; + }) + newQuote; +}; + +const AVOID_ESCAPE = "avoid-escape"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the consistent use of either backticks, double, or single quotes", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/quotes" + }, + + fixable: "code", + + schema: [ + { + enum: ["single", "double", "backtick"] + }, + { + anyOf: [ + { + enum: ["avoid-escape"] + }, + { + type: "object", + properties: { + avoidEscape: { + type: "boolean" + }, + allowTemplateLiterals: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + wrongQuotes: "Strings must use {{description}}." + } + }, + + create(context) { + + const quoteOption = context.options[0], + settings = QUOTE_SETTINGS[quoteOption || "double"], + options = context.options[1], + allowTemplateLiterals = options && options.allowTemplateLiterals === true, + sourceCode = context.getSourceCode(); + let avoidEscape = options && options.avoidEscape === true; + + // deprecated + if (options === AVOID_ESCAPE) { + avoidEscape = true; + } + + /** + * Determines if a given node is part of JSX syntax. + * + * This function returns `true` in the following cases: + * + * - `
` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`. + * - `
foo
` ... If the literal is a text content, the parent of the literal is `JSXElement`. + * - `<>foo` ... If the literal is a text content, the parent of the literal is `JSXFragment`. + * + * In particular, this function returns `false` in the following cases: + * + * - `
` + * - `
{"foo"}
` + * + * In both cases, inside of the braces is handled as normal JavaScript. + * The braces are `JSXExpressionContainer` nodes. + * @param {ASTNode} node The Literal node to check. + * @returns {boolean} True if the node is a part of JSX, false if not. + * @private + */ + function isJSXLiteral(node) { + return node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment"; + } + + /** + * Checks whether or not a given node is a directive. + * The directive is a `ExpressionStatement` which has only a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a directive. + * @private + */ + function isDirective(node) { + return ( + node.type === "ExpressionStatement" && + node.expression.type === "Literal" && + typeof node.expression.value === "string" + ); + } + + /** + * Checks whether or not a given node is a part of directive prologues. + * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a part of directive prologues. + * @private + */ + function isPartOfDirectivePrologue(node) { + const block = node.parent.parent; + + if (block.type !== "Program" && (block.type !== "BlockStatement" || !astUtils.isFunction(block.parent))) { + return false; + } + + // Check the node is at a prologue. + for (let i = 0; i < block.body.length; ++i) { + const statement = block.body[i]; + + if (statement === node.parent) { + return true; + } + if (!isDirective(statement)) { + break; + } + } + + return false; + } + + /** + * Checks whether or not a given node is allowed as non backtick. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is allowed as non backtick. + * @private + */ + function isAllowedAsNonBacktick(node) { + const parent = node.parent; + + switch (parent.type) { + + // Directive Prologues. + case "ExpressionStatement": + return isPartOfDirectivePrologue(node); + + // LiteralPropertyName. + case "Property": + case "MethodDefinition": + return parent.key === node && !parent.computed; + + // ModuleSpecifier. + case "ImportDeclaration": + case "ExportNamedDeclaration": + case "ExportAllDeclaration": + return parent.source === node; + + // Others don't allow. + default: + return false; + } + } + + /** + * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings. + * @param {ASTNode} node A TemplateLiteral node to check. + * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings. + * @private + */ + function isUsingFeatureOfTemplateLiteral(node) { + const hasTag = node.parent.type === "TaggedTemplateExpression" && node === node.parent.quasi; + + if (hasTag) { + return true; + } + + const hasStringInterpolation = node.expressions.length > 0; + + if (hasStringInterpolation) { + return true; + } + + const isMultilineString = node.quasis.length >= 1 && UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw); + + if (isMultilineString) { + return true; + } + + return false; + } + + return { + + Literal(node) { + const val = node.value, + rawVal = node.raw; + + if (settings && typeof val === "string") { + let isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || + isJSXLiteral(node) || + astUtils.isSurroundedBy(rawVal, settings.quote); + + if (!isValid && avoidEscape) { + isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; + } + + if (!isValid) { + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (quoteOption === "backtick" && astUtils.hasOctalEscapeSequence(rawVal)) { + + // An octal escape sequence in a template literal would produce syntax error, even in non-strict mode. + return null; + } + + return fixer.replaceText(node, settings.convert(node.raw)); + } + }); + } + } + }, + + TemplateLiteral(node) { + + // Don't throw an error if backticks are expected or a template literal feature is in use. + if ( + allowTemplateLiterals || + quoteOption === "backtick" || + isUsingFeatureOfTemplateLiteral(node) + ) { + return; + } + + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (isPartOfDirectivePrologue(node)) { + + /* + * TemplateLiterals in a directive prologue aren't actually directives, but if they're + * in the directive prologue, then fixing them might turn them into directives and change + * the behavior of the code. + */ + return null; + } + return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/radix.js b/node_modules/eslint/lib/rules/radix.js new file mode 100644 index 0000000..e322566 --- /dev/null +++ b/node_modules/eslint/lib/rules/radix.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to flag use of parseInt without a radix argument + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const MODE_ALWAYS = "always", + MODE_AS_NEEDED = "as-needed"; + +const validRadixValues = new Set(Array.from({ length: 37 - 2 }, (_, index) => index + 2)); + +/** + * Checks whether a given variable is shadowed or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is shadowed. + */ +function isShadowed(variable) { + return variable.defs.length >= 1; +} + +/** + * Checks whether a given node is a MemberExpression of `parseInt` method or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a MemberExpression of `parseInt` + * method. + */ +function isParseIntMethod(node) { + return ( + node.type === "MemberExpression" && + !node.computed && + node.property.type === "Identifier" && + node.property.name === "parseInt" + ); +} + +/** + * Checks whether a given node is a valid value of radix or not. + * + * The following values are invalid. + * + * - A literal except integers between 2 and 36. + * - undefined. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is valid. + */ +function isValidRadix(radix) { + return !( + (radix.type === "Literal" && !validRadixValues.has(radix.value)) || + (radix.type === "Identifier" && radix.name === "undefined") + ); +} + +/** + * Checks whether a given node is a default value of radix or not. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is the literal node of `10`. + */ +function isDefaultRadix(radix) { + return radix.type === "Literal" && radix.value === 10; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the consistent use of the radix argument when using `parseInt()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/radix" + }, + + schema: [ + { + enum: ["always", "as-needed"] + } + ], + + messages: { + missingParameters: "Missing parameters.", + redundantRadix: "Redundant radix parameter.", + missingRadix: "Missing radix parameter.", + invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36." + } + }, + + create(context) { + const mode = context.options[0] || MODE_ALWAYS; + + /** + * Checks the arguments of a given CallExpression node and reports it if it + * offends this rule. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArguments(node) { + const args = node.arguments; + + switch (args.length) { + case 0: + context.report({ + node, + messageId: "missingParameters" + }); + break; + + case 1: + if (mode === MODE_ALWAYS) { + context.report({ + node, + messageId: "missingRadix" + }); + } + break; + + default: + if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) { + context.report({ + node, + messageId: "redundantRadix" + }); + } else if (!isValidRadix(args[1])) { + context.report({ + node, + messageId: "invalidRadix" + }); + } + break; + } + } + + return { + "Program:exit"() { + const scope = context.getScope(); + let variable; + + // Check `parseInt()` + variable = astUtils.getVariableByName(scope, "parseInt"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const node = reference.identifier; + + if (astUtils.isCallee(node)) { + checkArguments(node.parent); + } + }); + } + + // Check `Number.parseInt()` + variable = astUtils.getVariableByName(scope, "Number"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const node = reference.identifier.parent; + const maybeCallee = node.parent.type === "ChainExpression" + ? node.parent + : node; + + if (isParseIntMethod(node) && astUtils.isCallee(maybeCallee)) { + checkArguments(maybeCallee.parent); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-atomic-updates.js b/node_modules/eslint/lib/rules/require-atomic-updates.js new file mode 100644 index 0000000..4f6acce --- /dev/null +++ b/node_modules/eslint/lib/rules/require-atomic-updates.js @@ -0,0 +1,283 @@ +/** + * @fileoverview disallow assignments that can lead to race conditions due to usage of `await` or `yield` + * @author Teddy Katz + * @author Toru Nagashima + */ +"use strict"; + +/** + * Make the map from identifiers to each reference. + * @param {escope.Scope} scope The scope to get references. + * @param {Map} [outReferenceMap] The map from identifier nodes to each reference object. + * @returns {Map} `referenceMap`. + */ +function createReferenceMap(scope, outReferenceMap = new Map()) { + for (const reference of scope.references) { + outReferenceMap.set(reference.identifier, reference); + } + for (const childScope of scope.childScopes) { + if (childScope.type !== "function") { + createReferenceMap(childScope, outReferenceMap); + } + } + + return outReferenceMap; +} + +/** + * Get `reference.writeExpr` of a given reference. + * If it's the read reference of MemberExpression in LHS, returns RHS in order to address `a.b = await a` + * @param {escope.Reference} reference The reference to get. + * @returns {Expression|null} The `reference.writeExpr`. + */ +function getWriteExpr(reference) { + if (reference.writeExpr) { + return reference.writeExpr; + } + let node = reference.identifier; + + while (node) { + const t = node.parent.type; + + if (t === "AssignmentExpression" && node.parent.left === node) { + return node.parent.right; + } + if (t === "MemberExpression" && node.parent.object === node) { + node = node.parent; + continue; + } + + break; + } + + return null; +} + +/** + * Checks if an expression is a variable that can only be observed within the given function. + * @param {Variable|null} variable The variable to check + * @param {boolean} isMemberAccess If `true` then this is a member access. + * @returns {boolean} `true` if the variable is local to the given function, and is never referenced in a closure. + */ +function isLocalVariableWithoutEscape(variable, isMemberAccess) { + if (!variable) { + return false; // A global variable which was not defined. + } + + // If the reference is a property access and the variable is a parameter, it handles the variable is not local. + if (isMemberAccess && variable.defs.some(d => d.type === "Parameter")) { + return false; + } + + const functionScope = variable.scope.variableScope; + + return variable.references.every(reference => + reference.from.variableScope === functionScope); +} + +class SegmentInfo { + constructor() { + this.info = new WeakMap(); + } + + /** + * Initialize the segment information. + * @param {PathSegment} segment The segment to initialize. + * @returns {void} + */ + initialize(segment) { + const outdatedReadVariableNames = new Set(); + const freshReadVariableNames = new Set(); + + for (const prevSegment of segment.prevSegments) { + const info = this.info.get(prevSegment); + + if (info) { + info.outdatedReadVariableNames.forEach(Set.prototype.add, outdatedReadVariableNames); + info.freshReadVariableNames.forEach(Set.prototype.add, freshReadVariableNames); + } + } + + this.info.set(segment, { outdatedReadVariableNames, freshReadVariableNames }); + } + + /** + * Mark a given variable as read on given segments. + * @param {PathSegment[]} segments The segments that it read the variable on. + * @param {string} variableName The variable name to be read. + * @returns {void} + */ + markAsRead(segments, variableName) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariableNames.add(variableName); + } + } + } + + /** + * Move `freshReadVariableNames` to `outdatedReadVariableNames`. + * @param {PathSegment[]} segments The segments to process. + * @returns {void} + */ + makeOutdated(segments) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariableNames.forEach(Set.prototype.add, info.outdatedReadVariableNames); + info.freshReadVariableNames.clear(); + } + } + } + + /** + * Check if a given variable is outdated on the current segments. + * @param {PathSegment[]} segments The current segments. + * @param {string} variableName The variable name to check. + * @returns {boolean} `true` if the variable is outdated on the segments. + */ + isOutdated(segments, variableName) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info && info.outdatedReadVariableNames.has(variableName)) { + return true; + } + } + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignments that can lead to race conditions due to usage of `await` or `yield`", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/require-atomic-updates" + }, + + fixable: null, + schema: [], + + messages: { + nonAtomicUpdate: "Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const assignmentReferences = new Map(); + const segmentInfo = new SegmentInfo(); + let stack = null; + + return { + onCodePathStart(codePath) { + const scope = context.getScope(); + const shouldVerify = + scope.type === "function" && + (scope.block.async || scope.block.generator); + + stack = { + upper: stack, + codePath, + referenceMap: shouldVerify ? createReferenceMap(scope) : null + }; + }, + onCodePathEnd() { + stack = stack.upper; + }, + + // Initialize the segment information. + onCodePathSegmentStart(segment) { + segmentInfo.initialize(segment); + }, + + // Handle references to prepare verification. + Identifier(node) { + const { codePath, referenceMap } = stack; + const reference = referenceMap && referenceMap.get(node); + + // Ignore if this is not a valid variable reference. + if (!reference) { + return; + } + const name = reference.identifier.name; + const variable = reference.resolved; + const writeExpr = getWriteExpr(reference); + const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; + + // Add a fresh read variable. + if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { + segmentInfo.markAsRead(codePath.currentSegments, name); + } + + /* + * Register the variable to verify after ESLint traversed the `writeExpr` node + * if this reference is an assignment to a variable which is referred from other closure. + */ + if (writeExpr && + writeExpr.parent.right === writeExpr && // ← exclude variable declarations. + !isLocalVariableWithoutEscape(variable, isMemberAccess) + ) { + let refs = assignmentReferences.get(writeExpr); + + if (!refs) { + refs = []; + assignmentReferences.set(writeExpr, refs); + } + + refs.push(reference); + } + }, + + /* + * Verify assignments. + * If the reference exists in `outdatedReadVariableNames` list, report it. + */ + ":expression:exit"(node) { + const { codePath, referenceMap } = stack; + + // referenceMap exists if this is in a resumable function scope. + if (!referenceMap) { + return; + } + + // Mark the read variables on this code path as outdated. + if (node.type === "AwaitExpression" || node.type === "YieldExpression") { + segmentInfo.makeOutdated(codePath.currentSegments); + } + + // Verify. + const references = assignmentReferences.get(node); + + if (references) { + assignmentReferences.delete(node); + + for (const reference of references) { + const name = reference.identifier.name; + + if (segmentInfo.isOutdated(codePath.currentSegments, name)) { + context.report({ + node: node.parent, + messageId: "nonAtomicUpdate", + data: { + value: sourceCode.getText(node.parent.left) + } + }); + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-await.js b/node_modules/eslint/lib/rules/require-await.js new file mode 100644 index 0000000..9b5acc7 --- /dev/null +++ b/node_modules/eslint/lib/rules/require-await.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to disallow async functions which have no `await` expression. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Capitalize the 1st letter of the given text. + * @param {string} text The text to capitalize. + * @returns {string} The text that the 1st letter was capitalized. + */ +function capitalizeFirstLetter(text) { + return text[0].toUpperCase() + text.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow async functions which have no `await` expression", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/require-await" + }, + + schema: [], + + messages: { + missingAwait: "{{name}} has no 'await' expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Push the scope info object to the stack. + * @returns {void} + */ + function enterFunction() { + scopeInfo = { + upper: scopeInfo, + hasAwait: false + }; + } + + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function exitFunction(node) { + if (!node.generator && node.async && !scopeInfo.hasAwait && !astUtils.isEmptyFunction(node)) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: "missingAwait", + data: { + name: capitalizeFirstLetter( + astUtils.getFunctionNameWithKind(node) + ) + } + }); + } + + scopeInfo = scopeInfo.upper; + } + + return { + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + AwaitExpression() { + if (!scopeInfo) { + return; + } + + scopeInfo.hasAwait = true; + }, + ForOfStatement(node) { + if (!scopeInfo) { + return; + } + + if (node.await) { + scopeInfo.hasAwait = true; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-jsdoc.js b/node_modules/eslint/lib/rules/require-jsdoc.js new file mode 100644 index 0000000..e581b2b --- /dev/null +++ b/node_modules/eslint/lib/rules/require-jsdoc.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to check for jsdoc presence. + * @author Gyandeep Singh + */ +"use strict"; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require JSDoc comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/require-jsdoc" + }, + + schema: [ + { + type: "object", + properties: { + require: { + type: "object", + properties: { + ClassDeclaration: { + type: "boolean", + default: false + }, + MethodDefinition: { + type: "boolean", + default: false + }, + FunctionDeclaration: { + type: "boolean", + default: true + }, + ArrowFunctionExpression: { + type: "boolean", + default: false + }, + FunctionExpression: { + type: "boolean", + default: false + } + }, + additionalProperties: false, + default: {} + } + }, + additionalProperties: false + } + ], + + deprecated: true, + replacedBy: [], + + messages: { + missingJSDocComment: "Missing JSDoc comment." + } + }, + + create(context) { + const source = context.getSourceCode(); + const DEFAULT_OPTIONS = { + FunctionDeclaration: true, + MethodDefinition: false, + ClassDeclaration: false, + ArrowFunctionExpression: false, + FunctionExpression: false + }; + const options = Object.assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require); + + /** + * Report the error message + * @param {ASTNode} node node to report + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "missingJSDocComment" }); + } + + /** + * Check if the jsdoc comment is present or not. + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkJsDoc(node) { + const jsdocComment = source.getJSDocComment(node); + + if (!jsdocComment) { + report(node); + } + } + + return { + FunctionDeclaration(node) { + if (options.FunctionDeclaration) { + checkJsDoc(node); + } + }, + FunctionExpression(node) { + if ( + (options.MethodDefinition && node.parent.type === "MethodDefinition") || + (options.FunctionExpression && (node.parent.type === "VariableDeclarator" || (node.parent.type === "Property" && node === node.parent.value))) + ) { + checkJsDoc(node); + } + }, + ClassDeclaration(node) { + if (options.ClassDeclaration) { + checkJsDoc(node); + } + }, + ArrowFunctionExpression(node) { + if (options.ArrowFunctionExpression && node.parent.type === "VariableDeclarator") { + checkJsDoc(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-unicode-regexp.js b/node_modules/eslint/lib/rules/require-unicode-regexp.js new file mode 100644 index 0000000..880405e --- /dev/null +++ b/node_modules/eslint/lib/rules/require-unicode-regexp.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Rule to enforce the use of `u` flag on RegExp. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the use of `u` flag on RegExp", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/require-unicode-regexp" + }, + + messages: { + requireUFlag: "Use the 'u' flag." + }, + + schema: [] + }, + + create(context) { + return { + "Literal[regex]"(node) { + const flags = node.regex.flags || ""; + + if (!flags.includes("u")) { + context.report({ node, messageId: "requireUFlag" }); + } + }, + + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + RegExp: { [CALL]: true, [CONSTRUCT]: true } + }; + + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + const flagsNode = node.arguments[1]; + const flags = getStringIfConstant(flagsNode, scope); + + if (!flagsNode || (typeof flags === "string" && !flags.includes("u"))) { + context.report({ node, messageId: "requireUFlag" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-yield.js b/node_modules/eslint/lib/rules/require-yield.js new file mode 100644 index 0000000..af2344d --- /dev/null +++ b/node_modules/eslint/lib/rules/require-yield.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag the generator functions that does not have yield. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require generator functions to contain `yield`", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/require-yield" + }, + + schema: [], + + messages: { + missingYield: "This generator function does not have 'yield'." + } + }, + + create(context) { + const stack = []; + + /** + * If the node is a generator function, start counting `yield` keywords. + * @param {Node} node A function node to check. + * @returns {void} + */ + function beginChecking(node) { + if (node.generator) { + stack.push(0); + } + } + + /** + * If the node is a generator function, end counting `yield` keywords, then + * reports result. + * @param {Node} node A function node to check. + * @returns {void} + */ + function endChecking(node) { + if (!node.generator) { + return; + } + + const countYield = stack.pop(); + + if (countYield === 0 && node.body.body.length > 0) { + context.report({ node, messageId: "missingYield" }); + } + } + + return { + FunctionDeclaration: beginChecking, + "FunctionDeclaration:exit": endChecking, + FunctionExpression: beginChecking, + "FunctionExpression:exit": endChecking, + + // Increases the count of `yield` keyword. + YieldExpression() { + + /* istanbul ignore else */ + if (stack.length > 0) { + stack[stack.length - 1] += 1; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/rest-spread-spacing.js b/node_modules/eslint/lib/rules/rest-spread-spacing.js new file mode 100644 index 0000000..8cb9814 --- /dev/null +++ b/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Enforce spacing between rest and spread operators and their expressions. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce spacing between rest and spread operators and their expressions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/rest-spread-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + + messages: { + unexpectedWhitespace: "Unexpected whitespace after {{type}} operator.", + expectedWhitespace: "Expected whitespace after {{type}} operator." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + alwaysSpace = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whitespace between rest/spread operators and their expressions + * @param {ASTNode} node The node to check + * @returns {void} + */ + function checkWhiteSpace(node) { + const operator = sourceCode.getFirstToken(node), + nextToken = sourceCode.getTokenAfter(operator), + hasWhitespace = sourceCode.isSpaceBetweenTokens(operator, nextToken); + let type; + + switch (node.type) { + case "SpreadElement": + type = "spread"; + if (node.parent.type === "ObjectExpression") { + type += " property"; + } + break; + case "RestElement": + type = "rest"; + if (node.parent.type === "ObjectPattern") { + type += " property"; + } + break; + case "ExperimentalSpreadProperty": + type = "spread property"; + break; + case "ExperimentalRestProperty": + type = "rest property"; + break; + default: + return; + } + + if (alwaysSpace && !hasWhitespace) { + context.report({ + node, + loc: operator.loc, + messageId: "expectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.replaceTextRange([operator.range[1], nextToken.range[0]], " "); + } + }); + } else if (!alwaysSpace && hasWhitespace) { + context.report({ + node, + loc: { + start: operator.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.removeRange([operator.range[1], nextToken.range[0]]); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + SpreadElement: checkWhiteSpace, + RestElement: checkWhiteSpace, + ExperimentalSpreadProperty: checkWhiteSpace, + ExperimentalRestProperty: checkWhiteSpace + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi-spacing.js b/node_modules/eslint/lib/rules/semi-spacing.js new file mode 100644 index 0000000..5c546f2 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi-spacing.js @@ -0,0 +1,244 @@ +/** + * @fileoverview Validates spacing before and after semicolon + * @author Mathias Schreck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after semicolons", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedWhitespaceBefore: "Unexpected whitespace before semicolon.", + unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.", + missingWhitespaceBefore: "Missing whitespace before semicolon.", + missingWhitespaceAfter: "Missing whitespace after semicolon." + } + }, + + create(context) { + + const config = context.options[0], + sourceCode = context.getSourceCode(); + let requireSpaceBefore = false, + requireSpaceAfter = true; + + if (typeof config === "object") { + requireSpaceBefore = config.before; + requireSpaceAfter = config.after; + } + + /** + * Checks if a given token has leading whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has leading space, false if not. + */ + function hasLeadingSpace(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token); + } + + /** + * Checks if a given token has trailing whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has trailing space, false if not. + */ + function hasTrailingSpace(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); + } + + /** + * Checks if the given token is the last token in its line. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the last in its line. + */ + function isLastTokenInCurrentLine(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)); + } + + /** + * Checks if the given token is the first token in its line + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the first in its line. + */ + function isFirstTokenInCurrentLine(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)); + } + + /** + * Checks if the next token of a given token is a closing parenthesis. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis. + */ + function isBeforeClosingParen(token) { + const nextToken = sourceCode.getTokenAfter(token); + + return (nextToken && astUtils.isClosingBraceToken(nextToken) || astUtils.isClosingParenToken(nextToken)); + } + + /** + * Report location example : + * + * for unexpected space `before` + * + * var a = 'b' ; + * ^^^ + * + * for unexpected space `after` + * + * var a = 'b'; c = 10; + * ^^ + * + * Reports if the given token has invalid spacing. + * @param {Token} token The semicolon token to check. + * @param {ASTNode} node The corresponding node of the token. + * @returns {void} + */ + function checkSemicolonSpacing(token, node) { + if (astUtils.isSemicolonToken(token)) { + if (hasLeadingSpace(token)) { + if (!requireSpaceBefore) { + const tokenBefore = sourceCode.getTokenBefore(token); + const loc = { + start: tokenBefore.loc.end, + end: token.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceBefore", + fix(fixer) { + + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + } else { + if (requireSpaceBefore) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceBefore", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { + if (hasTrailingSpace(token)) { + if (!requireSpaceAfter) { + const tokenAfter = sourceCode.getTokenAfter(token); + const loc = { + start: token.loc.end, + end: tokenAfter.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceAfter", + fix(fixer) { + + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + } else { + if (requireSpaceAfter) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceAfter", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + } + } + } + + /** + * Checks the spacing of the semicolon with the assumption that the last token is the semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + const token = sourceCode.getLastToken(node); + + checkSemicolonSpacing(token, node); + } + + return { + VariableDeclaration: checkNode, + ExpressionStatement: checkNode, + BreakStatement: checkNode, + ContinueStatement: checkNode, + DebuggerStatement: checkNode, + DoWhileStatement: checkNode, + ReturnStatement: checkNode, + ThrowStatement: checkNode, + ImportDeclaration: checkNode, + ExportNamedDeclaration: checkNode, + ExportAllDeclaration: checkNode, + ExportDefaultDeclaration: checkNode, + ForStatement(node) { + if (node.init) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.init), node); + } + + if (node.test) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi-style.js b/node_modules/eslint/lib/rules/semi-style.js new file mode 100644 index 0000000..0c9bec4 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi-style.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Rule to enforce location of semicolons. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const SELECTOR = `:matches(${ + [ + "BreakStatement", "ContinueStatement", "DebuggerStatement", + "DoWhileStatement", "ExportAllDeclaration", + "ExportDefaultDeclaration", "ExportNamedDeclaration", + "ExpressionStatement", "ImportDeclaration", "ReturnStatement", + "ThrowStatement", "VariableDeclaration" + ].join(",") +})`; + +/** + * Get the child node list of a given node. + * This returns `Program#body`, `BlockStatement#body`, or `SwitchCase#consequent`. + * This is used to check whether a node is the first/last child. + * @param {Node} node A node to get child node list. + * @returns {Node[]|null} The child node list. + */ +function getChildren(node) { + const t = node.type; + + if (t === "BlockStatement" || t === "Program") { + return node.body; + } + if (t === "SwitchCase") { + return node.consequent; + } + return null; +} + +/** + * Check whether a given node is the last statement in the parent block. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is the last statement in the parent block. + */ +function isLastChild(node) { + const t = node.parent.type; + + if (t === "IfStatement" && node.parent.consequent === node && node.parent.alternate) { // before `else` keyword. + return true; + } + if (t === "DoWhileStatement") { // before `while` keyword. + return true; + } + const nodeList = getChildren(node.parent); + + return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc. +} + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce location of semicolons", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi-style" + }, + + schema: [{ enum: ["last", "first"] }], + fixable: "whitespace", + + messages: { + expectedSemiColon: "Expected this semicolon to be at {{pos}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "last"; + + /** + * Check the given semicolon token. + * @param {Token} semiToken The semicolon token to check. + * @param {"first"|"last"} expected The expected location to check. + * @returns {void} + */ + function check(semiToken, expected) { + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const prevIsSameLine = !prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken); + const nextIsSameLine = !nextToken || astUtils.isTokenOnSameLine(semiToken, nextToken); + + if ((expected === "last" && !prevIsSameLine) || (expected === "first" && !nextIsSameLine)) { + context.report({ + loc: semiToken.loc, + messageId: "expectedSemiColon", + data: { + pos: (expected === "last") + ? "the end of the previous line" + : "the beginning of the next line" + }, + fix(fixer) { + if (prevToken && nextToken && sourceCode.commentsExistBetween(prevToken, nextToken)) { + return null; + } + + const start = prevToken ? prevToken.range[1] : semiToken.range[0]; + const end = nextToken ? nextToken.range[0] : semiToken.range[1]; + const text = (expected === "last") ? ";\n" : "\n;"; + + return fixer.replaceTextRange([start, end], text); + } + }); + } + } + + return { + [SELECTOR](node) { + if (option === "first" && isLastChild(node)) { + return; + } + + const lastToken = sourceCode.getLastToken(node); + + if (astUtils.isSemicolonToken(lastToken)) { + check(lastToken, option); + } + }, + + ForStatement(node) { + const firstSemi = node.init && sourceCode.getTokenAfter(node.init, astUtils.isSemicolonToken); + const secondSemi = node.test && sourceCode.getTokenAfter(node.test, astUtils.isSemicolonToken); + + if (firstSemi) { + check(firstSemi, "last"); + } + if (secondSemi) { + check(secondSemi, "last"); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi.js b/node_modules/eslint/lib/rules/semi.js new file mode 100644 index 0000000..d2f0670 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi.js @@ -0,0 +1,336 @@ +/** + * @fileoverview Rule to flag missing semicolons. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow semicolons instead of ASI", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + beforeStatementContinuationChars: { + enum: ["always", "any", "never"] + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + omitLastInOneLineBlock: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + missingSemi: "Missing semicolon.", + extraSemi: "Extra semicolon." + } + }, + + create(context) { + + const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-` + const options = context.options[1]; + const never = context.options[0] === "never"; + const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); + const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars || "any"; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports a semicolon error with appropriate location and message. + * @param {ASTNode} node The node with an extra or missing semicolon. + * @param {boolean} missing True if the semicolon is missing. + * @returns {void} + */ + function report(node, missing) { + const lastToken = sourceCode.getLastToken(node); + let messageId, + fix, + loc; + + if (!missing) { + messageId = "missingSemi"; + loc = { + start: lastToken.loc.end, + end: astUtils.getNextLocation(sourceCode, lastToken.loc.end) + }; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + messageId = "extraSemi"; + loc = lastToken.loc; + fix = function(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with no-extra-semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, sourceCode) + .retainSurroundingTokens(lastToken) + .remove(lastToken); + }; + } + + context.report({ + node, + loc, + messageId, + fix + }); + + } + + /** + * Check whether a given semicolon token is redundant. + * @param {Token} semiToken A semicolon token to check. + * @returns {boolean} `true` if the next token is `;` or `}`. + */ + function isRedundantSemi(semiToken) { + const nextToken = sourceCode.getTokenAfter(semiToken); + + return ( + !nextToken || + astUtils.isClosingBraceToken(nextToken) || + astUtils.isSemicolonToken(nextToken) + ); + } + + /** + * Check whether a given token is the closing brace of an arrow function. + * @param {Token} lastToken A token to check. + * @returns {boolean} `true` if the token is the closing brace of an arrow function. + */ + function isEndOfArrowBlock(lastToken) { + if (!astUtils.isClosingBraceToken(lastToken)) { + return false; + } + const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]); + + return ( + node.type === "BlockStatement" && + node.parent.type === "ArrowFunctionExpression" + ); + } + + /** + * Check whether a given node is on the same line with the next token. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node is on the same line with the next token. + */ + function isOnSameLineWithNextToken(node) { + const prevToken = sourceCode.getLastToken(node, 1); + const nextToken = sourceCode.getTokenAfter(node); + + return !!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken); + } + + /** + * Check whether a given node can connect the next line if the next line is unreliable. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node can connect the next line. + */ + function maybeAsiHazardAfter(node) { + const t = node.type; + + if (t === "DoWhileStatement" || + t === "BreakStatement" || + t === "ContinueStatement" || + t === "DebuggerStatement" || + t === "ImportDeclaration" || + t === "ExportAllDeclaration" + ) { + return false; + } + if (t === "ReturnStatement") { + return Boolean(node.argument); + } + if (t === "ExportNamedDeclaration") { + return Boolean(node.declaration); + } + if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) { + return false; + } + + return true; + } + + /** + * Check whether a given token can connect the previous statement. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is one of `[`, `(`, `/`, `+`, `-`, ```, `++`, and `--`. + */ + function maybeAsiHazardBefore(token) { + return ( + Boolean(token) && + OPT_OUT_PATTERN.test(token.value) && + token.value !== "++" && + token.value !== "--" + ); + } + + /** + * Check if the semicolon of a given node is unnecessary, only true if: + * - next token is a valid statement divider (`;` or `}`). + * - next token is on a new line and the node is not connectable to the new line. + * @param {Node} node A statement node to check. + * @returns {boolean} whether the semicolon is unnecessary. + */ + function canRemoveSemicolon(node) { + if (isRedundantSemi(sourceCode.getLastToken(node))) { + return true; // `;;` or `;}` + } + if (isOnSameLineWithNextToken(node)) { + return false; // One liner. + } + if (beforeStatementContinuationChars === "never" && !maybeAsiHazardAfter(node)) { + return true; // ASI works. This statement doesn't connect to the next. + } + if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + return true; // ASI works. The next token doesn't connect to this statement. + } + + return false; + } + + /** + * Checks a node to see if it's in a one-liner block statement. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is in a one-liner block statement. + */ + function isOneLinerBlock(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + return ( + !!parent && + parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line + ); + } + + /** + * Checks a node to see if it's followed by a semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolon(node) { + const isSemi = astUtils.isSemicolonToken(sourceCode.getLastToken(node)); + + if (never) { + if (isSemi && canRemoveSemicolon(node)) { + report(node, true); + } else if (!isSemi && beforeStatementContinuationChars === "always" && maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + report(node); + } + } else { + const oneLinerBlock = (exceptOneLine && isOneLinerBlock(node)); + + if (isSemi && oneLinerBlock) { + report(node, true); + } else if (!isSemi && !oneLinerBlock) { + report(node); + } + } + } + + /** + * Checks to see if there's a semicolon after a variable declaration. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolonForVariableDeclaration(node) { + const parent = node.parent; + + if ((parent.type !== "ForStatement" || parent.init !== node) && + (!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node) + ) { + checkForSemicolon(node); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForSemicolonForVariableDeclaration, + ExpressionStatement: checkForSemicolon, + ReturnStatement: checkForSemicolon, + ThrowStatement: checkForSemicolon, + DoWhileStatement: checkForSemicolon, + DebuggerStatement: checkForSemicolon, + BreakStatement: checkForSemicolon, + ContinueStatement: checkForSemicolon, + ImportDeclaration: checkForSemicolon, + ExportAllDeclaration: checkForSemicolon, + ExportNamedDeclaration(node) { + if (!node.declaration) { + checkForSemicolon(node); + } + }, + ExportDefaultDeclaration(node) { + if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) { + checkForSemicolon(node); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/sort-imports.js b/node_modules/eslint/lib/rules/sort-imports.js new file mode 100644 index 0000000..4c3ddec --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-imports.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Rule to require sorting of import declarations + * @author Christian Schuller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce sorted import declarations within modules", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/sort-imports" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean", + default: false + }, + memberSyntaxSortOrder: { + type: "array", + items: { + enum: ["none", "all", "multiple", "single"] + }, + uniqueItems: true, + minItems: 4, + maxItems: 4 + }, + ignoreDeclarationSort: { + type: "boolean", + default: false + }, + ignoreMemberSort: { + type: "boolean", + default: false + }, + allowSeparatedGroups: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortImportsAlphabetically: "Imports should be sorted alphabetically.", + sortMembersAlphabetically: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.", + unexpectedSyntaxOrder: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax." + } + }, + + create(context) { + + const configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + ignoreDeclarationSort = configuration.ignoreDeclarationSort || false, + ignoreMemberSort = configuration.ignoreMemberSort || false, + memberSyntaxSortOrder = configuration.memberSyntaxSortOrder || ["none", "all", "multiple", "single"], + allowSeparatedGroups = configuration.allowSeparatedGroups || false, + sourceCode = context.getSourceCode(); + let previousDeclaration = null; + + /** + * Gets the used member syntax style. + * + * import "my-module.js" --> none + * import * as myModule from "my-module.js" --> all + * import {myMember} from "my-module.js" --> single + * import {foo, bar} from "my-module.js" --> multiple + * @param {ASTNode} node the ImportDeclaration node. + * @returns {string} used member parameter style, ["all", "multiple", "single"] + */ + function usedMemberSyntax(node) { + if (node.specifiers.length === 0) { + return "none"; + } + if (node.specifiers[0].type === "ImportNamespaceSpecifier") { + return "all"; + } + if (node.specifiers.length === 1) { + return "single"; + } + return "multiple"; + + } + + /** + * Gets the group by member parameter index for given declaration. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {number} the declaration group by member index. + */ + function getMemberParameterGroupIndex(node) { + return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node)); + } + + /** + * Gets the local name of the first imported module. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {?string} the local name of the first imported module. + */ + function getFirstLocalMemberName(node) { + if (node.specifiers[0]) { + return node.specifiers[0].local.name; + } + return null; + + } + + /** + * Calculates number of lines between two nodes. It is assumed that the given `left` node appears before + * the given `right` node in the source code. Lines are counted from the end of the `left` node till the + * start of the `right` node. If the given nodes are on the same line, it returns `0`, same as if they were + * on two consecutive lines. + * @param {ASTNode} left node that appears before the given `right` node. + * @param {ASTNode} right node that appears after the given `left` node. + * @returns {number} number of lines between nodes. + */ + function getNumberOfLinesBetween(left, right) { + return Math.max(right.loc.start.line - left.loc.end.line - 1, 0); + } + + return { + ImportDeclaration(node) { + if (!ignoreDeclarationSort) { + if ( + previousDeclaration && + allowSeparatedGroups && + getNumberOfLinesBetween(previousDeclaration, node) > 0 + ) { + + // reset declaration sort + previousDeclaration = null; + } + + if (previousDeclaration) { + const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node), + previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); + let currentLocalMemberName = getFirstLocalMemberName(node), + previousLocalMemberName = getFirstLocalMemberName(previousDeclaration); + + if (ignoreCase) { + previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase(); + currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase(); + } + + /* + * When the current declaration uses a different member syntax, + * then check if the ordering is correct. + * Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name. + */ + if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) { + if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) { + context.report({ + node, + messageId: "unexpectedSyntaxOrder", + data: { + syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex], + syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex] + } + }); + } + } else { + if (previousLocalMemberName && + currentLocalMemberName && + currentLocalMemberName < previousLocalMemberName + ) { + context.report({ + node, + messageId: "sortImportsAlphabetically" + }); + } + } + } + + previousDeclaration = node; + } + + if (!ignoreMemberSort) { + const importSpecifiers = node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"); + const getSortableName = ignoreCase ? specifier => specifier.local.name.toLowerCase() : specifier => specifier.local.name; + const firstUnsortedIndex = importSpecifiers.map(getSortableName).findIndex((name, index, array) => array[index - 1] > name); + + if (firstUnsortedIndex !== -1) { + context.report({ + node: importSpecifiers[firstUnsortedIndex], + messageId: "sortMembersAlphabetically", + data: { memberName: importSpecifiers[firstUnsortedIndex].local.name }, + fix(fixer) { + if (importSpecifiers.some(specifier => + sourceCode.getCommentsBefore(specifier).length || sourceCode.getCommentsAfter(specifier).length)) { + + // If there are comments in the ImportSpecifier list, don't rearrange the specifiers. + return null; + } + + return fixer.replaceTextRange( + [importSpecifiers[0].range[0], importSpecifiers[importSpecifiers.length - 1].range[1]], + importSpecifiers + + // Clone the importSpecifiers array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((specifierA, specifierB) => { + const aName = getSortableName(specifierA); + const bName = getSortableName(specifierB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of import specifiers and the text between the originals + .reduce((sourceText, specifier, index) => { + const textAfterSpecifier = index === importSpecifiers.length - 1 + ? "" + : sourceCode.getText().slice(importSpecifiers[index].range[1], importSpecifiers[index + 1].range[0]); + + return sourceText + sourceCode.getText(specifier) + textAfterSpecifier; + }, "") + ); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/sort-keys.js b/node_modules/eslint/lib/rules/sort-keys.js new file mode 100644 index 0000000..8a95ee2 --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-keys.js @@ -0,0 +1,187 @@ +/** + * @fileoverview Rule to require object keys to be sorted + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + naturalCompare = require("natural-compare"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the property name of the given `Property` node. + * + * - If the property's key is an `Identifier` node, this returns the key's name + * whether it's a computed property or not. + * - If the property has a static name, this returns the static name. + * - Otherwise, this returns null. + * @param {ASTNode} node The `Property` node to get. + * @returns {string|null} The property name or null. + * @private + */ +function getPropertyName(node) { + const staticName = astUtils.getStaticPropertyName(node); + + if (staticName !== null) { + return staticName; + } + + return node.key.name || null; +} + +/** + * Functions which check that the given 2 names are in specific order. + * + * Postfix `I` is meant insensitive. + * Postfix `N` is meant natural. + * @private + */ +const isValidOrders = { + asc(a, b) { + return a <= b; + }, + ascI(a, b) { + return a.toLowerCase() <= b.toLowerCase(); + }, + ascN(a, b) { + return naturalCompare(a, b) <= 0; + }, + ascIN(a, b) { + return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0; + }, + desc(a, b) { + return isValidOrders.asc(b, a); + }, + descI(a, b) { + return isValidOrders.ascI(b, a); + }, + descN(a, b) { + return isValidOrders.ascN(b, a); + }, + descIN(a, b) { + return isValidOrders.ascIN(b, a); + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require object keys to be sorted", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/sort-keys" + }, + + schema: [ + { + enum: ["asc", "desc"] + }, + { + type: "object", + properties: { + caseSensitive: { + type: "boolean", + default: true + }, + natural: { + type: "boolean", + default: false + }, + minKeys: { + type: "integer", + minimum: 2, + default: 2 + } + }, + additionalProperties: false + } + ], + + messages: { + sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'." + } + }, + + create(context) { + + // Parse options. + const order = context.options[0] || "asc"; + const options = context.options[1]; + const insensitive = options && options.caseSensitive === false; + const natural = options && options.natural; + const minKeys = options && options.minKeys; + const isValidOrder = isValidOrders[ + order + (insensitive ? "I" : "") + (natural ? "N" : "") + ]; + + // The stack to save the previous property's name for each object literals. + let stack = null; + + return { + ObjectExpression(node) { + stack = { + upper: stack, + prevName: null, + numKeys: node.properties.length + }; + }, + + "ObjectExpression:exit"() { + stack = stack.upper; + }, + + SpreadElement(node) { + if (node.parent.type === "ObjectExpression") { + stack.prevName = null; + } + }, + + Property(node) { + if (node.parent.type === "ObjectPattern") { + return; + } + + const prevName = stack.prevName; + const numKeys = stack.numKeys; + const thisName = getPropertyName(node); + + if (thisName !== null) { + stack.prevName = thisName; + } + + if (prevName === null || thisName === null || numKeys < minKeys) { + return; + } + + if (!isValidOrder(prevName, thisName)) { + context.report({ + node, + loc: node.key.loc, + messageId: "sortKeys", + data: { + thisName, + prevName, + order, + insensitive: insensitive ? "insensitive " : "", + natural: natural ? "natural " : "" + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/sort-vars.js b/node_modules/eslint/lib/rules/sort-vars.js new file mode 100644 index 0000000..7add2cf --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-vars.js @@ -0,0 +1,104 @@ +/** + * @fileoverview Rule to require sorting of variables within a single Variable Declaration block + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require variables within the same declaration block to be sorted", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/sort-vars" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortVars: "Variables within the same declaration block should be sorted alphabetically." + } + }, + + create(context) { + + const configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + sourceCode = context.getSourceCode(); + + return { + VariableDeclaration(node) { + const idDeclarations = node.declarations.filter(decl => decl.id.type === "Identifier"); + const getSortableName = ignoreCase ? decl => decl.id.name.toLowerCase() : decl => decl.id.name; + const unfixable = idDeclarations.some(decl => decl.init !== null && decl.init.type !== "Literal"); + let fixed = false; + + idDeclarations.slice(1).reduce((memo, decl) => { + const lastVariableName = getSortableName(memo), + currentVariableName = getSortableName(decl); + + if (currentVariableName < lastVariableName) { + context.report({ + node: decl, + messageId: "sortVars", + fix(fixer) { + if (unfixable || fixed) { + return null; + } + return fixer.replaceTextRange( + [idDeclarations[0].range[0], idDeclarations[idDeclarations.length - 1].range[1]], + idDeclarations + + // Clone the idDeclarations array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((declA, declB) => { + const aName = getSortableName(declA); + const bName = getSortableName(declB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of identifier declarations and the text between the originals + .reduce((sourceText, identifier, index) => { + const textAfterIdentifier = index === idDeclarations.length - 1 + ? "" + : sourceCode.getText().slice(idDeclarations[index].range[1], idDeclarations[index + 1].range[0]); + + return sourceText + sourceCode.getText(identifier) + textAfterIdentifier; + }, "") + + ); + } + }); + fixed = true; + return memo; + } + return decl; + + }, idDeclarations[0]); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-before-blocks.js b/node_modules/eslint/lib/rules/space-before-blocks.js new file mode 100644 index 0000000..9b56481 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-before-blocks.js @@ -0,0 +1,164 @@ +/** + * @fileoverview A rule to ensure whitespace before blocks. + * @author Mathias Schreck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-before-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + keywords: { + enum: ["always", "never", "off"] + }, + functions: { + enum: ["always", "never", "off"] + }, + classes: { + enum: ["always", "never", "off"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before opening brace.", + missingSpace: "Missing space before opening brace." + } + }, + + create(context) { + const config = context.options[0], + sourceCode = context.getSourceCode(); + let alwaysFunctions = true, + alwaysKeywords = true, + alwaysClasses = true, + neverFunctions = false, + neverKeywords = false, + neverClasses = false; + + if (typeof config === "object") { + alwaysFunctions = config.functions === "always"; + alwaysKeywords = config.keywords === "always"; + alwaysClasses = config.classes === "always"; + neverFunctions = config.functions === "never"; + neverKeywords = config.keywords === "never"; + neverClasses = config.classes === "never"; + } else if (config === "never") { + alwaysFunctions = false; + alwaysKeywords = false; + alwaysClasses = false; + neverFunctions = true; + neverKeywords = true; + neverClasses = true; + } + + /** + * Checks whether or not a given token is an arrow operator (=>) or a keyword + * in order to avoid to conflict with `arrow-spacing` and `keyword-spacing`. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is an arrow operator. + */ + function isConflicted(token) { + return (token.type === "Punctuator" && token.value === "=>") || token.type === "Keyword"; + } + + /** + * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line. + * @param {ASTNode|Token} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPrecedingSpace(node) { + const precedingToken = sourceCode.getTokenBefore(node); + + if (precedingToken && !isConflicted(precedingToken) && astUtils.isTokenOnSameLine(precedingToken, node)) { + const hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); + const parent = context.getAncestors().pop(); + let requireSpace; + let requireNoSpace; + + if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration") { + requireSpace = alwaysFunctions; + requireNoSpace = neverFunctions; + } else if (node.type === "ClassBody") { + requireSpace = alwaysClasses; + requireNoSpace = neverClasses; + } else { + requireSpace = alwaysKeywords; + requireNoSpace = neverKeywords; + } + + if (requireSpace && !hasSpace) { + context.report({ + node, + messageId: "missingSpace", + fix(fixer) { + return fixer.insertTextBefore(node, " "); + } + }); + } else if (requireNoSpace && hasSpace) { + context.report({ + node, + messageId: "unexpectedSpace", + fix(fixer) { + return fixer.removeRange([precedingToken.range[1], node.range[0]]); + } + }); + } + } + } + + /** + * Checks if the CaseBlock of an given SwitchStatement node has a preceding space. + * @param {ASTNode} node The node of a SwitchStatement. + * @returns {void} undefined. + */ + function checkSpaceBeforeCaseBlock(node) { + const cases = node.cases; + let openingBrace; + + if (cases.length > 0) { + openingBrace = sourceCode.getTokenBefore(cases[0]); + } else { + openingBrace = sourceCode.getLastToken(node, 1); + } + + checkPrecedingSpace(openingBrace); + } + + return { + BlockStatement: checkPrecedingSpace, + ClassBody: checkPrecedingSpace, + SwitchStatement: checkSpaceBeforeCaseBlock + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/space-before-function-paren.js b/node_modules/eslint/lib/rules/space-before-function-paren.js new file mode 100644 index 0000000..1021a11 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -0,0 +1,164 @@ +/** + * @fileoverview Rule to validate spacing before function paren. + * @author Mathias Schreck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before `function` definition opening parenthesis", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-before-function-paren" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + anonymous: { + enum: ["always", "never", "ignore"] + }, + named: { + enum: ["always", "never", "ignore"] + }, + asyncArrow: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before function parentheses.", + missingSpace: "Missing space before function parentheses." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const baseConfig = typeof context.options[0] === "string" ? context.options[0] : "always"; + const overrideConfig = typeof context.options[0] === "object" ? context.options[0] : {}; + + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction(node) { + if (node.id) { + return true; + } + + const parent = node.parent; + + return parent.type === "MethodDefinition" || + (parent.type === "Property" && + ( + parent.kind === "get" || + parent.kind === "set" || + parent.method + ) + ); + } + + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction(node) { + if (node.type === "ArrowFunctionExpression") { + + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if (node.async && astUtils.isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 }))) { + return overrideConfig.asyncArrow || baseConfig; + } + } else if (isNamedFunction(node)) { + return overrideConfig.named || baseConfig; + + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } else if (!node.generator) { + return overrideConfig.anonymous || baseConfig; + } + + return "ignore"; + } + + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction(node) { + const functionConfig = getConfigForFunction(node); + + if (functionConfig === "ignore") { + return; + } + + const rightToken = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const leftToken = sourceCode.getTokenBefore(rightToken); + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + + if (hasSpacing && functionConfig === "never") { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedSpace", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(rightToken); + + // Don't fix anything if there's a single line comment between the left and the right token + if (comments.some(comment => comment.type === "Line")) { + return null; + } + return fixer.replaceTextRange( + [leftToken.range[1], rightToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!hasSpacing && functionConfig === "always") { + context.report({ + node, + loc: rightToken.loc, + messageId: "missingSpace", + fix: fixer => fixer.insertTextAfter(leftToken, " ") + }); + } + } + + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-in-parens.js b/node_modules/eslint/lib/rules/space-in-parens.js new file mode 100644 index 0000000..b0a604d --- /dev/null +++ b/node_modules/eslint/lib/rules/space-in-parens.js @@ -0,0 +1,282 @@ +/** + * @fileoverview Disallows or enforces spaces inside of parentheses. + * @author Jonathan Rajavuori + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside parentheses", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-in-parens" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: ["{}", "[]", "()", "empty"] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + missingOpeningSpace: "There must be a space after this paren.", + missingClosingSpace: "There must be a space before this paren.", + rejectedOpeningSpace: "There should be no space after this paren.", + rejectedClosingSpace: "There should be no space before this paren." + } + }, + + create(context) { + const ALWAYS = context.options[0] === "always", + exceptionsArrayOptions = (context.options[1] && context.options[1].exceptions) || [], + options = {}; + + let exceptions; + + if (exceptionsArrayOptions.length) { + options.braceException = exceptionsArrayOptions.includes("{}"); + options.bracketException = exceptionsArrayOptions.includes("[]"); + options.parenException = exceptionsArrayOptions.includes("()"); + options.empty = exceptionsArrayOptions.includes("empty"); + } + + /** + * Produces an object with the opener and closer exception values + * @returns {Object} `openers` and `closers` exception values + * @private + */ + function getExceptions() { + const openers = [], + closers = []; + + if (options.braceException) { + openers.push("{"); + closers.push("}"); + } + + if (options.bracketException) { + openers.push("["); + closers.push("]"); + } + + if (options.parenException) { + openers.push("("); + closers.push(")"); + } + + if (options.empty) { + openers.push(")"); + closers.push("("); + } + + return { + openers, + closers + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + const sourceCode = context.getSourceCode(); + + /** + * Determines if a token is one of the exceptions for the opener paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the opener paren + */ + function isOpenerException(token) { + return exceptions.openers.includes(token.value); + } + + /** + * Determines if a token is one of the exceptions for the closer paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the closer paren + */ + function isCloserException(token) { + return exceptions.closers.includes(token.value); + } + + /** + * Determines if an opening paren is immediately followed by a required space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren is missing a required space + */ + function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) { + if (sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (!options.empty && astUtils.isClosingParenToken(tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return !isOpenerException(tokenAfterOpeningParen); + } + return isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if an opening paren is immediately followed by a disallowed space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren has a disallowed space + */ + function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) { + if (!astUtils.isTokenOnSameLine(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (tokenAfterOpeningParen.type === "Line") { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return isOpenerException(tokenAfterOpeningParen); + } + return !isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if a closing paren is immediately preceded by a required space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren is missing a required space + */ + function closerMissingSpace(tokenBeforeClosingParen, closingParenToken) { + if (sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!options.empty && astUtils.isOpeningParenToken(tokenBeforeClosingParen)) { + return false; + } + + if (ALWAYS) { + return !isCloserException(tokenBeforeClosingParen); + } + return isCloserException(tokenBeforeClosingParen); + } + + /** + * Determines if a closer paren is immediately preceded by a disallowed space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren has a disallowed space + */ + function closerRejectsSpace(tokenBeforeClosingParen, closingParenToken) { + if (!astUtils.isTokenOnSameLine(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (ALWAYS) { + return isCloserException(tokenBeforeClosingParen); + } + return !isCloserException(tokenBeforeClosingParen); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkParenSpaces(node) { + exceptions = getExceptions(); + const tokens = sourceCode.tokensAndComments; + + tokens.forEach((token, i) => { + const prevToken = tokens[i - 1]; + const nextToken = tokens[i + 1]; + + // if token is not an opening or closing paren token, do nothing + if (!astUtils.isOpeningParenToken(token) && !astUtils.isClosingParenToken(token)) { + return; + } + + // if token is an opening paren and is not followed by a required space + if (token.value === "(" && openerMissingSpace(token, nextToken)) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningSpace", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + // if token is an opening paren and is followed by a disallowed space + if (token.value === "(" && openerRejectsSpace(token, nextToken)) { + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "rejectedOpeningSpace", + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + // if token is a closing paren and is not preceded by a required space + if (token.value === ")" && closerMissingSpace(prevToken, token)) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingSpace", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + // if token is a closing paren and is preceded by a disallowed space + if (token.value === ")" && closerRejectsSpace(prevToken, token)) { + context.report({ + node, + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "rejectedClosingSpace", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-infix-ops.js b/node_modules/eslint/lib/rules/space-infix-ops.js new file mode 100644 index 0000000..471c222 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-infix-ops.js @@ -0,0 +1,169 @@ +/** + * @fileoverview Require spaces around infix operators + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require spacing around infix operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-infix-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + missingSpace: "Operator '{{operator}}' must be spaced." + } + }, + + create(context) { + const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; + const sourceCode = context.getSourceCode(); + + /** + * Returns the first token which violates the rule + * @param {ASTNode} left The left node of the main node + * @param {ASTNode} right The right node of the main node + * @param {string} op The operator of the main node + * @returns {Object} The violator token or null + * @private + */ + function getFirstNonSpacedToken(left, right, op) { + const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op); + const prev = sourceCode.getTokenBefore(operator); + const next = sourceCode.getTokenAfter(operator); + + if (!sourceCode.isSpaceBetweenTokens(prev, operator) || !sourceCode.isSpaceBetweenTokens(operator, next)) { + return operator; + } + + return null; + } + + /** + * Reports an AST node as a rule violation + * @param {ASTNode} mainNode The node to report + * @param {Object} culpritToken The token which has a problem + * @returns {void} + * @private + */ + function report(mainNode, culpritToken) { + context.report({ + node: mainNode, + loc: culpritToken.loc, + messageId: "missingSpace", + data: { + operator: culpritToken.value + }, + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(culpritToken); + const afterToken = sourceCode.getTokenAfter(culpritToken); + let fixString = ""; + + if (culpritToken.range[0] - previousToken.range[1] === 0) { + fixString = " "; + } + + fixString += culpritToken.value; + + if (afterToken.range[0] - culpritToken.range[1] === 0) { + fixString += " "; + } + + return fixer.replaceText(culpritToken, fixString); + } + }); + } + + /** + * Check if the node is binary then report + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinary(node) { + const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left; + const rightNode = node.right; + + // search for = in AssignmentPattern nodes + const operator = node.operator || "="; + + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, operator); + + if (nonSpacedNode) { + if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) { + report(node, nonSpacedNode); + } + } + } + + /** + * Check if the node is conditional + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkConditional(node) { + const nonSpacedConsequentNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); + const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); + + if (nonSpacedConsequentNode) { + report(node, nonSpacedConsequentNode); + } else if (nonSpacedAlternateNode) { + report(node, nonSpacedAlternateNode); + } + } + + /** + * Check if the node is a variable + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkVar(node) { + const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id; + const rightNode = node.init; + + if (rightNode) { + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "="); + + if (nonSpacedNode) { + report(node, nonSpacedNode); + } + } + } + + return { + AssignmentExpression: checkBinary, + AssignmentPattern: checkBinary, + BinaryExpression: checkBinary, + LogicalExpression: checkBinary, + ConditionalExpression: checkConditional, + VariableDeclarator: checkVar + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/space-unary-ops.js b/node_modules/eslint/lib/rules/space-unary-ops.js new file mode 100644 index 0000000..f417eea --- /dev/null +++ b/node_modules/eslint/lib/rules/space-unary-ops.js @@ -0,0 +1,321 @@ +/** + * @fileoverview This rule shoud require or disallow spaces before or after unary operations. + * @author Marcin Kumorek + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before or after unary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-unary-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + words: { + type: "boolean", + default: true + }, + nonwords: { + type: "boolean", + default: false + }, + overrides: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + messages: { + unexpectedBefore: "Unexpected space before unary operator '{{operator}}'.", + unexpectedAfter: "Unexpected space after unary operator '{{operator}}'.", + unexpectedAfterWord: "Unexpected space after unary word operator '{{word}}'.", + wordOperator: "Unary word operator '{{word}}' must be followed by whitespace.", + operator: "Unary operator '{{operator}}' must be followed by whitespace.", + beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'." + } + }, + + create(context) { + const options = context.options[0] || { words: true, nonwords: false }; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the node is the first "!" in a "!!" convert to Boolean expression + * @param {ASTnode} node AST node + * @returns {boolean} Whether or not the node is first "!" in "!!" + */ + function isFirstBangInBangBangExpression(node) { + return node && node.type === "UnaryExpression" && node.argument.operator === "!" && + node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; + } + + /** + * Checks if an override exists for a given operator. + * @param {string} operator Operator + * @returns {boolean} Whether or not an override has been provided for the operator + */ + function overrideExistsForOperator(operator) { + return options.overrides && Object.prototype.hasOwnProperty.call(options.overrides, operator); + } + + /** + * Gets the value that the override was set to for this operator + * @param {string} operator Operator + * @returns {boolean} Whether or not an override enforces a space with this operator + */ + function overrideEnforcesSpaces(operator) { + return options.overrides[operator]; + } + + /** + * Verify Unary Word Operator has spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordHasSpaces(node, firstToken, secondToken, word) { + if (secondToken.range[0] === firstToken.range[1]) { + context.report({ + node, + messageId: "wordOperator", + data: { + word + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } + + /** + * Verify Unary Word Operator doesn't have spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfterWord", + data: { + word + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Check Unary Word Operators for spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { + if (overrideExistsForOperator(word)) { + if (overrideEnforcesSpaces(word)) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } else if (options.words) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } + + /** + * Verifies YieldExpressions satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpacesAfterYield(node) { + const tokens = sourceCode.getFirstTokens(node, 3), + word = "yield"; + + if (!node.argument || node.delegate) { + return; + } + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); + } + + /** + * Verifies AwaitExpressions satisfy spacing requirements + * @param {ASTNode} node AwaitExpression AST node + * @returns {void} + */ + function checkForSpacesAfterAwait(node) { + const tokens = sourceCode.getFirstTokens(node, 3); + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], "await"); + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (isFirstBangInBangBangExpression(node)) { + return; + } + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "operator", + data: { + operator: firstToken.value + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } else { + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "beforeUnaryExpressions", + data: { + token: secondToken.value + }, + fix(fixer) { + return fixer.insertTextBefore(secondToken, " "); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfter", + data: { + operator: firstToken.value + }, + fix(fixer) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + return null; + } + }); + } + } else { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedBefore", + data: { + operator: secondToken.value + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpaces(node) { + const tokens = node.type === "UpdateExpression" && !node.prefix + ? sourceCode.getLastTokens(node, 2) + : sourceCode.getFirstTokens(node, 2); + const firstToken = tokens[0]; + const secondToken = tokens[1]; + + if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") { + checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, firstToken.value); + return; + } + + const operator = node.prefix ? tokens[0].value : tokens[1].value; + + if (overrideExistsForOperator(operator)) { + if (overrideEnforcesSpaces(operator)) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } else if (options.nonwords) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + UnaryExpression: checkForSpaces, + UpdateExpression: checkForSpaces, + NewExpression: checkForSpaces, + YieldExpression: checkForSpacesAfterYield, + AwaitExpression: checkForSpacesAfterAwait + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/spaced-comment.js b/node_modules/eslint/lib/rules/spaced-comment.js new file mode 100644 index 0000000..d3221f0 --- /dev/null +++ b/node_modules/eslint/lib/rules/spaced-comment.js @@ -0,0 +1,382 @@ +/** + * @fileoverview Source code for spaced-comments rule + * @author Gyandeep Singh + */ +"use strict"; + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Escapes the control characters of a given string. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escape(s) { + return `(?:${lodash.escapeRegExp(s)})`; +} + +/** + * Escapes the control characters of a given string. + * And adds a repeat flag. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escapeAndRepeat(s) { + return `${escape(s)}+`; +} + +/** + * Parses `markers` option. + * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. + * @param {string[]} [markers] A marker list. + * @returns {string[]} A marker list. + */ +function parseMarkersOption(markers) { + + // `*` is a marker for JSDoc comments. + if (markers.indexOf("*") === -1) { + return markers.concat("*"); + } + + return markers; +} + +/** + * Creates string pattern for exceptions. + * Generated pattern: + * + * 1. A space or an exception pattern sequence. + * @param {string[]} exceptions An exception pattern list. + * @returns {string} A regular expression string for exceptions. + */ +function createExceptionsPattern(exceptions) { + let pattern = ""; + + /* + * A space or an exception pattern sequence. + * [] ==> "\s" + * ["-"] ==> "(?:\s|\-+$)" + * ["-", "="] ==> "(?:\s|(?:\-+|=+)$)" + * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24) + */ + if (exceptions.length === 0) { + + // a space. + pattern += "\\s"; + } else { + + // a space or... + pattern += "(?:\\s|"; + + if (exceptions.length === 1) { + + // a sequence of the exception pattern. + pattern += escapeAndRepeat(exceptions[0]); + } else { + + // a sequence of one of the exception patterns. + pattern += "(?:"; + pattern += exceptions.map(escapeAndRepeat).join("|"); + pattern += ")"; + } + pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`; + } + + return pattern; +} + +/** + * Creates RegExp object for `always` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing. + * 2. Next, a space or an exception pattern sequence. + * @param {string[]} markers A marker list. + * @param {string[]} exceptions An exception pattern list. + * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode. + */ +function createAlwaysStylePattern(markers, exceptions) { + let pattern = "^"; + + /* + * A marker or nothing. + * ["*"] ==> "\*?" + * ["*", "!"] ==> "(?:\*|!)?" + * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F + */ + if (markers.length === 1) { + + // the marker. + pattern += escape(markers[0]); + } else { + + // one of markers. + pattern += "(?:"; + pattern += markers.map(escape).join("|"); + pattern += ")"; + } + + pattern += "?"; // or nothing. + pattern += createExceptionsPattern(exceptions); + + return new RegExp(pattern, "u"); +} + +/** + * Creates RegExp object for `never` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing (captured). + * 2. Next, a space or a tab. + * @param {string[]} markers A marker list. + * @returns {RegExp} A RegExp object for `never` mode. + */ +function createNeverStylePattern(markers) { + const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`; + + return new RegExp(pattern, "u"); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent spacing after the `//` or `/*` in a comment", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/spaced-comment" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + line: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }, + block: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + balanced: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfterMarker: "Unexpected space or tab after marker ({{refChar}}) in comment.", + expectedExceptionAfter: "Expected exception block, space or tab after '{{refChar}}' in comment.", + unexpectedSpaceBefore: "Unexpected space or tab before '*/' in comment.", + unexpectedSpaceAfter: "Unexpected space or tab after '{{refChar}}' in comment.", + expectedSpaceBefore: "Expected space or tab before '*/' in comment.", + expectedSpaceAfter: "Expected space or tab after '{{refChar}}' in comment." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + // Unless the first option is never, require a space + const requireSpace = context.options[0] !== "never"; + + /* + * Parse the second options. + * If markers don't include `"*"`, it's added automatically for JSDoc + * comments. + */ + const config = context.options[1] || {}; + const balanced = config.block && config.block.balanced; + + const styleRules = ["block", "line"].reduce((rule, type) => { + const markers = parseMarkersOption(config[type] && config[type].markers || config.markers || []); + const exceptions = config[type] && config[type].exceptions || config.exceptions || []; + const endNeverPattern = "[ \t]+$"; + + // Create RegExp object for valid patterns. + rule[type] = { + beginRegex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers), + endRegex: balanced && requireSpace ? new RegExp(`${createExceptionsPattern(exceptions)}$`, "u") : new RegExp(endNeverPattern, "u"), + hasExceptions: exceptions.length > 0, + captureMarker: new RegExp(`^(${markers.map(escape).join("|")})`, "u"), + markers: new Set(markers) + }; + + return rule; + }, {}); + + /** + * Reports a beginning spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {Array} match An array of match results for markers. + * @param {string} refChar Character used for reference in the error message. + * @returns {void} + */ + function reportBegin(node, messageId, match, refChar) { + const type = node.type.toLowerCase(), + commentIdentifier = type === "block" ? "/*" : "//"; + + context.report({ + node, + fix(fixer) { + const start = node.range[0]; + let end = start + 2; + + if (requireSpace) { + if (match) { + end += match[0].length; + } + return fixer.insertTextAfterRange([start, end], " "); + } + end += match[0].length; + return fixer.replaceTextRange([start, end], commentIdentifier + (match[1] ? match[1] : "")); + + }, + messageId, + data: { refChar } + }); + } + + /** + * Reports an ending spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {string} match An array of the matched whitespace characters. + * @returns {void} + */ + function reportEnd(node, messageId, match) { + context.report({ + node, + fix(fixer) { + if (requireSpace) { + return fixer.insertTextAfterRange([node.range[0], node.range[1] - 2], " "); + } + const end = node.range[1] - 2, + start = end - match[0].length; + + return fixer.replaceTextRange([start, end], ""); + + }, + messageId + }); + } + + /** + * Reports a given comment if it's invalid. + * @param {ASTNode} node a comment node to check. + * @returns {void} + */ + function checkCommentForSpace(node) { + const type = node.type.toLowerCase(), + rule = styleRules[type], + commentIdentifier = type === "block" ? "/*" : "//"; + + // Ignores empty comments and comments that consist only of a marker. + if (node.value.length === 0 || rule.markers.has(node.value)) { + return; + } + + const beginMatch = rule.beginRegex.exec(node.value); + const endMatch = rule.endRegex.exec(node.value); + + // Checks. + if (requireSpace) { + if (!beginMatch) { + const hasMarker = rule.captureMarker.exec(node.value); + const marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier; + + if (rule.hasExceptions) { + reportBegin(node, "expectedExceptionAfter", hasMarker, marker); + } else { + reportBegin(node, "expectedSpaceAfter", hasMarker, marker); + } + } + + if (balanced && type === "block" && !endMatch) { + reportEnd(node, "expectedSpaceBefore"); + } + } else { + if (beginMatch) { + if (!beginMatch[1]) { + reportBegin(node, "unexpectedSpaceAfter", beginMatch, commentIdentifier); + } else { + reportBegin(node, "unexpectedSpaceAfterMarker", beginMatch, beginMatch[1]); + } + } + + if (balanced && type === "block" && endMatch) { + reportEnd(node, "unexpectedSpaceBefore", endMatch); + } + } + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(checkCommentForSpace); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/strict.js b/node_modules/eslint/lib/rules/strict.js new file mode 100644 index 0000000..b0d6cf9 --- /dev/null +++ b/node_modules/eslint/lib/rules/strict.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to control usage of strict mode directives. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets all of the Use Strict Directives in the Directive Prologue of a group of + * statements. + * @param {ASTNode[]} statements Statements in the program or function body. + * @returns {ASTNode[]} All of the Use Strict Directives. + */ +function getUseStrictDirectives(statements) { + const directives = []; + + for (let i = 0; i < statements.length; i++) { + const statement = statements[i]; + + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + statement.expression.value === "use strict" + ) { + directives[i] = statement; + } else { + break; + } + } + + return directives; +} + +/** + * Checks whether a given parameter is a simple parameter. + * @param {ASTNode} node A pattern node to check. + * @returns {boolean} `true` if the node is an Identifier node. + */ +function isSimpleParameter(node) { + return node.type === "Identifier"; +} + +/** + * Checks whether a given parameter list is a simple parameter list. + * @param {ASTNode[]} params A parameter list to check. + * @returns {boolean} `true` if the every parameter is an Identifier node. + */ +function isSimpleParameterList(params) { + return params.every(isSimpleParameter); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow strict mode directives", + category: "Strict Mode", + recommended: false, + url: "https://eslint.org/docs/rules/strict" + }, + + schema: [ + { + enum: ["never", "global", "function", "safe"] + } + ], + + fixable: "code", + messages: { + function: "Use the function form of 'use strict'.", + global: "Use the global form of 'use strict'.", + multiple: "Multiple 'use strict' directives.", + never: "Strict mode is not permitted.", + unnecessary: "Unnecessary 'use strict' directive.", + module: "'use strict' is unnecessary inside of modules.", + implied: "'use strict' is unnecessary when implied strict mode is enabled.", + unnecessaryInClasses: "'use strict' is unnecessary inside of classes.", + nonSimpleParameterList: "'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.", + wrap: "Wrap {{name}} in a function with 'use strict' directive." + } + }, + + create(context) { + + const ecmaFeatures = context.parserOptions.ecmaFeatures || {}, + scopes = [], + classScopes = []; + let mode = context.options[0] || "safe"; + + if (ecmaFeatures.impliedStrict) { + mode = "implied"; + } else if (mode === "safe") { + mode = ecmaFeatures.globalReturn ? "global" : "function"; + } + + /** + * Determines whether a reported error should be fixed, depending on the error type. + * @param {string} errorType The type of error + * @returns {boolean} `true` if the reported error should be fixed + */ + function shouldFix(errorType) { + return errorType === "multiple" || errorType === "unnecessary" || errorType === "module" || errorType === "implied" || errorType === "unnecessaryInClasses"; + } + + /** + * Gets a fixer function to remove a given 'use strict' directive. + * @param {ASTNode} node The directive that should be removed + * @returns {Function} A fixer function + */ + function getFixFunction(node) { + return fixer => fixer.remove(node); + } + + /** + * Report a slice of an array of nodes with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} start Index to start from. + * @param {string} end Index to end before. + * @param {string} messageId Message to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportSlice(nodes, start, end, messageId, fix) { + nodes.slice(start, end).forEach(node => { + context.report({ node, messageId, fix: fix ? getFixFunction(node) : null }); + }); + } + + /** + * Report all nodes in an array with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAll(nodes, messageId, fix) { + reportSlice(nodes, 0, nodes.length, messageId, fix); + } + + /** + * Report all nodes in an array, except the first, with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAllExceptFirst(nodes, messageId, fix) { + reportSlice(nodes, 1, nodes.length, messageId, fix); + } + + /** + * Entering a function in 'function' mode pushes a new nested scope onto the + * stack. The new scope is true if the nested function is strict mode code. + * @param {ASTNode} node The function declaration or expression. + * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node. + * @returns {void} + */ + function enterFunctionInFunctionMode(node, useStrictDirectives) { + const isInClass = classScopes.length > 0, + isParentGlobal = scopes.length === 0 && classScopes.length === 0, + isParentStrict = scopes.length > 0 && scopes[scopes.length - 1], + isStrict = useStrictDirectives.length > 0; + + if (isStrict) { + if (!isSimpleParameterList(node.params)) { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + } else if (isParentStrict) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessary", fix: getFixFunction(useStrictDirectives[0]) }); + } else if (isInClass) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessaryInClasses", fix: getFixFunction(useStrictDirectives[0]) }); + } + + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else if (isParentGlobal) { + if (isSimpleParameterList(node.params)) { + context.report({ node, messageId: "function" }); + } else { + context.report({ + node, + messageId: "wrap", + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + } + + scopes.push(isParentStrict || isStrict); + } + + /** + * Exiting a function in 'function' mode pops its scope off the stack. + * @returns {void} + */ + function exitFunctionInFunctionMode() { + scopes.pop(); + } + + /** + * Enter a function and either: + * - Push a new nested scope onto the stack (in 'function' mode). + * - Report all the Use Strict Directives (in the other modes). + * @param {ASTNode} node The function declaration or expression. + * @returns {void} + */ + function enterFunction(node) { + const isBlock = node.body.type === "BlockStatement", + useStrictDirectives = isBlock + ? getUseStrictDirectives(node.body.body) : []; + + if (mode === "function") { + enterFunctionInFunctionMode(node, useStrictDirectives); + } else if (useStrictDirectives.length > 0) { + if (isSimpleParameterList(node.params)) { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } else { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } + } + } + + const rule = { + Program(node) { + const useStrictDirectives = getUseStrictDirectives(node.body); + + if (node.sourceType === "module") { + mode = "module"; + } + + if (mode === "global") { + if (node.body.length > 0 && useStrictDirectives.length === 0) { + context.report({ node, messageId: "global" }); + } + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } + }, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction + }; + + if (mode === "function") { + Object.assign(rule, { + + // Inside of class bodies are always strict mode. + ClassBody() { + classScopes.push(true); + }, + "ClassBody:exit"() { + classScopes.pop(); + }, + + "FunctionDeclaration:exit": exitFunctionInFunctionMode, + "FunctionExpression:exit": exitFunctionInFunctionMode, + "ArrowFunctionExpression:exit": exitFunctionInFunctionMode + }); + } + + return rule; + } +}; diff --git a/node_modules/eslint/lib/rules/switch-colon-spacing.js b/node_modules/eslint/lib/rules/switch-colon-spacing.js new file mode 100644 index 0000000..c906415 --- /dev/null +++ b/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Rule to enforce spacing around colons of switch statements. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce spacing around colons of switch statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/switch-colon-spacing" + }, + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: false }, + after: { type: "boolean", default: true } + }, + additionalProperties: false + } + ], + fixable: "whitespace", + messages: { + expectedBefore: "Expected space(s) before this colon.", + expectedAfter: "Expected space(s) after this colon.", + unexpectedBefore: "Unexpected space(s) before this colon.", + unexpectedAfter: "Unexpected space(s) after this colon." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const beforeSpacing = options.before === true; // false by default + const afterSpacing = options.after !== false; // true by default + + /** + * Get the colon token of the given SwitchCase node. + * @param {ASTNode} node The SwitchCase node to get. + * @returns {Token} The colon token of the node. + */ + function getColonToken(node) { + if (node.test) { + return sourceCode.getTokenAfter(node.test, astUtils.isColonToken); + } + return sourceCode.getFirstToken(node, 1); + } + + /** + * Check whether the spacing between the given 2 tokens is valid or not. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @param {boolean} expected The expected spacing to check. `true` if there should be a space. + * @returns {boolean} `true` if the spacing between the tokens is valid. + */ + function isValidSpacing(left, right, expected) { + return ( + astUtils.isClosingBraceToken(right) || + !astUtils.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === expected + ); + } + + /** + * Check whether comments exist between the given 2 tokens. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @returns {boolean} `true` if comments exist between the given 2 tokens. + */ + function commentsExistBetween(left, right) { + return sourceCode.getFirstTokenBetween( + left, + right, + { + includeComments: true, + filter: astUtils.isCommentToken + } + ) !== null; + } + + /** + * Fix the spacing between the given 2 tokens. + * @param {RuleFixer} fixer The fixer to fix. + * @param {Token} left The left token of fix range. + * @param {Token} right The right token of fix range. + * @param {boolean} spacing The spacing style. `true` if there should be a space. + * @returns {Fix|null} The fix object. + */ + function fix(fixer, left, right, spacing) { + if (commentsExistBetween(left, right)) { + return null; + } + if (spacing) { + return fixer.insertTextAfter(left, " "); + } + return fixer.removeRange([left.range[1], right.range[0]]); + } + + return { + SwitchCase(node) { + const colonToken = getColonToken(node); + const beforeToken = sourceCode.getTokenBefore(colonToken); + const afterToken = sourceCode.getTokenAfter(colonToken); + + if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: beforeSpacing ? "expectedBefore" : "unexpectedBefore", + fix: fixer => fix(fixer, beforeToken, colonToken, beforeSpacing) + }); + } + if (!isValidSpacing(colonToken, afterToken, afterSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: afterSpacing ? "expectedAfter" : "unexpectedAfter", + fix: fixer => fix(fixer, colonToken, afterToken, afterSpacing) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/symbol-description.js b/node_modules/eslint/lib/rules/symbol-description.js new file mode 100644 index 0000000..155cea4 --- /dev/null +++ b/node_modules/eslint/lib/rules/symbol-description.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to enforce description with the `Symbol` object + * @author Jarek Rencz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require symbol descriptions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/symbol-description" + }, + fixable: null, + schema: [], + messages: { + expected: "Expected Symbol to have a description." + } + }, + + create(context) { + + /** + * Reports if node does not conform the rule in case rule is set to + * report missing description + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArgument(node) { + if (node.arguments.length === 0) { + context.report({ + node, + messageId: "expected" + }); + } + } + + return { + "Program:exit"() { + const scope = context.getScope(); + const variable = astUtils.getVariableByName(scope, "Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(reference => { + const node = reference.identifier; + + if (astUtils.isCallee(node)) { + checkArgument(node.parent); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/template-curly-spacing.js b/node_modules/eslint/lib/rules/template-curly-spacing.js new file mode 100644 index 0000000..26043bc --- /dev/null +++ b/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Rule to enforce spacing around embedded expressions of template strings + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing around embedded expressions of template strings", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/template-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + expectedBefore: "Expected space(s) before '}'.", + expectedAfter: "Expected space(s) after '${'.", + unexpectedBefore: "Unexpected space(s) before '}'.", + unexpectedAfter: "Unexpected space(s) after '${'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const always = context.options[0] === "always"; + + /** + * Checks spacing before `}` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingBefore(token) { + if (!token.value.startsWith("}")) { + return; // starts with a backtick, this is the first template element in the template literal + } + + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(prevToken, token); + + if (!astUtils.isTokenOnSameLine(prevToken, token)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: token.loc.start, + end: { + line: token.loc.start.line, + column: token.loc.start.column + 1 + } + }, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: prevToken.loc.end, + end: token.loc.start + }, + messageId: "unexpectedBefore", + fix: fixer => fixer.removeRange([prevToken.range[1], token.range[0]]) + }); + } + } + + /** + * Checks spacing after `${` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingAfter(token) { + if (!token.value.endsWith("${")) { + return; // ends with a backtick, this is the last template element in the template literal + } + + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(token, nextToken); + + if (!astUtils.isTokenOnSameLine(token, nextToken)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: { + line: token.loc.end.line, + column: token.loc.end.column - 2 + }, + end: token.loc.end + }, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: token.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedAfter", + fix: fixer => fixer.removeRange([token.range[1], nextToken.range[0]]) + }); + } + } + + return { + TemplateElement(node) { + const token = sourceCode.getFirstToken(node); + + checkSpacingBefore(token); + checkSpacingAfter(token); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/template-tag-spacing.js b/node_modules/eslint/lib/rules/template-tag-spacing.js new file mode 100644 index 0000000..16f5862 --- /dev/null +++ b/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Rule to check spacing between template tags and their literals + * @author Jonathan Wilsson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing between template tags and their literals", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/template-tag-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + unexpected: "Unexpected space between template tag and template literal.", + missing: "Missing space between template tag and template literal." + } + }, + + create(context) { + const never = context.options[0] !== "always"; + const sourceCode = context.getSourceCode(); + + /** + * Check if a space is present between a template tag and its literal + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkSpacing(node) { + const tagToken = sourceCode.getTokenBefore(node.quasi); + const literalToken = sourceCode.getFirstToken(node.quasi); + const hasWhitespace = sourceCode.isSpaceBetweenTokens(tagToken, literalToken); + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: tagToken.loc.end, + end: literalToken.loc.start + }, + messageId: "unexpected", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(node.quasi); + + // Don't fix anything if there's a single line comment after the template tag + if (comments.some(comment => comment.type === "Line")) { + return null; + } + + return fixer.replaceTextRange( + [tagToken.range[1], literalToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: node.loc.start, + end: literalToken.loc.start + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(tagToken, " "); + } + }); + } + } + + return { + TaggedTemplateExpression: checkSpacing + }; + } +}; diff --git a/node_modules/eslint/lib/rules/unicode-bom.js b/node_modules/eslint/lib/rules/unicode-bom.js new file mode 100644 index 0000000..39642f8 --- /dev/null +++ b/node_modules/eslint/lib/rules/unicode-bom.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Require or disallow Unicode BOM + * @author Andrew Johnston + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow Unicode byte order mark (BOM)", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/unicode-bom" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + messages: { + expected: "Expected Unicode BOM (Byte Order Mark).", + unexpected: "Unexpected Unicode BOM (Byte Order Mark)." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkUnicodeBOM(node) { + + const sourceCode = context.getSourceCode(), + location = { column: 0, line: 1 }, + requireBOM = context.options[0] || "never"; + + if (!sourceCode.hasBOM && (requireBOM === "always")) { + context.report({ + node, + loc: location, + messageId: "expected", + fix(fixer) { + return fixer.insertTextBeforeRange([0, 1], "\uFEFF"); + } + }); + } else if (sourceCode.hasBOM && (requireBOM === "never")) { + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + return fixer.removeRange([-1, 0]); + } + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/use-isnan.js b/node_modules/eslint/lib/rules/use-isnan.js new file mode 100644 index 0000000..53ffeb7 --- /dev/null +++ b/node_modules/eslint/lib/rules/use-isnan.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Rule to flag comparisons to the value NaN + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given node is a NaN `Identifier` node. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is 'NaN' identifier. + */ +function isNaNIdentifier(node) { + return Boolean(node) && node.type === "Identifier" && node.name === "NaN"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "require calls to `isNaN()` when checking for `NaN`", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/use-isnan" + }, + + schema: [ + { + type: "object", + properties: { + enforceForSwitchCase: { + type: "boolean", + default: true + }, + enforceForIndexOf: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + comparisonWithNaN: "Use the isNaN function to compare with NaN.", + switchNaN: "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", + caseNaN: "'case NaN' can never match. Use Number.isNaN before the switch.", + indexOfNaN: "Array prototype method '{{ methodName }}' cannot find NaN." + } + }, + + create(context) { + + const enforceForSwitchCase = !context.options[0] || context.options[0].enforceForSwitchCase; + const enforceForIndexOf = context.options[0] && context.options[0].enforceForIndexOf; + + /** + * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkBinaryExpression(node) { + if ( + /^(?:[<>]|[!=]=)=?$/u.test(node.operator) && + (isNaNIdentifier(node.left) || isNaNIdentifier(node.right)) + ) { + context.report({ node, messageId: "comparisonWithNaN" }); + } + } + + /** + * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:` + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkSwitchStatement(node) { + if (isNaNIdentifier(node.discriminant)) { + context.report({ node, messageId: "switchNaN" }); + } + + for (const switchCase of node.cases) { + if (isNaNIdentifier(switchCase.test)) { + context.report({ node: switchCase, messageId: "caseNaN" }); + } + } + } + + /** + * Checks the the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkCallExpression(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "MemberExpression") { + const methodName = astUtils.getStaticPropertyName(callee); + + if ( + (methodName === "indexOf" || methodName === "lastIndexOf") && + node.arguments.length === 1 && + isNaNIdentifier(node.arguments[0]) + ) { + context.report({ node, messageId: "indexOfNaN", data: { methodName } }); + } + } + } + + const listeners = { + BinaryExpression: checkBinaryExpression + }; + + if (enforceForSwitchCase) { + listeners.SwitchStatement = checkSwitchStatement; + } + + if (enforceForIndexOf) { + listeners.CallExpression = checkCallExpression; + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/utils/ast-utils.js b/node_modules/eslint/lib/rules/utils/ast-utils.js new file mode 100644 index 0000000..fb8beb2 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -0,0 +1,1794 @@ +/** + * @fileoverview Common utils for AST. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esutils = require("esutils"); +const espree = require("espree"); +const lodash = require("lodash"); +const { + breakableTypePattern, + createGlobalLinebreakMatcher, + lineBreakPattern, + shebangPattern +} = require("../../shared/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u; +const arrayOrTypedArrayPattern = /Array$/u; +const arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/u; +const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u; +const thisTagPattern = /^[\s*]*@this/mu; + + +const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u; +const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); + +// A set of node types that can contain a list of statements +const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "SwitchCase"]); + +const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; +const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u; + +const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]); + +/** + * Checks reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {boolean} Success/Failure + * @private + */ +function isModifyingReference(reference, index, references) { + const identifier = reference.identifier; + + /* + * Destructuring assignments can have multiple default value, so + * possibly there are multiple writeable references for the same + * identifier. + */ + const modifyingDifferentIdentifier = index === 0 || + references[index - 1].identifier !== identifier; + + return (identifier && + reference.init === false && + reference.isWrite() && + modifyingDifferentIdentifier + ); +} + +/** + * Checks whether the given string starts with uppercase or not. + * @param {string} s The string to check. + * @returns {boolean} `true` if the string starts with uppercase. + */ +function startsWithUpperCase(s) { + return s[0] !== s[0].toLocaleLowerCase(); +} + +/** + * Checks whether or not a node is a constructor. + * @param {ASTNode} node A function node to check. + * @returns {boolean} Wehether or not a node is a constructor. + */ +function isES5Constructor(node) { + return (node.id && startsWithUpperCase(node.id.name)); +} + +/** + * Finds a function node from ancestors of a node. + * @param {ASTNode} node A start node to find. + * @returns {Node|null} A found function node. + */ +function getUpperFunction(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (anyFunctionPattern.test(currentNode.type)) { + return currentNode; + } + } + return null; +} + +/** + * Checks whether a given node is a function node or not. + * The following types are function nodes: + * + * - ArrowFunctionExpression + * - FunctionDeclaration + * - FunctionExpression + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a function node. + */ +function isFunction(node) { + return Boolean(node && anyFunctionPattern.test(node.type)); +} + +/** + * Checks whether a given node is a loop node or not. + * The following types are loop nodes: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - WhileStatement + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a loop node. + */ +function isLoop(node) { + return Boolean(node && anyLoopPattern.test(node.type)); +} + +/** + * Checks whether the given node is in a loop or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is in a loop. + */ +function isInLoop(node) { + for (let currentNode = node; currentNode && !isFunction(currentNode); currentNode = currentNode.parent) { + if (isLoop(currentNode)) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given node is a `null` literal. + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a `null` literal + */ +function isNullLiteral(node) { + + /* + * Checking `node.value === null` does not guarantee that a literal is a null literal. + * When parsing values that cannot be represented in the current environment (e.g. unicode + * regexes in Node 4), `node.value` is set to `null` because it wouldn't be possible to + * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check + * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020 + */ + return node.type === "Literal" && node.value === null && !node.regex && !node.bigint; +} + +/** + * Checks whether or not a node is `null` or `undefined`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(node) { + return ( + isNullLiteral(node) || + (node.type === "Identifier" && node.name === "undefined") || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Checks whether or not a node is callee. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is callee. + */ +function isCallee(node) { + return node.parent.type === "CallExpression" && node.parent.callee === node; +} + +/** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param {ASTNode} node Expression node. + * @returns {string|null} String value if it can be determined. Otherwise, `null`. + */ +function getStaticStringValue(node) { + switch (node.type) { + case "Literal": + if (node.value === null) { + if (isNullLiteral(node)) { + return String(node.value); // "null" + } + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}`; + } + if (node.bigint) { + return node.bigint; + } + + // Otherwise, this is an unknown literal. The function will return null. + + } else { + return String(node.value); + } + break; + case "TemplateLiteral": + if (node.expressions.length === 0 && node.quasis.length === 1) { + return node.quasis[0].value.cooked; + } + break; + + // no default + } + + return null; +} + +/** + * Gets the property name of a given node. + * The node can be a MemberExpression, a Property, or a MethodDefinition. + * + * If the name is dynamic, this returns `null`. + * + * For examples: + * + * a.b // => "b" + * a["b"] // => "b" + * a['b'] // => "b" + * a[`b`] // => "b" + * a[100] // => "100" + * a[b] // => null + * a["a" + "b"] // => null + * a[tag`b`] // => null + * a[`${b}`] // => null + * + * let a = {b: 1} // => "b" + * let a = {["b"]: 1} // => "b" + * let a = {['b']: 1} // => "b" + * let a = {[`b`]: 1} // => "b" + * let a = {[100]: 1} // => "100" + * let a = {[b]: 1} // => null + * let a = {["a" + "b"]: 1} // => null + * let a = {[tag`b`]: 1} // => null + * let a = {[`${b}`]: 1} // => null + * @param {ASTNode} node The node to get. + * @returns {string|null} The property name if static. Otherwise, null. + */ +function getStaticPropertyName(node) { + let prop; + + switch (node && node.type) { + case "ChainExpression": + return getStaticPropertyName(node.expression); + + case "Property": + case "MethodDefinition": + prop = node.key; + break; + + case "MemberExpression": + prop = node.property; + break; + + // no default + } + + if (prop) { + if (prop.type === "Identifier" && !node.computed) { + return prop.name; + } + + return getStaticStringValue(prop); + } + + return null; +} + +/** + * Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it. + * @param {ASTNode} node The node to address. + * @returns {ASTNode} The `ChainExpression#expression` value if the node is a `ChainExpression` node. Otherwise, the node. + */ +function skipChainExpression(node) { + return node && node.type === "ChainExpression" ? node.expression : node; +} + +/** + * Check if the `actual` is an expected value. + * @param {string} actual The string value to check. + * @param {string | RegExp} expected The expected string value or pattern. + * @returns {boolean} `true` if the `actual` is an expected value. + */ +function checkText(actual, expected) { + return typeof expected === "string" + ? actual === expected + : expected.test(actual); +} + +/** + * Check if a given node is an Identifier node with a given name. + * @param {ASTNode} node The node to check. + * @param {string | RegExp} name The expected name or the expected pattern of the object name. + * @returns {boolean} `true` if the node is an Identifier node with the name. + */ +function isSpecificId(node, name) { + return node.type === "Identifier" && checkText(node.name, name); +} + +/** + * Check if a given node is member access with a given object name and property name pair. + * This is regardless of optional or not. + * @param {ASTNode} node The node to check. + * @param {string | RegExp | null} objectName The expected name or the expected pattern of the object name. If this is nullish, this method doesn't check object. + * @param {string | RegExp | null} propertyName The expected name or the expected pattern of the property name. If this is nullish, this method doesn't check property. + * @returns {boolean} `true` if the node is member access with the object name and property name pair. + * The node is a `MemberExpression` or `ChainExpression`. + */ +function isSpecificMemberAccess(node, objectName, propertyName) { + const checkNode = skipChainExpression(node); + + if (checkNode.type !== "MemberExpression") { + return false; + } + + if (objectName && !isSpecificId(checkNode.object, objectName)) { + return false; + } + + if (propertyName) { + const actualPropertyName = getStaticPropertyName(checkNode); + + if (typeof actualPropertyName !== "string" || !checkText(actualPropertyName, propertyName)) { + return false; + } + } + + return true; +} + +/** + * Check if two literal nodes are the same value. + * @param {ASTNode} left The Literal node to compare. + * @param {ASTNode} right The other Literal node to compare. + * @returns {boolean} `true` if the two literal nodes are the same value. + */ +function equalLiteralValue(left, right) { + + // RegExp literal. + if (left.regex || right.regex) { + return Boolean( + left.regex && + right.regex && + left.regex.pattern === right.regex.pattern && + left.regex.flags === right.regex.flags + ); + } + + // BigInt literal. + if (left.bigint || right.bigint) { + return left.bigint === right.bigint; + } + + return left.value === right.value; +} + +/** + * Check if two expressions reference the same value. For example: + * a = a + * a.b = a.b + * a[0] = a[0] + * a['b'] = a['b'] + * @param {ASTNode} left The left side of the comparison. + * @param {ASTNode} right The right side of the comparison. + * @param {boolean} [disableStaticComputedKey] Don't address `a.b` and `a["b"]` are the same if `true`. For backward compatibility. + * @returns {boolean} `true` if both sides match and reference the same value. + */ +function isSameReference(left, right, disableStaticComputedKey = false) { + if (left.type !== right.type) { + + // Handle `a.b` and `a?.b` are samely. + if (left.type === "ChainExpression") { + return isSameReference(left.expression, right, disableStaticComputedKey); + } + if (right.type === "ChainExpression") { + return isSameReference(left, right.expression, disableStaticComputedKey); + } + + return false; + } + + switch (left.type) { + case "Super": + case "ThisExpression": + return true; + + case "Identifier": + return left.name === right.name; + case "Literal": + return equalLiteralValue(left, right); + + case "ChainExpression": + return isSameReference(left.expression, right.expression, disableStaticComputedKey); + + case "MemberExpression": { + if (!disableStaticComputedKey) { + const nameA = getStaticPropertyName(left); + + // x.y = x["y"] + if (nameA !== null) { + return ( + isSameReference(left.object, right.object, disableStaticComputedKey) && + nameA === getStaticPropertyName(right) + ); + } + } + + /* + * x[0] = x[0] + * x[y] = x[y] + * x.y = x.y + */ + return ( + left.computed === right.computed && + isSameReference(left.object, right.object, disableStaticComputedKey) && + isSameReference(left.property, right.property, disableStaticComputedKey) + ); + } + + default: + return false; + } +} + +/** + * Checks whether or not a node is `Reflect.apply`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Reflect.apply`. + */ +function isReflectApply(node) { + return isSpecificMemberAccess(node, "Reflect", "apply"); +} + +/** + * Checks whether or not a node is `Array.from`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Array.from`. + */ +function isArrayFromMethod(node) { + return isSpecificMemberAccess(node, arrayOrTypedArrayPattern, "from"); +} + +/** + * Checks whether or not a node is a method which has `thisArg`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a method which has `thisArg`. + */ +function isMethodWhichHasThisArg(node) { + return isSpecificMemberAccess(node, null, arrayMethodPattern); +} + +/** + * Creates the negate function of the given function. + * @param {Function} f The function to negate. + * @returns {Function} Negated function. + */ +function negate(f) { + return token => !f(token); +} + +/** + * Checks whether or not a node has a `@this` tag in its comments. + * @param {ASTNode} node A node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @returns {boolean} Whether or not the node has a `@this` tag in its comments. + */ +function hasJSDocThisTag(node, sourceCode) { + const jsdocComment = sourceCode.getJSDocComment(node); + + if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { + return true; + } + + // Checks `@this` in its leading comments for callbacks, + // because callbacks don't have its JSDoc comment. + // e.g. + // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); + return sourceCode.getCommentsBefore(node).some(comment => thisTagPattern.test(comment.value)); +} + +/** + * Determines if a node is surrounded by parentheses. + * @param {SourceCode} sourceCode The ESLint source code object + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ +function isParenthesised(sourceCode, node) { + const previousToken = sourceCode.getTokenBefore(node), + nextToken = sourceCode.getTokenAfter(node); + + return Boolean(previousToken && nextToken) && + previousToken.value === "(" && previousToken.range[1] <= node.range[0] && + nextToken.value === ")" && nextToken.range[0] >= node.range[1]; +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return token.value === "=>" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return token.value === "," && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a dot token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a dot token. + */ +function isDotToken(token) { + return token.value === "." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a `?.` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `?.` token. + */ +function isQuestionDotToken(token) { + return token.value === "?." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return token.value === ";" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return token.value === ":" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return token.value === "(" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return token.value === ")" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return token.value === "[" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return token.value === "]" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return token.value === "{" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return token.value === "}" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return token.type === "Line" || token.type === "Block" || token.type === "Shebang"; +} + +/** + * Checks if the given token is a keyword token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a keyword token. + */ +function isKeywordToken(token) { + return token.type === "Keyword"; +} + +/** + * Gets the `(` token of the given function node. + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken); +} + +/** + * Checks whether or not the tokens of two given nodes are same. + * @param {ASTNode} left A node 1 to compare. + * @param {ASTNode} right A node 2 to compare. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} the source code for the given node. + */ +function equalTokens(left, right, sourceCode) { + const tokensL = sourceCode.getTokens(left); + const tokensR = sourceCode.getTokens(right); + + if (tokensL.length !== tokensR.length) { + return false; + } + for (let i = 0; i < tokensL.length; ++i) { + if (tokensL[i].type !== tokensR[i].type || + tokensL[i].value !== tokensR[i].value + ) { + return false; + } + } + + return true; +} + +/** + * Check if the given node is a true logical expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function rejects coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `&&` or `||`. + * @see https://tc39.es/ecma262/#prod-ShortCircuitExpression + */ +function isLogicalExpression(node) { + return ( + node.type === "LogicalExpression" && + (node.operator === "&&" || node.operator === "||") + ); +} + +/** + * Check if the given node is a nullish coalescing expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function finds only coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `??`. + */ +function isCoalesceExpression(node) { + return node.type === "LogicalExpression" && node.operator === "??"; +} + +/** + * Check if given two nodes are the pair of a logical expression and a coalesce expression. + * @param {ASTNode} left A node to check. + * @param {ASTNode} right Another node to check. + * @returns {boolean} `true` if the two nodes are the pair of a logical expression and a coalesce expression. + */ +function isMixedLogicalAndCoalesceExpressions(left, right) { + return ( + (isLogicalExpression(left) && isCoalesceExpression(right)) || + (isCoalesceExpression(left) && isLogicalExpression(right)) + ); +} + +/** + * Checks if the given operator is a logical assignment operator. + * @param {string} operator The operator to check. + * @returns {boolean} `true` if the operator is a logical assignment operator. + */ +function isLogicalAssignmentOperator(operator) { + return LOGICAL_ASSIGNMENT_OPERATORS.has(operator); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + COMMENTS_IGNORE_PATTERN, + LINEBREAKS, + LINEBREAK_MATCHER: lineBreakPattern, + SHEBANG_MATCHER: shebangPattern, + STATEMENT_LIST_PARENTS, + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left The left token object. + * @param {Object} right The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + * @public + */ + isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; + }, + + isNullOrUndefined, + isCallee, + isES5Constructor, + getUpperFunction, + isFunction, + isLoop, + isInLoop, + isArrayFromMethod, + isParenthesised, + createGlobalLinebreakMatcher, + equalTokens, + + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isDotToken, + isQuestionDotToken, + isKeywordToken, + isNotClosingBraceToken: negate(isClosingBraceToken), + isNotClosingBracketToken: negate(isClosingBracketToken), + isNotClosingParenToken: negate(isClosingParenToken), + isNotColonToken: negate(isColonToken), + isNotCommaToken: negate(isCommaToken), + isNotDotToken: negate(isDotToken), + isNotQuestionDotToken: negate(isQuestionDotToken), + isNotOpeningBraceToken: negate(isOpeningBraceToken), + isNotOpeningBracketToken: negate(isOpeningBracketToken), + isNotOpeningParenToken: negate(isOpeningParenToken), + isNotSemicolonToken: negate(isSemicolonToken), + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isSemicolonToken, + + /** + * Checks whether or not a given node is a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a string literal. + */ + isStringLiteral(node) { + return ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ); + }, + + /** + * Checks whether a given node is a breakable statement or not. + * The node is breakable if the node is one of the following type: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - SwitchStatement + * - WhileStatement + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is breakable. + */ + isBreakableStatement(node) { + return breakableTypePattern.test(node.type); + }, + + /** + * Gets references which are non initializer and writable. + * @param {Reference[]} references An array of references. + * @returns {Reference[]} An array of only references which are non initializer and writable. + * @public + */ + getModifyingReferences(references) { + return references.filter(isModifyingReference); + }, + + /** + * Validate that a string passed in is surrounded by the specified character + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. + * @returns {boolean} True if the text is surrounded by the character, false if not. + * @private + */ + isSurroundedBy(val, character) { + return val[0] === character && val[val.length - 1] === character; + }, + + /** + * Returns whether the provided node is an ESLint directive comment or not + * @param {Line|Block} node The comment token to be checked + * @returns {boolean} `true` if the node is an ESLint directive comment + */ + isDirectiveComment(node) { + const comment = node.value.trim(); + + return ( + node.type === "Line" && comment.indexOf("eslint-") === 0 || + node.type === "Block" && ( + comment.indexOf("global ") === 0 || + comment.indexOf("eslint ") === 0 || + comment.indexOf("eslint-") === 0 + ) + ); + }, + + /** + * Gets the trailing statement of a given node. + * + * if (code) + * consequent; + * + * When taking this `IfStatement`, returns `consequent;` statement. + * @param {ASTNode} A node to get. + * @returns {ASTNode|null} The trailing statement's node. + */ + getTrailingStatement: esutils.ast.trailingStatement, + + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @param {string} name A variable name to find. + * @returns {eslint-scope.Variable|null} A found variable or `null`. + */ + getVariableByName(initScope, name) { + let scope = initScope; + + while (scope) { + const variable = scope.set.get(name); + + if (variable) { + return variable; + } + + scope = scope.upper; + } + + return null; + }, + + /** + * Checks whether or not a given function node is the default `this` binding. + * + * First, this checks the node: + * + * - The function name does not start with uppercase. It's a convention to capitalize the names + * of constructor functions. This check is not performed if `capIsConstructor` is set to `false`. + * - The function does not have a JSDoc comment that has a @this tag. + * + * Next, this checks the location of the node. + * If the location is below, this judges `this` is valid. + * + * - The location is not on an object literal. + * - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous + * functions only, as the name of the variable is considered to be the name of the function in this case. + * This check is not performed if `capIsConstructor` is set to `false`. + * - The location is not on an ES2015 class. + * - Its `bind`/`call`/`apply` method is not called directly. + * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. + * @param {ASTNode} node A function node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts + * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors. + * @returns {boolean} The function node is the default `this` binding. + */ + isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) { + if ( + (capIsConstructor && isES5Constructor(node)) || + hasJSDocThisTag(node, sourceCode) + ) { + return false; + } + const isAnonymous = node.id === null; + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. + * e.g., obj.foo = nativeFoo || function foo() { ... }; + */ + case "LogicalExpression": + case "ConditionalExpression": + case "ChainExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * obj.foo = (function() { + * // setup... + * return function foo() { ... }; + * })(); + * obj.foo = (() => + * function foo() { ... } + * )(); + */ + case "ReturnStatement": { + const func = getUpperFunction(parent); + + if (func === null || !isCallee(func)) { + return true; + } + currentNode = func.parent; + break; + } + case "ArrowFunctionExpression": + if (currentNode !== parent.body || !isCallee(parent)) { + return true; + } + currentNode = parent.parent; + break; + + /* + * e.g. + * var obj = { foo() { ... } }; + * var obj = { foo: function() { ... } }; + * class A { constructor() { ... } } + * class A { foo() { ... } } + * class A { get foo() { ... } } + * class A { set foo() { ... } } + * class A { static foo() { ... } } + */ + case "Property": + case "MethodDefinition": + return parent.value !== currentNode; + + /* + * e.g. + * obj.foo = function foo() { ... }; + * Foo = function() { ... }; + * [obj.foo = function foo() { ... }] = a; + * [Foo = function() { ... }] = a; + */ + case "AssignmentExpression": + case "AssignmentPattern": + if (parent.left.type === "MemberExpression") { + return false; + } + if ( + capIsConstructor && + isAnonymous && + parent.left.type === "Identifier" && + startsWithUpperCase(parent.left.name) + ) { + return false; + } + return true; + + /* + * e.g. + * var Foo = function() { ... }; + */ + case "VariableDeclarator": + return !( + capIsConstructor && + isAnonymous && + parent.init === currentNode && + parent.id.type === "Identifier" && + startsWithUpperCase(parent.id.name) + ); + + /* + * e.g. + * var foo = function foo() { ... }.bind(obj); + * (function foo() { ... }).call(obj); + * (function foo() { ... }).apply(obj, []); + */ + case "MemberExpression": + if ( + parent.object === currentNode && + isSpecificMemberAccess(parent, null, bindOrCallOrApplyPattern) + ) { + const maybeCalleeNode = parent.parent.type === "ChainExpression" + ? parent.parent + : parent; + + return !( + isCallee(maybeCalleeNode) && + maybeCalleeNode.parent.arguments.length >= 1 && + !isNullOrUndefined(maybeCalleeNode.parent.arguments[0]) + ); + } + return true; + + /* + * e.g. + * Reflect.apply(function() {}, obj, []); + * Array.from([], function() {}, obj); + * list.forEach(function() {}, obj); + */ + case "CallExpression": + if (isReflectApply(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + if (isArrayFromMethod(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[1] !== currentNode || + isNullOrUndefined(parent.arguments[2]) + ); + } + if (isMethodWhichHasThisArg(parent.callee)) { + return ( + parent.arguments.length !== 2 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + return true; + + // Otherwise `this` is default. + default: + return true; + } + } + + /* istanbul ignore next */ + return true; + }, + + /** + * Get the precedence level based on the node type + * @param {ASTNode} node node to evaluate + * @returns {int} precedence level + * @private + */ + getPrecedence(node) { + switch (node.type) { + case "SequenceExpression": + return 0; + + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "YieldExpression": + return 1; + + case "ConditionalExpression": + return 3; + + case "LogicalExpression": + switch (node.operator) { + case "||": + case "??": + return 4; + case "&&": + return 5; + + // no default + } + + /* falls through */ + + case "BinaryExpression": + + switch (node.operator) { + case "|": + return 6; + case "^": + return 7; + case "&": + return 8; + case "==": + case "!=": + case "===": + case "!==": + return 9; + case "<": + case "<=": + case ">": + case ">=": + case "in": + case "instanceof": + return 10; + case "<<": + case ">>": + case ">>>": + return 11; + case "+": + case "-": + return 12; + case "*": + case "/": + case "%": + return 13; + case "**": + return 15; + + // no default + } + + /* falls through */ + + case "UnaryExpression": + case "AwaitExpression": + return 16; + + case "UpdateExpression": + return 17; + + case "CallExpression": + case "ChainExpression": + case "ImportExpression": + return 18; + + case "NewExpression": + return 19; + + default: + return 20; + } + }, + + /** + * Checks whether the given node is an empty block node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty block. + */ + isEmptyBlock(node) { + return Boolean(node && node.type === "BlockStatement" && node.body.length === 0); + }, + + /** + * Checks whether the given node is an empty function node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty function. + */ + isEmptyFunction(node) { + return isFunction(node) && module.exports.isEmptyBlock(node.body); + }, + + /** + * Get directives from directive prologue of a Program or Function node. + * @param {ASTNode} node The node to check. + * @returns {ASTNode[]} The directives found in the directive prologue. + */ + getDirectivePrologue(node) { + const directives = []; + + // Directive prologues only occur at the top of files or functions. + if ( + node.type === "Program" || + node.type === "FunctionDeclaration" || + node.type === "FunctionExpression" || + + /* + * Do not check arrow functions with implicit return. + * `() => "use strict";` returns the string `"use strict"`. + */ + (node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement") + ) { + const statements = node.type === "Program" ? node.body : node.body.body; + + for (const statement of statements) { + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" + ) { + directives.push(statement); + } else { + break; + } + } + } + + return directives; + }, + + + /** + * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added + * after the node will be parsed as a decimal point, rather than a property-access dot. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if this node is a decimal integer. + * @example + * + * 0 // true + * 5 // true + * 50 // true + * 5_000 // true + * 1_234_56 // true + * 08 // true + * 0192 // true + * 5. // false + * .5 // false + * 5.0 // false + * 5.00_00 // false + * 05 // false + * 0x5 // false + * 0b101 // false + * 0b11_01 // false + * 0o5 // false + * 5e0 // false + * 5e1_000 // false + * 5n // false + * 1_000n // false + * '5' // false + */ + isDecimalInteger(node) { + return node.type === "Literal" && typeof node.value === "number" && + DECIMAL_INTEGER_PATTERN.test(node.raw); + }, + + /** + * Determines whether this token is a decimal integer numeric token. + * This is similar to isDecimalInteger(), but for tokens. + * @param {Token} token The token to check. + * @returns {boolean} `true` if this token is a decimal integer. + */ + isDecimalIntegerNumericToken(token) { + return token.type === "Numeric" && DECIMAL_INTEGER_PATTERN.test(token.value); + }, + + /** + * Gets the name and kind of the given function node. + * + * - `function foo() {}` .................... `function 'foo'` + * - `(function foo() {})` .................. `function 'foo'` + * - `(function() {})` ...................... `function` + * - `function* foo() {}` ................... `generator function 'foo'` + * - `(function* foo() {})` ................. `generator function 'foo'` + * - `(function*() {})` ..................... `generator function` + * - `() => {}` ............................. `arrow function` + * - `async () => {}` ....................... `async arrow function` + * - `({ foo: function foo() {} })` ......... `method 'foo'` + * - `({ foo: function() {} })` ............. `method 'foo'` + * - `({ ['foo']: function() {} })` ......... `method 'foo'` + * - `({ [foo]: function() {} })` ........... `method` + * - `({ foo() {} })` ....................... `method 'foo'` + * - `({ foo: function* foo() {} })` ........ `generator method 'foo'` + * - `({ foo: function*() {} })` ............ `generator method 'foo'` + * - `({ ['foo']: function*() {} })` ........ `generator method 'foo'` + * - `({ [foo]: function*() {} })` .......... `generator method` + * - `({ *foo() {} })` ...................... `generator method 'foo'` + * - `({ foo: async function foo() {} })` ... `async method 'foo'` + * - `({ foo: async function() {} })` ....... `async method 'foo'` + * - `({ ['foo']: async function() {} })` ... `async method 'foo'` + * - `({ [foo]: async function() {} })` ..... `async method` + * - `({ async foo() {} })` ................. `async method 'foo'` + * - `({ get foo() {} })` ................... `getter 'foo'` + * - `({ set foo(a) {} })` .................. `setter 'foo'` + * - `class A { constructor() {} }` ......... `constructor` + * - `class A { foo() {} }` ................. `method 'foo'` + * - `class A { *foo() {} }` ................ `generator method 'foo'` + * - `class A { async foo() {} }` ........... `async method 'foo'` + * - `class A { ['foo']() {} }` ............. `method 'foo'` + * - `class A { *['foo']() {} }` ............ `generator method 'foo'` + * - `class A { async ['foo']() {} }` ....... `async method 'foo'` + * - `class A { [foo]() {} }` ............... `method` + * - `class A { *[foo]() {} }` .............. `generator method` + * - `class A { async [foo]() {} }` ......... `async method` + * - `class A { get foo() {} }` ............. `getter 'foo'` + * - `class A { set foo(a) {} }` ............ `setter 'foo'` + * - `class A { static foo() {} }` .......... `static method 'foo'` + * - `class A { static *foo() {} }` ......... `static generator method 'foo'` + * - `class A { static async foo() {} }` .... `static async method 'foo'` + * - `class A { static get foo() {} }` ...... `static getter 'foo'` + * - `class A { static set foo(a) {} }` ..... `static setter 'foo'` + * @param {ASTNode} node The function node to get. + * @returns {string} The name and kind of the function node. + */ + getFunctionNameWithKind(node) { + const parent = node.parent; + const tokens = []; + + if (parent.type === "MethodDefinition" && parent.static) { + tokens.push("static"); + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow", "function"); + } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + if (parent.kind === "constructor") { + return "constructor"; + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else { + tokens.push("function"); + } + + if (node.id) { + tokens.push(`'${node.id.name}'`); + } else { + const name = getStaticPropertyName(parent); + + if (name !== null) { + tokens.push(`'${name}'`); + } + } + + return tokens.join(" "); + }, + + /** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ + getFunctionHeadLoc(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: Object.assign({}, start), + end: Object.assign({}, end) + }; + }, + + /** + * Gets next location when the result is not out of bound, otherwise returns null. + * + * Assumptions: + * + * - The given location represents a valid location in the given source code. + * - Columns are 0-based. + * - Lines are 1-based. + * - Column immediately after the last character in a line (not incl. linebreaks) is considered to be a valid location. + * - If the source code ends with a linebreak, `sourceCode.lines` array will have an extra element (empty string) at the end. + * The start (column 0) of that extra line is considered to be a valid location. + * + * Examples of successive locations (line, column): + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: a + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (3, 0) -> null + * + * code: + * locations: (1, 0) -> (2, 0) -> null + * + * code: + * locations: (1, 0) -> null + * @param {SourceCode} sourceCode The sourceCode + * @param {{line: number, column: number}} location The location + * @returns {{line: number, column: number} | null} Next location + */ + getNextLocation(sourceCode, { line, column }) { + if (column < sourceCode.lines[line - 1].length) { + return { + line, + column: column + 1 + }; + } + + if (line < sourceCode.lines.length) { + return { + line: line + 1, + column: 0 + }; + } + + return null; + }, + + /** + * Gets the parenthesized text of a node. This is similar to sourceCode.getText(node), but it also includes any parentheses + * surrounding the node. + * @param {SourceCode} sourceCode The source code object + * @param {ASTNode} node An expression node + * @returns {string} The text representing the node, with all surrounding parentheses included + */ + getParenthesisedText(sourceCode, node) { + let leftToken = sourceCode.getFirstToken(node); + let rightToken = sourceCode.getLastToken(node); + + while ( + sourceCode.getTokenBefore(leftToken) && + sourceCode.getTokenBefore(leftToken).type === "Punctuator" && + sourceCode.getTokenBefore(leftToken).value === "(" && + sourceCode.getTokenAfter(rightToken) && + sourceCode.getTokenAfter(rightToken).type === "Punctuator" && + sourceCode.getTokenAfter(rightToken).value === ")" + ) { + leftToken = sourceCode.getTokenBefore(leftToken); + rightToken = sourceCode.getTokenAfter(rightToken); + } + + return sourceCode.getText().slice(leftToken.range[0], rightToken.range[1]); + }, + + /* + * Determine if a node has a possiblity to be an Error object + * @param {ASTNode} node ASTNode to check + * @returns {boolean} True if there is a chance it contains an Error obj + */ + couldBeError(node) { + switch (node.type) { + case "Identifier": + case "CallExpression": + case "NewExpression": + case "MemberExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + case "AwaitExpression": + case "ChainExpression": + return true; // possibly an error object. + + case "AssignmentExpression": + if (["=", "&&="].includes(node.operator)) { + return module.exports.couldBeError(node.right); + } + + if (["||=", "??="].includes(node.operator)) { + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + } + + /** + * All other assignment operators are mathematical assignment operators (arithmetic or bitwise). + * An assignment expression with a mathematical operator can either evaluate to a primitive value, + * or throw, depending on the operands. Thus, it cannot evaluate to an `Error` object. + */ + return false; + + case "SequenceExpression": { + const exprs = node.expressions; + + return exprs.length !== 0 && module.exports.couldBeError(exprs[exprs.length - 1]); + } + + case "LogicalExpression": + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + + case "ConditionalExpression": + return module.exports.couldBeError(node.consequent) || module.exports.couldBeError(node.alternate); + + default: + return false; + } + }, + + /** + * Check if a given node is a numeric literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a number or bigint literal. + */ + isNumericLiteral(node) { + return ( + node.type === "Literal" && + (typeof node.value === "number" || Boolean(node.bigint)) + ); + }, + + /** + * Determines whether two tokens can safely be placed next to each other without merging into a single token + * @param {Token|string} leftValue The left token. If this is a string, it will be tokenized and the last token will be used. + * @param {Token|string} rightValue The right token. If this is a string, it will be tokenized and the first token will be used. + * @returns {boolean} If the tokens cannot be safely placed next to each other, returns `false`. If the tokens can be placed + * next to each other, behavior is undefined (although it should return `true` in most cases). + */ + canTokensBeAdjacent(leftValue, rightValue) { + const espreeOptions = { + ecmaVersion: espree.latestEcmaVersion, + comment: true, + range: true + }; + + let leftToken; + + if (typeof leftValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(leftValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + leftToken = tokens[tokens.length - 1]; + if (comments.length) { + const lastComment = comments[comments.length - 1]; + + if (lastComment.range[0] > leftToken.range[0]) { + leftToken = lastComment; + } + } + } else { + leftToken = leftValue; + } + + if (leftToken.type === "Shebang") { + return false; + } + + let rightToken; + + if (typeof rightValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(rightValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + rightToken = tokens[0]; + if (comments.length) { + const firstComment = comments[0]; + + if (firstComment.range[0] < rightToken.range[0]) { + rightToken = firstComment; + } + } + } else { + rightToken = rightValue; + } + + if (leftToken.type === "Punctuator" || rightToken.type === "Punctuator") { + if (leftToken.type === "Punctuator" && rightToken.type === "Punctuator") { + const PLUS_TOKENS = new Set(["+", "++"]); + const MINUS_TOKENS = new Set(["-", "--"]); + + return !( + PLUS_TOKENS.has(leftToken.value) && PLUS_TOKENS.has(rightToken.value) || + MINUS_TOKENS.has(leftToken.value) && MINUS_TOKENS.has(rightToken.value) + ); + } + if (leftToken.type === "Punctuator" && leftToken.value === "/") { + return !["Block", "Line", "RegularExpression"].includes(rightToken.type); + } + return true; + } + + if ( + leftToken.type === "String" || rightToken.type === "String" || + leftToken.type === "Template" || rightToken.type === "Template" + ) { + return true; + } + + if (leftToken.type !== "Numeric" && rightToken.type === "Numeric" && rightToken.value.startsWith(".")) { + return true; + } + + if (leftToken.type === "Block" || rightToken.type === "Block" || rightToken.type === "Line") { + return true; + } + + return false; + }, + + /** + * Get the `loc` object of a given name in a `/*globals` directive comment. + * @param {SourceCode} sourceCode The source code to convert index to loc. + * @param {Comment} comment The `/*globals` directive comment which include the name. + * @param {string} name The name to find. + * @returns {SourceLocation} The `loc` object. + */ + getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${lodash.escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); + + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf("global") + 6; + + // Search a given variable name. + const match = namePattern.exec(comment.value); + + // Convert the index to loc. + const start = sourceCode.getLocFromIndex( + comment.range[0] + + "/*".length + + (match ? match.index + 1 : 0) + ); + const end = { + line: start.line, + column: start.column + (match ? name.length : 1) + }; + + return { start, end }; + }, + + /** + * Determines whether the given raw string contains an octal escape sequence. + * + * "\1", "\2" ... "\7" + * "\00", "\01" ... "\09" + * + * "\0", when not followed by a digit, is not an octal escape sequence. + * @param {string} rawString A string in its raw representation. + * @returns {boolean} `true` if the string contains at least one octal escape sequence. + */ + hasOctalEscapeSequence(rawString) { + return OCTAL_ESCAPE_PATTERN.test(rawString); + }, + + isLogicalExpression, + isCoalesceExpression, + isMixedLogicalAndCoalesceExpressions, + isNullLiteral, + getStaticStringValue, + getStaticPropertyName, + skipChainExpression, + isSpecificId, + isSpecificMemberAccess, + equalLiteralValue, + isSameReference, + isLogicalAssignmentOperator +}; diff --git a/node_modules/eslint/lib/rules/utils/fix-tracker.js b/node_modules/eslint/lib/rules/utils/fix-tracker.js new file mode 100644 index 0000000..589870b --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/fix-tracker.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Helper class to aid in constructing fix commands. + * @author Alan Pierce + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./ast-utils"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A helper class to combine fix options into a fix command. Currently, it + * exposes some "retain" methods that extend the range of the text being + * replaced so that other fixes won't touch that region in the same pass. + */ +class FixTracker { + + /** + * Create a new FixTracker. + * @param {ruleFixer} fixer A ruleFixer instance. + * @param {SourceCode} sourceCode A SourceCode object for the current code. + */ + constructor(fixer, sourceCode) { + this.fixer = fixer; + this.sourceCode = sourceCode; + this.retainedRange = null; + } + + /** + * Mark the given range as "retained", meaning that other fixes may not + * may not modify this region in the same pass. + * @param {int[]} range The range to retain. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainRange(range) { + this.retainedRange = range; + return this; + } + + /** + * Given a node, find the function containing it (or the entire program) and + * mark it as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that modify control + * flow. + * @param {ASTNode} node The node to use as a starting point. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainEnclosingFunction(node) { + const functionNode = astUtils.getUpperFunction(node); + + return this.retainRange(functionNode ? functionNode.range : this.sourceCode.ast.range); + } + + /** + * Given a node or token, find the token before and afterward, and mark that + * range as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that make a small + * change to the code where the AST should not be changed. + * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting + * point. The token to the left and right are use in the range. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainSurroundingTokens(nodeOrToken) { + const tokenBefore = this.sourceCode.getTokenBefore(nodeOrToken) || nodeOrToken; + const tokenAfter = this.sourceCode.getTokenAfter(nodeOrToken) || nodeOrToken; + + return this.retainRange([tokenBefore.range[0], tokenAfter.range[1]]); + } + + /** + * Create a fix command that replaces the given range with the given text, + * accounting for any retained ranges. + * @param {int[]} range The range to remove in the fix. + * @param {string} text The text to insert in place of the range. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + let actualRange; + + if (this.retainedRange) { + actualRange = [ + Math.min(this.retainedRange[0], range[0]), + Math.max(this.retainedRange[1], range[1]) + ]; + } else { + actualRange = range; + } + + return this.fixer.replaceTextRange( + actualRange, + this.sourceCode.text.slice(actualRange[0], range[0]) + + text + + this.sourceCode.text.slice(range[1], actualRange[1]) + ); + } + + /** + * Create a fix command that removes the given node or token, accounting for + * any retained ranges. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.replaceTextRange(nodeOrToken.range, ""); + } +} + +module.exports = FixTracker; diff --git a/node_modules/eslint/lib/rules/utils/keywords.js b/node_modules/eslint/lib/rules/utils/keywords.js new file mode 100644 index 0000000..3fbb777 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/keywords.js @@ -0,0 +1,67 @@ +/** + * @fileoverview A shared list of ES3 keywords. + * @author Josh Perez + */ +"use strict"; + +module.exports = [ + "abstract", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with" +]; diff --git a/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js new file mode 100644 index 0000000..d426d85 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js @@ -0,0 +1,115 @@ +/** + * @fileoverview `Map` to load rules lazily. + * @author Toru Nagashima + */ +"use strict"; + +const debug = require("debug")("eslint:rules"); + +/** @typedef {import("./types").Rule} Rule */ + +/** + * The `Map` object that loads each rule when it's accessed. + * @example + * const rules = new LazyLoadingRuleMap([ + * ["eqeqeq", () => require("eqeqeq")], + * ["semi", () => require("semi")], + * ["no-unused-vars", () => require("no-unused-vars")], + * ]) + * + * rules.get("semi") // call `() => require("semi")` here. + * + * @extends {Map Rule>} + */ +class LazyLoadingRuleMap extends Map { + + /** + * Initialize this map. + * @param {Array<[string, function(): Rule]>} loaders The rule loaders. + */ + constructor(loaders) { + let remaining = loaders.length; + + super( + debug.enabled + ? loaders.map(([ruleId, load]) => { + let cache = null; + + return [ + ruleId, + () => { + if (!cache) { + debug("Loading rule %o (remaining=%d)", ruleId, --remaining); + cache = load(); + } + return cache; + } + ]; + }) + : loaders + ); + + // `super(...iterable)` uses `this.set()`, so disable it here. + Object.defineProperty(LazyLoadingRuleMap.prototype, "set", { + configurable: true, + value: void 0 + }); + } + + /** + * Get a rule. + * Each rule will be loaded on the first access. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|undefined} The rule. + */ + get(ruleId) { + const load = super.get(ruleId); + + return load && load(); + } + + /** + * Iterate rules. + * @returns {IterableIterator} Rules. + */ + *values() { + for (const load of super.values()) { + yield load(); + } + } + + /** + * Iterate rules. + * @returns {IterableIterator<[string, Rule]>} Rules. + */ + *entries() { + for (const [ruleId, load] of super.entries()) { + yield [ruleId, load()]; + } + } + + /** + * Call a function with each rule. + * @param {Function} callbackFn The callback function. + * @param {any} [thisArg] The object to pass to `this` of the callback function. + * @returns {void} + */ + forEach(callbackFn, thisArg) { + for (const [ruleId, load] of super.entries()) { + callbackFn.call(thisArg, load(), ruleId, this); + } + } +} + +// Forbid mutation. +Object.defineProperties(LazyLoadingRuleMap.prototype, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + [Symbol.iterator]: { + configurable: true, + writable: true, + value: LazyLoadingRuleMap.prototype.entries + } +}); + +module.exports = { LazyLoadingRuleMap }; diff --git a/node_modules/eslint/lib/rules/utils/patterns/letters.js b/node_modules/eslint/lib/rules/utils/patterns/letters.js new file mode 100644 index 0000000..9bb2de3 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/patterns/letters.js @@ -0,0 +1,36 @@ +/** + * @fileoverview Pattern for detecting any letter (even letters outside of ASCII). + * NOTE: This file was generated using this script in JSCS based on the Unicode 7.0.0 standard: https://github.com/jscs-dev/node-jscs/blob/f5ed14427deb7e7aac84f3056a5aab2d9f3e563e/publish/helpers/generate-patterns.js + * Do not edit this file by hand-- please use https://github.com/mathiasbynens/regenerate to regenerate the regular expression exported from this file. + * @author Kevin Partington + * @license MIT License (from JSCS). See below. + */ + +/* + * The MIT License (MIT) + * + * Copyright 2013-2016 Dulin Marat 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. + */ + +"use strict"; + +module.exports = /[A-Za-z\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-\u08B2\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\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\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\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\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184\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\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\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\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]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\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]|\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]|\uD87E[\uDC00-\uDE1D]/u; diff --git a/node_modules/eslint/lib/rules/utils/unicode/index.js b/node_modules/eslint/lib/rules/utils/unicode/index.js new file mode 100644 index 0000000..02eea50 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/index.js @@ -0,0 +1,11 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +module.exports = { + isCombiningCharacter: require("./is-combining-character"), + isEmojiModifier: require("./is-emoji-modifier"), + isRegionalIndicatorSymbol: require("./is-regional-indicator-symbol"), + isSurrogatePair: require("./is-surrogate-pair") +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js b/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js new file mode 100644 index 0000000..0498b99 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a combining mark or not. + * @param {number} codePoint The character code to check. + * @returns {boolean} `true` if the character belongs to the category, any of `Mc`, `Me`, and `Mn`. + */ +module.exports = function isCombiningCharacter(codePoint) { + return /^[\p{Mc}\p{Me}\p{Mn}]$/u.test(String.fromCodePoint(codePoint)); +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js b/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js new file mode 100644 index 0000000..1bd5f55 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is an emoji modifier. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is an emoji modifier. + */ +module.exports = function isEmojiModifier(code) { + return code >= 0x1F3FB && code <= 0x1F3FF; +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js b/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js new file mode 100644 index 0000000..c48ed46 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a regional indicator symbol. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is a regional indicator symbol. + */ +module.exports = function isRegionalIndicatorSymbol(code) { + return code >= 0x1F1E6 && code <= 0x1F1FF; +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js b/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js new file mode 100644 index 0000000..b8e5c1c --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js @@ -0,0 +1,14 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether given two characters are a surrogate pair. + * @param {number} lead The code of the lead character. + * @param {number} tail The code of the tail character. + * @returns {boolean} `true` if the character pair is a surrogate pair. + */ +module.exports = function isSurrogatePair(lead, tail) { + return lead >= 0xD800 && lead < 0xDC00 && tail >= 0xDC00 && tail < 0xE000; +}; diff --git a/node_modules/eslint/lib/rules/valid-jsdoc.js b/node_modules/eslint/lib/rules/valid-jsdoc.js new file mode 100644 index 0000000..9ec6938 --- /dev/null +++ b/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -0,0 +1,515 @@ +/** + * @fileoverview Validates JSDoc comments are syntactically correct + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const doctrine = require("doctrine"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce valid JSDoc comments", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/valid-jsdoc" + }, + + schema: [ + { + type: "object", + properties: { + prefer: { + type: "object", + additionalProperties: { + type: "string" + } + }, + preferType: { + type: "object", + additionalProperties: { + type: "string" + } + }, + requireReturn: { + type: "boolean", + default: true + }, + requireParamDescription: { + type: "boolean", + default: true + }, + requireReturnDescription: { + type: "boolean", + default: true + }, + matchDescription: { + type: "string" + }, + requireReturnType: { + type: "boolean", + default: true + }, + requireParamType: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + unexpectedTag: "Unexpected @{{title}} tag; function has no return statement.", + expected: "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", + use: "Use @{{name}} instead.", + useType: "Use '{{expectedTypeName}}' instead of '{{currentTypeName}}'.", + syntaxError: "JSDoc syntax error.", + missingBrace: "JSDoc type missing brace.", + missingParamDesc: "Missing JSDoc parameter description for '{{name}}'.", + missingParamType: "Missing JSDoc parameter type for '{{name}}'.", + missingReturnType: "Missing JSDoc return type.", + missingReturnDesc: "Missing JSDoc return description.", + missingReturn: "Missing JSDoc @{{returns}} for function.", + missingParam: "Missing JSDoc for parameter '{{name}}'.", + duplicateParam: "Duplicate JSDoc parameter '{{name}}'.", + unsatisfiedDesc: "JSDoc description does not satisfy the regex pattern." + }, + + deprecated: true, + replacedBy: [] + }, + + create(context) { + + const options = context.options[0] || {}, + prefer = options.prefer || {}, + sourceCode = context.getSourceCode(), + + // these both default to true, so you have to explicitly make them false + requireReturn = options.requireReturn !== false, + requireParamDescription = options.requireParamDescription !== false, + requireReturnDescription = options.requireReturnDescription !== false, + requireReturnType = options.requireReturnType !== false, + requireParamType = options.requireParamType !== false, + preferType = options.preferType || {}, + checkPreferType = Object.keys(preferType).length !== 0; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store if a function returns or not (handling nested functions) + const fns = []; + + /** + * Check if node type is a Class + * @param {ASTNode} node node to check. + * @returns {boolean} True is its a class + * @private + */ + function isTypeClass(node) { + return node.type === "ClassExpression" || node.type === "ClassDeclaration"; + } + + /** + * When parsing a new function, store it in our function stack. + * @param {ASTNode} node A function node to check. + * @returns {void} + * @private + */ + function startFunction(node) { + fns.push({ + returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") || + isTypeClass(node) || node.async + }); + } + + /** + * Indicate that return has been found in the current function. + * @param {ASTNode} node The return node. + * @returns {void} + * @private + */ + function addReturn(node) { + const functionState = fns[fns.length - 1]; + + if (functionState && node.argument !== null) { + functionState.returnPresent = true; + } + } + + /** + * Check if return tag type is void or undefined + * @param {Object} tag JSDoc tag + * @returns {boolean} True if its of type void or undefined + * @private + */ + function isValidReturnType(tag) { + return tag.type === null || tag.type.name === "void" || tag.type.type === "UndefinedLiteral"; + } + + /** + * Check if type should be validated based on some exceptions + * @param {Object} type JSDoc tag + * @returns {boolean} True if it can be validated + * @private + */ + function canTypeBeValidated(type) { + return type !== "UndefinedLiteral" && // {undefined} as there is no name property available. + type !== "NullLiteral" && // {null} + type !== "NullableLiteral" && // {?} + type !== "FunctionType" && // {function(a)} + type !== "AllLiteral"; // {*} + } + + /** + * Extract the current and expected type based on the input type object + * @param {Object} type JSDoc tag + * @returns {{currentType: Doctrine.Type, expectedTypeName: string}} The current type annotation and + * the expected name of the annotation + * @private + */ + function getCurrentExpectedTypes(type) { + let currentType; + + if (type.name) { + currentType = type; + } else if (type.expression) { + currentType = type.expression; + } + + return { + currentType, + expectedTypeName: currentType && preferType[currentType.name] + }; + } + + /** + * Gets the location of a JSDoc node in a file + * @param {Token} jsdocComment The comment that this node is parsed from + * @param {{range: number[]}} parsedJsdocNode A tag or other node which was parsed from this comment + * @returns {{start: SourceLocation, end: SourceLocation}} The 0-based source location for the tag + */ + function getAbsoluteRange(jsdocComment, parsedJsdocNode) { + return { + start: sourceCode.getLocFromIndex(jsdocComment.range[0] + 2 + parsedJsdocNode.range[0]), + end: sourceCode.getLocFromIndex(jsdocComment.range[0] + 2 + parsedJsdocNode.range[1]) + }; + } + + /** + * Validate type for a given JSDoc node + * @param {Object} jsdocNode JSDoc node + * @param {Object} type JSDoc tag + * @returns {void} + * @private + */ + function validateType(jsdocNode, type) { + if (!type || !canTypeBeValidated(type.type)) { + return; + } + + const typesToCheck = []; + let elements = []; + + switch (type.type) { + case "TypeApplication": // {Array.} + elements = type.applications[0].type === "UnionType" ? type.applications[0].elements : type.applications; + typesToCheck.push(getCurrentExpectedTypes(type)); + break; + case "RecordType": // {{20:String}} + elements = type.fields; + break; + case "UnionType": // {String|number|Test} + case "ArrayType": // {[String, number, Test]} + elements = type.elements; + break; + case "FieldType": // Array.<{count: number, votes: number}> + if (type.value) { + typesToCheck.push(getCurrentExpectedTypes(type.value)); + } + break; + default: + typesToCheck.push(getCurrentExpectedTypes(type)); + } + + elements.forEach(validateType.bind(null, jsdocNode)); + + typesToCheck.forEach(typeToCheck => { + if (typeToCheck.expectedTypeName && + typeToCheck.expectedTypeName !== typeToCheck.currentType.name) { + context.report({ + node: jsdocNode, + messageId: "useType", + loc: getAbsoluteRange(jsdocNode, typeToCheck.currentType), + data: { + currentTypeName: typeToCheck.currentType.name, + expectedTypeName: typeToCheck.expectedTypeName + }, + fix(fixer) { + return fixer.replaceTextRange( + typeToCheck.currentType.range.map(indexInComment => jsdocNode.range[0] + 2 + indexInComment), + typeToCheck.expectedTypeName + ); + } + }); + } + }); + } + + /** + * Validate the JSDoc node and output warnings if anything is wrong. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkJSDoc(node) { + const jsdocNode = sourceCode.getJSDocComment(node), + functionData = fns.pop(), + paramTagsByName = Object.create(null), + paramTags = []; + let hasReturns = false, + returnsTag, + hasConstructor = false, + isInterface = false, + isOverride = false, + isAbstract = false; + + // make sure only to validate JSDoc comments + if (jsdocNode) { + let jsdoc; + + try { + jsdoc = doctrine.parse(jsdocNode.value, { + strict: true, + unwrap: true, + sloppy: true, + range: true + }); + } catch (ex) { + + if (/braces/iu.test(ex.message)) { + context.report({ node: jsdocNode, messageId: "missingBrace" }); + } else { + context.report({ node: jsdocNode, messageId: "syntaxError" }); + } + + return; + } + + jsdoc.tags.forEach(tag => { + + switch (tag.title.toLowerCase()) { + + case "param": + case "arg": + case "argument": + paramTags.push(tag); + break; + + case "return": + case "returns": + hasReturns = true; + returnsTag = tag; + break; + + case "constructor": + case "class": + hasConstructor = true; + break; + + case "override": + case "inheritdoc": + isOverride = true; + break; + + case "abstract": + case "virtual": + isAbstract = true; + break; + + case "interface": + isInterface = true; + break; + + // no default + } + + // check tag preferences + if (Object.prototype.hasOwnProperty.call(prefer, tag.title) && tag.title !== prefer[tag.title]) { + const entireTagRange = getAbsoluteRange(jsdocNode, tag); + + context.report({ + node: jsdocNode, + messageId: "use", + loc: { + start: entireTagRange.start, + end: { + line: entireTagRange.start.line, + column: entireTagRange.start.column + `@${tag.title}`.length + } + }, + data: { name: prefer[tag.title] }, + fix(fixer) { + return fixer.replaceTextRange( + [ + jsdocNode.range[0] + tag.range[0] + 3, + jsdocNode.range[0] + tag.range[0] + tag.title.length + 3 + ], + prefer[tag.title] + ); + } + }); + } + + // validate the types + if (checkPreferType && tag.type) { + validateType(jsdocNode, tag.type); + } + }); + + paramTags.forEach(param => { + if (requireParamType && !param.type) { + context.report({ + node: jsdocNode, + messageId: "missingParamType", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } + if (!param.description && requireParamDescription) { + context.report({ + node: jsdocNode, + messageId: "missingParamDesc", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } + if (paramTagsByName[param.name]) { + context.report({ + node: jsdocNode, + messageId: "duplicateParam", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } else if (param.name.indexOf(".") === -1) { + paramTagsByName[param.name] = param; + } + }); + + if (hasReturns) { + if (!requireReturn && !functionData.returnPresent && (returnsTag.type === null || !isValidReturnType(returnsTag)) && !isAbstract) { + context.report({ + node: jsdocNode, + messageId: "unexpectedTag", + loc: getAbsoluteRange(jsdocNode, returnsTag), + data: { + title: returnsTag.title + } + }); + } else { + if (requireReturnType && !returnsTag.type) { + context.report({ node: jsdocNode, messageId: "missingReturnType" }); + } + + if (!isValidReturnType(returnsTag) && !returnsTag.description && requireReturnDescription) { + context.report({ node: jsdocNode, messageId: "missingReturnDesc" }); + } + } + } + + // check for functions missing @returns + if (!isOverride && !hasReturns && !hasConstructor && !isInterface && + node.parent.kind !== "get" && node.parent.kind !== "constructor" && + node.parent.kind !== "set" && !isTypeClass(node)) { + if (requireReturn || (functionData.returnPresent && !node.async)) { + context.report({ + node: jsdocNode, + messageId: "missingReturn", + data: { + returns: prefer.returns || "returns" + } + }); + } + } + + // check the parameters + const jsdocParamNames = Object.keys(paramTagsByName); + + if (node.params) { + node.params.forEach((param, paramsIndex) => { + const bindingParam = param.type === "AssignmentPattern" + ? param.left + : param; + + // TODO(nzakas): Figure out logical things to do with destructured, default, rest params + if (bindingParam.type === "Identifier") { + const name = bindingParam.name; + + if (jsdocParamNames[paramsIndex] && (name !== jsdocParamNames[paramsIndex])) { + context.report({ + node: jsdocNode, + messageId: "expected", + loc: getAbsoluteRange(jsdocNode, paramTagsByName[jsdocParamNames[paramsIndex]]), + data: { + name, + jsdocName: jsdocParamNames[paramsIndex] + } + }); + } else if (!paramTagsByName[name] && !isOverride) { + context.report({ + node: jsdocNode, + messageId: "missingParam", + data: { + name + } + }); + } + } + }); + } + + if (options.matchDescription) { + const regex = new RegExp(options.matchDescription, "u"); + + if (!regex.test(jsdoc.description)) { + context.report({ node: jsdocNode, messageId: "unsatisfiedDesc" }); + } + } + + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: startFunction, + FunctionExpression: startFunction, + FunctionDeclaration: startFunction, + ClassExpression: startFunction, + ClassDeclaration: startFunction, + "ArrowFunctionExpression:exit": checkJSDoc, + "FunctionExpression:exit": checkJSDoc, + "FunctionDeclaration:exit": checkJSDoc, + "ClassExpression:exit": checkJSDoc, + "ClassDeclaration:exit": checkJSDoc, + ReturnStatement: addReturn + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/valid-typeof.js b/node_modules/eslint/lib/rules/valid-typeof.js new file mode 100644 index 0000000..a0f20f7 --- /dev/null +++ b/node_modules/eslint/lib/rules/valid-typeof.js @@ -0,0 +1,85 @@ +/** + * @fileoverview Ensures that the results of typeof are compared against a valid string + * @author Ian Christian Myers + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce comparing `typeof` expressions against valid strings", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/valid-typeof" + }, + + schema: [ + { + type: "object", + properties: { + requireStringLiterals: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + invalidValue: "Invalid typeof comparison value.", + notString: "Typeof comparisons should be to string literals." + } + }, + + create(context) { + + const VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"], + OPERATORS = ["==", "===", "!=", "!=="]; + + const requireStringLiterals = context.options[0] && context.options[0].requireStringLiterals; + + /** + * Determines whether a node is a typeof expression. + * @param {ASTNode} node The node + * @returns {boolean} `true` if the node is a typeof expression + */ + function isTypeofExpression(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + UnaryExpression(node) { + if (isTypeofExpression(node)) { + const parent = context.getAncestors().pop(); + + if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) { + const sibling = parent.left === node ? parent.right : parent.left; + + if (sibling.type === "Literal" || sibling.type === "TemplateLiteral" && !sibling.expressions.length) { + const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked; + + if (VALID_TYPES.indexOf(value) === -1) { + context.report({ node: sibling, messageId: "invalidValue" }); + } + } else if (requireStringLiterals && !isTypeofExpression(sibling)) { + context.report({ node: sibling, messageId: "notString" }); + } + } + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/vars-on-top.js b/node_modules/eslint/lib/rules/vars-on-top.js new file mode 100644 index 0000000..28ddae4 --- /dev/null +++ b/node_modules/eslint/lib/rules/vars-on-top.js @@ -0,0 +1,144 @@ +/** + * @fileoverview Rule to enforce var declarations are only at the top of a function. + * @author Danny Fritz + * @author Gyandeep Singh + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `var` declarations be placed at the top of their containing scope", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/vars-on-top" + }, + + schema: [], + messages: { + top: "All 'var' declarations must be at the top of the function scope." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + /** + * Check to see if its a ES6 import declaration + * @param {ASTNode} node any node + * @returns {boolean} whether the given node represents a import declaration + */ + function looksLikeImport(node) { + return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" || + node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier"; + } + + /** + * Checks whether a given node is a variable declaration or not. + * @param {ASTNode} node any node + * @returns {boolean} `true` if the node is a variable declaration. + */ + function isVariableDeclaration(node) { + return ( + node.type === "VariableDeclaration" || + ( + node.type === "ExportNamedDeclaration" && + node.declaration && + node.declaration.type === "VariableDeclaration" + ) + ); + } + + /** + * Checks whether this variable is on top of the block body + * @param {ASTNode} node The node to check + * @param {ASTNode[]} statements collection of ASTNodes for the parent node block + * @returns {boolean} True if var is on top otherwise false + */ + function isVarOnTop(node, statements) { + const l = statements.length; + let i = 0; + + // skip over directives + for (; i < l; ++i) { + if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { + break; + } + } + + for (; i < l; ++i) { + if (!isVariableDeclaration(statements[i])) { + return false; + } + if (statements[i] === node) { + return true; + } + } + + return false; + } + + /** + * Checks whether variable is on top at the global level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @returns {void} + */ + function globalVarCheck(node, parent) { + if (!isVarOnTop(node, parent.body)) { + context.report({ node, messageId: "top" }); + } + } + + /** + * Checks whether variable is on top at functional block scope level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @param {ASTNode} grandParent Parent of the node's parent + * @returns {void} + */ + function blockScopeVarCheck(node, parent, grandParent) { + if (!(/Function/u.test(grandParent.type) && + parent.type === "BlockStatement" && + isVarOnTop(node, parent.body))) { + context.report({ node, messageId: "top" }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration[kind='var']"(node) { + if (node.parent.type === "ExportNamedDeclaration") { + globalVarCheck(node.parent, node.parent.parent); + } else if (node.parent.type === "Program") { + globalVarCheck(node, node.parent); + } else { + blockScopeVarCheck(node, node.parent, node.parent.parent); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/wrap-iife.js b/node_modules/eslint/lib/rules/wrap-iife.js new file mode 100644 index 0000000..07e5b84 --- /dev/null +++ b/node_modules/eslint/lib/rules/wrap-iife.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to flag when IIFE is not wrapped in parens + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("eslint-utils"); + +//---------------------------------------------------------------------- +// Helpers +//---------------------------------------------------------------------- + +/** + * Check if the given node is callee of a `NewExpression` node + * @param {ASTNode} node node to check + * @returns {boolean} True if the node is callee of a `NewExpression` node + * @private + */ +function isCalleeOfNewExpression(node) { + const maybeCallee = node.parent.type === "ChainExpression" + ? node.parent + : node; + + return ( + maybeCallee.parent.type === "NewExpression" && + maybeCallee.parent.callee === maybeCallee + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parentheses around immediate `function` invocations", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/wrap-iife" + }, + + schema: [ + { + enum: ["outside", "inside", "any"] + }, + { + type: "object", + properties: { + functionPrototypeMethods: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + wrapInvocation: "Wrap an immediate function invocation in parentheses.", + wrapExpression: "Wrap only the function expression in parens.", + moveInvocation: "Move the invocation into the parens that contain the function." + } + }, + + create(context) { + + const style = context.options[0] || "outside"; + const includeFunctionPrototypeMethods = context.options[1] && context.options[1].functionPrototypeMethods; + + const sourceCode = context.getSourceCode(); + + /** + * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if() + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in any parens + * @private + */ + function isWrappedInAnyParens(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in grouping parens + * @private + */ + function isWrappedInGroupingParens(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Get the function node from an IIFE + * @param {ASTNode} node node to evaluate + * @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist + */ + function getFunctionNodeFromIIFE(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "FunctionExpression") { + return callee; + } + + if (includeFunctionPrototypeMethods && + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + (astUtils.getStaticPropertyName(callee) === "call" || astUtils.getStaticPropertyName(callee) === "apply") + ) { + return callee.object; + } + + return null; + } + + + return { + CallExpression(node) { + const innerNode = getFunctionNodeFromIIFE(node); + + if (!innerNode) { + return; + } + + const isCallExpressionWrapped = isWrappedInAnyParens(node), + isFunctionExpressionWrapped = isWrappedInAnyParens(innerNode); + + if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapInvocation", + fix(fixer) { + const nodeToSurround = style === "inside" ? innerNode : node; + + return fixer.replaceText(nodeToSurround, `(${sourceCode.getText(nodeToSurround)})`); + } + }); + } else if (style === "inside" && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapExpression", + fix(fixer) { + + // The outer call expression will always be wrapped at this point. + + if (isWrappedInGroupingParens(node) && !isCalleeOfNewExpression(node)) { + + /* + * Parenthesize the function expression and remove unnecessary grouping parens around the call expression. + * Replace the range between the end of the function expression and the end of the call expression. + * for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`. + */ + + const parenAfter = sourceCode.getTokenAfter(node); + + return fixer.replaceTextRange( + [innerNode.range[1], parenAfter.range[1]], + `)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}` + ); + } + + /* + * Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens. + * These parens cannot be removed, so just parenthesize the function expression. + */ + + return fixer.replaceText(innerNode, `(${sourceCode.getText(innerNode)})`); + } + }); + } else if (style === "outside" && !isCallExpressionWrapped) { + context.report({ + node, + messageId: "moveInvocation", + fix(fixer) { + + /* + * The inner function expression will always be wrapped at this point. + * It's only necessary to replace the range between the end of the function expression + * and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)` + * should get replaced with `(bar))`. + */ + const parenAfter = sourceCode.getTokenAfter(innerNode); + + return fixer.replaceTextRange( + [parenAfter.range[0], node.range[1]], + `${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})` + ); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/wrap-regex.js b/node_modules/eslint/lib/rules/wrap-regex.js new file mode 100644 index 0000000..4ecbcec --- /dev/null +++ b/node_modules/eslint/lib/rules/wrap-regex.js @@ -0,0 +1,59 @@ +/** + * @fileoverview Rule to flag when regex literals are not wrapped in parens + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parenthesis around regex literals", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/wrap-regex" + }, + + schema: [], + fixable: "code", + + messages: { + requireParens: "Wrap the regexp literal in parens to disambiguate the slash." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node), + nodeType = token.type; + + if (nodeType === "RegularExpression") { + const beforeToken = sourceCode.getTokenBefore(node); + const afterToken = sourceCode.getTokenAfter(node); + const ancestors = context.getAncestors(); + const grandparent = ancestors[ancestors.length - 1]; + + if (grandparent.type === "MemberExpression" && grandparent.object === node && + !(beforeToken && beforeToken.value === "(" && afterToken && afterToken.value === ")")) { + context.report({ + node, + messageId: "requireParens", + fix: fixer => fixer.replaceText(node, `(${sourceCode.getText(node)})`) + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/yield-star-spacing.js b/node_modules/eslint/lib/rules/yield-star-spacing.js new file mode 100644 index 0000000..20b8e9e --- /dev/null +++ b/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to check the spacing around the * in yield* expressions. + * @author Bryan Smith + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing around the `*` in `yield*` expressions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/yield-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const mode = (function(option) { + if (!option || typeof option === "string") { + return { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[option || "after"]; + } + return option; + }(context.options[0])); + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(side, leftToken, rightToken) { + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken) !== mode[side]) { + const after = leftToken.value === "*"; + const spaceRequired = mode[side]; + const node = after ? leftToken : rightToken; + let messageId = ""; + + if (spaceRequired) { + messageId = side === "before" ? "missingBefore" : "missingAfter"; + } else { + messageId = side === "before" ? "unexpectedBefore" : "unexpectedAfter"; + } + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a yield* expression. + * @param {ASTNode} node A yield expression node. + * @returns {void} + */ + function checkExpression(node) { + if (!node.delegate) { + return; + } + + const tokens = sourceCode.getFirstTokens(node, 3); + const yieldToken = tokens[0]; + const starToken = tokens[1]; + const nextToken = tokens[2]; + + checkSpacing("before", yieldToken, starToken); + checkSpacing("after", starToken, nextToken); + } + + return { + YieldExpression: checkExpression + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/yoda.js b/node_modules/eslint/lib/rules/yoda.js new file mode 100644 index 0000000..87dd5ed --- /dev/null +++ b/node_modules/eslint/lib/rules/yoda.js @@ -0,0 +1,352 @@ +/** + * @fileoverview Rule to require or disallow yoda comparisons + * @author Nicholas C. Zakas + */ +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines whether an operator is a comparison operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is a comparison operator. + */ +function isComparisonOperator(operator) { + return /^(==|===|!=|!==|<|>|<=|>=)$/u.test(operator); +} + +/** + * Determines whether an operator is an equality operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is an equality operator. + */ +function isEqualityOperator(operator) { + return /^(==|===)$/u.test(operator); +} + +/** + * Determines whether an operator is one used in a range test. + * Allowed operators are `<` and `<=`. + * @param {string} operator The operator to check. + * @returns {boolean} Whether the operator is used in range tests. + */ +function isRangeTestOperator(operator) { + return ["<", "<="].indexOf(operator) >= 0; +} + +/** + * Determines whether a non-Literal node is a negative number that should be + * treated as if it were a single Literal node. + * @param {ASTNode} node Node to test. + * @returns {boolean} True if the node is a negative number that looks like a + * real literal and should be treated as such. + */ +function isNegativeNumericLiteral(node) { + return ( + node.type === "UnaryExpression" && + node.operator === "-" && + node.prefix && + astUtils.isNumericLiteral(node.argument) + ); +} + +/** + * Determines whether a node is a Template Literal which can be determined statically. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node is a Template Literal without expression. + */ +function isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; +} + +/** + * Determines whether a non-Literal node should be treated as a single Literal node. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node should be treated as a single Literal node. + */ +function looksLikeLiteral(node) { + return isNegativeNumericLiteral(node) || isStaticTemplateLiteral(node); +} + +/** + * Attempts to derive a Literal node from nodes that are treated like literals. + * @param {ASTNode} node Node to normalize. + * @returns {ASTNode} One of the following options. + * 1. The original node if the node is already a Literal + * 2. A normalized Literal node with the negative number as the value if the + * node represents a negative number literal. + * 3. A normalized Literal node with the string as the value if the node is + * a Template Literal without expression. + * 4. Otherwise `null`. + */ +function getNormalizedLiteral(node) { + if (node.type === "Literal") { + return node; + } + + if (isNegativeNumericLiteral(node)) { + return { + type: "Literal", + value: -node.argument.value, + raw: `-${node.argument.value}` + }; + } + + if (isStaticTemplateLiteral(node)) { + return { + type: "Literal", + value: node.quasis[0].value.cooked, + raw: node.quasis[0].value.raw + }; + } + + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: 'require or disallow "Yoda" conditions', + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/yoda" + }, + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptRange: { + type: "boolean", + default: false + }, + onlyEquality: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + expected: + "Expected literal to be on the {{expectedSide}} side of {{operator}}." + } + }, + + create(context) { + + // Default to "never" (!always) if no option + const always = context.options[0] === "always"; + const exceptRange = + context.options[1] && context.options[1].exceptRange; + const onlyEquality = + context.options[1] && context.options[1].onlyEquality; + + const sourceCode = context.getSourceCode(); + + /** + * Determines whether node represents a range test. + * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside" + * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and + * both operators must be `<` or `<=`. Finally, the literal on the left side + * must be less than or equal to the literal on the right side so that the + * test makes any sense. + * @param {ASTNode} node LogicalExpression node to test. + * @returns {boolean} Whether node is a range test. + */ + function isRangeTest(node) { + const left = node.left, + right = node.right; + + /** + * Determines whether node is of the form `0 <= x && x < 1`. + * @returns {boolean} Whether node is a "between" range test. + */ + function isBetweenTest() { + if (node.operator === "&&" && astUtils.isSameReference(left.right, right.left)) { + const leftLiteral = getNormalizedLiteral(left.left); + const rightLiteral = getNormalizedLiteral(right.right); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + return false; + } + + /** + * Determines whether node is of the form `x < 0 || 1 <= x`. + * @returns {boolean} Whether node is an "outside" range test. + */ + function isOutsideTest() { + if (node.operator === "||" && astUtils.isSameReference(left.left, right.right)) { + const leftLiteral = getNormalizedLiteral(left.right); + const rightLiteral = getNormalizedLiteral(right.left); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + + return false; + } + + /** + * Determines whether node is wrapped in parentheses. + * @returns {boolean} Whether node is preceded immediately by an open + * paren token and followed immediately by a close + * paren token. + */ + function isParenWrapped() { + return astUtils.isParenthesised(sourceCode, node); + } + + return ( + node.type === "LogicalExpression" && + left.type === "BinaryExpression" && + right.type === "BinaryExpression" && + isRangeTestOperator(left.operator) && + isRangeTestOperator(right.operator) && + (isBetweenTest() || isOutsideTest()) && + isParenWrapped() + ); + } + + const OPERATOR_FLIP_MAP = { + "===": "===", + "!==": "!==", + "==": "==", + "!=": "!=", + "<": ">", + ">": "<", + "<=": ">=", + ">=": "<=" + }; + + /** + * Returns a string representation of a BinaryExpression node with its sides/operator flipped around. + * @param {ASTNode} node The BinaryExpression node + * @returns {string} A string representation of the node with the sides and operator flipped + */ + function getFlippedString(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const textBeforeOperator = sourceCode + .getText() + .slice( + sourceCode.getTokenBefore(operatorToken).range[1], + operatorToken.range[0] + ); + const textAfterOperator = sourceCode + .getText() + .slice( + operatorToken.range[1], + sourceCode.getTokenAfter(operatorToken).range[0] + ); + const leftText = sourceCode + .getText() + .slice( + node.range[0], + sourceCode.getTokenBefore(operatorToken).range[1] + ); + const firstRightToken = sourceCode.getTokenAfter(operatorToken); + const rightText = sourceCode + .getText() + .slice(firstRightToken.range[0], node.range[1]); + + let prefix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken) + ) { + prefix = " "; + } + + return ( + prefix + + rightText + + textBeforeOperator + + OPERATOR_FLIP_MAP[operatorToken.value] + + textAfterOperator + + leftText + ); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression(node) { + const expectedLiteral = always ? node.left : node.right; + const expectedNonLiteral = always ? node.right : node.left; + + // If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error. + if ( + (expectedNonLiteral.type === "Literal" || + looksLikeLiteral(expectedNonLiteral)) && + !( + expectedLiteral.type === "Literal" || + looksLikeLiteral(expectedLiteral) + ) && + !(!isEqualityOperator(node.operator) && onlyEquality) && + isComparisonOperator(node.operator) && + !(exceptRange && isRangeTest(context.getAncestors().pop())) + ) { + context.report({ + node, + messageId: "expected", + data: { + operator: node.operator, + expectedSide: always ? "left" : "right" + }, + fix: fixer => + fixer.replaceText(node, getFlippedString(node)) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/shared/ajv.js b/node_modules/eslint/lib/shared/ajv.js new file mode 100644 index 0000000..3fb0fbd --- /dev/null +++ b/node_modules/eslint/lib/shared/ajv.js @@ -0,0 +1,34 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Ajv = require("ajv"), + metaSchema = require("ajv/lib/refs/json-schema-draft-04.json"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/node_modules/eslint/lib/shared/ast-utils.js b/node_modules/eslint/lib/shared/ast-utils.js new file mode 100644 index 0000000..4ebd49c --- /dev/null +++ b/node_modules/eslint/lib/shared/ast-utils.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Common utils for AST. + * + * This file contains only shared items for core and rules. + * If you make a utility for rules, please see `../rules/utils/ast-utils.js`. + * + * @author Toru Nagashima + */ +"use strict"; + +const breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u; +const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u; +const shebangPattern = /^#!([^\r\n]+)/u; + +/** + * Creates a version of the `lineBreakPattern` regex with the global flag. + * Global regexes are mutable, so this needs to be a function instead of a constant. + * @returns {RegExp} A global regular expression that matches line terminators + */ +function createGlobalLinebreakMatcher() { + return new RegExp(lineBreakPattern.source, "gu"); +} + +module.exports = { + breakableTypePattern, + lineBreakPattern, + createGlobalLinebreakMatcher, + shebangPattern +}; diff --git a/node_modules/eslint/lib/shared/config-validator.js b/node_modules/eslint/lib/shared/config-validator.js new file mode 100644 index 0000000..03b32f1 --- /dev/null +++ b/node_modules/eslint/lib/shared/config-validator.js @@ -0,0 +1,338 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + util = require("util"), + configSchema = require("../../conf/config-schema"), + BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), + BuiltInRules = require("../rules"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + { emitDeprecationWarning } = require("./deprecation-warnings"); + +const ajv = require("./ajv")(); +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +/** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ +function getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; +} + +/** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ +function validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + +} + +/** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ +function validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } +} + +/** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ +function validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = validateRuleSeverity(options); + + if (severity !== 0) { + validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } +} + +/** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ +function validateEnvironment( + environment, + source, + getAdditionalEnv = noop +) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); +} + +/** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ +function validateRules( + rulesConfig, + source, + getAdditionalRule = noop +) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || BuiltInRules.get(id) || null; + + validateRuleOptions(rule, id, rulesConfig[id], source); + }); +} + +/** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ +function validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + ConfigOps.normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); +} + +/** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ +function validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } +} + +/** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ +function formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); +} + +/** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ +function validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } +} + +/** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ +function validate(config, source, getAdditionalRule, getAdditionalEnv) { + validateConfigSchema(config, source); + validateRules(config.rules, source, getAdditionalRule); + validateEnvironment(config.env, source, getAdditionalEnv); + validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + validateRules(override.rules, source, getAdditionalRule); + validateEnvironment(override.env, source, getAdditionalEnv); + validateGlobals(config.globals, source); + } +} + +const validated = new WeakSet(); + +/** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ +function validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + validateEnvironment(element.env, element.name, getPluginEnv); + validateGlobals(element.globals, element.name); + validateProcessor(element.processor, element.name, getPluginProcessor); + validateRules(element.rules, element.name, getPluginRule); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + getRuleOptionsSchema, + validate, + validateConfigArray, + validateConfigSchema, + validateRuleOptions +}; diff --git a/node_modules/eslint/lib/shared/deprecation-warnings.js b/node_modules/eslint/lib/shared/deprecation-warnings.js new file mode 100644 index 0000000..e1481a2 --- /dev/null +++ b/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +const emitDeprecationWarning = lodash.memoize((source, errorCode) => { + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +}, (...args) => JSON.stringify(args)); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + emitDeprecationWarning +}; diff --git a/node_modules/eslint/lib/shared/logging.js b/node_modules/eslint/lib/shared/logging.js new file mode 100644 index 0000000..6aa1f5a --- /dev/null +++ b/node_modules/eslint/lib/shared/logging.js @@ -0,0 +1,30 @@ +/** + * @fileoverview Handle logging for ESLint + * @author Gyandeep Singh + */ + +"use strict"; + +/* eslint no-console: "off" */ + +/* istanbul ignore next */ +module.exports = { + + /** + * Cover for console.log + * @param {...any} args The elements to log. + * @returns {void} + */ + info(...args) { + console.log(...args); + }, + + /** + * Cover for console.error + * @param {...any} args The elements to log. + * @returns {void} + */ + error(...args) { + console.error(...args); + } +}; diff --git a/node_modules/eslint/lib/shared/relative-module-resolver.js b/node_modules/eslint/lib/shared/relative-module-resolver.js new file mode 100644 index 0000000..cd743f3 --- /dev/null +++ b/node_modules/eslint/lib/shared/relative-module-resolver.js @@ -0,0 +1,56 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +"use strict"; + +const Module = require("module"); + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api +const createRequire = Module.createRequire || Module.createRequireFromPath; + +module.exports = { + + /** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ + resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } + } +}; diff --git a/node_modules/eslint/lib/shared/runtime-info.js b/node_modules/eslint/lib/shared/runtime-info.js new file mode 100644 index 0000000..feed005 --- /dev/null +++ b/node_modules/eslint/lib/shared/runtime-info.js @@ -0,0 +1,163 @@ +/** + * @fileoverview Utility to get information about the execution environment. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const spawn = require("cross-spawn"); +const { isEmpty } = require("lodash"); +const log = require("../shared/logging"); +const packageJson = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Generates and returns execution environment information. + * @returns {string} A string that contains execution environment information. + */ +function environment() { + const cache = new Map(); + + /** + * Checks if a path is a child of a directory. + * @param {string} parentPath The parent path to check. + * @param {string} childPath The path to check. + * @returns {boolean} Whether or not the given path is a child of a directory. + */ + function isChildOfDirectory(parentPath, childPath) { + return !path.relative(parentPath, childPath).startsWith(".."); + } + + /** + * Synchronously executes a shell command and formats the result. + * @param {string} cmd The command to execute. + * @param {Array} args The arguments to be executed with the command. + * @returns {string} The version returned by the command. + */ + function execCommand(cmd, args) { + const key = [cmd, ...args].join(" "); + + if (cache.has(key)) { + return cache.get(key); + } + + const process = spawn.sync(cmd, args, { encoding: "utf8" }); + + if (process.error) { + throw process.error; + } + + const result = process.stdout.trim(); + + cache.set(key, result); + return result; + } + + /** + * Normalizes a version number. + * @param {string} versionStr The string to normalize. + * @returns {string} The normalized version number. + */ + function normalizeVersionStr(versionStr) { + return versionStr.startsWith("v") ? versionStr : `v${versionStr}`; + } + + /** + * Gets bin version. + * @param {string} bin The bin to check. + * @returns {string} The normalized version returned by the command. + */ + function getBinVersion(bin) { + const binArgs = ["--version"]; + + try { + return normalizeVersionStr(execCommand(bin, binArgs)); + } catch (e) { + log.error(`Error finding ${bin} version running the command \`${bin} ${binArgs.join(" ")}\``); + throw e; + } + } + + /** + * Gets installed npm package version. + * @param {string} pkg The package to check. + * @param {boolean} global Whether to check globally or not. + * @returns {string} The normalized version returned by the command. + */ + function getNpmPackageVersion(pkg, { global = false } = {}) { + const npmBinArgs = ["bin", "-g"]; + const npmLsArgs = ["ls", "--depth=0", "--json", "eslint"]; + + if (global) { + npmLsArgs.push("-g"); + } + + try { + const parsedStdout = JSON.parse(execCommand("npm", npmLsArgs)); + + /* + * Checking globally returns an empty JSON object, while local checks + * include the name and version of the local project. + */ + if (isEmpty(parsedStdout) || !(parsedStdout.dependencies && parsedStdout.dependencies.eslint)) { + return "Not found"; + } + + const [, processBinPath] = process.argv; + let npmBinPath; + + try { + npmBinPath = execCommand("npm", npmBinArgs); + } catch (e) { + log.error(`Error finding npm binary path when running command \`npm ${npmBinArgs.join(" ")}\``); + throw e; + } + + const isGlobal = isChildOfDirectory(npmBinPath, processBinPath); + let pkgVersion = parsedStdout.dependencies.eslint.version; + + if ((global && isGlobal) || (!global && !isGlobal)) { + pkgVersion += " (Currently used)"; + } + + return normalizeVersionStr(pkgVersion); + } catch (e) { + log.error(`Error finding ${pkg} version running the command \`npm ${npmLsArgs.join(" ")}\``); + throw e; + } + } + + return [ + "Environment Info:", + "", + `Node version: ${getBinVersion("node")}`, + `npm version: ${getBinVersion("npm")}`, + `Local ESLint version: ${getNpmPackageVersion("eslint", { global: false })}`, + `Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}` + ].join("\n"); +} + +/** + * Returns version of currently executing ESLint. + * @returns {string} The version from the currently executing ESLint's package.json. + */ +function version() { + return `v${packageJson.version}`; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + environment, + version +}; diff --git a/node_modules/eslint/lib/shared/traverser.js b/node_modules/eslint/lib/shared/traverser.js new file mode 100644 index 0000000..32f7677 --- /dev/null +++ b/node_modules/eslint/lib/shared/traverser.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Traverser to traverse AST trees. + * @author Nicholas C. Zakas + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const vk = require("eslint-visitor-keys"); +const debug = require("debug")("eslint:traverser"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Do nothing. + * @returns {void} + */ +function noop() { + + // do nothing. +} + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string"; +} + +/** + * Get the visitor keys of a given node. + * @param {Object} visitorKeys The map of visitor keys. + * @param {ASTNode} node The node to get their visitor keys. + * @returns {string[]} The visitor keys of the node. + */ +function getVisitorKeys(visitorKeys, node) { + let keys = visitorKeys[node.type]; + + if (!keys) { + keys = vk.getKeys(node); + debug("Unknown node type \"%s\": Estimated visitor keys %j", node.type, keys); + } + + return keys; +} + +/** + * The traverser class to traverse AST trees. + */ +class Traverser { + constructor() { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = null; + this._enter = null; + this._leave = null; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {ASTNode} The current node. + */ + current() { + return this._current; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {ASTNode[]} The ancestor nodes. + */ + parents() { + return this._parents.slice(0); + } + + /** + * Break the current traversal. + * @returns {void} + */ + break() { + this._broken = true; + } + + /** + * Skip child nodes for the current traversal. + * @returns {void} + */ + skip() { + this._skipped = true; + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + traverse(node, options) { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = options.visitorKeys || vk.KEYS; + this._enter = options.enter || noop; + this._leave = options.leave || noop; + this._traverse(node, null); + } + + /** + * Traverse the given AST tree recursively. + * @param {ASTNode} node The current node. + * @param {ASTNode|null} parent The parent node. + * @returns {void} + * @private + */ + _traverse(node, parent) { + if (!isNode(node)) { + return; + } + + this._current = node; + this._skipped = false; + this._enter(node, parent); + + if (!this._skipped && !this._broken) { + const keys = getVisitorKeys(this._visitorKeys, node); + + if (keys.length >= 1) { + this._parents.push(node); + for (let i = 0; i < keys.length && !this._broken; ++i) { + const child = node[keys[i]]; + + if (Array.isArray(child)) { + for (let j = 0; j < child.length && !this._broken; ++j) { + this._traverse(child[j], node); + } + } else { + this._traverse(child, node); + } + } + this._parents.pop(); + } + } + + if (!this._broken) { + this._leave(node, parent); + } + + this._current = parent; + } + + /** + * Calculates the keys to use for traversal. + * @param {ASTNode} node The node to read keys from. + * @returns {string[]} An array of keys to visit on the node. + * @private + */ + static getKeys(node) { + return vk.getKeys(node); + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + static traverse(node, options) { + new Traverser().traverse(node, options); + } + + /** + * The default visitor keys. + * @type {Object} + */ + static get DEFAULT_VISITOR_KEYS() { + return vk.KEYS; + } +} + +module.exports = Traverser; diff --git a/node_modules/eslint/lib/shared/types.js b/node_modules/eslint/lib/shared/types.js new file mode 100644 index 0000000..8ad3b1b --- /dev/null +++ b/node_modules/eslint/lib/shared/types.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Define common types for input completion. + * @author Toru Nagashima + */ +"use strict"; + +/** @type {any} */ +module.exports = {}; + +/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ +/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ +/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */ + +/** + * @typedef {Object} EcmaFeatures + * @property {boolean} [globalReturn] Enabling `return` statements at the top-level. + * @property {boolean} [jsx] Enabling JSX syntax. + * @property {boolean} [impliedStrict] Enabling strict mode always. + */ + +/** + * @typedef {Object} ParserOptions + * @property {EcmaFeatures} [ecmaFeatures] The optional features. + * @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number). + * @property {"script"|"module"} [sourceType] The source code type. + */ + +/** + * @typedef {Object} ConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {Record} [globals] The global variable settings. + * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {boolean} [root] The root flag. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} OverrideConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {string | string[]} files The glob pattarns for target files. + * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} ParseResult + * @property {Object} ast The AST. + * @property {ScopeManager} [scopeManager] The scope manager of the AST. + * @property {Record} [services] The services that the parser provides. + * @property {Record} [visitorKeys] The visitor keys of the AST. + */ + +/** + * @typedef {Object} Parser + * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables. + * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} Environment + * @property {Record} [globals] The definition of global variables. + * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} LintMessage + * @property {number} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} fatal If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number} line The 1-based line number. + * @property {string} message The error message. + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuggestionResult + * @property {string} desc A short description. + * @property {string} [messageId] Id referencing a message for the description. + * @property {{ text: string, range: number[] }} fix fix result info + */ + +/** + * @typedef {Object} Processor + * @property {(text:string, filename:string) => Array} [preprocess] The function to extract code blocks. + * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages. + * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix. + */ + +/** + * @typedef {Object} RuleMetaDocs + * @property {string} category The category of the rule. + * @property {string} description The description of the rule. + * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. + * @property {string} url The URL of the rule documentation. + */ + +/** + * @typedef {Object} RuleMeta + * @property {boolean} [deprecated] If `true` then the rule has been deprecated. + * @property {RuleMetaDocs} docs The document information of the rule. + * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {Record} [messages] The messages the rule reports. + * @property {string[]} [replacedBy] The IDs of the alternative rules. + * @property {Array|Object} schema The option schema of the rule. + * @property {"problem"|"suggestion"|"layout"} type The rule type. + */ + +/** + * @typedef {Object} Rule + * @property {Function} create The factory of the rule. + * @property {RuleMeta} meta The meta data of the rule. + */ + +/** + * @typedef {Object} Plugin + * @property {Record} [configs] The definition of plugin configs. + * @property {Record} [environments] The definition of plugin environments. + * @property {Record} [processors] The definition of plugin processors. + * @property {Record} [rules] The definition of plugin rules. + */ + +/** + * Information of deprecated rules. + * @typedef {Object} DeprecatedRuleInfo + * @property {string} ruleId The rule ID. + * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. + */ diff --git a/node_modules/eslint/lib/source-code/index.js b/node_modules/eslint/lib/source-code/index.js new file mode 100644 index 0000000..76e2786 --- /dev/null +++ b/node_modules/eslint/lib/source-code/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + SourceCode: require("./source-code") +}; diff --git a/node_modules/eslint/lib/source-code/source-code.js b/node_modules/eslint/lib/source-code/source-code.js new file mode 100644 index 0000000..6b20495 --- /dev/null +++ b/node_modules/eslint/lib/source-code/source-code.js @@ -0,0 +1,586 @@ +/** + * @fileoverview Abstraction of JavaScript source code. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + { isCommentToken } = require("eslint-utils"), + TokenStore = require("./token-store"), + astUtils = require("../shared/ast-utils"), + Traverser = require("../shared/traverser"), + lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Validates that the given AST has the required information. + * @param {ASTNode} ast The Program node of the AST to check. + * @throws {Error} If the AST doesn't contain the correct information. + * @returns {void} + * @private + */ +function validate(ast) { + if (!ast.tokens) { + throw new Error("AST is missing the tokens array."); + } + + if (!ast.comments) { + throw new Error("AST is missing the comments array."); + } + + if (!ast.loc) { + throw new Error("AST is missing location information."); + } + + if (!ast.range) { + throw new Error("AST is missing range information"); + } +} + +/** + * Check to see if its a ES6 export declaration. + * @param {ASTNode} astNode An AST node. + * @returns {boolean} whether the given node represents an export declaration. + * @private + */ +function looksLikeExport(astNode) { + return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || + astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; +} + +/** + * Merges two sorted lists into a larger sorted list in O(n) time. + * @param {Token[]} tokens The list of tokens. + * @param {Token[]} comments The list of comments. + * @returns {Token[]} A sorted list of tokens and comments. + * @private + */ +function sortedMerge(tokens, comments) { + const result = []; + let tokenIndex = 0; + let commentIndex = 0; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].range[0]) { + result.push(tokens[tokenIndex++]); + } else { + result.push(comments[commentIndex++]); + } + } + + return result; +} + +/** + * Determines if two nodes or tokens overlap. + * @param {ASTNode|Token} first The first node or token to check. + * @param {ASTNode|Token} second The second node or token to check. + * @returns {boolean} True if the two nodes or tokens overlap. + * @private + */ +function nodesOrTokensOverlap(first, second) { + return (first.range[0] <= second.range[0] && first.range[1] >= second.range[0]) || + (second.range[0] <= first.range[0] && second.range[1] >= first.range[0]); +} + +/** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {SourceCode} sourceCode The source code object. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @param {boolean} checkInsideOfJSXText If `true` is present, check inside of JSXText tokens for backward compatibility. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ +function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) { + if (nodesOrTokensOverlap(first, second)) { + return false; + } + + const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0] + ? [first, second] + : [second, first]; + const firstToken = sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken; + const finalToken = sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken; + let currentToken = firstToken; + + while (currentToken !== finalToken) { + const nextToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + + if ( + currentToken.range[1] !== nextToken.range[0] || + + /* + * For backward compatibility, check spaces in JSXText. + * https://github.com/eslint/eslint/issues/12614 + */ + ( + checkInsideOfJSXText && + nextToken !== finalToken && + nextToken.type === "JSXText" && + /\s/u.test(nextToken.value) + ) + ) { + return true; + } + + currentToken = nextToken; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class SourceCode extends TokenStore { + + /** + * Represents parsed source code. + * @param {string|Object} textOrConfig The source code text or config object. + * @param {string} textOrConfig.text The source code text. + * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @param {Object|null} textOrConfig.parserServices The parser services. + * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code. + * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST. + * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + constructor(textOrConfig, astIfNoConfig) { + let text, ast, parserServices, scopeManager, visitorKeys; + + // Process overloading. + if (typeof textOrConfig === "string") { + text = textOrConfig; + ast = astIfNoConfig; + } else if (typeof textOrConfig === "object" && textOrConfig !== null) { + text = textOrConfig.text; + ast = textOrConfig.ast; + parserServices = textOrConfig.parserServices; + scopeManager = textOrConfig.scopeManager; + visitorKeys = textOrConfig.visitorKeys; + } + + validate(ast); + super(ast.tokens, ast.comments); + + /** + * The flag to indicate that the source code has Unicode BOM. + * @type boolean + */ + this.hasBOM = (text.charCodeAt(0) === 0xFEFF); + + /** + * The original text source code. + * BOM was stripped from this text. + * @type string + */ + this.text = (this.hasBOM ? text.slice(1) : text); + + /** + * The parsed AST for the source code. + * @type ASTNode + */ + this.ast = ast; + + /** + * The parser services of this source code. + * @type {Object} + */ + this.parserServices = parserServices || {}; + + /** + * The scope of this source code. + * @type {ScopeManager|null} + */ + this.scopeManager = scopeManager || null; + + /** + * The visitor keys to traverse AST. + * @type {Object} + */ + this.visitorKeys = visitorKeys || Traverser.DEFAULT_VISITOR_KEYS; + + // Check the source text for the presence of a shebang since it is parsed as a standard line comment. + const shebangMatched = this.text.match(astUtils.shebangPattern); + const hasShebang = shebangMatched && ast.comments.length && ast.comments[0].value === shebangMatched[1]; + + if (hasShebang) { + ast.comments[0].type = "Shebang"; + } + + this.tokensAndComments = sortedMerge(ast.tokens, ast.comments); + + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + * @type string[] + */ + this.lines = []; + this.lineStartIndices = [0]; + + const lineEndingPattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + /* + * Previously, this was implemented using a regex that + * matched a sequence of non-linebreak characters followed by a + * linebreak, then adding the lengths of the matches. However, + * this caused a catastrophic backtracking issue when the end + * of a file contained a large number of non-newline characters. + * To avoid this, the current implementation just matches newlines + * and uses match.index to get the correct line start indices. + */ + while ((match = lineEndingPattern.exec(this.text))) { + this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1], match.index)); + this.lineStartIndices.push(match.index + match[0].length); + } + this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1])); + + // Cache for comments found using getComments(). + this._commentCache = new WeakMap(); + + // don't allow modification of this object + Object.freeze(this); + Object.freeze(this.lines); + } + + /** + * Split the source code into multiple lines based on the line delimiters. + * @param {string} text Source code as a string. + * @returns {string[]} Array of source code lines. + * @public + */ + static splitLines(text) { + return text.split(astUtils.createGlobalLinebreakMatcher()); + } + + /** + * Gets the source code for the given node. + * @param {ASTNode} [node] The AST node to get the text for. + * @param {int} [beforeCount] The number of characters before the node to retrieve. + * @param {int} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + getText(node, beforeCount, afterCount) { + if (node) { + return this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), + node.range[1] + (afterCount || 0)); + } + return this.text; + } + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + getLines() { + return this.lines; + } + + /** + * Retrieves an array containing all comments in the source code. + * @returns {ASTNode[]} An array of comment nodes. + * @public + */ + getAllComments() { + return this.ast.comments; + } + + /** + * Gets all comments for the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Object} An object containing a leading and trailing array + * of comments indexed by their position. + * @public + * @deprecated replaced by getCommentsBefore(), getCommentsAfter(), and getCommentsInside(). + */ + getComments(node) { + if (this._commentCache.has(node)) { + return this._commentCache.get(node); + } + + const comments = { + leading: [], + trailing: [] + }; + + /* + * Return all comments as leading comments of the Program node when + * there is no executable code. + */ + if (node.type === "Program") { + if (node.body.length === 0) { + comments.leading = node.comments; + } + } else { + + /* + * Return comments as trailing comments of nodes that only contain + * comments (to mimic the comment attachment behavior present in Espree). + */ + if ((node.type === "BlockStatement" || node.type === "ClassBody") && node.body.length === 0 || + node.type === "ObjectExpression" && node.properties.length === 0 || + node.type === "ArrayExpression" && node.elements.length === 0 || + node.type === "SwitchStatement" && node.cases.length === 0 + ) { + comments.trailing = this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } + + /* + * Iterate over tokens before and after node and collect comment tokens. + * Do not include comments that exist outside of the parent node + * to avoid duplication. + */ + let currentToken = this.getTokenBefore(node, { includeComments: true }); + + while (currentToken && isCommentToken(currentToken)) { + if (node.parent && (currentToken.start < node.parent.start)) { + break; + } + comments.leading.push(currentToken); + currentToken = this.getTokenBefore(currentToken, { includeComments: true }); + } + + comments.leading.reverse(); + + currentToken = this.getTokenAfter(node, { includeComments: true }); + + while (currentToken && isCommentToken(currentToken)) { + if (node.parent && (currentToken.end > node.parent.end)) { + break; + } + comments.trailing.push(currentToken); + currentToken = this.getTokenAfter(currentToken, { includeComments: true }); + } + } + + this._commentCache.set(node, comments); + return comments; + } + + /** + * Retrieves the JSDoc comment for a given node. + * @param {ASTNode} node The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @public + * @deprecated + */ + getJSDocComment(node) { + + /** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * @param {ASTNode} astNode The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @private + */ + const findJSDocComment = astNode => { + const tokenBefore = this.getTokenBefore(astNode, { includeComments: true }); + + if ( + tokenBefore && + isCommentToken(tokenBefore) && + tokenBefore.type === "Block" && + tokenBefore.value.charAt(0) === "*" && + astNode.loc.start.line - tokenBefore.loc.end.line <= 1 + ) { + return tokenBefore; + } + + return null; + }; + let parent = node.parent; + + switch (node.type) { + case "ClassDeclaration": + case "FunctionDeclaration": + return findJSDocComment(looksLikeExport(parent) ? parent : node); + + case "ClassExpression": + return findJSDocComment(parent.parent); + + case "ArrowFunctionExpression": + case "FunctionExpression": + if (parent.type !== "CallExpression" && parent.type !== "NewExpression") { + while ( + !this.getCommentsBefore(parent).length && + !/Function/u.test(parent.type) && + parent.type !== "MethodDefinition" && + parent.type !== "Property" + ) { + parent = parent.parent; + + if (!parent) { + break; + } + } + + if (parent && parent.type !== "FunctionDeclaration" && parent.type !== "Program") { + return findJSDocComment(parent); + } + } + + return findJSDocComment(node); + + // falls through + default: + return null; + } + } + + /** + * Gets the deepest node containing a range index. + * @param {int} index Range index of the desired node. + * @returns {ASTNode} The node if found or null if not found. + * @public + */ + getNodeByRangeIndex(index) { + let result = null; + + Traverser.traverse(this.ast, { + visitorKeys: this.visitorKeys, + enter(node) { + if (node.range[0] <= index && index < node.range[1]) { + result = node; + } else { + this.skip(); + } + }, + leave(node) { + if (node === result) { + this.break(); + } + } + }); + + return result; + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ + isSpaceBetween(first, second) { + return isSpaceBetween(this, first, second, false); + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * For backward compatibility, this method returns true if there are + * `JSXText` tokens that contain whitespaces between the two. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @deprecated in favor of isSpaceBetween(). + * @public + */ + isSpaceBetweenTokens(first, second) { + return isSpaceBetween(this, first, second, true); + } + + /** + * Converts a source text index into a (line, column) pair. + * @param {number} index The index of a character in a file + * @returns {Object} A {line, column} location object with a 0-indexed column + * @public + */ + getLocFromIndex(index) { + if (typeof index !== "number") { + throw new TypeError("Expected `index` to be a number."); + } + + if (index < 0 || index > this.text.length) { + throw new RangeError(`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`); + } + + /* + * For an argument of this.text.length, return the location one "spot" past the last character + * of the file. If the last character is a linebreak, the location will be column 0 of the next + * line; otherwise, the location will be in the next column on the same line. + * + * See getIndexFromLoc for the motivation for this special case. + */ + if (index === this.text.length) { + return { line: this.lines.length, column: this.lines[this.lines.length - 1].length }; + } + + /* + * To figure out which line rangeIndex is on, determine the last index at which rangeIndex could + * be inserted into lineIndices to keep the list sorted. + */ + const lineNumber = lodash.sortedLastIndex(this.lineStartIndices, index); + + return { line: lineNumber, column: index - this.lineStartIndices[lineNumber - 1] }; + } + + /** + * Converts a (line, column) pair into a range index. + * @param {Object} loc A line/column location + * @param {number} loc.line The line number of the location (1-indexed) + * @param {number} loc.column The column number of the location (0-indexed) + * @returns {number} The range index of the location in the file. + * @public + */ + getIndexFromLoc(loc) { + if (typeof loc !== "object" || typeof loc.line !== "number" || typeof loc.column !== "number") { + throw new TypeError("Expected `loc` to be an object with numeric `line` and `column` properties."); + } + + if (loc.line <= 0) { + throw new RangeError(`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`); + } + + if (loc.line > this.lineStartIndices.length) { + throw new RangeError(`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`); + } + + const lineStartIndex = this.lineStartIndices[loc.line - 1]; + const lineEndIndex = loc.line === this.lineStartIndices.length ? this.text.length : this.lineStartIndices[loc.line]; + const positionIndex = lineStartIndex + loc.column; + + /* + * By design, getIndexFromLoc({ line: lineNum, column: 0 }) should return the start index of + * the given line, provided that the line number is valid element of this.lines. Since the + * last element of this.lines is an empty string for files with trailing newlines, add a + * special case where getting the index for the first location after the end of the file + * will return the length of the file, rather than throwing an error. This allows rules to + * use getIndexFromLoc consistently without worrying about edge cases at the end of a file. + */ + if ( + loc.line === this.lineStartIndices.length && positionIndex > lineEndIndex || + loc.line < this.lineStartIndices.length && positionIndex >= lineEndIndex + ) { + throw new RangeError(`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`); + } + + return positionIndex; + } +} + +module.exports = SourceCode; diff --git a/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js b/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js new file mode 100644 index 0000000..7255a62 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments in reverse. + */ +module.exports = class BackwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc); + this.commentIndex = utils.search(comments, endLoc) - 1; + this.border = startLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex >= 0) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex >= 0) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[1] > comment.range[1])) { + this.current = token; + this.tokenIndex -= 1; + } else if (comment) { + this.current = comment; + this.commentIndex -= 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[0] >= this.border); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js b/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js new file mode 100644 index 0000000..454a244 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Define the cursor which iterates tokens only in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only in reverse. + */ +module.exports = class BackwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = utils.getLastIndex(tokens, indexMap, endLoc); + this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index >= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index -= 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index >= this.indexEnd) ? this.tokens[this.index] : null; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/cursor.js b/node_modules/eslint/lib/source-code/token-store/cursor.js new file mode 100644 index 0000000..4e1595c --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/cursor.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Define the abstract class about cursors which iterate tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which iterate tokens. + * + * This class has 2 abstract methods. + * + * - `current: Token | Comment | null` ... The current token. + * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`. + * + * This is similar to ES2015 Iterators. + * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable. + * + * There are the following known sub classes. + * + * - ForwardTokenCursor .......... The cursor which iterates tokens only. + * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse. + * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments. + * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse. + * - DecorativeCursor + * - FilterCursor ............ The cursor which ignores the specified tokens. + * - SkipCursor .............. The cursor which ignores the first few tokens. + * - LimitCursor ............. The cursor which limits the count of tokens. + * + */ +module.exports = class Cursor { + + /** + * Initializes this cursor. + */ + constructor() { + this.current = null; + } + + /** + * Gets the first token. + * This consumes this cursor. + * @returns {Token|Comment} The first token or null. + */ + getOneToken() { + return this.moveNext() ? this.current : null; + } + + /** + * Gets the first tokens. + * This consumes this cursor. + * @returns {(Token|Comment)[]} All tokens. + */ + getAllTokens() { + const tokens = []; + + while (this.moveNext()) { + tokens.push(this.current); + } + + return tokens; + } + + /** + * Moves this cursor to the next token. + * @returns {boolean} `true` if the next token exists. + * @abstract + */ + /* istanbul ignore next */ + moveNext() { // eslint-disable-line class-methods-use-this + throw new Error("Not implemented."); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/cursors.js b/node_modules/eslint/lib/source-code/token-store/cursors.js new file mode 100644 index 0000000..30c72b6 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/cursors.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Define 2 token factories; forward and backward. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const BackwardTokenCommentCursor = require("./backward-token-comment-cursor"); +const BackwardTokenCursor = require("./backward-token-cursor"); +const FilterCursor = require("./filter-cursor"); +const ForwardTokenCommentCursor = require("./forward-token-comment-cursor"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const LimitCursor = require("./limit-cursor"); +const SkipCursor = require("./skip-cursor"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * The cursor factory. + * @private + */ +class CursorFactory { + + /** + * Initializes this cursor. + * @param {Function} TokenCursor The class of the cursor which iterates tokens only. + * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments. + */ + constructor(TokenCursor, TokenCommentCursor) { + this.TokenCursor = TokenCursor; + this.TokenCommentCursor = TokenCommentCursor; + } + + /** + * Creates a base cursor instance that can be decorated by createCursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @returns {Cursor} The created base cursor. + */ + createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) { + const Cursor = includeComments ? this.TokenCommentCursor : this.TokenCursor; + + return new Cursor(tokens, comments, indexMap, startLoc, endLoc); + } + + /** + * Creates a cursor that iterates tokens with normalized options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @param {Function|null} filter The predicate function to choose tokens. + * @param {number} skip The count of tokens the cursor skips. + * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + */ + createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) { + let cursor = this.createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments); + + if (filter) { + cursor = new FilterCursor(cursor, filter); + } + if (skip >= 1) { + cursor = new SkipCursor(cursor, skip); + } + if (count >= 0) { + cursor = new LimitCursor(cursor, count); + } + + return cursor; + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +exports.forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor); +exports.backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor); diff --git a/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js b/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js new file mode 100644 index 0000000..3ee7b0b --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Define the abstract class about cursors which manipulate another cursor. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which manipulate another cursor. + */ +module.exports = class DecorativeCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + */ + constructor(cursor) { + super(); + this.cursor = cursor; + } + + /** @inheritdoc */ + moveNext() { + const retv = this.cursor.moveNext(); + + this.current = this.cursor.current; + + return retv; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/filter-cursor.js b/node_modules/eslint/lib/source-code/token-store/filter-cursor.js new file mode 100644 index 0000000..08c4f22 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/filter-cursor.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Define the cursor which ignores specified tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores specified tokens. + */ +module.exports = class FilterCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {Function} predicate The predicate function to decide tokens this cursor iterates. + */ + constructor(cursor, predicate) { + super(cursor); + this.predicate = predicate; + } + + /** @inheritdoc */ + moveNext() { + const predicate = this.predicate; + + while (super.moveNext()) { + if (predicate(this.current)) { + return true; + } + } + return false; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js b/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js new file mode 100644 index 0000000..50c7a39 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments. + */ +module.exports = class ForwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc); + this.commentIndex = utils.search(comments, startLoc); + this.border = endLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex < this.tokens.length) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex < this.comments.length) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[0] < comment.range[0])) { + this.current = token; + this.tokenIndex += 1; + } else if (comment) { + this.current = comment; + this.commentIndex += 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[1] <= this.border); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js b/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js new file mode 100644 index 0000000..e8c1860 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Define the cursor which iterates tokens only. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only. + */ +module.exports = class ForwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = utils.getFirstIndex(tokens, indexMap, startLoc); + this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index <= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index += 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index <= this.indexEnd) ? this.tokens[this.index] : null; + } + + /** @inheritdoc */ + getAllTokens() { + return this.tokens.slice(this.index, this.indexEnd + 1); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/index.js b/node_modules/eslint/lib/source-code/token-store/index.js new file mode 100644 index 0000000..25db8a4 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/index.js @@ -0,0 +1,627 @@ +/** + * @fileoverview Object to handle access and retrieval of tokens. + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const { isCommentToken } = require("eslint-utils"); +const cursors = require("./cursors"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const PaddedTokenCursor = require("./padded-token-cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TOKENS = Symbol("tokens"); +const COMMENTS = Symbol("comments"); +const INDEX_MAP = Symbol("indexMap"); + +/** + * Creates the map from locations to indices in `tokens`. + * + * The first/last location of tokens is mapped to the index of the token. + * The first/last location of comments is mapped to the index of the next token of each comment. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @returns {Object} The map from locations to indices in `tokens`. + * @private + */ +function createIndexMap(tokens, comments) { + const map = Object.create(null); + let tokenIndex = 0; + let commentIndex = 0; + let nextStart = 0; + let range = null; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + nextStart = (commentIndex < comments.length) ? comments[commentIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (tokenIndex < tokens.length && (range = tokens[tokenIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + tokenIndex += 1; + } + + nextStart = (tokenIndex < tokens.length) ? tokens[tokenIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (commentIndex < comments.length && (range = comments[commentIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + commentIndex += 1; + } + } + + return map; +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.skip=0] The count of tokens the cursor skips. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let skip = 0; + let filter = null; + + if (typeof opts === "number") { + skip = opts | 0; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + skip = opts.skip | 0; + filter = opts.filter || null; + } + assert(skip >= 0, "options.skip should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, -1); +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let count = 0; + let countExists = false; + let filter = null; + + if (typeof opts === "number") { + count = opts | 0; + countExists = true; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + count = opts.count | 0; + countExists = typeof opts.count === "number"; + filter = opts.filter || null; + } + assert(count >= 0, "options.count should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, 0, countExists ? count : -1); +} + +/** + * Creates the cursor iterates tokens with options. + * This is overload function of the below. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +/** + * Creates the cursor iterates tokens with options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") { + return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc); + } + if (typeof beforeCount === "number" || typeof beforeCount === "undefined") { + return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0); + } + return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount); +} + +/** + * Gets comment tokens that are adjacent to the current cursor position. + * @param {Cursor} cursor A cursor instance. + * @returns {Array} An array of comment tokens adjacent to the current cursor position. + * @private + */ +function getAdjacentCommentTokensFromCursor(cursor) { + const tokens = []; + let currentToken = cursor.getOneToken(); + + while (currentToken && isCommentToken(currentToken)) { + tokens.push(currentToken); + currentToken = cursor.getOneToken(); + } + + return tokens; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The token store. + * + * This class provides methods to get tokens by locations as fast as possible. + * The methods are a part of public API, so we should be careful if it changes this class. + * + * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens. + * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments. + * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost. + * This uses binary-searching instead for comments. + */ +module.exports = class TokenStore { + + /** + * Initializes this token store. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + */ + constructor(tokens, comments) { + this[TOKENS] = tokens; + this[COMMENTS] = comments; + this[INDEX_MAP] = createIndexMap(tokens, comments); + } + + //-------------------------------------------------------------------------- + // Gets single token. + //-------------------------------------------------------------------------- + + /** + * Gets the token starting at the specified index. + * @param {number} offset Index of the start of the token's range. + * @param {Object} [options=0] The option object. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @returns {Token|null} The token starting at index, or null if no such token. + */ + getTokenByRangeStart(offset, options) { + const includeComments = options && options.includeComments; + const token = cursors.forward.createBaseCursor( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + offset, + -1, + includeComments + ).getOneToken(); + + if (token && token.range[0] === offset) { + return token; + } + return null; + } + + /** + * Gets the first token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.skip=0] The count of tokens the cursor skips. + * @returns {Token|null} An object representing the token. + */ + getFirstToken(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the last token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastToken(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenBefore(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenAfter(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getOneToken(); + } + + /** + * Gets the first token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getFirstTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the last token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentBefore(node, skip) { + return this.getTokenBefore(node, { includeComments: true, skip }); + } + + /** + * Gets the token that follows a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentAfter(node, skip) { + return this.getTokenAfter(node, { includeComments: true, skip }); + } + + //-------------------------------------------------------------------------- + // Gets multiple tokens. + //-------------------------------------------------------------------------- + + /** + * Gets the first `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens. + */ + getFirstTokens(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getLastTokens(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensBefore(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensAfter(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getAllTokens(); + } + + /** + * Gets the first `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getFirstTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getLastTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Array of objects representing tokens. + */ + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {int} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {int} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Token[]} Array of objects representing tokens. + */ + getTokens(node, beforeCount, afterCount) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + beforeCount, + afterCount + ).getAllTokens(); + } + + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens between left and right. + */ + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {int} [padding=0] Number of extra tokens on either side of center. + * @returns {Token[]} Tokens between left and right. + */ + getTokensBetween(left, right, padding) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + padding, + padding + ).getAllTokens(); + } + + //-------------------------------------------------------------------------- + // Others. + //-------------------------------------------------------------------------- + + /** + * Checks whether any comments exist or not between the given 2 nodes. + * @param {ASTNode} left The node to check. + * @param {ASTNode} right The node to check. + * @returns {boolean} `true` if one or more comments exist. + */ + commentsExistBetween(left, right) { + const index = utils.search(this[COMMENTS], left.range[1]); + + return ( + index < this[COMMENTS].length && + this[COMMENTS][index].range[1] <= right.range[0] + ); + } + + /** + * Gets all comment tokens directly before the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsBefore(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + nodeOrToken.range[0], + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor).reverse(); + } + + /** + * Gets all comment tokens directly after the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsAfter(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + nodeOrToken.range[1], + -1, + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor); + } + + /** + * Gets all comment tokens inside the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsInside(node) { + return this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/limit-cursor.js b/node_modules/eslint/lib/source-code/token-store/limit-cursor.js new file mode 100644 index 0000000..0fd92a7 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/limit-cursor.js @@ -0,0 +1,40 @@ +/** + * @fileoverview Define the cursor which limits the number of tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which limits the number of tokens. + */ +module.exports = class LimitCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor iterates. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + if (this.count > 0) { + this.count -= 1; + return super.moveNext(); + } + return false; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js b/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js new file mode 100644 index 0000000..89349fa --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js @@ -0,0 +1,38 @@ +/** + * @fileoverview Define the cursor which iterates tokens only, with inflated range. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const ForwardTokenCursor = require("./forward-token-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only, with inflated range. + * This is for the backward compatibility of padding options. + */ +module.exports = class PaddedTokenCursor extends ForwardTokenCursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} beforeCount The number of tokens this cursor iterates before start. + * @param {number} afterCount The number of tokens this cursor iterates after end. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + super(tokens, comments, indexMap, startLoc, endLoc); + this.index = Math.max(0, this.index - beforeCount); + this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/skip-cursor.js b/node_modules/eslint/lib/source-code/token-store/skip-cursor.js new file mode 100644 index 0000000..f068f53 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/skip-cursor.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Define the cursor which ignores the first few tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores the first few tokens. + */ +module.exports = class SkipCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor skips. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + while (this.count > 0) { + this.count -= 1; + if (!super.moveNext()) { + return false; + } + } + return super.moveNext(); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/utils.js b/node_modules/eslint/lib/source-code/token-store/utils.js new file mode 100644 index 0000000..21e1d6f --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/utils.js @@ -0,0 +1,100 @@ +/** + * @fileoverview Define utility functions for token store. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets `token.range[0]` from the given token. + * @param {Node|Token|Comment} token The token to get. + * @returns {number} The start location. + * @private + */ +function getStartLocation(token) { + return token.range[0]; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * Binary-searches the index of the first token which is after the given location. + * If it was not found, this returns `tokens.length`. + * @param {(Token|Comment)[]} tokens It searches the token in this list. + * @param {number} location The location to search. + * @returns {number} The found index or `tokens.length`. + */ +exports.search = function search(tokens, location) { + return lodash.sortedIndexBy( + tokens, + { range: [location] }, + getStartLocation + ); +}; + +/** + * Gets the index of the `startLoc` in `tokens`. + * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} startLoc The location to get an index. + * @returns {number} The index. + */ +exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { + if (startLoc in indexMap) { + return indexMap[startLoc]; + } + if ((startLoc - 1) in indexMap) { + const index = indexMap[startLoc - 1]; + const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, +1 is unnecessary. + */ + if (token && token.range[0] >= startLoc) { + return index; + } + return index + 1; + } + return 0; +}; + +/** + * Gets the index of the `endLoc` in `tokens`. + * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} endLoc The location to get an index. + * @returns {number} The index. + */ +exports.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) { + if (endLoc in indexMap) { + return indexMap[endLoc] - 1; + } + if ((endLoc - 1) in indexMap) { + const index = indexMap[endLoc - 1]; + const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, -1 is necessary. + */ + if (token && token.range[1] > endLoc) { + return index - 1; + } + return index; + } + return tokens.length - 1; +}; diff --git a/node_modules/eslint/messages/all-files-ignored.txt b/node_modules/eslint/messages/all-files-ignored.txt new file mode 100644 index 0000000..3f4c8ce --- /dev/null +++ b/node_modules/eslint/messages/all-files-ignored.txt @@ -0,0 +1,8 @@ +You are linting "<%= pattern %>", but all of the files matching the glob pattern "<%= pattern %>" are ignored. + +If you don't want to lint these files, remove the pattern "<%= pattern %>" from the list of arguments passed to ESLint. + +If you do want to lint these files, try the following solutions: + +* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored. +* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument. diff --git a/node_modules/eslint/messages/extend-config-missing.txt b/node_modules/eslint/messages/extend-config-missing.txt new file mode 100644 index 0000000..4defd7a --- /dev/null +++ b/node_modules/eslint/messages/extend-config-missing.txt @@ -0,0 +1,5 @@ +ESLint couldn't find the config "<%- configName %>" to extend from. Please check that the name of the config is correct. + +The config "<%- configName %>" was referenced from the config file in "<%- importerName %>". + +If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/failed-to-read-json.txt b/node_modules/eslint/messages/failed-to-read-json.txt new file mode 100644 index 0000000..b5e2b86 --- /dev/null +++ b/node_modules/eslint/messages/failed-to-read-json.txt @@ -0,0 +1,3 @@ +Failed to read JSON file at <%= path %>: + +<%= message %> diff --git a/node_modules/eslint/messages/file-not-found.txt b/node_modules/eslint/messages/file-not-found.txt new file mode 100644 index 0000000..639498e --- /dev/null +++ b/node_modules/eslint/messages/file-not-found.txt @@ -0,0 +1,2 @@ +No files matching the pattern "<%= pattern %>"<% if (globDisabled) { %> (with disabling globs)<% } %> were found. +Please check for typing mistakes in the pattern. diff --git a/node_modules/eslint/messages/no-config-found.txt b/node_modules/eslint/messages/no-config-found.txt new file mode 100644 index 0000000..b46a7e5 --- /dev/null +++ b/node_modules/eslint/messages/no-config-found.txt @@ -0,0 +1,7 @@ +ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: + + eslint --init + +ESLint looked for configuration files in <%= directoryPath %> and its ancestors. If it found none, it then looked in your home directory. + +If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat/help diff --git a/node_modules/eslint/messages/plugin-conflict.txt b/node_modules/eslint/messages/plugin-conflict.txt new file mode 100644 index 0000000..3ab4b34 --- /dev/null +++ b/node_modules/eslint/messages/plugin-conflict.txt @@ -0,0 +1,7 @@ +ESLint couldn't determine the plugin "<%- pluginId %>" uniquely. +<% for (const { filePath, importerName } of plugins) { %> +- <%= filePath %> (loaded in "<%= importerName %>")<% } %> + +Please remove the "plugins" setting from either config or remove either plugin installation. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/plugin-invalid.txt b/node_modules/eslint/messages/plugin-invalid.txt new file mode 100644 index 0000000..3ee2518 --- /dev/null +++ b/node_modules/eslint/messages/plugin-invalid.txt @@ -0,0 +1,8 @@ +"<%- configName %>" is invalid syntax for a config specifier. + +* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "<%- configName %>/myConfig". +* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "<%- configName.slice("plugin:".length) %>". + +"<%- configName %>" was referenced from the config file in "<%- importerName %>". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/plugin-missing.txt b/node_modules/eslint/messages/plugin-missing.txt new file mode 100644 index 0000000..aa25f59 --- /dev/null +++ b/node_modules/eslint/messages/plugin-missing.txt @@ -0,0 +1,11 @@ +ESLint couldn't find the plugin "<%- pluginName %>". + +(The package "<%- pluginName %>" was not found when loaded as a Node module from the directory "<%- resolvePluginsRelativeTo %>".) + +It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: + + npm install <%- pluginName %>@latest --save-dev + +The plugin "<%- pluginName %>" was referenced from the config file in "<%- importerName %>". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/print-config-with-directory-path.txt b/node_modules/eslint/messages/print-config-with-directory-path.txt new file mode 100644 index 0000000..1afc9b1 --- /dev/null +++ b/node_modules/eslint/messages/print-config-with-directory-path.txt @@ -0,0 +1,2 @@ +The '--print-config' CLI option requires a path to a source code file rather than a directory. +See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config diff --git a/node_modules/eslint/messages/whitespace-found.txt b/node_modules/eslint/messages/whitespace-found.txt new file mode 100644 index 0000000..3eed1af --- /dev/null +++ b/node_modules/eslint/messages/whitespace-found.txt @@ -0,0 +1,3 @@ +ESLint couldn't find the plugin "<%- pluginName %>". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/package.json b/node_modules/eslint/package.json new file mode 100644 index 0000000..6c194e8 --- /dev/null +++ b/node_modules/eslint/package.json @@ -0,0 +1,180 @@ +{ + "_from": "eslint@^5.16.0 || ^6.8.0 || ^7.2.0", + "_id": "eslint@7.10.0", + "_inBundle": false, + "_integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==", + "_location": "/eslint", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "eslint@^5.16.0 || ^6.8.0 || ^7.2.0", + "name": "eslint", + "escapedName": "eslint", + "rawSpec": "^5.16.0 || ^6.8.0 || ^7.2.0", + "saveSpec": null, + "fetchSpec": "^5.16.0 || ^6.8.0 || ^7.2.0" + }, + "_requiredBy": [ + "#DEV:/", + "#USER" + ], + "_resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz", + "_shasum": "494edb3e4750fb791133ca379e786a8f648c72b9", + "_spec": "eslint@^5.16.0 || ^6.8.0 || ^7.2.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message", + "author": { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "bugs": { + "url": "https://github.com/eslint/eslint/issues/" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.3.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "deprecated": false, + "description": "An AST-based pattern checker for JavaScript.", + "devDependencies": { + "@babel/core": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "acorn": "^7.2.0", + "babel-loader": "^8.0.5", + "chai": "^4.0.1", + "cheerio": "^0.22.0", + "common-tags": "^1.8.0", + "core-js": "^3.1.3", + "dateformat": "^3.0.3", + "ejs": "^3.0.2", + "escape-string-regexp": "^3.0.0", + "eslint": "file:.", + "eslint-config-eslint": "file:packages/eslint-config-eslint", + "eslint-plugin-eslint-plugin": "^2.2.1", + "eslint-plugin-internal-rules": "file:tools/internal-rules", + "eslint-plugin-jsdoc": "^22.1.0", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^2.0.0", + "eslump": "^2.0.0", + "esprima": "^4.0.1", + "glob": "^7.1.6", + "jsdoc": "^3.5.5", + "karma": "^4.0.1", + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^1.3.0", + "karma-mocha-reporter": "^2.2.3", + "karma-webpack": "^4.0.0-rc.6", + "lint-staged": "^10.1.2", + "load-perf": "^0.2.0", + "markdownlint": "^0.19.0", + "markdownlint-cli": "^0.22.0", + "memfs": "^3.0.1", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.23.0", + "npm-license": "^0.3.3", + "nyc": "^15.0.1", + "proxyquire": "^2.0.1", + "puppeteer": "^4.0.0", + "recast": "^0.19.0", + "regenerator-runtime": "^0.13.2", + "shelljs": "^0.8.2", + "sinon": "^9.0.1", + "temp": "^0.9.0", + "webpack": "^4.35.0", + "webpack-cli": "^3.3.5", + "yorkie": "^2.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "LICENSE", + "README.md", + "bin", + "conf", + "lib", + "messages" + ], + "funding": "https://opencollective.com/eslint", + "gitHooks": { + "pre-commit": "lint-staged" + }, + "homepage": "https://eslint.org", + "keywords": [ + "ast", + "lint", + "javascript", + "ecmascript", + "espree" + ], + "license": "MIT", + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ], + "*.md": "markdownlint" + }, + "main": "./lib/api.js", + "name": "eslint", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint.git" + }, + "scripts": { + "docs": "node Makefile.js docs", + "fix": "node Makefile.js lint -- fix", + "fuzz": "node Makefile.js fuzz", + "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", + "generate-betarelease": "node Makefile.js generatePrerelease -- beta", + "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", + "generate-release": "node Makefile.js generateRelease", + "gensite": "node Makefile.js gensite", + "lint": "node Makefile.js lint", + "perf": "node Makefile.js perf", + "publish-release": "node Makefile.js publishRelease", + "test": "node Makefile.js test", + "test:cli": "mocha", + "webpack": "node Makefile.js webpack" + }, + "version": "7.10.0" +} diff --git a/node_modules/espree/CHANGELOG.md b/node_modules/espree/CHANGELOG.md new file mode 100644 index 0000000..5bfd614 --- /dev/null +++ b/node_modules/espree/CHANGELOG.md @@ -0,0 +1,503 @@ +v7.3.0 - August 22, 2020 + +* [`4ba3eef`](https://github.com/eslint/espree/commit/4ba3eefdc4b32784565822b34f11977e99ca1a19) Chore: move to GitHub Actions (#449) (Kai Cataldo) +* [`bd0a405`](https://github.com/eslint/espree/commit/bd0a405ffbe4962bcf5aa225ed3861a6a15cb827) Update: support logical assignment and numeric separators (#448) (Toru Nagashima) + +v7.2.0 - July 17, 2020 + +* [`91c2d58`](https://github.com/eslint/espree/commit/91c2d5896889042058399cd64de4b218c5add0eb) Docs: Add security policy (#447) (Nicholas C. Zakas) +* [`872645c`](https://github.com/eslint/espree/commit/872645cea0bee08960b93c097f84153d44b44d7f) Update: support optional chaining (#446) (Toru Nagashima) +* [`0cc7800`](https://github.com/eslint/espree/commit/0cc78007c933564f32fd849bd8022992845c3ac1) Docs: Clean up LICENSE file (#445) (Nicholas C. Zakas) + +v7.1.0 - June 4, 2020 + +* [`75e80bc`](https://github.com/eslint/espree/commit/75e80bc1b5a100f64b09b2c7bf47c5168417d890) Update: support `??` operator, `import.meta`, and `export * as ns` (#441) (Toru Nagashima) +* [`ad0543c`](https://github.com/eslint/espree/commit/ad0543c8b9f6981857ebebf23a37589a656e61a6) Chore: added fixlint in Makefile.js (#440) (Anix) + +v7.0.0 - May 7, 2020 + +* [`8fe2efc`](https://github.com/eslint/espree/commit/8fe2efc00902e7f1680af00a6279e1aecb3c5b47) Breaking: drop Node v8 support (#429) (Kai Cataldo) +* [`6048bfe`](https://github.com/eslint/espree/commit/6048bfe3939fa7dc162c0b3c4b043bb410736b0b) Docs: documenting public API (fixes #431) (#442) (Anix) +* [`9a4cff3`](https://github.com/eslint/espree/commit/9a4cff3626d50a88428ca1b66610a2bdedd774dd) Chore: added tests for options normalize (#439) (Anix) +* [`99707f3`](https://github.com/eslint/espree/commit/99707f3f9d337ca719dce5720106f98b65bba7b1) Chore: added lockfiles to .gitignore (#438) (Anix) +* [`9b91bcc`](https://github.com/eslint/espree/commit/9b91bccacea15c75025a62bae828f83598aef5fe) Docs: new site for docs (#436) (Anix) + +v6.2.1 - March 10, 2020 + +* [`d6d7480`](https://github.com/eslint/espree/commit/d6d7480e424960159007caea86f209f696138734) Upgrade: acorn 7.1.1, Regex DOS vuln (fixes #435) (#434) (James) + +v6.2.0 - March 2, 2020 + +* [`ced1b68`](https://github.com/eslint/espree/commit/ced1b6810b991531e6d3788ebd5a322fc5c7d463) Update: update acorn-jsx and fix failing test (#432) (Kai Cataldo) +* [`acb8776`](https://github.com/eslint/espree/commit/acb8776d369abf9e02f79142879e9b1a4774f938) Update: add latestEcmaVersion & supportedEcmaVersions (#430) (Kai Cataldo) + +v6.1.2 - October 20, 2019 + +* [`70c4970`](https://github.com/eslint/espree/commit/70c4970e5eba6f060e1e32a22d231647f2d0e0f8) Fix: misuse token types (fixes #393, refs eslint/eslint#11018) (#426) (Toru Nagashima) + +v6.1.1 - August 23, 2019 + +* [`ba81546`](https://github.com/eslint/espree/commit/ba81546e8552ec0f779aae7e03668c334630484e) Upgrade: dev deps to latest (#424) (薛定谔的猫) +* [`bbe0119`](https://github.com/eslint/espree/commit/bbe01195fb57e24634d18825d39b820ed1767e95) Upgrade: acorn-jsx@5.0.2 (#423) (薛定谔的猫) +* [`c0635ba`](https://github.com/eslint/espree/commit/c0635bac4cd891cb612fb81655012e2579f4e2b1) Docs: update readme to mention ES2020 (#422) (Kai Cataldo) + +v6.1.0 - August 18, 2019 + +* [`9870c55`](https://github.com/eslint/espree/commit/9870c553efd3eb1bd22b4b3bb5220896c5cb6933) Update: improve error messaging when validating ecmaVersion (#421) (Kai Cataldo) +* [`3f49224`](https://github.com/eslint/espree/commit/3f49224eb05f6b8cb1b996ce424a99c40978b389) Fix: tokenize the latest right curly brace (fixes #403) (#419) (finico) +* [`f5e58cc`](https://github.com/eslint/espree/commit/f5e58cc5e9030793baca3426366b8d7286ef5b89) Update: support bigint and dynamic import (#415) (Toru Nagashima) + +v6.0.0 - June 21, 2019 + +* [`a988a36`](https://github.com/eslint/espree/commit/a988a36e436a1ab6c84005ba0adb6cf9c262c1ec) Build: add node 12 (#414) (薛定谔的猫) + +v6.0.0-alpha.0 - April 12, 2019 + +* [`493d464`](https://github.com/eslint/espree/commit/493d464e1564aea0ea33000389771d42ddece2cb) Breaking: validate parser options (fixes #384) (#412) (薛定谔的猫) + +v5.0.1 - February 15, 2019 + +* [`c40e2fc`](https://github.com/eslint/espree/commit/c40e2fcedf81ff06151e82bdf655d2d0d29e71b8) Upgrade: acorn@6.0.7 (#407) (Kai Cataldo) + +v5.0.0 - December 5, 2018 + +* [`1bcd563`](https://github.com/eslint/espree/commit/1bcd563d4eb4b4032d2662cc5ccd3bfd841b39d7) Breaking: remove attachComment (#405) (Kai Cataldo) +* [`35623ee`](https://github.com/eslint/espree/commit/35623ee07289c9199eef8b735c97cb3d3d08d5b8) Chore: update linting config (#406) (Kai Cataldo) +* [`4b86a7d`](https://github.com/eslint/espree/commit/4b86a7dc7c447c11bb6530e46dc43428ce2bd372) Build: add node 11 (#400) (薛定谔的猫) +* [`7c278d6`](https://github.com/eslint/espree/commit/7c278d6acc6b5db86b803d0cd21b830deb6f569e) Fix: build failing due to incorrectly super() call (fixes #398) (#399) (薛定谔的猫) +* [`6ebc219`](https://github.com/eslint/espree/commit/6ebc21947166399a0b4918d4a1beb9d610650336) Upgrade: eslint & eslint-config-eslint (#387) (薛定谔的猫) + +v4.1.0 - October 24, 2018 + +* 8eadb88 Upgrade: acorn 6, acorn-jsx 5, and istanbul (#391) (Toru Nagashima) +* 0f2edb8 Upgrade: eslint-release@1.0.0 (#392) (Teddy Katz) +* 560b6f7 Update: VisitorKeys depend on eslint-visitor-keys (#389) (othree) +* 6bf2ebf Docs: Fix some typos in the README (#386) (Hugo Locurcio) + +v4.0.0 - June 21, 2018 + + + +v4.0.0-rc.0 - June 9, 2018 + +* d8224c4 Build: Adding rc release script to package.json (#383) (Kevin Partington) +* 4207773 Build: add node 10 (#381) (薛定谔的猫) +* cd9da7e Update: upgrade acorn to support two ES2019 syntax (#380) (Toru Nagashima) +* 8cb3ceb Chore: remove Object.assign polyfill (#382) (薛定谔的猫) + +v4.0.0-alpha.1 - May 28, 2018 + +* 56c5a9c Fix: remove workarounds for acorn < 4 (#372) (Rouven Weßling) +* fd305e5 Upgrade: eslint-release to v0.11.1 (#376) (Teddy Katz) + +v4.0.0-alpha.0 - March 30, 2018 + +* 95fa890 Build: fix typos in package.json release scripts (#375) (Teddy Katz) +* 6284e09 Breaking: remove experimentalObjectRestSpread option (#374) (Teddy Katz) +* 0df063f Breaking: require Node.js 6+, upgrade acorn-jsx@4.1.1 (fixes #345) (#371) (薛定谔的猫) +* 0252144 Upgrade: acorn 5.5.1 (#370) (Rouven Weßling) + +v3.5.4 - March 4, 2018 + +* 706167b Upgrade: acorn 5.5.0 (#369) (Toru Nagashima) + +v3.5.3 - February 2, 2018 + +* 70f9859 Upgrade: acorn 5.4.0 (#367) (Toru Nagashima) +* cea4823 Chore: Adding .gitattributes file (#366) (Kevin Partington) +* 4160aee Upgrade: acorn v5.3.0 (#365) (Toru Nagashima) + +v3.5.2 - November 10, 2017 + +* 019b70a Fix: Remove blockBindings from docs (fixes #307, fixes #339) (#356) (Jan Pilzer) +* b2016cb Chore: refactoring rest/spread properties (#361) (Toru Nagashima) +* 59c9d06 Chore: upgrade acorn@5.2 (fixes #358) (#360) (Toru Nagashima) +* 06c35c9 Chore: add .npmrc (#359) (Toru Nagashima) + +v3.5.1 - September 15, 2017 + +* 5eb1388 Fix: Fix parsing of async keyword-named object methods (#352) (#353) (Mark Banner) + +v3.5.0 - August 5, 2017 + +* 4d442a1 Update: add initial support for ES2018 (#348) (Teddy Katz) +* d4bdcb6 Fix: Make template token objects adhere to token object structure (#343) (Ian Christian Myers) +* 9ac671a Upgrade: acorn to 5.1.1 (#347) (Teddy Katz) +* 16e1fec Docs: Specify default values of options (fixes #325) (#342) (Jan Pilzer) +* be85b8e Fix: async shorthand properties (fixes #340) (#341) (Toru Nagashima) + +v3.4.3 - May 5, 2017 + +* 343590a Fix: add AwaitExpression to espree.Syntax (fixes #331) (#332) (Teddy Katz) + +v3.4.2 - April 21, 2017 + +* c99e436 Upgrade: eslint to 2.13.1 (#328) (Teddy Katz) +* 628cf3a Fix: don't mutate user-provided configs (fixes #329) (#330) (Teddy Katz) + +v3.4.1 - March 31, 2017 + +* a3ae0bd Upgrade: acorn to 5.0.1 (#327) (Teddy Katz) +* 15ef24f Docs: Add badges (#326) (Jan Pilzer) +* 652990a Fix: raise error for trailing commas after rest properties (fixes #310) (#323) (Teddy Katz) +* 9d86ba5 Upgrade: acorn to ^4.0.11 (#317) (Toru Nagashima) +* a3442b5 Chore: fix tests for Node 6+ (#315) (Teddy Katz) + +v3.4.0 - February 2, 2017 + +* f55fa51 Build: Lock acorn to v4.0.4 (#314) (Kai Cataldo) +* 58f75be Fix:generic error for invalid ecmaVersion(fixes eslint#7405) (#303) (Scott Stern) +* d6b383d Docs: Update license copyright (Nicholas C. Zakas) +* e5df542 Update: To support year in ecmaVersion number (fixes #300) (#301) (Gyandeep Singh) + +v3.3.2 - September 29, 2016 + +* 7d3e2fc Fix: reset `isAsync` flag for each property (fixes #298) (#299) (Toru Nagashima) + +v3.3.1 - September 26, 2016 + +* 80abdce Fix: `}` token followed by template had been lost (fixes #293) (#294) (Toru Nagashima) +* 9810bab Fix: parsing error on `async` as property name. (#295) (Toru Nagashima) + +v3.3.0 - September 20, 2016 + +* 92b04b1 Update: create-test script (fixes #291) (#292) (Jamund Ferguson) + +v3.2.0 - September 16, 2016 + +* 5a37f80 Build: Update release tool (Nicholas C. Zakas) +* 9bbcad8 Update: Upgrade Acorn to support ES2017 (fixes #287) (#290) (Jamund Ferguson) +* 8d9767d Build: Add CI release scripts (Nicholas C. Zakas) + +v3.1.7 - July 29, 2016 + +* 8f6cfbd Build: Add CI release (Nicholas C. Zakas) +* ff15922 Fix: Catch ES2016 invalid syntax (fixes #284) (#285) (Nicholas C. Zakas) + +v3.1.6 - June 15, 2016 + +* a90edc2 Upgrade: acorn 3.2.0 (fixes #279) (#280) (Toru Nagashima) + +v3.1.5 - May 27, 2016 + +* 7df2e4a Fix: Convert ~ and ! prefix tokens to esprima (fixes #274) (#276) (Daniel Tschinder) + +v3.1.4 - April 21, 2016 + +* e044705 Fix: remove extra leading comments at node level (fixes #264) (Kai Cataldo) +* 25c27fb Chore: Remove jQuery copyright from header of each file (Kai Cataldo) +* 10709f0 Chore: Add jQuery Foundation copyright (Nicholas C. Zakas) +* d754b32 Upgrade: Acorn 3.1.0 (fixes #270) (Toru Nagashima) +* 3a90886 Docs: replace a dead link with the correct contributing guide URL (Shinnosuke Watanabe) +* 55184a2 Build: replace optimist with a simple native method (Shinnosuke Watanabe) +* c7e5a13 Fix: Disallow namespaces objects in JSX (fixes #261) (Kai Cataldo) +* 22290b9 Fix: Add test for leading comments (fixes #136) (Kai Cataldo) + +v3.1.3 - March 18, 2016 + +* 98441cb Fix: Fix behavior of ignoring comments within previous nodes (refs #256) (Kai Cataldo) + +v3.1.2 - March 14, 2016 + +* a2b23ca Fix: Ensure 'var let' works (fixes #149) (Nicholas C. Zakas) +* 5783282 Fix: Make obj.await work in modules (fixes #258) (Nicholas C. Zakas) +* d1b4929 Fix: leading comments added from previous node (fixes #256) (Kai Cataldo) + +v3.1.1 - February 26, 2016 + +* 3614e81 Fix: exponentiation operator token (fixes #254) (Nicholas C. Zakas) + +v3.1.0 - February 25, 2016 + +* da35d98 New: Support ecmaVersion 7 (fixes #246) (Nicholas C. Zakas) + +v3.0.2 - February 19, 2016 + +* 0973cda Build: Update release script (Nicholas C. Zakas) +* 106000f Fix: use the plugins feature of acorn (fixes #250) (Toru Nagashima) +* 36d84c7 Build: Add tests (fixes #243) (Nicholas C. Zakas) + +v3.0.1 - February 2, 2016 + +* ecfe4c8 Upgrade: eslint-config-eslint to 3.0.0 (Nicholas C. Zakas) +* ea6261e Fix: Object rest/spread in assign (fixes #247) (Nicholas C. Zakas) +* 7e57ee0 Docs: fix `options.comment` typo (xuezu) +* dd5863e Build: Add prerelease script (Nicholas C. Zakas) +* 0b409ee Upgrade: eslint-release to 0.2.0 (Nicholas C. Zakas) + +v3.0.0 - January 20, 2016 + +* 5ff65f6 Upgrade: Change Esprima version to latest (Nicholas C. Zakas) +* a8badcc Upgrade: eslint-release to 0.1.4 (Nicholas C. Zakas) +* 34d195b Build: Switch to eslint-release (Nicholas C. Zakas) +* a0ddc30 Breaking: Remove binary scripts (Nicholas C. Zakas) +* 02b5284 Build: Fix package.json dependencies (Nicholas C. Zakas) +* b07696f Fix: tests for importing keywords (fixes #225) (Toru Nagashima) +* 2e2808a Build: Add node@5 to CI (fixes #237) (alberto) +* 445c685 Update: Unrecognized license format in package.json (fixes #234) (alberto) +* 61cb5ee Update: Remove duplicated acorn-jsx dep (fixes #232) (alberto) +* df5b71c Upgrade: eslint and eslint-config-eslint (fixes #231) (alberto) +* ef7a06d Fix: lastToken not reset between calls to parse (fixes #229) (alberto) +* cdf8407 New: ecmaFeatures.impliedStrict (fixes: #227) (Nick Evans) + +v3.0.0-alpha-2 - December 9, 2015 + +* 3.0.0-alpha-2 (Nicholas C. Zakas) +* Breaking: move ecmaFeatures into ecmaVersion (fixes #222) (Nicholas C. Zakas) +* New: Export VisitorKeys (fixes #220) (Nicholas C. Zakas) + +v3.0.0-alpha-1 - December 1, 2015 + +* 3.0.0-alpha-1 (Nicholas C. Zakas) +* Fix: parse unicode escapes in identifiers (fixes #181) (Nicholas C. Zakas) +* Fix: Ensur object rest works in destructed arg (fixes #213) (Nicholas C. Zakas) +* Breaking: Switch to Acorn (fixes #200) (Nicholas C. Zakas) +* Update: Add tokens to tests (fixes #203) (Nicholas C. Zakas) +* Docs: Update README (Nicholas C. Zakas) + +v2.2.5 - September 15, 2015 + +* 2.2.5 (Nicholas C. Zakas) +* Fix: Ensure node type is correct for destructured (fixes #195) (Nicholas C. Zakas) + +v2.2.4 - August 13, 2015 + +* 2.2.4 (Nicholas C. Zakas) +* Fix: newlines in arrow functions (fixes #172) (Jamund Ferguson) +* Fix: nested arrow function as default param (fixes #145) (Jamund Ferguson) +* Fix: Rest Params & Arrow Functions (fixes #187) (Jamund Ferguson) +* Fix: trailing commas in import/export (fixes #148) (Jamund Ferguson) +* Build: Added sudo false to Travis to build faster (fixes #177) (KahWee Teng) + +v2.2.3 - July 22, 2015 + +* 2.2.3 (Nicholas C. Zakas) +* Fix: Incorrect error location (fixes #173) (Nicholas C. Zakas) + +v2.2.2 - July 16, 2015 + +* 2.2.2 (Nicholas C. Zakas) +* 2.2.1 (Nicholas C. Zakas) +* Fix: Yield as identifier in arrow func args (fixes #165) (Nicholas C. Zakas) +* Fix: Allow AssignmentExpression in object spread (fixes #167) (Nicholas C. Zakas) + +v2.2.1 - July 16, 2015 + +* 2.2.1 (Nicholas C. Zakas) + +v2.2.0 - July 15, 2015 + +* 2.2.0 (Nicholas C. Zakas) +* New: Add experimental object rest/spread (fixes #163) (Nicholas C. Zakas) +* Fix: npm browserify (fixes #156) (Jason Laster) + +v2.1.0 - July 10, 2015 + +* 2.1.0 (Nicholas C. Zakas) +* Fix: Leading comments for anonymous classes (fixes #155, fixes #158) (Toru Nagashima) +* New: Add newTarget option (fixes #157) (Nicholas C. Zakas) + +v2.0.4 - June 26, 2015 + +* 2.0.4 (Nicholas C. Zakas) +* Docs: added missing `ecmaFeatures.superInFunctions` option from doc (Clément Fiorio) +* Fix: "await" is a future reserved word (fixes #151) (Jose Roberto Vidal) + +v2.0.3 - June 2, 2015 + +* 2.0.3 (Nicholas C. Zakas) +* Fix: Incomplete Switch Statement Hangs (Fixes #146) (Jamund Ferguson) +* Docs: Clarify ecmaFeatures usage (Dan Wolff) + +v2.0.2 - April 28, 2015 + +* 2.0.2 (Nicholas C. Zakas) +* Fix: Allow yield without value as function param (fixes #134) (Nicholas C. Zakas) +* Fix: Allow computed generators in classes (fixes #123) (Nicholas C. Zakas) +* Fix: Don't allow arrow function rest param (fixes #130) (Nicholas C. Zakas) + +v2.0.1 - April 11, 2015 + +* 2.0.1 (Nicholas C. Zakas) +* Fix: Yield should parse without an argument (fixes #121) (Nicholas C. Zakas) + +v2.0.0 - April 4, 2015 + +* 2.0.0 (Nicholas C. Zakas) +* Docs: Update README with latest info (Nicholas C. Zakas) +* Breaking: Use ESTree format for default params (fixes #114) (Nicholas C. Zakas) +* New: Add Super node (fixes #115) (Nicholas C. Zakas) +* Breaking: Switch to RestElement for rest args (fixes #84) (Nicholas C. Zakas) +* Docs: Correct license info on README (fixes #117) (AJ Ortega) +* Breaking: Remove guardedHandlers/handlers from try (fixes #71) (Nicholas C. Zakas) + +v1.12.3 - March 28, 2015 + +* 1.12.3 (Nicholas C. Zakas) +* Fix: Tagged template strings (fixes #110) (Nicholas C. Zakas) + +v1.12.2 - March 21, 2015 + +* 1.12.2 (Nicholas C. Zakas) +* Fix: Destructured arg for catch (fixes #105) (Nicholas C. Zakas) + +v1.12.1 - March 21, 2015 + +* 1.12.1 (Nicholas C. Zakas) +* Fix: Disallow octals in template strings (fixes #96) (Nicholas C. Zakas) +* Fix: Template string parsing (fixes #95) (Nicholas C. Zakas) +* Fix: shorthand properties named get or set (fixes #100) (Brandon Mills) +* Fix: bad error in parsing invalid class setter (fixes #98) (Marsup) + +v1.12.0 - March 14, 2015 + +* 1.12.0 (Nicholas C. Zakas) +* Fix: Update broken tests (Nicholas C. Zakas) +* New: Add sourceType to Program node (fixes #93) (Nicholas C. Zakas) +* Allow spread in more places (fixes #89) (Nicholas C. Zakas) +* Fix: Deeply nested template literals (fixes #86) (Nicholas C. Zakas) +* Fix: Allow super in classes by default (fixes #87) (Nicholas C. Zakas) +* Fix: generator methods in classes (fixes #85) (Jamund Ferguson) +* Remove XJS note from Esprima-FB incompatibilities (Joe Lencioni) + +v1.11.0 - March 7, 2015 + +* 1.11.0 (Nicholas C. Zakas) +* Fix: Don't allow default export class by mistake (fixes #82) (Nicholas C. Zakas) +* Fix: Export default function should be FunctionDeclaration (fixes #81) (Nicholas C. Zakas) +* Fix: Ensure class declarations must have IDs outside of exports (refs #72) (Nicholas C. Zakas) +* Fix: export class expression support (refs #72) (Jamund Ferguson) +* Update: Add tests for sourceType=module (refs #72) (Nicholas C. Zakas) +* Fix: Class name should be id (fixes #78) (Nicholas C. Zakas) +* Fix: disallow import/export in functions (refs #72) (Jamund Ferguson) +* Test: strict mode enforced in modules (refs #72) (Jamund Ferguson) +* New: Add modules feature flag (refs #72) (Nicholas C. Zakas) +* merging upstream and solving conflicts for PR #43 (Caridy Patino) +* New: Add ES6 module support (fixes #35) (Caridy Patino) +* Update: Add TryStatement.handler (fixes #69) (Brandon Mills) +* Fix: Destructured Defaults (fixes #56) (Jamund Ferguson) +* Update: Refactor out comment attachment logic (Nicholas C. Zakas) + +v1.10.0 - March 1, 2015 + +* 1.10.0 (Nicholas C. Zakas) +* New: Support ES6 classes (refs #10) (Nicholas C. Zakas) +* Docs: Update README.md (Jamund Ferguson) + +v1.9.1 - February 21, 2015 + +* 1.9.1 (Nicholas C. Zakas) +* Fix: Allow let/const in switchcase (fixes #54) (Nicholas C. Zakas) + +v1.9.0 - February 21, 2015 + +* 1.9.0 (Nicholas C. Zakas) +* Fix: Extend property method range and loc to include params (fixes #36) (Brandon Mills) +* New: spread operator (refs #10) (Jamund Ferguson) +* Fix: incorrectly parsed arrow fragment (refs #58) (Jamund Ferguson) +* New: Rest Parameter (refs: #10) (Jamund Ferguson) +* New: Destructuring (refs #10) (Jamund Ferguson) + +v1.8.1 - February 7, 2015 + +* 1.8.1 (Nicholas C. Zakas) +* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) +* Fix: Actuall fix tokenization issue with templates (fixes #44) (Nicholas C. Zakas) + +v1.8.0 - February 6, 2015 + +* 1.8.0 (Nicholas C. Zakas) +* New: Support for Arrow Functions (refs #10) (Jamund Ferguson) +* New: Allow super references in functions (refs #10) (Nicholas C. Zakas) +* Update create-test.js (Jamund Ferguson) +* Fix: Tokenization for template strings (fixes #44) (Nicholas C. Zakas) +* New: Allow return in global scope (fixes #46) (Nicholas C. Zakas) + +v1.7.1 - January 23, 2015 + +* 1.7.1 (Nicholas C. Zakas) +* Fix: When ecmaFeatures.forOf is true, check for operater is "undefined" when match keyword is "in" (fixes #39) (Peter Chanthamynavong) + +v1.7.0 - January 23, 2015 + +* 1.7.0 (Nicholas C. Zakas) +* New: Add support for template strings (FredKSchott) +* New: Add support for default parameters (refs #10) (Jamund Ferguson) +* New: Add support for unicode code point escape sequences (FredKSchott) + +v1.6.0 - January 10, 2015 + +* 1.6.0 (Nicholas C. Zakas) +* Update: Make comment attachment tests look at whole AST (Nicholas C. Zakas) +* Docs: Update README to reflect feature flags (Nicholas C. Zakas) +* Docs: Add a couple more FAQs to README (Nicholas C. Zakas) +* New: Add support for duplicate object literal properties (FredKSchott) +* New: Implement generators (refs #10) (Nicholas C. Zakas) + +v1.5.0 - December 29, 2014 + +* 1.5.0 (Nicholas C. Zakas) +* Docs: Update README with compat info (Nicholas C. Zakas) +* Update: Add regex parsing test (Nicholas C. Zakas) +* Update: s/XJS/JSX/g (Nicholas C. Zakas) +* Build: Update release script (Nicholas C. Zakas) +* Update: Move SyntaxTree to ast-node-factory.js (FredKSchott) +* New: Add JSX parsing (fixes #26) (Nicholas C. Zakas) +* Update: Switch location marker logic (fixes #15) (Nicholas C. Zakas) +* 1.4.0 (Nicholas C. Zakas) + +v1.4.0 - December 23, 2014 + +* 1.4.0 (Nicholas C. Zakas) +* Fix: Parsing issues with property methods (fixes #21) (Nicholas C. Zakas) +* New: Add support for shorthand properties (refs #10) (Nicholas C. Zakas) +* New: Add support for object literal method shorthand (refs #10) (Nicholas C. Zakas) +* Fix: Ensure comments are attached for return (fixes #2) (Nicholas C. Zakas) +* Build: Ensure CHANGELOG.md is committed on release (Nicholas C. Zakas) +* 1.3.1 (Nicholas C. Zakas) + +v1.3.1 - December 22, 2014 + +* 1.3.1 (Nicholas C. Zakas) +* Fix: Add all files to npm package (fixes #17) (Nicholas C. Zakas) +* Update: Move Messages to separate file (Nicholas C. Zakas) +* Docs: Removed unnecessary comment (Nicholas C. Zakas) +* 1.3.0 (Nicholas C. Zakas) + +v1.3.0 - December 21, 2014 + +* 1.3.0 (Nicholas C. Zakas) +* Build: Add release scripts (Nicholas C. Zakas) +* New: Add computed object literal properties (refs #10) (Nicholas C. Zakas) +* Build: Fix commands in Makefile.js (Nicholas C. Zakas) +* Docs: Add FAQ to README (Nicholas C. Zakas) +* Fix: Don't allow let/const in for loops (fixes #14) (Nicholas C. Zakas) +* New: Support for-of loops (refs #10) (Nicholas C. Zakas) +* Update: Change .ast.js files to .result.js files (Nicholas C. Zakas) +* New: Support ES6 octal literals (Nicholas C. Zakas) +* New: Ability to parse binary literals (Nicholas C. Zakas) +* Update: More tests for regex u flag (Nicholas C. Zakas) +* Update: Switch to using ecmaFeatures (Nicholas C. Zakas) +* Update: Add comment attachment tests (Nicholas C. Zakas) +* Update README.md (Jamund Ferguson) +* New: Add u and y regex flags (refs #10) (Nicholas C. Zakas) +* Update: Cleanup tests (Nicholas C. Zakas) +* New: Add ecmascript flag (fixes #7) (Nicholas C. Zakas) +* Docs: Update README with build commands (Nicholas C. Zakas) +* Update: Move some things around (Nicholas C. Zakas) +* Update: Read version number from package.json (Nicholas C. Zakas) +* Update: Move AST node types to separate file (Nicholas C. Zakas) +* Update: Remove duplicate file (Nicholas C. Zakas) +* Update: Move token information to a separate file (Nicholas C. Zakas) +* Update: Bring in Makefile.js for linting and browserify (Nicholas C. Zakas) +* Update: Fix ESLint warnings, remove check-version (Nicholas C. Zakas) +* Update: Move Position and SourceLocation to separate file (Nicholas C. Zakas) +* Update: Move syntax checks into separate file (Nicholas C. Zakas) +* Update: Remove UMD format (Nicholas C. Zakas) +* Docs: Update README with more info (Nicholas C. Zakas) +* Update: remove npm-debug.log from tracked files (Brandon Mills) +* Docs: Remove redundant 'features' in readme (Matthias Oßwald) +* Docs: Fix a link to Wikipedia (Ryuichi Okumura) +* Update: Split parsing tests into smaller files (Nicholas C. Zakas) +* Update: Normalize values in tests (Nicholas C. Zakas) +* Update: CommonJSify test file (Nicholas C. Zakas) diff --git a/node_modules/espree/LICENSE b/node_modules/espree/LICENSE new file mode 100644 index 0000000..b18469f --- /dev/null +++ b/node_modules/espree/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) Open JS Foundation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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 THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/espree/README.md b/node_modules/espree/README.md new file mode 100644 index 0000000..e7b5064 --- /dev/null +++ b/node_modules/espree/README.md @@ -0,0 +1,233 @@ +[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) +[![Build Status](https://travis-ci.org/eslint/espree.svg?branch=master)](https://travis-ci.org/eslint/espree) +[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) +[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) + +# Espree + +Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. + +## Usage + +Install: + +``` +npm i espree +``` + +And in your Node.js code: + +```javascript +const espree = require("espree"); + +const ast = espree.parse(code); +``` + +## API + +### `parse()` + +`parse` parses the given code and returns a abstract syntax tree (AST). It takes two paramenter. + +- `code` [string]() - the code which needs to be parsed. +- `options (Optional)` [Object]() - read more about this [here](#options) + +```javascript +const espree = require("espree"); + +const ast = espree.parse(code, options); +``` + +**Example :** + +```js +const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 }); +console.log(ast); +``` + +
Output +

+ +``` +Node { + type: 'Program', + start: 0, + end: 15, + body: [ + Node { + type: 'VariableDeclaration', + start: 0, + end: 15, + declarations: [Array], + kind: 'let' + } + ], + sourceType: 'script' +} +``` + +

+
+ +### `tokenize()` + +`tokenize` returns the tokens of a give code. It takes two paramenter. + +- `code` [string]() - the code which needs to be parsed. +- `options (Optional)` [Object]() - read more about this [here](#options) + +Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array + +**Example :** + +```js +const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); +console.log(tokens); +``` + +
Output +

+ +``` +Token { type: 'Keyword', value: 'let', start: 0, end: 3 }, +Token { type: 'Identifier', value: 'foo', start: 4, end: 7 }, +Token { type: 'Punctuator', value: '=', start: 8, end: 9 }, +Token { type: 'String', value: '"bar"', start: 10, end: 15 } +``` + +

+
+ +### `version` + +Returns the current `espree` version + +### `VisitorKeys` + +Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/eslint-visitor-keys) + +### `latestEcmaVersion` + +Returns the latest ECMAScript supported by `espree` + +### `supportedEcmaVersions` + +Returns an array of all supported ECMAScript version + +## Options + +```js +const options = { + // attach range information to each node + range: false, + + // attach line/column location information to each node + loc: false, + + // create a top-level comments array containing all comments + comment: false, + + // create a top-level tokens array containing all tokens + tokens: false, + + // Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. + // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming. + ecmaVersion: 5, + + // specify which type of script you're parsing ("script" or "module") + sourceType: "script", + + // specify additional language features + ecmaFeatures: { + + // enable JSX parsing + jsx: false, + + // enable return in global scope + globalReturn: false, + + // enable implied strict mode (if ecmaVersion >= 5) + impliedStrict: false + } +} +``` + +## Esprima Compatibility Going Forward + +The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same. + +Espree may also deviate from Esprima in the interface it exposes. + +## 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/espree/issues). + +Espree is licensed under a permissive BSD 2-clause license. + +## Security Policy + +We work hard to ensure that Espree is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). + +## Build Commands + +* `npm test` - run all linting and tests +* `npm run lint` - run all linting +* `npm run browserify` - creates a version of Espree that is usable in a browser + +## Differences from Espree 2.x + +* The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics. +* Trailing whitespace no longer is counted as part of a node. +* `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`. +* The `esparse` and `esvalidate` binary scripts have been removed. +* There is no `tolerant` option. We will investigate adding this back in the future. + +## Known Incompatibilities + +In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change. + +### Esprima 1.2.2 + +* Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs. +* Espree does not parse `let` and `const` declarations by default. +* Error messages returned for parsing errors are different. +* There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn. + +### Esprima 2.x + +* Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2. + +## Frequently Asked Questions + +### Why another parser + +[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration. + +We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API. + +With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima. + +### Have you tried working with Esprima? + +Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support. + +### Why don't you just use Acorn? + +Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint. + +We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better. + +### What ECMAScript features do you support? + +Espree supports all ECMAScript 2020 features and partially supports ECMAScript 2021 features. + +Because ECMAScript 2021 is still under development, we are implementing features as they are finalized. Currently, Espree supports: + +* [Logical Assignment Operators](https://github.com/tc39/proposal-logical-assignment) +* [Numeric Separators](https://github.com/tc39/proposal-numeric-separator) + +See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. + +### How do you determine which experimental features to support? + +In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. diff --git a/node_modules/espree/espree.js b/node_modules/espree/espree.js new file mode 100644 index 0000000..d806952 --- /dev/null +++ b/node_modules/espree/espree.js @@ -0,0 +1,177 @@ +/** + * @fileoverview Main Espree file that converts Acorn into Esprima output. + * + * This file contains code from the following MIT-licensed projects: + * 1. Acorn + * 2. Babylon + * 3. Babel-ESLint + * + * This file also contains code from Esprima, which is BSD licensed. + * + * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) + * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) + * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie + * + * 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. + * + * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + * + * 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. + */ +/* eslint no-undefined:0, no-use-before-define: 0 */ + +"use strict"; + +const acorn = require("acorn"); +const jsx = require("acorn-jsx"); +const astNodeTypes = require("./lib/ast-node-types"); +const espree = require("./lib/espree"); +const { getLatestEcmaVersion, getSupportedEcmaVersions } = require("./lib/options"); + +// To initialize lazily. +const parsers = { + _regular: null, + _jsx: null, + + get regular() { + if (this._regular === null) { + this._regular = acorn.Parser.extend(espree()); + } + return this._regular; + }, + + get jsx() { + if (this._jsx === null) { + this._jsx = acorn.Parser.extend(jsx(), espree()); + } + return this._jsx; + }, + + get(options) { + const useJsx = Boolean( + options && + options.ecmaFeatures && + options.ecmaFeatures.jsx + ); + + return useJsx ? this.jsx : this.regular; + } +}; + +//------------------------------------------------------------------------------ +// Tokenizer +//------------------------------------------------------------------------------ + +/** + * Tokenizes the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {Token[]} An array of tokens. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ +function tokenize(code, options) { + const Parser = parsers.get(options); + + // Ensure to collect tokens. + if (!options || options.tokens !== true) { + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign + } + + return new Parser(options, code).tokenize(); +} + +//------------------------------------------------------------------------------ +// Parser +//------------------------------------------------------------------------------ + +/** + * Parses the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {ASTNode} The "Program" AST node. + * @throws {SyntaxError} If the input code is invalid. + */ +function parse(code, options) { + const Parser = parsers.get(options); + + return new Parser(options, code).parse(); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +exports.version = require("./package.json").version; + +exports.tokenize = tokenize; + +exports.parse = parse; + +// Deep copy. +/* istanbul ignore next */ +exports.Syntax = (function() { + let name, + types = {}; + + if (typeof Object.create === "function") { + types = Object.create(null); + } + + for (name in astNodeTypes) { + if (Object.hasOwnProperty.call(astNodeTypes, name)) { + types[name] = astNodeTypes[name]; + } + } + + if (typeof Object.freeze === "function") { + Object.freeze(types); + } + + return types; +}()); + +/* istanbul ignore next */ +exports.VisitorKeys = (function() { + return require("eslint-visitor-keys").KEYS; +}()); + +exports.latestEcmaVersion = getLatestEcmaVersion(); + +exports.supportedEcmaVersions = getSupportedEcmaVersions(); diff --git a/node_modules/espree/lib/ast-node-types.js b/node_modules/espree/lib/ast-node-types.js new file mode 100644 index 0000000..2844024 --- /dev/null +++ b/node_modules/espree/lib/ast-node-types.js @@ -0,0 +1,96 @@ +/** + * @fileoverview The AST node types produced by the parser. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + AssignmentExpression: "AssignmentExpression", + AssignmentPattern: "AssignmentPattern", + ArrayExpression: "ArrayExpression", + ArrayPattern: "ArrayPattern", + ArrowFunctionExpression: "ArrowFunctionExpression", + AwaitExpression: "AwaitExpression", + BlockStatement: "BlockStatement", + BinaryExpression: "BinaryExpression", + BreakStatement: "BreakStatement", + CallExpression: "CallExpression", + CatchClause: "CatchClause", + ClassBody: "ClassBody", + ClassDeclaration: "ClassDeclaration", + ClassExpression: "ClassExpression", + ConditionalExpression: "ConditionalExpression", + ContinueStatement: "ContinueStatement", + DoWhileStatement: "DoWhileStatement", + DebuggerStatement: "DebuggerStatement", + EmptyStatement: "EmptyStatement", + ExpressionStatement: "ExpressionStatement", + ForStatement: "ForStatement", + ForInStatement: "ForInStatement", + ForOfStatement: "ForOfStatement", + FunctionDeclaration: "FunctionDeclaration", + FunctionExpression: "FunctionExpression", + Identifier: "Identifier", + IfStatement: "IfStatement", + Literal: "Literal", + LabeledStatement: "LabeledStatement", + LogicalExpression: "LogicalExpression", + MemberExpression: "MemberExpression", + MetaProperty: "MetaProperty", + MethodDefinition: "MethodDefinition", + NewExpression: "NewExpression", + ObjectExpression: "ObjectExpression", + ObjectPattern: "ObjectPattern", + Program: "Program", + Property: "Property", + RestElement: "RestElement", + ReturnStatement: "ReturnStatement", + SequenceExpression: "SequenceExpression", + SpreadElement: "SpreadElement", + Super: "Super", + SwitchCase: "SwitchCase", + SwitchStatement: "SwitchStatement", + 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", + JSXIdentifier: "JSXIdentifier", + JSXNamespacedName: "JSXNamespacedName", + JSXMemberExpression: "JSXMemberExpression", + JSXEmptyExpression: "JSXEmptyExpression", + JSXExpressionContainer: "JSXExpressionContainer", + JSXElement: "JSXElement", + JSXClosingElement: "JSXClosingElement", + JSXOpeningElement: "JSXOpeningElement", + JSXAttribute: "JSXAttribute", + JSXSpreadAttribute: "JSXSpreadAttribute", + JSXText: "JSXText", + ExportDefaultDeclaration: "ExportDefaultDeclaration", + ExportNamedDeclaration: "ExportNamedDeclaration", + ExportAllDeclaration: "ExportAllDeclaration", + ExportSpecifier: "ExportSpecifier", + ImportDeclaration: "ImportDeclaration", + ImportSpecifier: "ImportSpecifier", + ImportDefaultSpecifier: "ImportDefaultSpecifier", + ImportNamespaceSpecifier: "ImportNamespaceSpecifier" +}; diff --git a/node_modules/espree/lib/espree.js b/node_modules/espree/lib/espree.js new file mode 100644 index 0000000..50ca6e4 --- /dev/null +++ b/node_modules/espree/lib/espree.js @@ -0,0 +1,286 @@ +"use strict"; + +/* eslint-disable no-param-reassign*/ +const TokenTranslator = require("./token-translator"); +const { normalizeOptions } = require("./options"); + +const STATE = Symbol("espree's internal state"); +const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); + + +/** + * Converts an Acorn comment to a Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @returns {Object} The comment object. + * @private + */ +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { + const comment = { + type: block ? "Block" : "Line", + value: text + }; + + if (typeof start === "number") { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +module.exports = () => Parser => { + const tokTypes = Object.assign({}, Parser.acorn.tokTypes); + + if (Parser.acornJsx) { + Object.assign(tokTypes, Parser.acornJsx.tokTypes); + } + + return class Espree extends Parser { + constructor(opts, code) { + if (typeof opts !== "object" || opts === null) { + opts = {}; + } + if (typeof code !== "string" && !(code instanceof String)) { + code = String(code); + } + + const options = normalizeOptions(opts); + const ecmaFeatures = options.ecmaFeatures || {}; + const tokenTranslator = + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; + + // Initialize acorn parser. + super({ + + // TODO: use {...options} when spread is supported(Node.js >= 8.3.0). + ecmaVersion: options.ecmaVersion, + sourceType: options.sourceType, + ranges: options.ranges, + locations: options.locations, + + // Truthy value is true for backward compatibility. + allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn), + + // Collect tokens + onToken: token => { + if (tokenTranslator) { + + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. + tokenTranslator.onToken(token, this[STATE]); + } + if (token.type !== tokTypes.eof) { + this[STATE].lastToken = token; + } + }, + + // Collect comments + onComment: (block, text, start, end, startLoc, endLoc) => { + if (this[STATE].comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); + + this[STATE].comments.push(comment); + } + } + }, code); + + // Initialize internal state. + this[STATE] = { + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5, + ecmaVersion: this.options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null + }; + } + + tokenize() { + do { + this.next(); + } while (this.type !== tokTypes.eof); + + // Consume the final eof token + this.next(); + + const extra = this[STATE]; + const tokens = extra.tokens; + + if (extra.comments) { + tokens.comments = extra.comments; + } + + return tokens; + } + + finishNode(...args) { + const result = super.finishNode(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + finishNodeAt(...args) { + const result = super.finishNodeAt(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + parse() { + const extra = this[STATE]; + const program = super.parse(); + + program.sourceType = this.options.sourceType; + + if (extra.comments) { + program.comments = extra.comments; + } + if (extra.tokens) { + program.tokens = extra.tokens; + } + + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.range) { + program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0]; + program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1]; + } + if (program.loc) { + program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start; + program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end; + } + + return program; + } + + parseTopLevel(node) { + if (this[STATE].impliedStrict) { + this.strict = true; + } + return super.parseTopLevel(node); + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raise(pos, message) { + const loc = Parser.acorn.getLineInfo(this.input, pos); + const err = new SyntaxError(message); + + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raiseRecoverable(pos, message) { + this.raise(pos, message); + } + + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + unexpected(pos) { + let message = "Unexpected token"; + + if (pos !== null && pos !== void 0) { + this.pos = pos; + + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } + } + + this.nextToken(); + } + + if (this.end > this.start) { + message += ` ${this.input.slice(this.start, this.end)}`; + } + + this.raise(this.start, message); + } + + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + jsx_readString(quote) { // eslint-disable-line camelcase + const result = super.jsx_readString(quote); + + if (this.type === tokTypes.string) { + this[STATE].jsxAttrValueToken = true; + } + return result; + } + + /** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + */ + [ESPRIMA_FINISH_NODE](result) { + + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { + + // additional adjustment needed if ${ is the last token + const terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; + + if (result.range) { + result.range[0]--; + result.range[1] += (terminalDollarBraceL ? 2 : 1); + } + + if (result.loc) { + result.loc.start.column--; + result.loc.end.column += (terminalDollarBraceL ? 2 : 1); + } + } + + if (result.type.indexOf("Function") > -1 && !result.generator) { + result.generator = false; + } + + return result; + } + }; +}; diff --git a/node_modules/espree/lib/features.js b/node_modules/espree/lib/features.js new file mode 100644 index 0000000..d1ad5f8 --- /dev/null +++ b/node_modules/espree/lib/features.js @@ -0,0 +1,29 @@ +/** + * @fileoverview The list of feature flags supported by the parser and their default + * settings. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + + // React JSX parsing + jsx: false, + + // allow return statement in global scope + globalReturn: false, + + // allow implied strict mode + impliedStrict: false +}; diff --git a/node_modules/espree/lib/options.js b/node_modules/espree/lib/options.js new file mode 100644 index 0000000..eddca20 --- /dev/null +++ b/node_modules/espree/lib/options.js @@ -0,0 +1,106 @@ +/** + * @fileoverview A collection of methods for processing Espree's options. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_ECMA_VERSION = 5; +const SUPPORTED_VERSIONS = [ + 3, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 +]; + +/** + * Normalize ECMAScript version from the initial config + * @param {number} ecmaVersion ECMAScript version from the initial config + * @throws {Error} throws an error if the ecmaVersion is invalid. + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion = DEFAULT_ECMA_VERSION) { + if (typeof ecmaVersion !== "number") { + throw new Error(`ecmaVersion must be a number. Received value of type ${typeof ecmaVersion} instead.`); + } + + let version = ecmaVersion; + + // Calculate ECMAScript edition number from official year version starting with + // ES2015, which corresponds with ES6 (or a difference of 2009). + if (version >= 2015) { + version -= 2009; + } + + if (!SUPPORTED_VERSIONS.includes(version)) { + throw new Error("Invalid ecmaVersion."); + } + + return version; +} + +/** + * Normalize sourceType from the initial config + * @param {string} sourceType to normalize + * @throws {Error} throw an error if sourceType is invalid + * @returns {string} normalized sourceType + */ +function normalizeSourceType(sourceType = "script") { + if (sourceType === "script" || sourceType === "module") { + return sourceType; + } + throw new Error("Invalid sourceType."); +} + +/** + * Normalize parserOptions + * @param {Object} options the parser options to normalize + * @throws {Error} throw an error if found invalid option. + * @returns {Object} normalized options + */ +function normalizeOptions(options) { + const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); + const sourceType = normalizeSourceType(options.sourceType); + const ranges = options.range === true; + const locations = options.loc === true; + + if (sourceType === "module" && ecmaVersion < 6) { + throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); + } + return Object.assign({}, options, { ecmaVersion, sourceType, ranges, locations }); +} + +/** + * Get the latest ECMAScript version supported by Espree. + * @returns {number} The latest ECMAScript version. + */ +function getLatestEcmaVersion() { + return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; +} + +/** + * Get the list of ECMAScript versions supported by Espree. + * @returns {number[]} An array containing the supported ECMAScript versions. + */ +function getSupportedEcmaVersions() { + return [...SUPPORTED_VERSIONS]; +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + normalizeOptions, + getLatestEcmaVersion, + getSupportedEcmaVersions +}; diff --git a/node_modules/espree/lib/token-translator.js b/node_modules/espree/lib/token-translator.js new file mode 100644 index 0000000..f06c7c0 --- /dev/null +++ b/node_modules/espree/lib/token-translator.js @@ -0,0 +1,263 @@ +/** + * @fileoverview Translates tokens between Acorn format and Esprima format. + * @author Nicholas C. Zakas + */ +/* eslint no-underscore-dangle: 0 */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + + +// Esprima Token Types +const Token = { + Boolean: "Boolean", + EOF: "", + Identifier: "Identifier", + Keyword: "Keyword", + Null: "Null", + Numeric: "Numeric", + Punctuator: "Punctuator", + String: "String", + RegularExpression: "RegularExpression", + Template: "Template", + JSXIdentifier: "JSXIdentifier", + JSXText: "JSXText" +}; + +/** + * Converts part of a template into an Esprima token. + * @param {AcornToken[]} tokens The Acorn tokens representing the template. + * @param {string} code The source code. + * @returns {EsprimaToken} The Esprima equivalent of the template token. + * @private + */ +function convertTemplatePart(tokens, code) { + const firstToken = tokens[0], + lastTemplateToken = tokens[tokens.length - 1]; + + const token = { + type: Token.Template, + value: code.slice(firstToken.start, lastTemplateToken.end) + }; + + if (firstToken.loc) { + token.loc = { + start: firstToken.loc.start, + end: lastTemplateToken.loc.end + }; + } + + if (firstToken.range) { + token.start = firstToken.range[0]; + token.end = lastTemplateToken.range[1]; + token.range = [token.start, token.end]; + } + + return token; +} + +/** + * Contains logic to translate Acorn tokens into Esprima tokens. + * @param {Object} acornTokTypes The Acorn token types. + * @param {string} code The source code Acorn is parsing. This is necessary + * to correct the "value" property of some tokens. + * @constructor + */ +function TokenTranslator(acornTokTypes, code) { + + // token types + this._acornTokTypes = acornTokTypes; + + // token buffer for templates + this._tokens = []; + + // track the last curly brace + this._curlyBrace = null; + + // the source code + this._code = code; + +} + +TokenTranslator.prototype = { + constructor: TokenTranslator, + + /** + * Translates a single Esprima token to a single Acorn token. This may be + * inaccurate due to how templates are handled differently in Esprima and + * Acorn, but should be accurate for all other tokens. + * @param {AcornToken} token The Acorn token to translate. + * @param {Object} extra Espree extra object. + * @returns {EsprimaToken} The Esprima version of the token. + */ + translate(token, extra) { + + const type = token.type, + tt = this._acornTokTypes; + + if (type === tt.name) { + token.type = Token.Identifier; + + // TODO: See if this is an Acorn bug + if (token.value === "static") { + token.type = Token.Keyword; + } + + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.dot || type === tt.bracketL || + type === tt.colon || type === tt.question || + type === tt.bracketR || type === tt.ellipsis || + type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || + type === tt.jsxTagEnd || type === tt.prefix || + type === tt.questionDot || + (type.binop && !type.keyword) || + type.isAssign) { + + token.type = Token.Punctuator; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.jsxName) { + token.type = Token.JSXIdentifier; + } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { + token.type = Token.JSXText; + } else if (type.keyword) { + if (type.keyword === "true" || type.keyword === "false") { + token.type = Token.Boolean; + } else if (type.keyword === "null") { + token.type = Token.Null; + } else { + token.type = Token.Keyword; + } + } else if (type === tt.num) { + token.type = Token.Numeric; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.string) { + + if (extra.jsxAttrValueToken) { + extra.jsxAttrValueToken = false; + token.type = Token.JSXText; + } else { + token.type = Token.String; + } + + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = Token.RegularExpression; + const value = token.value; + + token.regex = { + flags: value.flags, + pattern: value.pattern + }; + token.value = `/${value.pattern}/${value.flags}`; + } + + return token; + }, + + /** + * Function to call during Acorn's onToken handler. + * @param {AcornToken} token The Acorn token. + * @param {Object} extra The Espree extra object. + * @returns {void} + */ + onToken(token, extra) { + + const that = this, + tt = this._acornTokTypes, + tokens = extra.tokens, + templateTokens = this._tokens; + + /** + * Flushes the buffered template tokens and resets the template + * tracking. + * @returns {void} + * @private + */ + function translateTemplateTokens() { + tokens.push(convertTemplatePart(that._tokens, that._code)); + that._tokens = []; + } + + if (token.type === tt.eof) { + + // might be one last curlyBrace + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + return; + } + + if (token.type === tt.backQuote) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + templateTokens.push(token); + + // it's the end + if (templateTokens.length > 1) { + translateTemplateTokens(); + } + + return; + } + if (token.type === tt.dollarBraceL) { + templateTokens.push(token); + translateTemplateTokens(); + return; + } + if (token.type === tt.braceR) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + // store new curly for later + this._curlyBrace = token; + return; + } + if (token.type === tt.template || token.type === tt.invalidTemplate) { + if (this._curlyBrace) { + templateTokens.push(this._curlyBrace); + this._curlyBrace = null; + } + + templateTokens.push(token); + return; + } + + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + tokens.push(this.translate(token, extra)); + } +}; + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = TokenTranslator; diff --git a/node_modules/espree/lib/visitor-keys.js b/node_modules/espree/lib/visitor-keys.js new file mode 100644 index 0000000..4216864 --- /dev/null +++ b/node_modules/espree/lib/visitor-keys.js @@ -0,0 +1,123 @@ +/** + * @fileoverview The visitor keys for the node types Espree supports + * @author Nicholas C. Zakas + * + * This file contains code from estraverse-fb. + * + * The MIT license. Copyright (c) 2014 Ingvar Stepanyan + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + + // ECMAScript + AssignmentExpression: ["left", "right"], + AssignmentPattern: ["left", "right"], + ArrayExpression: ["elements"], + ArrayPattern: ["elements"], + ArrowFunctionExpression: ["params", "body"], + BlockStatement: ["body"], + BinaryExpression: ["left", "right"], + BreakStatement: ["label"], + CallExpression: ["callee", "arguments"], + CatchClause: ["param", "body"], + ClassBody: ["body"], + ClassDeclaration: ["id", "superClass", "body"], + ClassExpression: ["id", "superClass", "body"], + 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"], + Identifier: [], + IfStatement: ["test", "consequent", "alternate"], + 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"], + + // JSX + JSXIdentifier: [], + JSXNamespacedName: ["namespace", "name"], + JSXMemberExpression: ["object", "property"], + JSXEmptyExpression: [], + JSXExpressionContainer: ["expression"], + JSXElement: ["openingElement", "closingElement", "children"], + JSXClosingElement: ["name"], + JSXOpeningElement: ["name", "attributes"], + JSXAttribute: ["name", "value"], + JSXText: null, + JSXSpreadAttribute: ["argument"] +}; diff --git a/node_modules/espree/package.json b/node_modules/espree/package.json new file mode 100644 index 0000000..73ead5e --- /dev/null +++ b/node_modules/espree/package.json @@ -0,0 +1,96 @@ +{ + "_from": "espree@^7.3.0", + "_id": "espree@7.3.0", + "_inBundle": false, + "_integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", + "_location": "/espree", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "espree@^7.3.0", + "name": "espree", + "escapedName": "espree", + "rawSpec": "^7.3.0", + "saveSpec": null, + "fetchSpec": "^7.3.0" + }, + "_requiredBy": [ + "/@eslint/eslintrc", + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "_shasum": "dc30437cf67947cf576121ebd780f15eeac72348", + "_spec": "espree@^7.3.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com" + }, + "bugs": { + "url": "http://github.com/eslint/espree.git" + }, + "bundleDependencies": false, + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + }, + "deprecated": false, + "description": "An Esprima-compatible JavaScript parser built on Acorn", + "devDependencies": { + "browserify": "^16.5.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", + "esprima": "latest", + "esprima-fb": "^8001.2001.0-dev-harmony-fb", + "json-diff": "^0.5.4", + "leche": "^2.3.0", + "mocha": "^6.2.0", + "nyc": "^14.1.1", + "regenerate": "^1.4.0", + "shelljs": "^0.3.0", + "shelljs-nodecli": "^0.1.1", + "unicode-6.3.0": "^0.7.5" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "lib", + "espree.js" + ], + "homepage": "https://github.com/eslint/espree", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax", + "acorn" + ], + "license": "BSD-2-Clause", + "main": "espree.js", + "name": "espree", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/espree.git" + }, + "scripts": { + "browserify": "node Makefile.js browserify", + "fixlint": "node Makefile.js lint --fix", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-regex": "node tools/generate-identifier-regex.js", + "generate-release": "eslint-generate-release", + "lint": "node Makefile.js lint", + "publish-release": "eslint-publish-release", + "sync-docs": "node Makefile.js docs", + "test": "npm run-script lint && node Makefile.js test" + }, + "version": "7.3.0" +} diff --git a/node_modules/esprima/ChangeLog b/node_modules/esprima/ChangeLog new file mode 100644 index 0000000..fafe1c9 --- /dev/null +++ b/node_modules/esprima/ChangeLog @@ -0,0 +1,235 @@ +2018-06-17: Version 4.0.1 + + * Fix parsing async get/set in a class (issue 1861, 1875) + * Account for different return statement argument (issue 1829, 1897, 1928) + * Correct the handling of HTML comment when parsing a module (issue 1841) + * Fix incorrect parse async with proto-identifier-shorthand (issue 1847) + * Fix negative column in binary expression (issue 1844) + * Fix incorrect YieldExpression in object methods (issue 1834) + * Various documentation fixes + +2017-06-10: Version 4.0.0 + + * Support ES2017 async function and await expression (issue 1079) + * Support ES2017 trailing commas in function parameters (issue 1550) + * Explicitly distinguish parsing a module vs a script (issue 1576) + * Fix JSX non-empty container (issue 1786) + * Allow JSX element in a yield expression (issue 1765) + * Allow `in` expression in a concise body with a function body (issue 1793) + * Setter function argument must not be a rest parameter (issue 1693) + * Limit strict mode directive to functions with a simple parameter list (issue 1677) + * Prohibit any escape sequence in a reserved word (issue 1612) + * Only permit hex digits in hex escape sequence (issue 1619) + * Prohibit labelled class/generator/function declaration (issue 1484) + * Limit function declaration as if statement clause only in non-strict mode (issue 1657) + * Tolerate missing ) in a with and do-while statement (issue 1481) + +2016-12-22: Version 3.1.3 + + * Support binding patterns as rest element (issue 1681) + * Account for different possible arguments of a yield expression (issue 1469) + +2016-11-24: Version 3.1.2 + + * Ensure that import specifier is more restrictive (issue 1615) + * Fix duplicated JSX tokens (issue 1613) + * Scan template literal in a JSX expression container (issue 1622) + * Improve XHTML entity scanning in JSX (issue 1629) + +2016-10-31: Version 3.1.1 + + * Fix assignment expression problem in an export declaration (issue 1596) + * Fix incorrect tokenization of hex digits (issue 1605) + +2016-10-09: Version 3.1.0 + + * Do not implicitly collect comments when comment attachment is specified (issue 1553) + * Fix incorrect handling of duplicated proto shorthand fields (issue 1485) + * Prohibit initialization in some variants of for statements (issue 1309, 1561) + * Fix incorrect parsing of export specifier (issue 1578) + * Fix ESTree compatibility for assignment pattern (issue 1575) + +2016-09-03: Version 3.0.0 + + * Support ES2016 exponentiation expression (issue 1490) + * Support JSX syntax (issue 1467) + * Use the latest Unicode 8.0 (issue 1475) + * Add the support for syntax node delegate (issue 1435) + * Fix ESTree compatibility on meta property (issue 1338) + * Fix ESTree compatibility on default parameter value (issue 1081) + * Fix ESTree compatibility on try handler (issue 1030) + +2016-08-23: Version 2.7.3 + + * Fix tokenizer confusion with a comment (issue 1493, 1516) + +2016-02-02: Version 2.7.2 + + * Fix out-of-bound error location in an invalid string literal (issue 1457) + * Fix shorthand object destructuring defaults in variable declarations (issue 1459) + +2015-12-10: Version 2.7.1 + + * Do not allow trailing comma in a variable declaration (issue 1360) + * Fix assignment to `let` in non-strict mode (issue 1376) + * Fix missing delegate property in YieldExpression (issue 1407) + +2015-10-22: Version 2.7.0 + + * Fix the handling of semicolon in a break statement (issue 1044) + * Run the test suite with major web browsers (issue 1259, 1317) + * Allow `let` as an identifier in non-strict mode (issue 1289) + * Attach orphaned comments as `innerComments` (issue 1328) + * Add the support for token delegator (issue 1332) + +2015-09-01: Version 2.6.0 + + * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) + * Add sourceType field for Program node (issue 1159) + * Ensure that strict mode reserved word binding throw an error (issue 1171) + * Run the test suite with Node.js and IE 11 on Windows (issue 1294) + * Allow binding pattern with no initializer in a for statement (issue 1301) + +2015-07-31: Version 2.5.0 + + * Run the test suite in a browser environment (issue 1004) + * Ensure a comma between imported default binding and named imports (issue 1046) + * Distinguish `yield` as a keyword vs an identifier (issue 1186) + * Support ES6 meta property `new.target` (issue 1203) + * Fix the syntax node for yield with expression (issue 1223) + * Fix the check of duplicated proto in property names (issue 1225) + * Fix ES6 Unicode escape in identifier name (issue 1229) + * Support ES6 IdentifierStart and IdentifierPart (issue 1232) + * Treat await as a reserved word when parsing as a module (issue 1234) + * Recognize identifier characters from Unicode SMP (issue 1244) + * Ensure that export and import can be followed by a comma (issue 1250) + * Fix yield operator precedence (issue 1262) + +2015-07-01: Version 2.4.1 + + * Fix some cases of comment attachment (issue 1071, 1175) + * Fix the handling of destructuring in function arguments (issue 1193) + * Fix invalid ranges in assignment expression (issue 1201) + +2015-06-26: Version 2.4.0 + + * Support ES6 for-of iteration (issue 1047) + * Support ES6 spread arguments (issue 1169) + * Minimize npm payload (issue 1191) + +2015-06-16: Version 2.3.0 + + * Support ES6 generator (issue 1033) + * Improve parsing of regular expressions with `u` flag (issue 1179) + +2015-04-17: Version 2.2.0 + + * Support ES6 import and export declarations (issue 1000) + * Fix line terminator before arrow not recognized as error (issue 1009) + * Support ES6 destructuring (issue 1045) + * Support ES6 template literal (issue 1074) + * Fix the handling of invalid/incomplete string escape sequences (issue 1106) + * Fix ES3 static member access restriction (issue 1120) + * Support for `super` in ES6 class (issue 1147) + +2015-03-09: Version 2.1.0 + + * Support ES6 class (issue 1001) + * Support ES6 rest parameter (issue 1011) + * Expand the location of property getter, setter, and methods (issue 1029) + * Enable TryStatement transition to a single handler (issue 1031) + * Support ES6 computed property name (issue 1037) + * Tolerate unclosed block comment (issue 1041) + * Support ES6 lexical declaration (issue 1065) + +2015-02-06: Version 2.0.0 + + * Support ES6 arrow function (issue 517) + * Support ES6 Unicode code point escape (issue 521) + * Improve the speed and accuracy of comment attachment (issue 522) + * Support ES6 default parameter (issue 519) + * Support ES6 regular expression flags (issue 557) + * Fix scanning of implicit octal literals (issue 565) + * Fix the handling of automatic semicolon insertion (issue 574) + * Support ES6 method definition (issue 620) + * Support ES6 octal integer literal (issue 621) + * Support ES6 binary integer literal (issue 622) + * Support ES6 object literal property value shorthand (issue 624) + +2015-03-03: Version 1.2.5 + + * Fix scanning of implicit octal literals (issue 565) + +2015-02-05: Version 1.2.4 + + * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) + * Fix the handling of automatic semicolon insertion (issue 574) + +2015-01-18: Version 1.2.3 + + * Fix division by this (issue 616) + +2014-05-18: Version 1.2.2 + + * Fix duplicated tokens when collecting comments (issue 537) + +2014-05-04: Version 1.2.1 + + * Ensure that Program node may still have leading comments (issue 536) + +2014-04-29: Version 1.2.0 + + * Fix semicolon handling for expression statement (issue 462, 533) + * Disallow escaped characters in regular expression flags (issue 503) + * Performance improvement for location tracking (issue 520) + * Improve the speed of comment attachment (issue 522) + +2014-03-26: Version 1.1.1 + + * Fix token handling of forward slash after an array literal (issue 512) + +2014-03-23: Version 1.1.0 + + * Optionally attach comments to the owning syntax nodes (issue 197) + * Simplify binary parsing with stack-based shift reduce (issue 352) + * Always include the raw source of literals (issue 376) + * Add optional input source information (issue 386) + * Tokenizer API for pure lexical scanning (issue 398) + * Improve the web site and its online demos (issue 337, 400, 404) + * Performance improvement for location tracking (issue 417, 424) + * Support HTML comment syntax (issue 451) + * Drop support for legacy browsers (issue 474) + +2013-08-27: Version 1.0.4 + + * Minimize the payload for packages (issue 362) + * Fix missing cases on an empty switch statement (issue 436) + * Support escaped ] in regexp literal character classes (issue 442) + * Tolerate invalid left-hand side expression (issue 130) + +2013-05-17: Version 1.0.3 + + * Variable declaration needs at least one declarator (issue 391) + * Fix benchmark's variance unit conversion (issue 397) + * IE < 9: \v should be treated as vertical tab (issue 405) + * Unary expressions should always have prefix: true (issue 418) + * Catch clause should only accept an identifier (issue 423) + * Tolerate setters without parameter (issue 426) + +2012-11-02: Version 1.0.2 + + Improvement: + + * Fix esvalidate JUnit output upon a syntax error (issue 374) + +2012-10-28: Version 1.0.1 + + Improvements: + + * esvalidate understands shebang in a Unix shell script (issue 361) + * esvalidate treats fatal parsing failure as an error (issue 361) + * Reduce Node.js package via .npmignore (issue 362) + +2012-10-22: Version 1.0.0 + + Initial release. diff --git a/node_modules/esprima/LICENSE.BSD b/node_modules/esprima/LICENSE.BSD new file mode 100644 index 0000000..7a55160 --- /dev/null +++ b/node_modules/esprima/LICENSE.BSD @@ -0,0 +1,21 @@ +Copyright JS Foundation and other contributors, https://js.foundation/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esprima/README.md b/node_modules/esprima/README.md new file mode 100644 index 0000000..8fb25e6 --- /dev/null +++ b/node_modules/esprima/README.md @@ -0,0 +1,46 @@ +[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) +[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) +[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) +[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) + +**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, +standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +parser written in ECMAScript (also popularly known as +[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). +Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), +with the help of [many contributors](https://github.com/jquery/esprima/contributors). + +### Features + +- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) +- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) +- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) +- Optional tracking of syntax node location (index-based and line-column) +- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) + +### API + +Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. + +A simple example on Node.js REPL: + +```javascript +> var esprima = require('esprima'); +> var program = 'const answer = 42'; + +> esprima.tokenize(program); +[ { type: 'Keyword', value: 'const' }, + { type: 'Identifier', value: 'answer' }, + { type: 'Punctuator', value: '=' }, + { type: 'Numeric', value: '42' } ] + +> esprima.parseScript(program); +{ type: 'Program', + body: + [ { type: 'VariableDeclaration', + declarations: [Object], + kind: 'const' } ], + sourceType: 'script' } +``` + +For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/node_modules/esprima/bin/esparse.js b/node_modules/esprima/bin/esparse.js new file mode 100755 index 0000000..45d05fb --- /dev/null +++ b/node_modules/esprima/bin/esparse.js @@ -0,0 +1,139 @@ +#!/usr/bin/env node +/* + Copyright JS Foundation and other contributors, https://js.foundation/ + + 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 sloppy:true node:true rhino:true */ + +var fs, esprima, fname, forceFile, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + try { + esprima = require('esprima'); + } catch (e) { + esprima = require('../'); + } +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] [file.js]'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { + if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } + } else if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry === '--') { + forceFile = true; + } else { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } +}); + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +function run(content) { + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); +} + +try { + if (fname && (fname !== '-' || forceFile)) { + run(fs.readFileSync(fname, 'utf-8')); + } else { + var content = ''; + process.stdin.resume(); + process.stdin.on('data', function(chunk) { + content += chunk; + }); + process.stdin.on('end', function() { + run(content); + }); + } +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} diff --git a/node_modules/esprima/bin/esvalidate.js b/node_modules/esprima/bin/esvalidate.js new file mode 100755 index 0000000..d49a7e4 --- /dev/null +++ b/node_modules/esprima/bin/esvalidate.js @@ -0,0 +1,236 @@ +#!/usr/bin/env node +/* + Copyright JS Foundation and other contributors, https://js.foundation/ + + 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 sloppy:true plusplus:true node:true rhino:true */ +/*global phantom:true */ + +var fs, system, esprima, options, fnames, forceFile, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + try { + esprima = require('esprima'); + } catch (e) { + esprima = require('../'); + } + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } + } +} + +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit, + on: function (evt, callback) { + callback(); + } + }; + process.argv.unshift('phantomjs'); +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { + argv: arguments, + exit: quit, + on: function (evt, callback) { + callback(); + } + }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] [file.js...]'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { + fnames.push(entry); + } else if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry === '--') { + forceFile = true; + } else { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } +}); + +if (fnames.length === 0) { + fnames.push(''); +} + +if (options.format === 'junit') { + console.log(''); + console.log(''); +} + +count = 0; + +function run(fname, content) { + var timestamp, syntax, name; + try { + if (typeof content !== 'string') { + throw content; + } + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log(''); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' '); + console.log(' ' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + ''); + console.log(' '); + }); + + console.log(''); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log(''); + console.log(' '); + console.log(' ' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')'); + console.log(' '); + console.log(''); + } else { + console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); + } + } +} + +fnames.forEach(function (fname) { + var content = ''; + try { + if (fname && (fname !== '-' || forceFile)) { + content = fs.readFileSync(fname, 'utf-8'); + } else { + fname = ''; + process.stdin.resume(); + process.stdin.on('data', function(chunk) { + content += chunk; + }); + process.stdin.on('end', function() { + run(fname, content); + }); + return; + } + } catch (e) { + content = e; + } + run(fname, content); +}); + +process.on('exit', function () { + if (options.format === 'junit') { + console.log(''); + } + + if (count > 0) { + process.exit(1); + } + + if (count === 0 && typeof phantom === 'object') { + process.exit(0); + } +}); diff --git a/node_modules/esprima/dist/esprima.js b/node_modules/esprima/dist/esprima.js new file mode 100644 index 0000000..2af3eee --- /dev/null +++ b/node_modules/esprima/dist/esprima.js @@ -0,0 +1,6709 @@ +(function webpackUniversalModuleDefinition(root, factory) { +/* istanbul ignore next */ + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); +/* istanbul ignore next */ + else if(typeof exports === 'object') + exports["esprima"] = factory(); + else + root["esprima"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/* istanbul ignore if */ +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + /* + Copyright JS Foundation and other contributors, https://js.foundation/ + + 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. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + var comment_handler_1 = __webpack_require__(1); + var jsx_parser_1 = __webpack_require__(3); + var parser_1 = __webpack_require__(8); + var tokenizer_1 = __webpack_require__(15); + function parse(code, options, delegate) { + var commentHandler = null; + var proxyDelegate = function (node, metadata) { + if (delegate) { + delegate(node, metadata); + } + if (commentHandler) { + commentHandler.visit(node, metadata); + } + }; + var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; + var collectComment = false; + if (options) { + collectComment = (typeof options.comment === 'boolean' && options.comment); + var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); + if (collectComment || attachComment) { + commentHandler = new comment_handler_1.CommentHandler(); + commentHandler.attach = attachComment; + options.comment = true; + parserDelegate = proxyDelegate; + } + } + var isModule = false; + if (options && typeof options.sourceType === 'string') { + isModule = (options.sourceType === 'module'); + } + var parser; + if (options && typeof options.jsx === 'boolean' && options.jsx) { + parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + } + else { + parser = new parser_1.Parser(code, options, parserDelegate); + } + var program = isModule ? parser.parseModule() : parser.parseScript(); + var ast = program; + if (collectComment && commentHandler) { + ast.comments = commentHandler.comments; + } + if (parser.config.tokens) { + ast.tokens = parser.tokens; + } + if (parser.config.tolerant) { + ast.errors = parser.errorHandler.errors; + } + return ast; + } + exports.parse = parse; + function parseModule(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'module'; + return parse(code, parsingOptions, delegate); + } + exports.parseModule = parseModule; + function parseScript(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'script'; + return parse(code, parsingOptions, delegate); + } + exports.parseScript = parseScript; + function tokenize(code, options, delegate) { + var tokenizer = new tokenizer_1.Tokenizer(code, options); + var tokens; + tokens = []; + try { + while (true) { + var token = tokenizer.getNextToken(); + if (!token) { + break; + } + if (delegate) { + token = delegate(token); + } + tokens.push(token); + } + } + catch (e) { + tokenizer.errorHandler.tolerate(e); + } + if (tokenizer.errorHandler.tolerant) { + tokens.errors = tokenizer.errors(); + } + return tokens; + } + exports.tokenize = tokenize; + var syntax_1 = __webpack_require__(2); + exports.Syntax = syntax_1.Syntax; + // Sync with *.json manifests. + exports.version = '4.0.1'; + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + var CommentHandler = (function () { + function CommentHandler() { + this.attach = false; + this.comments = []; + this.stack = []; + this.leading = []; + this.trailing = []; + } + CommentHandler.prototype.insertInnerComments = function (node, metadata) { + // innnerComments for properties empty block + // `function a() {/** comments **\/}` + if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { + var innerComments = []; + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (metadata.end.offset >= entry.start) { + innerComments.unshift(entry.comment); + this.leading.splice(i, 1); + this.trailing.splice(i, 1); + } + } + if (innerComments.length) { + node.innerComments = innerComments; + } + } + }; + CommentHandler.prototype.findTrailingComments = function (metadata) { + var trailingComments = []; + if (this.trailing.length > 0) { + for (var i = this.trailing.length - 1; i >= 0; --i) { + var entry_1 = this.trailing[i]; + if (entry_1.start >= metadata.end.offset) { + trailingComments.unshift(entry_1.comment); + } + } + this.trailing.length = 0; + return trailingComments; + } + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.node.trailingComments) { + var firstComment = entry.node.trailingComments[0]; + if (firstComment && firstComment.range[0] >= metadata.end.offset) { + trailingComments = entry.node.trailingComments; + delete entry.node.trailingComments; + } + } + return trailingComments; + }; + CommentHandler.prototype.findLeadingComments = function (metadata) { + var leadingComments = []; + var target; + while (this.stack.length > 0) { + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.start >= metadata.start.offset) { + target = entry.node; + this.stack.pop(); + } + else { + break; + } + } + if (target) { + var count = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count - 1; i >= 0; --i) { + var comment = target.leadingComments[i]; + if (comment.range[1] <= metadata.start.offset) { + leadingComments.unshift(comment); + target.leadingComments.splice(i, 1); + } + } + if (target.leadingComments && target.leadingComments.length === 0) { + delete target.leadingComments; + } + return leadingComments; + } + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (entry.start <= metadata.start.offset) { + leadingComments.unshift(entry.comment); + this.leading.splice(i, 1); + } + } + return leadingComments; + }; + CommentHandler.prototype.visitNode = function (node, metadata) { + if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { + return; + } + this.insertInnerComments(node, metadata); + var trailingComments = this.findTrailingComments(metadata); + var leadingComments = this.findLeadingComments(metadata); + if (leadingComments.length > 0) { + node.leadingComments = leadingComments; + } + if (trailingComments.length > 0) { + node.trailingComments = trailingComments; + } + this.stack.push({ + node: node, + start: metadata.start.offset + }); + }; + CommentHandler.prototype.visitComment = function (node, metadata) { + var type = (node.type[0] === 'L') ? 'Line' : 'Block'; + var comment = { + type: type, + value: node.value + }; + if (node.range) { + comment.range = node.range; + } + if (node.loc) { + comment.loc = node.loc; + } + this.comments.push(comment); + if (this.attach) { + var entry = { + comment: { + type: type, + value: node.value, + range: [metadata.start.offset, metadata.end.offset] + }, + start: metadata.start.offset + }; + if (node.loc) { + entry.comment.loc = node.loc; + } + node.type = type; + this.leading.push(entry); + this.trailing.push(entry); + } + }; + CommentHandler.prototype.visit = function (node, metadata) { + if (node.type === 'LineComment') { + this.visitComment(node, metadata); + } + else if (node.type === 'BlockComment') { + this.visitComment(node, metadata); + } + else if (this.attach) { + this.visitNode(node, metadata); + } + }; + return CommentHandler; + }()); + exports.CommentHandler = CommentHandler; + + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForOfStatement: 'ForOfStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchCase: 'SwitchCase', + SwitchStatement: 'SwitchStatement', + 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' + }; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; +/* istanbul ignore next */ + var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + var character_1 = __webpack_require__(4); + var JSXNode = __webpack_require__(5); + var jsx_syntax_1 = __webpack_require__(6); + var Node = __webpack_require__(7); + var parser_1 = __webpack_require__(8); + var token_1 = __webpack_require__(13); + var xhtml_entities_1 = __webpack_require__(14); + token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; + token_1.TokenName[101 /* Text */] = 'JSXText'; + // Fully qualified element name, e.g. returns "svg:path" + function getQualifiedElementName(elementName) { + var qualifiedName; + switch (elementName.type) { + case jsx_syntax_1.JSXSyntax.JSXIdentifier: + var id = elementName; + qualifiedName = id.name; + break; + case jsx_syntax_1.JSXSyntax.JSXNamespacedName: + var ns = elementName; + qualifiedName = getQualifiedElementName(ns.namespace) + ':' + + getQualifiedElementName(ns.name); + break; + case jsx_syntax_1.JSXSyntax.JSXMemberExpression: + var expr = elementName; + qualifiedName = getQualifiedElementName(expr.object) + '.' + + getQualifiedElementName(expr.property); + break; + /* istanbul ignore next */ + default: + break; + } + return qualifiedName; + } + var JSXParser = (function (_super) { + __extends(JSXParser, _super); + function JSXParser(code, options, delegate) { + return _super.call(this, code, options, delegate) || this; + } + JSXParser.prototype.parsePrimaryExpression = function () { + return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); + }; + JSXParser.prototype.startJSX = function () { + // Unwind the scanner before the lookahead token. + this.scanner.index = this.startMarker.index; + this.scanner.lineNumber = this.startMarker.line; + this.scanner.lineStart = this.startMarker.index - this.startMarker.column; + }; + JSXParser.prototype.finishJSX = function () { + // Prime the next lookahead. + this.nextToken(); + }; + JSXParser.prototype.reenterJSX = function () { + this.startJSX(); + this.expectJSX('}'); + // Pop the closing '}' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + }; + JSXParser.prototype.createJSXNode = function () { + this.collectComments(); + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.createJSXChildNode = function () { + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.scanXHTMLEntity = function (quote) { + var result = '&'; + var valid = true; + var terminated = false; + var numeric = false; + var hex = false; + while (!this.scanner.eof() && valid && !terminated) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === quote) { + break; + } + terminated = (ch === ';'); + result += ch; + ++this.scanner.index; + if (!terminated) { + switch (result.length) { + case 2: + // e.g. '{' + numeric = (ch === '#'); + break; + case 3: + if (numeric) { + // e.g. 'A' + hex = (ch === 'x'); + valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); + numeric = numeric && !hex; + } + break; + default: + valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); + valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); + break; + } + } + } + if (valid && terminated && result.length > 2) { + // e.g. 'A' becomes just '#x41' + var str = result.substr(1, result.length - 2); + if (numeric && str.length > 1) { + result = String.fromCharCode(parseInt(str.substr(1), 10)); + } + else if (hex && str.length > 2) { + result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); + } + else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { + result = xhtml_entities_1.XHTMLEntities[str]; + } + } + return result; + }; + // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. + JSXParser.prototype.lexJSX = function () { + var cp = this.scanner.source.charCodeAt(this.scanner.index); + // < > / : = { } + if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { + var value = this.scanner.source[this.scanner.index++]; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index - 1, + end: this.scanner.index + }; + } + // " ' + if (cp === 34 || cp === 39) { + var start = this.scanner.index; + var quote = this.scanner.source[this.scanner.index++]; + var str = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index++]; + if (ch === quote) { + break; + } + else if (ch === '&') { + str += this.scanXHTMLEntity(quote); + } + else { + str += ch; + } + } + return { + type: 8 /* StringLiteral */, + value: str, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ... or . + if (cp === 46) { + var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); + var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); + var value = (n1 === 46 && n2 === 46) ? '...' : '.'; + var start = this.scanner.index; + this.scanner.index += value.length; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ` + if (cp === 96) { + // Only placeholder, since it will be rescanned as a real assignment expression. + return { + type: 10 /* Template */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index, + end: this.scanner.index + }; + } + // Identifer can not contain backslash (char code 92). + if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { + var start = this.scanner.index; + ++this.scanner.index; + while (!this.scanner.eof()) { + var ch = this.scanner.source.charCodeAt(this.scanner.index); + if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { + ++this.scanner.index; + } + else if (ch === 45) { + // Hyphen (char code 45) can be part of an identifier. + ++this.scanner.index; + } + else { + break; + } + } + var id = this.scanner.source.slice(start, this.scanner.index); + return { + type: 100 /* Identifier */, + value: id, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + return this.scanner.lex(); + }; + JSXParser.prototype.nextJSXToken = function () { + this.collectComments(); + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var token = this.lexJSX(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + if (this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.nextJSXText = function () { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var start = this.scanner.index; + var text = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === '{' || ch === '<') { + break; + } + ++this.scanner.index; + text += ch; + if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + ++this.scanner.lineNumber; + if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { + ++this.scanner.index; + } + this.scanner.lineStart = this.scanner.index; + } + } + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + var token = { + type: 101 /* Text */, + value: text, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + if ((text.length > 0) && this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.peekJSXToken = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.lexJSX(); + this.scanner.restoreState(state); + return next; + }; + // Expect the next JSX token to match the specified punctuator. + // If not, an exception will be thrown. + JSXParser.prototype.expectJSX = function (value) { + var token = this.nextJSXToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next JSX token matches the specified punctuator. + JSXParser.prototype.matchJSX = function (value) { + var next = this.peekJSXToken(); + return next.type === 7 /* Punctuator */ && next.value === value; + }; + JSXParser.prototype.parseJSXIdentifier = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 100 /* Identifier */) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); + }; + JSXParser.prototype.parseJSXElementName = function () { + var node = this.createJSXNode(); + var elementName = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = elementName; + this.expectJSX(':'); + var name_1 = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); + } + else if (this.matchJSX('.')) { + while (this.matchJSX('.')) { + var object = elementName; + this.expectJSX('.'); + var property = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); + } + } + return elementName; + }; + JSXParser.prototype.parseJSXAttributeName = function () { + var node = this.createJSXNode(); + var attributeName; + var identifier = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = identifier; + this.expectJSX(':'); + var name_2 = this.parseJSXIdentifier(); + attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); + } + else { + attributeName = identifier; + } + return attributeName; + }; + JSXParser.prototype.parseJSXStringLiteralAttribute = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 8 /* StringLiteral */) { + this.throwUnexpectedToken(token); + } + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + JSXParser.prototype.parseJSXExpressionAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.finishJSX(); + if (this.match('}')) { + this.tolerateError('JSX attributes must only be assigned a non-empty expression'); + } + var expression = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXAttributeValue = function () { + return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : + this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); + }; + JSXParser.prototype.parseJSXNameValueAttribute = function () { + var node = this.createJSXNode(); + var name = this.parseJSXAttributeName(); + var value = null; + if (this.matchJSX('=')) { + this.expectJSX('='); + value = this.parseJSXAttributeValue(); + } + return this.finalize(node, new JSXNode.JSXAttribute(name, value)); + }; + JSXParser.prototype.parseJSXSpreadAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.expectJSX('...'); + this.finishJSX(); + var argument = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); + }; + JSXParser.prototype.parseJSXAttributes = function () { + var attributes = []; + while (!this.matchJSX('/') && !this.matchJSX('>')) { + var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : + this.parseJSXNameValueAttribute(); + attributes.push(attribute); + } + return attributes; + }; + JSXParser.prototype.parseJSXOpeningElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXBoundaryElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + if (this.matchJSX('/')) { + this.expectJSX('/'); + var name_3 = this.parseJSXElementName(); + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); + } + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXEmptyExpression = function () { + var node = this.createJSXChildNode(); + this.collectComments(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + return this.finalize(node, new JSXNode.JSXEmptyExpression()); + }; + JSXParser.prototype.parseJSXExpressionContainer = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + var expression; + if (this.matchJSX('}')) { + expression = this.parseJSXEmptyExpression(); + this.expectJSX('}'); + } + else { + this.finishJSX(); + expression = this.parseAssignmentExpression(); + this.reenterJSX(); + } + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXChildren = function () { + var children = []; + while (!this.scanner.eof()) { + var node = this.createJSXChildNode(); + var token = this.nextJSXText(); + if (token.start < token.end) { + var raw = this.getTokenRaw(token); + var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); + children.push(child); + } + if (this.scanner.source[this.scanner.index] === '{') { + var container = this.parseJSXExpressionContainer(); + children.push(container); + } + else { + break; + } + } + return children; + }; + JSXParser.prototype.parseComplexJSXElement = function (el) { + var stack = []; + while (!this.scanner.eof()) { + el.children = el.children.concat(this.parseJSXChildren()); + var node = this.createJSXChildNode(); + var element = this.parseJSXBoundaryElement(); + if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { + var opening = element; + if (opening.selfClosing) { + var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); + el.children.push(child); + } + else { + stack.push(el); + el = { node: node, opening: opening, closing: null, children: [] }; + } + } + if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { + el.closing = element; + var open_1 = getQualifiedElementName(el.opening.name); + var close_1 = getQualifiedElementName(el.closing.name); + if (open_1 !== close_1) { + this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); + } + if (stack.length > 0) { + var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); + el = stack[stack.length - 1]; + el.children.push(child); + stack.pop(); + } + else { + break; + } + } + } + return el; + }; + JSXParser.prototype.parseJSXElement = function () { + var node = this.createJSXNode(); + var opening = this.parseJSXOpeningElement(); + var children = []; + var closing = null; + if (!opening.selfClosing) { + var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); + children = el.children; + closing = el.closing; + } + return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); + }; + JSXParser.prototype.parseJSXRoot = function () { + // Pop the opening '<' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + this.startJSX(); + var element = this.parseJSXElement(); + this.finishJSX(); + return element; + }; + JSXParser.prototype.isStartOfExpression = function () { + return _super.prototype.isStartOfExpression.call(this) || this.match('<'); + }; + return JSXParser; + }(parser_1.Parser)); + exports.JSXParser = JSXParser; + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // See also tools/generate-unicode-regex.js. + var Regex = { + // Unicode v8.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\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\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\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\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-\uA7AD\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\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[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\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]|\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]|\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]/, + // Unicode v8.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\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\u0C81-\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\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\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\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\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\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[\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]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\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]|\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]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\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]/ + }; + exports.Character = { + /* tslint:disable:no-bitwise */ + fromCodePoint: function (cp) { + return (cp < 0x10000) ? String.fromCharCode(cp) : + String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + + String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); + }, + // https://tc39.github.io/ecma262/#sec-white-space + isWhiteSpace: function (cp) { + return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || + (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); + }, + // https://tc39.github.io/ecma262/#sec-line-terminators + isLineTerminator: function (cp) { + return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); + }, + // https://tc39.github.io/ecma262/#sec-names-and-keywords + isIdentifierStart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); + }, + isIdentifierPart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp >= 0x30 && cp <= 0x39) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); + }, + // https://tc39.github.io/ecma262/#sec-literals-numeric-literals + isDecimalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39); // 0..9 + }, + isHexDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39) || + (cp >= 0x41 && cp <= 0x46) || + (cp >= 0x61 && cp <= 0x66); // a..f + }, + isOctalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x37); // 0..7 + } + }; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var jsx_syntax_1 = __webpack_require__(6); + /* tslint:disable:max-classes-per-file */ + var JSXClosingElement = (function () { + function JSXClosingElement(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; + this.name = name; + } + return JSXClosingElement; + }()); + exports.JSXClosingElement = JSXClosingElement; + var JSXElement = (function () { + function JSXElement(openingElement, children, closingElement) { + this.type = jsx_syntax_1.JSXSyntax.JSXElement; + this.openingElement = openingElement; + this.children = children; + this.closingElement = closingElement; + } + return JSXElement; + }()); + exports.JSXElement = JSXElement; + var JSXEmptyExpression = (function () { + function JSXEmptyExpression() { + this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; + } + return JSXEmptyExpression; + }()); + exports.JSXEmptyExpression = JSXEmptyExpression; + var JSXExpressionContainer = (function () { + function JSXExpressionContainer(expression) { + this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; + this.expression = expression; + } + return JSXExpressionContainer; + }()); + exports.JSXExpressionContainer = JSXExpressionContainer; + var JSXIdentifier = (function () { + function JSXIdentifier(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; + this.name = name; + } + return JSXIdentifier; + }()); + exports.JSXIdentifier = JSXIdentifier; + var JSXMemberExpression = (function () { + function JSXMemberExpression(object, property) { + this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; + this.object = object; + this.property = property; + } + return JSXMemberExpression; + }()); + exports.JSXMemberExpression = JSXMemberExpression; + var JSXAttribute = (function () { + function JSXAttribute(name, value) { + this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; + this.name = name; + this.value = value; + } + return JSXAttribute; + }()); + exports.JSXAttribute = JSXAttribute; + var JSXNamespacedName = (function () { + function JSXNamespacedName(namespace, name) { + this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; + this.namespace = namespace; + this.name = name; + } + return JSXNamespacedName; + }()); + exports.JSXNamespacedName = JSXNamespacedName; + var JSXOpeningElement = (function () { + function JSXOpeningElement(name, selfClosing, attributes) { + this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; + this.name = name; + this.selfClosing = selfClosing; + this.attributes = attributes; + } + return JSXOpeningElement; + }()); + exports.JSXOpeningElement = JSXOpeningElement; + var JSXSpreadAttribute = (function () { + function JSXSpreadAttribute(argument) { + this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; + this.argument = argument; + } + return JSXSpreadAttribute; + }()); + exports.JSXSpreadAttribute = JSXSpreadAttribute; + var JSXText = (function () { + function JSXText(value, raw) { + this.type = jsx_syntax_1.JSXSyntax.JSXText; + this.value = value; + this.raw = raw; + } + return JSXText; + }()); + exports.JSXText = JSXText; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JSXSyntax = { + JSXAttribute: 'JSXAttribute', + JSXClosingElement: 'JSXClosingElement', + JSXElement: 'JSXElement', + JSXEmptyExpression: 'JSXEmptyExpression', + JSXExpressionContainer: 'JSXExpressionContainer', + JSXIdentifier: 'JSXIdentifier', + JSXMemberExpression: 'JSXMemberExpression', + JSXNamespacedName: 'JSXNamespacedName', + JSXOpeningElement: 'JSXOpeningElement', + JSXSpreadAttribute: 'JSXSpreadAttribute', + JSXText: 'JSXText' + }; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + /* tslint:disable:max-classes-per-file */ + var ArrayExpression = (function () { + function ArrayExpression(elements) { + this.type = syntax_1.Syntax.ArrayExpression; + this.elements = elements; + } + return ArrayExpression; + }()); + exports.ArrayExpression = ArrayExpression; + var ArrayPattern = (function () { + function ArrayPattern(elements) { + this.type = syntax_1.Syntax.ArrayPattern; + this.elements = elements; + } + return ArrayPattern; + }()); + exports.ArrayPattern = ArrayPattern; + var ArrowFunctionExpression = (function () { + function ArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = false; + } + return ArrowFunctionExpression; + }()); + exports.ArrowFunctionExpression = ArrowFunctionExpression; + var AssignmentExpression = (function () { + function AssignmentExpression(operator, left, right) { + this.type = syntax_1.Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return AssignmentExpression; + }()); + exports.AssignmentExpression = AssignmentExpression; + var AssignmentPattern = (function () { + function AssignmentPattern(left, right) { + this.type = syntax_1.Syntax.AssignmentPattern; + this.left = left; + this.right = right; + } + return AssignmentPattern; + }()); + exports.AssignmentPattern = AssignmentPattern; + var AsyncArrowFunctionExpression = (function () { + function AsyncArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = true; + } + return AsyncArrowFunctionExpression; + }()); + exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; + var AsyncFunctionDeclaration = (function () { + function AsyncFunctionDeclaration(id, params, body) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionDeclaration; + }()); + exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; + var AsyncFunctionExpression = (function () { + function AsyncFunctionExpression(id, params, body) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionExpression; + }()); + exports.AsyncFunctionExpression = AsyncFunctionExpression; + var AwaitExpression = (function () { + function AwaitExpression(argument) { + this.type = syntax_1.Syntax.AwaitExpression; + this.argument = argument; + } + return AwaitExpression; + }()); + exports.AwaitExpression = AwaitExpression; + var BinaryExpression = (function () { + function BinaryExpression(operator, left, right) { + var logical = (operator === '||' || operator === '&&'); + this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return BinaryExpression; + }()); + exports.BinaryExpression = BinaryExpression; + var BlockStatement = (function () { + function BlockStatement(body) { + this.type = syntax_1.Syntax.BlockStatement; + this.body = body; + } + return BlockStatement; + }()); + exports.BlockStatement = BlockStatement; + var BreakStatement = (function () { + function BreakStatement(label) { + this.type = syntax_1.Syntax.BreakStatement; + this.label = label; + } + return BreakStatement; + }()); + exports.BreakStatement = BreakStatement; + var CallExpression = (function () { + function CallExpression(callee, args) { + this.type = syntax_1.Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + } + return CallExpression; + }()); + exports.CallExpression = CallExpression; + var CatchClause = (function () { + function CatchClause(param, body) { + this.type = syntax_1.Syntax.CatchClause; + this.param = param; + this.body = body; + } + return CatchClause; + }()); + exports.CatchClause = CatchClause; + var ClassBody = (function () { + function ClassBody(body) { + this.type = syntax_1.Syntax.ClassBody; + this.body = body; + } + return ClassBody; + }()); + exports.ClassBody = ClassBody; + var ClassDeclaration = (function () { + function ClassDeclaration(id, superClass, body) { + this.type = syntax_1.Syntax.ClassDeclaration; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassDeclaration; + }()); + exports.ClassDeclaration = ClassDeclaration; + var ClassExpression = (function () { + function ClassExpression(id, superClass, body) { + this.type = syntax_1.Syntax.ClassExpression; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassExpression; + }()); + exports.ClassExpression = ClassExpression; + var ComputedMemberExpression = (function () { + function ComputedMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = true; + this.object = object; + this.property = property; + } + return ComputedMemberExpression; + }()); + exports.ComputedMemberExpression = ComputedMemberExpression; + var ConditionalExpression = (function () { + function ConditionalExpression(test, consequent, alternate) { + this.type = syntax_1.Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return ConditionalExpression; + }()); + exports.ConditionalExpression = ConditionalExpression; + var ContinueStatement = (function () { + function ContinueStatement(label) { + this.type = syntax_1.Syntax.ContinueStatement; + this.label = label; + } + return ContinueStatement; + }()); + exports.ContinueStatement = ContinueStatement; + var DebuggerStatement = (function () { + function DebuggerStatement() { + this.type = syntax_1.Syntax.DebuggerStatement; + } + return DebuggerStatement; + }()); + exports.DebuggerStatement = DebuggerStatement; + var Directive = (function () { + function Directive(expression, directive) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + this.directive = directive; + } + return Directive; + }()); + exports.Directive = Directive; + var DoWhileStatement = (function () { + function DoWhileStatement(body, test) { + this.type = syntax_1.Syntax.DoWhileStatement; + this.body = body; + this.test = test; + } + return DoWhileStatement; + }()); + exports.DoWhileStatement = DoWhileStatement; + var EmptyStatement = (function () { + function EmptyStatement() { + this.type = syntax_1.Syntax.EmptyStatement; + } + return EmptyStatement; + }()); + exports.EmptyStatement = EmptyStatement; + var ExportAllDeclaration = (function () { + function ExportAllDeclaration(source) { + this.type = syntax_1.Syntax.ExportAllDeclaration; + this.source = source; + } + return ExportAllDeclaration; + }()); + exports.ExportAllDeclaration = ExportAllDeclaration; + var ExportDefaultDeclaration = (function () { + function ExportDefaultDeclaration(declaration) { + this.type = syntax_1.Syntax.ExportDefaultDeclaration; + this.declaration = declaration; + } + return ExportDefaultDeclaration; + }()); + exports.ExportDefaultDeclaration = ExportDefaultDeclaration; + var ExportNamedDeclaration = (function () { + function ExportNamedDeclaration(declaration, specifiers, source) { + this.type = syntax_1.Syntax.ExportNamedDeclaration; + this.declaration = declaration; + this.specifiers = specifiers; + this.source = source; + } + return ExportNamedDeclaration; + }()); + exports.ExportNamedDeclaration = ExportNamedDeclaration; + var ExportSpecifier = (function () { + function ExportSpecifier(local, exported) { + this.type = syntax_1.Syntax.ExportSpecifier; + this.exported = exported; + this.local = local; + } + return ExportSpecifier; + }()); + exports.ExportSpecifier = ExportSpecifier; + var ExpressionStatement = (function () { + function ExpressionStatement(expression) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + } + return ExpressionStatement; + }()); + exports.ExpressionStatement = ExpressionStatement; + var ForInStatement = (function () { + function ForInStatement(left, right, body) { + this.type = syntax_1.Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + } + return ForInStatement; + }()); + exports.ForInStatement = ForInStatement; + var ForOfStatement = (function () { + function ForOfStatement(left, right, body) { + this.type = syntax_1.Syntax.ForOfStatement; + this.left = left; + this.right = right; + this.body = body; + } + return ForOfStatement; + }()); + exports.ForOfStatement = ForOfStatement; + var ForStatement = (function () { + function ForStatement(init, test, update, body) { + this.type = syntax_1.Syntax.ForStatement; + this.init = init; + this.test = test; + this.update = update; + this.body = body; + } + return ForStatement; + }()); + exports.ForStatement = ForStatement; + var FunctionDeclaration = (function () { + function FunctionDeclaration(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionDeclaration; + }()); + exports.FunctionDeclaration = FunctionDeclaration; + var FunctionExpression = (function () { + function FunctionExpression(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionExpression; + }()); + exports.FunctionExpression = FunctionExpression; + var Identifier = (function () { + function Identifier(name) { + this.type = syntax_1.Syntax.Identifier; + this.name = name; + } + return Identifier; + }()); + exports.Identifier = Identifier; + var IfStatement = (function () { + function IfStatement(test, consequent, alternate) { + this.type = syntax_1.Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return IfStatement; + }()); + exports.IfStatement = IfStatement; + var ImportDeclaration = (function () { + function ImportDeclaration(specifiers, source) { + this.type = syntax_1.Syntax.ImportDeclaration; + this.specifiers = specifiers; + this.source = source; + } + return ImportDeclaration; + }()); + exports.ImportDeclaration = ImportDeclaration; + var ImportDefaultSpecifier = (function () { + function ImportDefaultSpecifier(local) { + this.type = syntax_1.Syntax.ImportDefaultSpecifier; + this.local = local; + } + return ImportDefaultSpecifier; + }()); + exports.ImportDefaultSpecifier = ImportDefaultSpecifier; + var ImportNamespaceSpecifier = (function () { + function ImportNamespaceSpecifier(local) { + this.type = syntax_1.Syntax.ImportNamespaceSpecifier; + this.local = local; + } + return ImportNamespaceSpecifier; + }()); + exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; + var ImportSpecifier = (function () { + function ImportSpecifier(local, imported) { + this.type = syntax_1.Syntax.ImportSpecifier; + this.local = local; + this.imported = imported; + } + return ImportSpecifier; + }()); + exports.ImportSpecifier = ImportSpecifier; + var LabeledStatement = (function () { + function LabeledStatement(label, body) { + this.type = syntax_1.Syntax.LabeledStatement; + this.label = label; + this.body = body; + } + return LabeledStatement; + }()); + exports.LabeledStatement = LabeledStatement; + var Literal = (function () { + function Literal(value, raw) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + } + return Literal; + }()); + exports.Literal = Literal; + var MetaProperty = (function () { + function MetaProperty(meta, property) { + this.type = syntax_1.Syntax.MetaProperty; + this.meta = meta; + this.property = property; + } + return MetaProperty; + }()); + exports.MetaProperty = MetaProperty; + var MethodDefinition = (function () { + function MethodDefinition(key, computed, value, kind, isStatic) { + this.type = syntax_1.Syntax.MethodDefinition; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.static = isStatic; + } + return MethodDefinition; + }()); + exports.MethodDefinition = MethodDefinition; + var Module = (function () { + function Module(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'module'; + } + return Module; + }()); + exports.Module = Module; + var NewExpression = (function () { + function NewExpression(callee, args) { + this.type = syntax_1.Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + } + return NewExpression; + }()); + exports.NewExpression = NewExpression; + var ObjectExpression = (function () { + function ObjectExpression(properties) { + this.type = syntax_1.Syntax.ObjectExpression; + this.properties = properties; + } + return ObjectExpression; + }()); + exports.ObjectExpression = ObjectExpression; + var ObjectPattern = (function () { + function ObjectPattern(properties) { + this.type = syntax_1.Syntax.ObjectPattern; + this.properties = properties; + } + return ObjectPattern; + }()); + exports.ObjectPattern = ObjectPattern; + var Property = (function () { + function Property(kind, key, computed, value, method, shorthand) { + this.type = syntax_1.Syntax.Property; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.method = method; + this.shorthand = shorthand; + } + return Property; + }()); + exports.Property = Property; + var RegexLiteral = (function () { + function RegexLiteral(value, raw, pattern, flags) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + this.regex = { pattern: pattern, flags: flags }; + } + return RegexLiteral; + }()); + exports.RegexLiteral = RegexLiteral; + var RestElement = (function () { + function RestElement(argument) { + this.type = syntax_1.Syntax.RestElement; + this.argument = argument; + } + return RestElement; + }()); + exports.RestElement = RestElement; + var ReturnStatement = (function () { + function ReturnStatement(argument) { + this.type = syntax_1.Syntax.ReturnStatement; + this.argument = argument; + } + return ReturnStatement; + }()); + exports.ReturnStatement = ReturnStatement; + var Script = (function () { + function Script(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'script'; + } + return Script; + }()); + exports.Script = Script; + var SequenceExpression = (function () { + function SequenceExpression(expressions) { + this.type = syntax_1.Syntax.SequenceExpression; + this.expressions = expressions; + } + return SequenceExpression; + }()); + exports.SequenceExpression = SequenceExpression; + var SpreadElement = (function () { + function SpreadElement(argument) { + this.type = syntax_1.Syntax.SpreadElement; + this.argument = argument; + } + return SpreadElement; + }()); + exports.SpreadElement = SpreadElement; + var StaticMemberExpression = (function () { + function StaticMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = false; + this.object = object; + this.property = property; + } + return StaticMemberExpression; + }()); + exports.StaticMemberExpression = StaticMemberExpression; + var Super = (function () { + function Super() { + this.type = syntax_1.Syntax.Super; + } + return Super; + }()); + exports.Super = Super; + var SwitchCase = (function () { + function SwitchCase(test, consequent) { + this.type = syntax_1.Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + } + return SwitchCase; + }()); + exports.SwitchCase = SwitchCase; + var SwitchStatement = (function () { + function SwitchStatement(discriminant, cases) { + this.type = syntax_1.Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + } + return SwitchStatement; + }()); + exports.SwitchStatement = SwitchStatement; + var TaggedTemplateExpression = (function () { + function TaggedTemplateExpression(tag, quasi) { + this.type = syntax_1.Syntax.TaggedTemplateExpression; + this.tag = tag; + this.quasi = quasi; + } + return TaggedTemplateExpression; + }()); + exports.TaggedTemplateExpression = TaggedTemplateExpression; + var TemplateElement = (function () { + function TemplateElement(value, tail) { + this.type = syntax_1.Syntax.TemplateElement; + this.value = value; + this.tail = tail; + } + return TemplateElement; + }()); + exports.TemplateElement = TemplateElement; + var TemplateLiteral = (function () { + function TemplateLiteral(quasis, expressions) { + this.type = syntax_1.Syntax.TemplateLiteral; + this.quasis = quasis; + this.expressions = expressions; + } + return TemplateLiteral; + }()); + exports.TemplateLiteral = TemplateLiteral; + var ThisExpression = (function () { + function ThisExpression() { + this.type = syntax_1.Syntax.ThisExpression; + } + return ThisExpression; + }()); + exports.ThisExpression = ThisExpression; + var ThrowStatement = (function () { + function ThrowStatement(argument) { + this.type = syntax_1.Syntax.ThrowStatement; + this.argument = argument; + } + return ThrowStatement; + }()); + exports.ThrowStatement = ThrowStatement; + var TryStatement = (function () { + function TryStatement(block, handler, finalizer) { + this.type = syntax_1.Syntax.TryStatement; + this.block = block; + this.handler = handler; + this.finalizer = finalizer; + } + return TryStatement; + }()); + exports.TryStatement = TryStatement; + var UnaryExpression = (function () { + function UnaryExpression(operator, argument) { + this.type = syntax_1.Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + } + return UnaryExpression; + }()); + exports.UnaryExpression = UnaryExpression; + var UpdateExpression = (function () { + function UpdateExpression(operator, argument, prefix) { + this.type = syntax_1.Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = prefix; + } + return UpdateExpression; + }()); + exports.UpdateExpression = UpdateExpression; + var VariableDeclaration = (function () { + function VariableDeclaration(declarations, kind) { + this.type = syntax_1.Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + } + return VariableDeclaration; + }()); + exports.VariableDeclaration = VariableDeclaration; + var VariableDeclarator = (function () { + function VariableDeclarator(id, init) { + this.type = syntax_1.Syntax.VariableDeclarator; + this.id = id; + this.init = init; + } + return VariableDeclarator; + }()); + exports.VariableDeclarator = VariableDeclarator; + var WhileStatement = (function () { + function WhileStatement(test, body) { + this.type = syntax_1.Syntax.WhileStatement; + this.test = test; + this.body = body; + } + return WhileStatement; + }()); + exports.WhileStatement = WhileStatement; + var WithStatement = (function () { + function WithStatement(object, body) { + this.type = syntax_1.Syntax.WithStatement; + this.object = object; + this.body = body; + } + return WithStatement; + }()); + exports.WithStatement = WithStatement; + var YieldExpression = (function () { + function YieldExpression(argument, delegate) { + this.type = syntax_1.Syntax.YieldExpression; + this.argument = argument; + this.delegate = delegate; + } + return YieldExpression; + }()); + exports.YieldExpression = YieldExpression; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var error_handler_1 = __webpack_require__(10); + var messages_1 = __webpack_require__(11); + var Node = __webpack_require__(7); + var scanner_1 = __webpack_require__(12); + var syntax_1 = __webpack_require__(2); + var token_1 = __webpack_require__(13); + var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; + var Parser = (function () { + function Parser(code, options, delegate) { + if (options === void 0) { options = {}; } + this.config = { + range: (typeof options.range === 'boolean') && options.range, + loc: (typeof options.loc === 'boolean') && options.loc, + source: null, + tokens: (typeof options.tokens === 'boolean') && options.tokens, + comment: (typeof options.comment === 'boolean') && options.comment, + tolerant: (typeof options.tolerant === 'boolean') && options.tolerant + }; + if (this.config.loc && options.source && options.source !== null) { + this.config.source = String(options.source); + } + this.delegate = delegate; + this.errorHandler = new error_handler_1.ErrorHandler(); + this.errorHandler.tolerant = this.config.tolerant; + this.scanner = new scanner_1.Scanner(code, this.errorHandler); + this.scanner.trackComment = this.config.comment; + this.operatorPrecedence = { + ')': 0, + ';': 0, + ',': 0, + '=': 0, + ']': 0, + '||': 1, + '&&': 2, + '|': 3, + '^': 4, + '&': 5, + '==': 6, + '!=': 6, + '===': 6, + '!==': 6, + '<': 7, + '>': 7, + '<=': 7, + '>=': 7, + '<<': 8, + '>>': 8, + '>>>': 8, + '+': 9, + '-': 9, + '*': 11, + '/': 11, + '%': 11 + }; + this.lookahead = { + type: 2 /* EOF */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: 0, + start: 0, + end: 0 + }; + this.hasLineTerminator = false; + this.context = { + isModule: false, + await: false, + allowIn: true, + allowStrictDirective: true, + allowYield: true, + firstCoverInitializedNameError: null, + isAssignmentTarget: false, + isBindingElement: false, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + labelSet: {}, + strict: false + }; + this.tokens = []; + this.startMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.lastMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.nextToken(); + this.lastMarker = { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + } + Parser.prototype.throwError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + throw this.errorHandler.createError(index, line, column, msg); + }; + Parser.prototype.tolerateError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.scanner.lineNumber; + var column = this.lastMarker.column + 1; + this.errorHandler.tolerateError(index, line, column, msg); + }; + // Throw an exception because of the token. + Parser.prototype.unexpectedTokenError = function (token, message) { + var msg = message || messages_1.Messages.UnexpectedToken; + var value; + if (token) { + if (!message) { + msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : + (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : + (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : + (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : + (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : + messages_1.Messages.UnexpectedToken; + if (token.type === 4 /* Keyword */) { + if (this.scanner.isFutureReservedWord(token.value)) { + msg = messages_1.Messages.UnexpectedReserved; + } + else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { + msg = messages_1.Messages.StrictReservedWord; + } + } + } + value = token.value; + } + else { + value = 'ILLEGAL'; + } + msg = msg.replace('%0', value); + if (token && typeof token.lineNumber === 'number') { + var index = token.start; + var line = token.lineNumber; + var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; + var column = token.start - lastMarkerLineStart + 1; + return this.errorHandler.createError(index, line, column, msg); + } + else { + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + return this.errorHandler.createError(index, line, column, msg); + } + }; + Parser.prototype.throwUnexpectedToken = function (token, message) { + throw this.unexpectedTokenError(token, message); + }; + Parser.prototype.tolerateUnexpectedToken = function (token, message) { + this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); + }; + Parser.prototype.collectComments = function () { + if (!this.config.comment) { + this.scanner.scanComments(); + } + else { + var comments = this.scanner.scanComments(); + if (comments.length > 0 && this.delegate) { + for (var i = 0; i < comments.length; ++i) { + var e = comments[i]; + var node = void 0; + node = { + type: e.multiLine ? 'BlockComment' : 'LineComment', + value: this.scanner.source.slice(e.slice[0], e.slice[1]) + }; + if (this.config.range) { + node.range = e.range; + } + if (this.config.loc) { + node.loc = e.loc; + } + var metadata = { + start: { + line: e.loc.start.line, + column: e.loc.start.column, + offset: e.range[0] + }, + end: { + line: e.loc.end.line, + column: e.loc.end.column, + offset: e.range[1] + } + }; + this.delegate(node, metadata); + } + } + } + }; + // From internal representation to an external structure + Parser.prototype.getTokenRaw = function (token) { + return this.scanner.source.slice(token.start, token.end); + }; + Parser.prototype.convertToken = function (token) { + var t = { + type: token_1.TokenName[token.type], + value: this.getTokenRaw(token) + }; + if (this.config.range) { + t.range = [token.start, token.end]; + } + if (this.config.loc) { + t.loc = { + start: { + line: this.startMarker.line, + column: this.startMarker.column + }, + end: { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + } + }; + } + if (token.type === 9 /* RegularExpression */) { + var pattern = token.pattern; + var flags = token.flags; + t.regex = { pattern: pattern, flags: flags }; + } + return t; + }; + Parser.prototype.nextToken = function () { + var token = this.lookahead; + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + this.collectComments(); + if (this.scanner.index !== this.startMarker.index) { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + } + var next = this.scanner.lex(); + this.hasLineTerminator = (token.lineNumber !== next.lineNumber); + if (next && this.context.strict && next.type === 3 /* Identifier */) { + if (this.scanner.isStrictModeReservedWord(next.value)) { + next.type = 4 /* Keyword */; + } + } + this.lookahead = next; + if (this.config.tokens && next.type !== 2 /* EOF */) { + this.tokens.push(this.convertToken(next)); + } + return token; + }; + Parser.prototype.nextRegexToken = function () { + this.collectComments(); + var token = this.scanner.scanRegExp(); + if (this.config.tokens) { + // Pop the previous token, '/' or '/=' + // This is added from the lookahead token. + this.tokens.pop(); + this.tokens.push(this.convertToken(token)); + } + // Prime the next lookahead. + this.lookahead = token; + this.nextToken(); + return token; + }; + Parser.prototype.createNode = function () { + return { + index: this.startMarker.index, + line: this.startMarker.line, + column: this.startMarker.column + }; + }; + Parser.prototype.startNode = function (token, lastLineStart) { + if (lastLineStart === void 0) { lastLineStart = 0; } + var column = token.start - token.lineStart; + var line = token.lineNumber; + if (column < 0) { + column += lastLineStart; + line--; + } + return { + index: token.start, + line: line, + column: column + }; + }; + Parser.prototype.finalize = function (marker, node) { + if (this.config.range) { + node.range = [marker.index, this.lastMarker.index]; + } + if (this.config.loc) { + node.loc = { + start: { + line: marker.line, + column: marker.column, + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column + } + }; + if (this.config.source) { + node.loc.source = this.config.source; + } + } + if (this.delegate) { + var metadata = { + start: { + line: marker.line, + column: marker.column, + offset: marker.index + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column, + offset: this.lastMarker.index + } + }; + this.delegate(node, metadata); + } + return node; + }; + // Expect the next token to match the specified punctuator. + // If not, an exception will be thrown. + Parser.prototype.expect = function (value) { + var token = this.nextToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). + Parser.prototype.expectCommaSeparator = function () { + if (this.config.tolerant) { + var token = this.lookahead; + if (token.type === 7 /* Punctuator */ && token.value === ',') { + this.nextToken(); + } + else if (token.type === 7 /* Punctuator */ && token.value === ';') { + this.nextToken(); + this.tolerateUnexpectedToken(token); + } + else { + this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); + } + } + else { + this.expect(','); + } + }; + // Expect the next token to match the specified keyword. + // If not, an exception will be thrown. + Parser.prototype.expectKeyword = function (keyword) { + var token = this.nextToken(); + if (token.type !== 4 /* Keyword */ || token.value !== keyword) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next token matches the specified punctuator. + Parser.prototype.match = function (value) { + return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; + }; + // Return true if the next token matches the specified keyword + Parser.prototype.matchKeyword = function (keyword) { + return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; + }; + // Return true if the next token matches the specified contextual keyword + // (where an identifier is sometimes a keyword depending on the context) + Parser.prototype.matchContextualKeyword = function (keyword) { + return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; + }; + // Return true if the next token is an assignment operator + Parser.prototype.matchAssign = function () { + if (this.lookahead.type !== 7 /* Punctuator */) { + return false; + } + var op = this.lookahead.value; + return op === '=' || + op === '*=' || + op === '**=' || + op === '/=' || + op === '%=' || + op === '+=' || + op === '-=' || + op === '<<=' || + op === '>>=' || + op === '>>>=' || + op === '&=' || + op === '^=' || + op === '|='; + }; + // Cover grammar support. + // + // When an assignment expression position starts with an left parenthesis, the determination of the type + // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) + // or the first comma. This situation also defers the determination of all the expressions nested in the pair. + // + // There are three productions that can be parsed in a parentheses pair that needs to be determined + // after the outermost pair is closed. They are: + // + // 1. AssignmentExpression + // 2. BindingElements + // 3. AssignmentTargets + // + // In order to avoid exponential backtracking, we use two flags to denote if the production can be + // binding element or assignment target. + // + // The three productions have the relationship: + // + // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression + // + // with a single exception that CoverInitializedName when used directly in an Expression, generates + // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the + // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. + // + // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not + // effect the current flags. This means the production the parser parses is only used as an expression. Therefore + // the CoverInitializedName check is conducted. + // + // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates + // the flags outside of the parser. This means the production the parser parses is used as a part of a potential + // pattern. The CoverInitializedName check is deferred. + Parser.prototype.isolateCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + if (this.context.firstCoverInitializedNameError !== null) { + this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); + } + this.context.isBindingElement = previousIsBindingElement; + this.context.isAssignmentTarget = previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; + return result; + }; + Parser.prototype.inheritCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; + this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; + return result; + }; + Parser.prototype.consumeSemicolon = function () { + if (this.match(';')) { + this.nextToken(); + } + else if (!this.hasLineTerminator) { + if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { + this.throwUnexpectedToken(this.lookahead); + } + this.lastMarker.index = this.startMarker.index; + this.lastMarker.line = this.startMarker.line; + this.lastMarker.column = this.startMarker.column; + } + }; + // https://tc39.github.io/ecma262/#sec-primary-expression + Parser.prototype.parsePrimaryExpression = function () { + var node = this.createNode(); + var expr; + var token, raw; + switch (this.lookahead.type) { + case 3 /* Identifier */: + if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { + this.tolerateUnexpectedToken(this.lookahead); + } + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + break; + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + if (this.context.strict && this.lookahead.octal) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 1 /* BooleanLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); + break; + case 5 /* NullLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(null, raw)); + break; + case 10 /* Template */: + expr = this.parseTemplateLiteral(); + break; + case 7 /* Punctuator */: + switch (this.lookahead.value) { + case '(': + this.context.isBindingElement = false; + expr = this.inheritCoverGrammar(this.parseGroupExpression); + break; + case '[': + expr = this.inheritCoverGrammar(this.parseArrayInitializer); + break; + case '{': + expr = this.inheritCoverGrammar(this.parseObjectInitializer); + break; + case '/': + case '/=': + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.scanner.index = this.startMarker.index; + token = this.nextRegexToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + break; + case 4 /* Keyword */: + if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseIdentifierName(); + } + else if (!this.context.strict && this.matchKeyword('let')) { + expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + } + else { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + if (this.matchKeyword('function')) { + expr = this.parseFunctionExpression(); + } + else if (this.matchKeyword('this')) { + this.nextToken(); + expr = this.finalize(node, new Node.ThisExpression()); + } + else if (this.matchKeyword('class')) { + expr = this.parseClassExpression(); + } + else { + expr = this.throwUnexpectedToken(this.nextToken()); + } + } + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-array-initializer + Parser.prototype.parseSpreadElement = function () { + var node = this.createNode(); + this.expect('...'); + var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); + return this.finalize(node, new Node.SpreadElement(arg)); + }; + Parser.prototype.parseArrayInitializer = function () { + var node = this.createNode(); + var elements = []; + this.expect('['); + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else if (this.match('...')) { + var element = this.parseSpreadElement(); + if (!this.match(']')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.expect(','); + } + elements.push(element); + } + else { + elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayExpression(elements)); + }; + // https://tc39.github.io/ecma262/#sec-object-initializer + Parser.prototype.parsePropertyMethod = function (params) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = params.simple; + var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); + if (this.context.strict && params.firstRestricted) { + this.tolerateUnexpectedToken(params.firstRestricted, params.message); + } + if (this.context.strict && params.stricted) { + this.tolerateUnexpectedToken(params.stricted, params.message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + return body; + }; + Parser.prototype.parsePropertyMethodFunction = function () { + var isGenerator = false; + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + Parser.prototype.parsePropertyMethodAsyncFunction = function () { + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = false; + this.context.await = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); + }; + Parser.prototype.parseObjectPropertyKey = function () { + var node = this.createNode(); + var token = this.nextToken(); + var key; + switch (token.type) { + case 8 /* StringLiteral */: + case 6 /* NumericLiteral */: + if (this.context.strict && token.octal) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); + } + var raw = this.getTokenRaw(token); + key = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 3 /* Identifier */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 4 /* Keyword */: + key = this.finalize(node, new Node.Identifier(token.value)); + break; + case 7 /* Punctuator */: + if (token.value === '[') { + key = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.expect(']'); + } + else { + key = this.throwUnexpectedToken(token); + } + break; + default: + key = this.throwUnexpectedToken(token); + } + return key; + }; + Parser.prototype.isPropertyKey = function (key, value) { + return (key.type === syntax_1.Syntax.Identifier && key.name === value) || + (key.type === syntax_1.Syntax.Literal && key.value === value); + }; + Parser.prototype.parseObjectProperty = function (hasProto) { + var node = this.createNode(); + var token = this.lookahead; + var kind; + var key = null; + var value = null; + var computed = false; + var method = false; + var shorthand = false; + var isAsync = false; + if (token.type === 3 /* Identifier */) { + var id = token.value; + this.nextToken(); + computed = this.match('['); + isAsync = !this.hasLineTerminator && (id === 'async') && + !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); + key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + } + else if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + else { + if (!key) { + this.throwUnexpectedToken(this.lookahead); + } + kind = 'init'; + if (this.match(':') && !isAsync) { + if (!computed && this.isPropertyKey(key, '__proto__')) { + if (hasProto.value) { + this.tolerateError(messages_1.Messages.DuplicateProtoProperty); + } + hasProto.value = true; + } + this.nextToken(); + value = this.inheritCoverGrammar(this.parseAssignmentExpression); + } + else if (this.match('(')) { + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + else if (token.type === 3 /* Identifier */) { + var id = this.finalize(node, new Node.Identifier(token.value)); + if (this.match('=')) { + this.context.firstCoverInitializedNameError = this.lookahead; + this.nextToken(); + shorthand = true; + var init = this.isolateCoverGrammar(this.parseAssignmentExpression); + value = this.finalize(node, new Node.AssignmentPattern(id, init)); + } + else { + shorthand = true; + value = id; + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectInitializer = function () { + var node = this.createNode(); + this.expect('{'); + var properties = []; + var hasProto = { value: false }; + while (!this.match('}')) { + properties.push(this.parseObjectProperty(hasProto)); + if (!this.match('}')) { + this.expectCommaSeparator(); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectExpression(properties)); + }; + // https://tc39.github.io/ecma262/#sec-template-literals + Parser.prototype.parseTemplateHead = function () { + assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateElement = function () { + if (this.lookahead.type !== 10 /* Template */) { + this.throwUnexpectedToken(); + } + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateLiteral = function () { + var node = this.createNode(); + var expressions = []; + var quasis = []; + var quasi = this.parseTemplateHead(); + quasis.push(quasi); + while (!quasi.tail) { + expressions.push(this.parseExpression()); + quasi = this.parseTemplateElement(); + quasis.push(quasi); + } + return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + }; + // https://tc39.github.io/ecma262/#sec-grouping-operator + Parser.prototype.reinterpretExpressionAsPattern = function (expr) { + switch (expr.type) { + case syntax_1.Syntax.Identifier: + case syntax_1.Syntax.MemberExpression: + case syntax_1.Syntax.RestElement: + case syntax_1.Syntax.AssignmentPattern: + break; + case syntax_1.Syntax.SpreadElement: + expr.type = syntax_1.Syntax.RestElement; + this.reinterpretExpressionAsPattern(expr.argument); + break; + case syntax_1.Syntax.ArrayExpression: + expr.type = syntax_1.Syntax.ArrayPattern; + for (var i = 0; i < expr.elements.length; i++) { + if (expr.elements[i] !== null) { + this.reinterpretExpressionAsPattern(expr.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectExpression: + expr.type = syntax_1.Syntax.ObjectPattern; + for (var i = 0; i < expr.properties.length; i++) { + this.reinterpretExpressionAsPattern(expr.properties[i].value); + } + break; + case syntax_1.Syntax.AssignmentExpression: + expr.type = syntax_1.Syntax.AssignmentPattern; + delete expr.operator; + this.reinterpretExpressionAsPattern(expr.left); + break; + default: + // Allow other node type for tolerant parsing. + break; + } + }; + Parser.prototype.parseGroupExpression = function () { + var expr; + this.expect('('); + if (this.match(')')) { + this.nextToken(); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [], + async: false + }; + } + else { + var startToken = this.lookahead; + var params = []; + if (this.match('...')) { + expr = this.parseRestElement(params); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + else { + var arrow = false; + this.context.isBindingElement = true; + expr = this.inheritCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + this.context.isAssignmentTarget = false; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + if (this.match(')')) { + this.nextToken(); + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else if (this.match('...')) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + expressions.push(this.parseRestElement(params)); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + this.context.isBindingElement = false; + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else { + expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + } + if (arrow) { + break; + } + } + if (!arrow) { + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + } + if (!arrow) { + this.expect(')'); + if (this.match('=>')) { + if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + if (!arrow) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + if (expr.type === syntax_1.Syntax.SequenceExpression) { + for (var i = 0; i < expr.expressions.length; i++) { + this.reinterpretExpressionAsPattern(expr.expressions[i]); + } + } + else { + this.reinterpretExpressionAsPattern(expr); + } + var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); + expr = { + type: ArrowParameterPlaceHolder, + params: parameters, + async: false + }; + } + } + this.context.isBindingElement = false; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions + Parser.prototype.parseArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAssignmentExpression); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.isIdentifierName = function (token) { + return token.type === 3 /* Identifier */ || + token.type === 4 /* Keyword */ || + token.type === 1 /* BooleanLiteral */ || + token.type === 5 /* NullLiteral */; + }; + Parser.prototype.parseIdentifierName = function () { + var node = this.createNode(); + var token = this.nextToken(); + if (!this.isIdentifierName(token)) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseNewExpression = function () { + var node = this.createNode(); + var id = this.parseIdentifierName(); + assert_1.assert(id.name === 'new', 'New expression must start with `new`'); + var expr; + if (this.match('.')) { + this.nextToken(); + if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { + var property = this.parseIdentifierName(); + expr = new Node.MetaProperty(id, property); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); + var args = this.match('(') ? this.parseArguments() : []; + expr = new Node.NewExpression(callee, args); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return this.finalize(node, expr); + }; + Parser.prototype.parseAsyncArgument = function () { + var arg = this.parseAssignmentExpression(); + this.context.firstCoverInitializedNameError = null; + return arg; + }; + Parser.prototype.parseAsyncArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAsyncArgument); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { + var startToken = this.lookahead; + var maybeAsync = this.matchContextualKeyword('async'); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var expr; + if (this.matchKeyword('super') && this.context.inFunctionBody) { + expr = this.createNode(); + this.nextToken(); + expr = this.finalize(expr, new Node.Super()); + if (!this.match('(') && !this.match('.') && !this.match('[')) { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + } + while (true) { + if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); + } + else if (this.match('(')) { + var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); + this.context.isBindingElement = false; + this.context.isAssignmentTarget = false; + var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); + expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + if (asyncArrow && this.match('=>')) { + for (var i = 0; i < args.length; ++i) { + this.reinterpretExpressionAsPattern(args[i]); + } + expr = { + type: ArrowParameterPlaceHolder, + params: args, + async: true + }; + } + } + else if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + this.context.allowIn = previousAllowIn; + return expr; + }; + Parser.prototype.parseSuper = function () { + var node = this.createNode(); + this.expectKeyword('super'); + if (!this.match('[') && !this.match('.')) { + this.throwUnexpectedToken(this.lookahead); + } + return this.finalize(node, new Node.Super()); + }; + Parser.prototype.parseLeftHandSideExpression = function () { + assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); + var node = this.startNode(this.lookahead); + var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : + this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + while (true) { + if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); + } + else if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-update-expressions + Parser.prototype.parseUpdateExpression = function () { + var expr; + var startToken = this.lookahead; + if (this.match('++') || this.match('--')) { + var node = this.startNode(startToken); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPrefix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + var prefix = true; + expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { + if (this.match('++') || this.match('--')) { + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPostfix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var operator = this.nextToken().value; + var prefix = false; + expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-unary-operators + Parser.prototype.parseAwaitExpression = function () { + var node = this.createNode(); + this.nextToken(); + var argument = this.parseUnaryExpression(); + return this.finalize(node, new Node.AwaitExpression(argument)); + }; + Parser.prototype.parseUnaryExpression = function () { + var expr; + if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || + this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { + var node = this.startNode(this.lookahead); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { + this.tolerateError(messages_1.Messages.StrictDelete); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else if (this.context.await && this.matchContextualKeyword('await')) { + expr = this.parseAwaitExpression(); + } + else { + expr = this.parseUpdateExpression(); + } + return expr; + }; + Parser.prototype.parseExponentiationExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-exp-operator + // https://tc39.github.io/ecma262/#sec-multiplicative-operators + // https://tc39.github.io/ecma262/#sec-additive-operators + // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators + // https://tc39.github.io/ecma262/#sec-relational-operators + // https://tc39.github.io/ecma262/#sec-equality-operators + // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators + // https://tc39.github.io/ecma262/#sec-binary-logical-operators + Parser.prototype.binaryPrecedence = function (token) { + var op = token.value; + var precedence; + if (token.type === 7 /* Punctuator */) { + precedence = this.operatorPrecedence[op] || 0; + } + else if (token.type === 4 /* Keyword */) { + precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; + } + else { + precedence = 0; + } + return precedence; + }; + Parser.prototype.parseBinaryExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); + var token = this.lookahead; + var prec = this.binaryPrecedence(token); + if (prec > 0) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var markers = [startToken, this.lookahead]; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + var stack = [left, token.value, right]; + var precedences = [prec]; + while (true) { + prec = this.binaryPrecedence(this.lookahead); + if (prec <= 0) { + break; + } + // Reduce: make a binary expression from the three topmost entries. + while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { + right = stack.pop(); + var operator = stack.pop(); + precedences.pop(); + left = stack.pop(); + markers.pop(); + var node = this.startNode(markers[markers.length - 1]); + stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + } + // Shift. + stack.push(this.nextToken().value); + precedences.push(prec); + markers.push(this.lookahead); + stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); + } + // Final reduce to clean-up the stack. + var i = stack.length - 1; + expr = stack[i]; + var lastMarker = markers.pop(); + while (i > 1) { + var marker = markers.pop(); + var lastLineStart = lastMarker && lastMarker.lineStart; + var node = this.startNode(marker, lastLineStart); + var operator = stack[i - 1]; + expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); + i -= 2; + lastMarker = marker; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-conditional-operator + Parser.prototype.parseConditionalExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseBinaryExpression); + if (this.match('?')) { + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + this.expect(':'); + var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-assignment-operators + Parser.prototype.checkPatternParam = function (options, param) { + switch (param.type) { + case syntax_1.Syntax.Identifier: + this.validateParam(options, param, param.name); + break; + case syntax_1.Syntax.RestElement: + this.checkPatternParam(options, param.argument); + break; + case syntax_1.Syntax.AssignmentPattern: + this.checkPatternParam(options, param.left); + break; + case syntax_1.Syntax.ArrayPattern: + for (var i = 0; i < param.elements.length; i++) { + if (param.elements[i] !== null) { + this.checkPatternParam(options, param.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectPattern: + for (var i = 0; i < param.properties.length; i++) { + this.checkPatternParam(options, param.properties[i].value); + } + break; + default: + break; + } + options.simple = options.simple && (param instanceof Node.Identifier); + }; + Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { + var params = [expr]; + var options; + var asyncArrow = false; + switch (expr.type) { + case syntax_1.Syntax.Identifier: + break; + case ArrowParameterPlaceHolder: + params = expr.params; + asyncArrow = expr.async; + break; + default: + return null; + } + options = { + simple: true, + paramSet: {} + }; + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.AssignmentPattern) { + if (param.right.type === syntax_1.Syntax.YieldExpression) { + if (param.right.argument) { + this.throwUnexpectedToken(this.lookahead); + } + param.right.type = syntax_1.Syntax.Identifier; + param.right.name = 'yield'; + delete param.right.argument; + delete param.right.delegate; + } + } + else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { + this.throwUnexpectedToken(this.lookahead); + } + this.checkPatternParam(options, param); + params[i] = param; + } + if (this.context.strict || !this.context.allowYield) { + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.YieldExpression) { + this.throwUnexpectedToken(this.lookahead); + } + } + } + if (options.message === messages_1.Messages.StrictParamDupe) { + var token = this.context.strict ? options.stricted : options.firstRestricted; + this.throwUnexpectedToken(token, options.message); + } + return { + simple: options.simple, + params: params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.parseAssignmentExpression = function () { + var expr; + if (!this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseYieldExpression(); + } + else { + var startToken = this.lookahead; + var token = startToken; + expr = this.parseConditionalExpression(); + if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { + if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { + var arg = this.parsePrimaryExpression(); + this.reinterpretExpressionAsPattern(arg); + expr = { + type: ArrowParameterPlaceHolder, + params: [arg], + async: true + }; + } + } + if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { + // https://tc39.github.io/ecma262/#sec-arrow-function-definitions + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var isAsync = expr.async; + var list = this.reinterpretAsCoverFormalsList(expr); + if (list) { + if (this.hasLineTerminator) { + this.tolerateUnexpectedToken(this.lookahead); + } + this.context.firstCoverInitializedNameError = null; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = list.simple; + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = true; + this.context.await = isAsync; + var node = this.startNode(startToken); + this.expect('=>'); + var body = void 0; + if (this.match('{')) { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + body = this.parseFunctionSourceElements(); + this.context.allowIn = previousAllowIn; + } + else { + body = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + var expression = body.type !== syntax_1.Syntax.BlockStatement; + if (this.context.strict && list.firstRestricted) { + this.throwUnexpectedToken(list.firstRestricted, list.message); + } + if (this.context.strict && list.stricted) { + this.tolerateUnexpectedToken(list.stricted, list.message); + } + expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : + this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + } + } + else { + if (this.matchAssign()) { + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { + var id = expr; + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); + } + if (this.scanner.isStrictModeReservedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + } + if (!this.match('=')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + this.reinterpretExpressionAsPattern(expr); + } + token = this.nextToken(); + var operator = token.value; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + this.context.firstCoverInitializedNameError = null; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-comma-operator + Parser.prototype.parseExpression = function () { + var startToken = this.lookahead; + var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-block + Parser.prototype.parseStatementListItem = function () { + var statement; + this.context.isAssignmentTarget = true; + this.context.isBindingElement = true; + if (this.lookahead.type === 4 /* Keyword */) { + switch (this.lookahead.value) { + case 'export': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); + } + statement = this.parseExportDeclaration(); + break; + case 'import': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); + } + statement = this.parseImportDeclaration(); + break; + case 'const': + statement = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'class': + statement = this.parseClassDeclaration(); + break; + case 'let': + statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); + break; + default: + statement = this.parseStatement(); + break; + } + } + else { + statement = this.parseStatement(); + } + return statement; + }; + Parser.prototype.parseBlock = function () { + var node = this.createNode(); + this.expect('{'); + var block = []; + while (true) { + if (this.match('}')) { + break; + } + block.push(this.parseStatementListItem()); + } + this.expect('}'); + return this.finalize(node, new Node.BlockStatement(block)); + }; + // https://tc39.github.io/ecma262/#sec-let-and-const-declarations + Parser.prototype.parseLexicalBinding = function (kind, options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, kind); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (kind === 'const') { + if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else { + this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); + } + } + } + else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { + this.expect('='); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseBindingList = function (kind, options) { + var list = [this.parseLexicalBinding(kind, options)]; + while (this.match(',')) { + this.nextToken(); + list.push(this.parseLexicalBinding(kind, options)); + } + return list; + }; + Parser.prototype.isLexicalDeclaration = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + return (next.type === 3 /* Identifier */) || + (next.type === 7 /* Punctuator */ && next.value === '[') || + (next.type === 7 /* Punctuator */ && next.value === '{') || + (next.type === 4 /* Keyword */ && next.value === 'let') || + (next.type === 4 /* Keyword */ && next.value === 'yield'); + }; + Parser.prototype.parseLexicalDeclaration = function (options) { + var node = this.createNode(); + var kind = this.nextToken().value; + assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); + var declarations = this.parseBindingList(kind, options); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + }; + // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns + Parser.prototype.parseBindingRestElement = function (params, kind) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params, kind); + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseArrayPattern = function (params, kind) { + var node = this.createNode(); + this.expect('['); + var elements = []; + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else { + if (this.match('...')) { + elements.push(this.parseBindingRestElement(params, kind)); + break; + } + else { + elements.push(this.parsePatternWithDefault(params, kind)); + } + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayPattern(elements)); + }; + Parser.prototype.parsePropertyPattern = function (params, kind) { + var node = this.createNode(); + var computed = false; + var shorthand = false; + var method = false; + var key; + var value; + if (this.lookahead.type === 3 /* Identifier */) { + var keyToken = this.lookahead; + key = this.parseVariableIdentifier(); + var init = this.finalize(node, new Node.Identifier(keyToken.value)); + if (this.match('=')) { + params.push(keyToken); + shorthand = true; + this.nextToken(); + var expr = this.parseAssignmentExpression(); + value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); + } + else if (!this.match(':')) { + params.push(keyToken); + shorthand = true; + value = init; + } + else { + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectPattern = function (params, kind) { + var node = this.createNode(); + var properties = []; + this.expect('{'); + while (!this.match('}')) { + properties.push(this.parsePropertyPattern(params, kind)); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectPattern(properties)); + }; + Parser.prototype.parsePattern = function (params, kind) { + var pattern; + if (this.match('[')) { + pattern = this.parseArrayPattern(params, kind); + } + else if (this.match('{')) { + pattern = this.parseObjectPattern(params, kind); + } + else { + if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); + } + params.push(this.lookahead); + pattern = this.parseVariableIdentifier(kind); + } + return pattern; + }; + Parser.prototype.parsePatternWithDefault = function (params, kind) { + var startToken = this.lookahead; + var pattern = this.parsePattern(params, kind); + if (this.match('=')) { + this.nextToken(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowYield = previousAllowYield; + pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); + } + return pattern; + }; + // https://tc39.github.io/ecma262/#sec-variable-statement + Parser.prototype.parseVariableIdentifier = function (kind) { + var node = this.createNode(); + var token = this.nextToken(); + if (token.type === 4 /* Keyword */ && token.value === 'yield') { + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else if (!this.context.allowYield) { + this.throwUnexpectedToken(token); + } + } + else if (token.type !== 3 /* Identifier */) { + if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else { + if (this.context.strict || token.value !== 'let' || kind !== 'var') { + this.throwUnexpectedToken(token); + } + } + } + else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { + this.tolerateUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseVariableDeclaration = function (options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, 'var'); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { + this.expect('='); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseVariableDeclarationList = function (options) { + var opt = { inFor: options.inFor }; + var list = []; + list.push(this.parseVariableDeclaration(opt)); + while (this.match(',')) { + this.nextToken(); + list.push(this.parseVariableDeclaration(opt)); + } + return list; + }; + Parser.prototype.parseVariableStatement = function () { + var node = this.createNode(); + this.expectKeyword('var'); + var declarations = this.parseVariableDeclarationList({ inFor: false }); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); + }; + // https://tc39.github.io/ecma262/#sec-empty-statement + Parser.prototype.parseEmptyStatement = function () { + var node = this.createNode(); + this.expect(';'); + return this.finalize(node, new Node.EmptyStatement()); + }; + // https://tc39.github.io/ecma262/#sec-expression-statement + Parser.prototype.parseExpressionStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ExpressionStatement(expr)); + }; + // https://tc39.github.io/ecma262/#sec-if-statement + Parser.prototype.parseIfClause = function () { + if (this.context.strict && this.matchKeyword('function')) { + this.tolerateError(messages_1.Messages.StrictFunction); + } + return this.parseStatement(); + }; + Parser.prototype.parseIfStatement = function () { + var node = this.createNode(); + var consequent; + var alternate = null; + this.expectKeyword('if'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + consequent = this.parseIfClause(); + if (this.matchKeyword('else')) { + this.nextToken(); + alternate = this.parseIfClause(); + } + } + return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + }; + // https://tc39.github.io/ecma262/#sec-do-while-statement + Parser.prototype.parseDoWhileStatement = function () { + var node = this.createNode(); + this.expectKeyword('do'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + var body = this.parseStatement(); + this.context.inIteration = previousInIteration; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + } + else { + this.expect(')'); + if (this.match(';')) { + this.nextToken(); + } + } + return this.finalize(node, new Node.DoWhileStatement(body, test)); + }; + // https://tc39.github.io/ecma262/#sec-while-statement + Parser.prototype.parseWhileStatement = function () { + var node = this.createNode(); + var body; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.parseStatement(); + this.context.inIteration = previousInIteration; + } + return this.finalize(node, new Node.WhileStatement(test, body)); + }; + // https://tc39.github.io/ecma262/#sec-for-statement + // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements + Parser.prototype.parseForStatement = function () { + var init = null; + var test = null; + var update = null; + var forIn = true; + var left, right; + var node = this.createNode(); + this.expectKeyword('for'); + this.expect('('); + if (this.match(';')) { + this.nextToken(); + } + else { + if (this.matchKeyword('var')) { + init = this.createNode(); + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseVariableDeclarationList({ inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && this.matchKeyword('in')) { + var decl = declarations[0]; + if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { + this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); + } + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.expect(';'); + } + } + else if (this.matchKeyword('const') || this.matchKeyword('let')) { + init = this.createNode(); + var kind = this.nextToken().value; + if (!this.context.strict && this.lookahead.value === 'in') { + init = this.finalize(init, new Node.Identifier(kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseBindingList(kind, { inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + this.consumeSemicolon(); + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + } + } + } + else { + var initStartToken = this.lookahead; + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + init = this.inheritCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + if (this.matchKeyword('in')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForIn); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseExpression(); + init = null; + } + else if (this.matchContextualKeyword('of')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + if (this.match(',')) { + var initSeq = [init]; + while (this.match(',')) { + this.nextToken(); + initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + } + this.expect(';'); + } + } + } + if (typeof left === 'undefined') { + if (!this.match(';')) { + test = this.parseExpression(); + } + this.expect(';'); + if (!this.match(')')) { + update = this.parseExpression(); + } + } + var body; + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.isolateCoverGrammar(this.parseStatement); + this.context.inIteration = previousInIteration; + } + return (typeof left === 'undefined') ? + this.finalize(node, new Node.ForStatement(init, test, update, body)) : + forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : + this.finalize(node, new Node.ForOfStatement(left, right, body)); + }; + // https://tc39.github.io/ecma262/#sec-continue-statement + Parser.prototype.parseContinueStatement = function () { + var node = this.createNode(); + this.expectKeyword('continue'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + label = id; + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration) { + this.throwError(messages_1.Messages.IllegalContinue); + } + return this.finalize(node, new Node.ContinueStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-break-statement + Parser.prototype.parseBreakStatement = function () { + var node = this.createNode(); + this.expectKeyword('break'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + label = id; + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration && !this.context.inSwitch) { + this.throwError(messages_1.Messages.IllegalBreak); + } + return this.finalize(node, new Node.BreakStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-return-statement + Parser.prototype.parseReturnStatement = function () { + if (!this.context.inFunctionBody) { + this.tolerateError(messages_1.Messages.IllegalReturn); + } + var node = this.createNode(); + this.expectKeyword('return'); + var hasArgument = (!this.match(';') && !this.match('}') && + !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || + this.lookahead.type === 8 /* StringLiteral */ || + this.lookahead.type === 10 /* Template */; + var argument = hasArgument ? this.parseExpression() : null; + this.consumeSemicolon(); + return this.finalize(node, new Node.ReturnStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-with-statement + Parser.prototype.parseWithStatement = function () { + if (this.context.strict) { + this.tolerateError(messages_1.Messages.StrictModeWith); + } + var node = this.createNode(); + var body; + this.expectKeyword('with'); + this.expect('('); + var object = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + body = this.parseStatement(); + } + return this.finalize(node, new Node.WithStatement(object, body)); + }; + // https://tc39.github.io/ecma262/#sec-switch-statement + Parser.prototype.parseSwitchCase = function () { + var node = this.createNode(); + var test; + if (this.matchKeyword('default')) { + this.nextToken(); + test = null; + } + else { + this.expectKeyword('case'); + test = this.parseExpression(); + } + this.expect(':'); + var consequent = []; + while (true) { + if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { + break; + } + consequent.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.SwitchCase(test, consequent)); + }; + Parser.prototype.parseSwitchStatement = function () { + var node = this.createNode(); + this.expectKeyword('switch'); + this.expect('('); + var discriminant = this.parseExpression(); + this.expect(')'); + var previousInSwitch = this.context.inSwitch; + this.context.inSwitch = true; + var cases = []; + var defaultFound = false; + this.expect('{'); + while (true) { + if (this.match('}')) { + break; + } + var clause = this.parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + this.expect('}'); + this.context.inSwitch = previousInSwitch; + return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + }; + // https://tc39.github.io/ecma262/#sec-labelled-statements + Parser.prototype.parseLabelledStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + var statement; + if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { + this.nextToken(); + var id = expr; + var key = '$' + id.name; + if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); + } + this.context.labelSet[key] = true; + var body = void 0; + if (this.matchKeyword('class')) { + this.tolerateUnexpectedToken(this.lookahead); + body = this.parseClassDeclaration(); + } + else if (this.matchKeyword('function')) { + var token = this.lookahead; + var declaration = this.parseFunctionDeclaration(); + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); + } + else if (declaration.generator) { + this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); + } + body = declaration; + } + else { + body = this.parseStatement(); + } + delete this.context.labelSet[key]; + statement = new Node.LabeledStatement(id, body); + } + else { + this.consumeSemicolon(); + statement = new Node.ExpressionStatement(expr); + } + return this.finalize(node, statement); + }; + // https://tc39.github.io/ecma262/#sec-throw-statement + Parser.prototype.parseThrowStatement = function () { + var node = this.createNode(); + this.expectKeyword('throw'); + if (this.hasLineTerminator) { + this.throwError(messages_1.Messages.NewlineAfterThrow); + } + var argument = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ThrowStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-try-statement + Parser.prototype.parseCatchClause = function () { + var node = this.createNode(); + this.expectKeyword('catch'); + this.expect('('); + if (this.match(')')) { + this.throwUnexpectedToken(this.lookahead); + } + var params = []; + var param = this.parsePattern(params); + var paramMap = {}; + for (var i = 0; i < params.length; i++) { + var key = '$' + params[i].value; + if (Object.prototype.hasOwnProperty.call(paramMap, key)) { + this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); + } + paramMap[key] = true; + } + if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(param.name)) { + this.tolerateError(messages_1.Messages.StrictCatchVariable); + } + } + this.expect(')'); + var body = this.parseBlock(); + return this.finalize(node, new Node.CatchClause(param, body)); + }; + Parser.prototype.parseFinallyClause = function () { + this.expectKeyword('finally'); + return this.parseBlock(); + }; + Parser.prototype.parseTryStatement = function () { + var node = this.createNode(); + this.expectKeyword('try'); + var block = this.parseBlock(); + var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; + var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; + if (!handler && !finalizer) { + this.throwError(messages_1.Messages.NoCatchOrFinally); + } + return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + }; + // https://tc39.github.io/ecma262/#sec-debugger-statement + Parser.prototype.parseDebuggerStatement = function () { + var node = this.createNode(); + this.expectKeyword('debugger'); + this.consumeSemicolon(); + return this.finalize(node, new Node.DebuggerStatement()); + }; + // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations + Parser.prototype.parseStatement = function () { + var statement; + switch (this.lookahead.type) { + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* Template */: + case 9 /* RegularExpression */: + statement = this.parseExpressionStatement(); + break; + case 7 /* Punctuator */: + var value = this.lookahead.value; + if (value === '{') { + statement = this.parseBlock(); + } + else if (value === '(') { + statement = this.parseExpressionStatement(); + } + else if (value === ';') { + statement = this.parseEmptyStatement(); + } + else { + statement = this.parseExpressionStatement(); + } + break; + case 3 /* Identifier */: + statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); + break; + case 4 /* Keyword */: + switch (this.lookahead.value) { + case 'break': + statement = this.parseBreakStatement(); + break; + case 'continue': + statement = this.parseContinueStatement(); + break; + case 'debugger': + statement = this.parseDebuggerStatement(); + break; + case 'do': + statement = this.parseDoWhileStatement(); + break; + case 'for': + statement = this.parseForStatement(); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'if': + statement = this.parseIfStatement(); + break; + case 'return': + statement = this.parseReturnStatement(); + break; + case 'switch': + statement = this.parseSwitchStatement(); + break; + case 'throw': + statement = this.parseThrowStatement(); + break; + case 'try': + statement = this.parseTryStatement(); + break; + case 'var': + statement = this.parseVariableStatement(); + break; + case 'while': + statement = this.parseWhileStatement(); + break; + case 'with': + statement = this.parseWithStatement(); + break; + default: + statement = this.parseExpressionStatement(); + break; + } + break; + default: + statement = this.throwUnexpectedToken(this.lookahead); + } + return statement; + }; + // https://tc39.github.io/ecma262/#sec-function-definitions + Parser.prototype.parseFunctionSourceElements = function () { + var node = this.createNode(); + this.expect('{'); + var body = this.parseDirectivePrologues(); + var previousLabelSet = this.context.labelSet; + var previousInIteration = this.context.inIteration; + var previousInSwitch = this.context.inSwitch; + var previousInFunctionBody = this.context.inFunctionBody; + this.context.labelSet = {}; + this.context.inIteration = false; + this.context.inSwitch = false; + this.context.inFunctionBody = true; + while (this.lookahead.type !== 2 /* EOF */) { + if (this.match('}')) { + break; + } + body.push(this.parseStatementListItem()); + } + this.expect('}'); + this.context.labelSet = previousLabelSet; + this.context.inIteration = previousInIteration; + this.context.inSwitch = previousInSwitch; + this.context.inFunctionBody = previousInFunctionBody; + return this.finalize(node, new Node.BlockStatement(body)); + }; + Parser.prototype.validateParam = function (options, param, name) { + var key = '$' + name; + if (this.context.strict) { + if (this.scanner.isRestrictedWord(name)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + else if (!options.firstRestricted) { + if (this.scanner.isRestrictedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictParamName; + } + else if (this.scanner.isStrictModeReservedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictReservedWord; + } + else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + /* istanbul ignore next */ + if (typeof Object.defineProperty === 'function') { + Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); + } + else { + options.paramSet[key] = true; + } + }; + Parser.prototype.parseRestElement = function (params) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params); + if (this.match('=')) { + this.throwError(messages_1.Messages.DefaultRestParameter); + } + if (!this.match(')')) { + this.throwError(messages_1.Messages.ParameterAfterRestParameter); + } + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseFormalParameter = function (options) { + var params = []; + var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); + for (var i = 0; i < params.length; i++) { + this.validateParam(options, params[i], params[i].value); + } + options.simple = options.simple && (param instanceof Node.Identifier); + options.params.push(param); + }; + Parser.prototype.parseFormalParameters = function (firstRestricted) { + var options; + options = { + simple: true, + params: [], + firstRestricted: firstRestricted + }; + this.expect('('); + if (!this.match(')')) { + options.paramSet = {}; + while (this.lookahead.type !== 2 /* EOF */) { + this.parseFormalParameter(options); + if (this.match(')')) { + break; + } + this.expect(','); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return { + simple: options.simple, + params: options.params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.matchAsyncFunction = function () { + var match = this.matchContextualKeyword('async'); + if (match) { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); + } + return match; + }; + Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted = null; + if (!identifierIsOptional || !this.match('(')) { + var token = this.lookahead; + id = this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : + this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + }; + Parser.prototype.parseFunctionExpression = function () { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted; + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + if (!this.match('(')) { + var token = this.lookahead; + id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : + this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive + Parser.prototype.parseDirective = function () { + var token = this.lookahead; + var node = this.createNode(); + var expr = this.parseExpression(); + var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; + this.consumeSemicolon(); + return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + }; + Parser.prototype.parseDirectivePrologues = function () { + var firstRestricted = null; + var body = []; + while (true) { + var token = this.lookahead; + if (token.type !== 8 /* StringLiteral */) { + break; + } + var statement = this.parseDirective(); + body.push(statement); + var directive = statement.directive; + if (typeof directive !== 'string') { + break; + } + if (directive === 'use strict') { + this.context.strict = true; + if (firstRestricted) { + this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); + } + if (!this.context.allowStrictDirective) { + this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); + } + } + else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + return body; + }; + // https://tc39.github.io/ecma262/#sec-method-definitions + Parser.prototype.qualifiedPropertyName = function (token) { + switch (token.type) { + case 3 /* Identifier */: + case 8 /* StringLiteral */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 4 /* Keyword */: + return true; + case 7 /* Punctuator */: + return token.value === '['; + default: + break; + } + return false; + }; + Parser.prototype.parseGetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length > 0) { + this.tolerateError(messages_1.Messages.BadGetterArity); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseSetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length !== 1) { + this.tolerateError(messages_1.Messages.BadSetterArity); + } + else if (formalParameters.params[0] instanceof Node.RestElement) { + this.tolerateError(messages_1.Messages.BadSetterRestParameter); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseGeneratorMethod = function () { + var node = this.createNode(); + var isGenerator = true; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + this.context.allowYield = false; + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-generator-function-definitions + Parser.prototype.isStartOfExpression = function () { + var start = true; + var value = this.lookahead.value; + switch (this.lookahead.type) { + case 7 /* Punctuator */: + start = (value === '[') || (value === '(') || (value === '{') || + (value === '+') || (value === '-') || + (value === '!') || (value === '~') || + (value === '++') || (value === '--') || + (value === '/') || (value === '/='); // regular expression literal + break; + case 4 /* Keyword */: + start = (value === 'class') || (value === 'delete') || + (value === 'function') || (value === 'let') || (value === 'new') || + (value === 'super') || (value === 'this') || (value === 'typeof') || + (value === 'void') || (value === 'yield'); + break; + default: + break; + } + return start; + }; + Parser.prototype.parseYieldExpression = function () { + var node = this.createNode(); + this.expectKeyword('yield'); + var argument = null; + var delegate = false; + if (!this.hasLineTerminator) { + var previousAllowYield = this.context.allowYield; + this.context.allowYield = false; + delegate = this.match('*'); + if (delegate) { + this.nextToken(); + argument = this.parseAssignmentExpression(); + } + else if (this.isStartOfExpression()) { + argument = this.parseAssignmentExpression(); + } + this.context.allowYield = previousAllowYield; + } + return this.finalize(node, new Node.YieldExpression(argument, delegate)); + }; + // https://tc39.github.io/ecma262/#sec-class-definitions + Parser.prototype.parseClassElement = function (hasConstructor) { + var token = this.lookahead; + var node = this.createNode(); + var kind = ''; + var key = null; + var value = null; + var computed = false; + var method = false; + var isStatic = false; + var isAsync = false; + if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + var id = key; + if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { + token = this.lookahead; + isStatic = true; + computed = this.match('['); + if (this.match('*')) { + this.nextToken(); + } + else { + key = this.parseObjectPropertyKey(); + } + } + if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { + var punctuator = this.lookahead.value; + if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { + isAsync = true; + token = this.lookahead; + key = this.parseObjectPropertyKey(); + if (token.type === 3 /* Identifier */ && token.value === 'constructor') { + this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); + } + } + } + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */) { + if (token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + if (!kind && key && this.match('(')) { + kind = 'init'; + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + if (!kind) { + this.throwUnexpectedToken(this.lookahead); + } + if (kind === 'init') { + kind = 'method'; + } + if (!computed) { + if (isStatic && this.isPropertyKey(key, 'prototype')) { + this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); + } + if (!isStatic && this.isPropertyKey(key, 'constructor')) { + if (kind !== 'method' || !method || (value && value.generator)) { + this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); + } + if (hasConstructor.value) { + this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); + } + else { + hasConstructor.value = true; + } + kind = 'constructor'; + } + } + return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); + }; + Parser.prototype.parseClassElementList = function () { + var body = []; + var hasConstructor = { value: false }; + this.expect('{'); + while (!this.match('}')) { + if (this.match(';')) { + this.nextToken(); + } + else { + body.push(this.parseClassElement(hasConstructor)); + } + } + this.expect('}'); + return body; + }; + Parser.prototype.parseClassBody = function () { + var node = this.createNode(); + var elementList = this.parseClassElementList(); + return this.finalize(node, new Node.ClassBody(elementList)); + }; + Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + }; + Parser.prototype.parseClassExpression = function () { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + }; + // https://tc39.github.io/ecma262/#sec-scripts + // https://tc39.github.io/ecma262/#sec-modules + Parser.prototype.parseModule = function () { + this.context.strict = true; + this.context.isModule = true; + this.scanner.isModule = true; + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Module(body)); + }; + Parser.prototype.parseScript = function () { + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Script(body)); + }; + // https://tc39.github.io/ecma262/#sec-imports + Parser.prototype.parseModuleSpecifier = function () { + var node = this.createNode(); + if (this.lookahead.type !== 8 /* StringLiteral */) { + this.throwError(messages_1.Messages.InvalidModuleSpecifier); + } + var token = this.nextToken(); + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + // import {} ...; + Parser.prototype.parseImportSpecifier = function () { + var node = this.createNode(); + var imported; + var local; + if (this.lookahead.type === 3 /* Identifier */) { + imported = this.parseVariableIdentifier(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + } + else { + imported = this.parseIdentifierName(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.ImportSpecifier(local, imported)); + }; + // {foo, bar as bas} + Parser.prototype.parseNamedImports = function () { + this.expect('{'); + var specifiers = []; + while (!this.match('}')) { + specifiers.push(this.parseImportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return specifiers; + }; + // import ...; + Parser.prototype.parseImportDefaultSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + }; + // import <* as foo> ...; + Parser.prototype.parseImportNamespaceSpecifier = function () { + var node = this.createNode(); + this.expect('*'); + if (!this.matchContextualKeyword('as')) { + this.throwError(messages_1.Messages.NoAsAfterImportNamespace); + } + this.nextToken(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + }; + Parser.prototype.parseImportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalImportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('import'); + var src; + var specifiers = []; + if (this.lookahead.type === 8 /* StringLiteral */) { + // import 'foo'; + src = this.parseModuleSpecifier(); + } + else { + if (this.match('{')) { + // import {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else if (this.match('*')) { + // import * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { + // import foo + specifiers.push(this.parseImportDefaultSpecifier()); + if (this.match(',')) { + this.nextToken(); + if (this.match('*')) { + // import foo, * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.match('{')) { + // import foo, {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + src = this.parseModuleSpecifier(); + } + this.consumeSemicolon(); + return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + }; + // https://tc39.github.io/ecma262/#sec-exports + Parser.prototype.parseExportSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + var exported = local; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + exported = this.parseIdentifierName(); + } + return this.finalize(node, new Node.ExportSpecifier(local, exported)); + }; + Parser.prototype.parseExportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalExportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('export'); + var exportDeclaration; + if (this.matchKeyword('default')) { + // export default ... + this.nextToken(); + if (this.matchKeyword('function')) { + // export default function foo () {} + // export default function () {} + var declaration = this.parseFunctionDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchKeyword('class')) { + // export default class foo {} + var declaration = this.parseClassDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchContextualKeyword('async')) { + // export default async function f () {} + // export default async function () {} + // export default async x => x + var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else { + if (this.matchContextualKeyword('from')) { + this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); + } + // export default {}; + // export default []; + // export default (1 + 2); + var declaration = this.match('{') ? this.parseObjectInitializer() : + this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + } + else if (this.match('*')) { + // export * from 'foo'; + this.nextToken(); + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + var src = this.parseModuleSpecifier(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + } + else if (this.lookahead.type === 4 /* Keyword */) { + // export var f = 1; + var declaration = void 0; + switch (this.lookahead.value) { + case 'let': + case 'const': + declaration = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'var': + case 'class': + case 'function': + declaration = this.parseStatementListItem(); + break; + default: + this.throwUnexpectedToken(this.lookahead); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else if (this.matchAsyncFunction()) { + var declaration = this.parseFunctionDeclaration(); + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else { + var specifiers = []; + var source = null; + var isExportFromIdentifier = false; + this.expect('{'); + while (!this.match('}')) { + isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); + specifiers.push(this.parseExportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + if (this.matchContextualKeyword('from')) { + // export {default} from 'foo'; + // export {foo} from 'foo'; + this.nextToken(); + source = this.parseModuleSpecifier(); + this.consumeSemicolon(); + } + else if (isExportFromIdentifier) { + // export {default}; // missing fromClause + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + else { + // export {foo}; + this.consumeSemicolon(); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + } + return exportDeclaration; + }; + return Parser; + }()); + exports.Parser = Parser; + + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + "use strict"; + // Ensure the condition is true, otherwise throw an error. + // This is only to have a better contract semantic, i.e. another safety net + // to catch a logic error. The condition shall be fulfilled in normal case. + // Do NOT use this to enforce a certain condition on any user input. + Object.defineProperty(exports, "__esModule", { value: true }); + function assert(condition, message) { + /* istanbul ignore if */ + if (!condition) { + throw new Error('ASSERT: ' + message); + } + } + exports.assert = assert; + + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + "use strict"; + /* tslint:disable:max-classes-per-file */ + Object.defineProperty(exports, "__esModule", { value: true }); + var ErrorHandler = (function () { + function ErrorHandler() { + this.errors = []; + this.tolerant = false; + } + ErrorHandler.prototype.recordError = function (error) { + this.errors.push(error); + }; + ErrorHandler.prototype.tolerate = function (error) { + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + ErrorHandler.prototype.constructError = function (msg, column) { + var error = new Error(msg); + try { + throw error; + } + catch (base) { + /* istanbul ignore else */ + if (Object.create && Object.defineProperty) { + error = Object.create(base); + Object.defineProperty(error, 'column', { value: column }); + } + } + /* istanbul ignore next */ + return error; + }; + ErrorHandler.prototype.createError = function (index, line, col, description) { + var msg = 'Line ' + line + ': ' + description; + var error = this.constructError(msg, col); + error.index = index; + error.lineNumber = line; + error.description = description; + return error; + }; + ErrorHandler.prototype.throwError = function (index, line, col, description) { + throw this.createError(index, line, col, description); + }; + ErrorHandler.prototype.tolerateError = function (index, line, col, description) { + var error = this.createError(index, line, col, description); + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + return ErrorHandler; + }()); + exports.ErrorHandler = ErrorHandler; + + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // Error messages should be identical to V8. + exports.Messages = { + 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', + ConstructorIsAsync: 'Class constructor may not be an async method', + ConstructorSpecialMethod: 'Class constructor may not be an accessor', + DeclarationMissingInitializer: 'Missing initializer in %0 declaration', + DefaultRestParameter: 'Unexpected token =', + DuplicateBinding: 'Duplicate binding %0', + DuplicateConstructor: 'A class may only have one constructor', + DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', + ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', + GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', + IllegalBreak: 'Illegal break statement', + IllegalContinue: 'Illegal continue statement', + IllegalExportDeclaration: 'Unexpected token', + IllegalImportDeclaration: 'Unexpected token', + IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', + IllegalReturn: 'Illegal return statement', + InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', + InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', + InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', + InvalidModuleSpecifier: 'Unexpected token', + InvalidRegExp: 'Invalid regular expression', + LetInLexicalBinding: 'let is disallowed as a lexically bound name', + MissingFromClause: 'Unexpected token', + MultipleDefaultsInSwitch: 'More than one default clause in switch statement', + NewlineAfterThrow: 'Illegal newline after throw', + NoAsAfterImportNamespace: 'Unexpected token', + NoCatchOrFinally: 'Missing catch or finally after try', + ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', + Redeclaration: '%0 \'%1\' has already been declared', + StaticPrototype: 'Classes may not have static property named prototype', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictParamDupe: 'Strict mode function may not have duplicate parameter names', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', + UnexpectedEOS: 'Unexpected end of input', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedNumber: 'Unexpected number', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedString: 'Unexpected string', + UnexpectedTemplate: 'Unexpected quasi %0', + UnexpectedToken: 'Unexpected token %0', + UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', + UnknownLabel: 'Undefined label \'%0\'', + UnterminatedRegExp: 'Invalid regular expression: missing /' + }; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var character_1 = __webpack_require__(4); + var messages_1 = __webpack_require__(11); + function hexValue(ch) { + return '0123456789abcdef'.indexOf(ch.toLowerCase()); + } + function octalValue(ch) { + return '01234567'.indexOf(ch); + } + var Scanner = (function () { + function Scanner(code, handler) { + this.source = code; + this.errorHandler = handler; + this.trackComment = false; + this.isModule = false; + this.length = code.length; + this.index = 0; + this.lineNumber = (code.length > 0) ? 1 : 0; + this.lineStart = 0; + this.curlyStack = []; + } + Scanner.prototype.saveState = function () { + return { + index: this.index, + lineNumber: this.lineNumber, + lineStart: this.lineStart + }; + }; + Scanner.prototype.restoreState = function (state) { + this.index = state.index; + this.lineNumber = state.lineNumber; + this.lineStart = state.lineStart; + }; + Scanner.prototype.eof = function () { + return this.index >= this.length; + }; + Scanner.prototype.throwUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + Scanner.prototype.tolerateUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + // https://tc39.github.io/ecma262/#sec-comments + Scanner.prototype.skipSingleLineComment = function (offset) { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - offset; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - offset + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + ++this.index; + if (character_1.Character.isLineTerminator(ch)) { + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart - 1 + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index - 1], + range: [start, this.index - 1], + loc: loc + }; + comments.push(entry); + } + if (ch === 13 && this.source.charCodeAt(this.index) === 10) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + return comments; + } + } + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + }; + Scanner.prototype.skipMultiLineComment = function () { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - 2; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - 2 + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isLineTerminator(ch)) { + if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + ++this.index; + this.lineStart = this.index; + } + else if (ch === 0x2A) { + // Block comment ends with '*/'. + if (this.source.charCodeAt(this.index + 1) === 0x2F) { + this.index += 2; + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index - 2], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + } + ++this.index; + } + else { + ++this.index; + } + } + // Ran off the end of the file - the whole thing is a comment + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + this.tolerateUnexpectedToken(); + return comments; + }; + Scanner.prototype.scanComments = function () { + var comments; + if (this.trackComment) { + comments = []; + } + var start = (this.index === 0); + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isWhiteSpace(ch)) { + ++this.index; + } + else if (character_1.Character.isLineTerminator(ch)) { + ++this.index; + if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + start = true; + } + else if (ch === 0x2F) { + ch = this.source.charCodeAt(this.index + 1); + if (ch === 0x2F) { + this.index += 2; + var comment = this.skipSingleLineComment(2); + if (this.trackComment) { + comments = comments.concat(comment); + } + start = true; + } + else if (ch === 0x2A) { + this.index += 2; + var comment = this.skipMultiLineComment(); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (start && ch === 0x2D) { + // U+003E is '>' + if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { + // '-->' is a single-line comment + this.index += 3; + var comment = this.skipSingleLineComment(3); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (ch === 0x3C && !this.isModule) { + if (this.source.slice(this.index + 1, this.index + 4) === '!--') { + this.index += 4; // ` + + + +Implementation of function.prototype.bind + +## Example + +I mainly do this for unit tests I run on phantomjs. +PhantomJS does not have Function.prototype.bind :( + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + + [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg + [travis-url]: https://travis-ci.org/Raynos/function-bind + [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg + [npm-url]: https://npmjs.org/package/function-bind + [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png + [6]: https://coveralls.io/r/Raynos/function-bind + [7]: https://gemnasium.com/Raynos/function-bind.png + [8]: https://gemnasium.com/Raynos/function-bind + [deps-svg]: https://david-dm.org/Raynos/function-bind.svg + [deps-url]: https://david-dm.org/Raynos/function-bind + [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg + [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies + [11]: https://ci.testling.com/Raynos/function-bind.png + [12]: https://ci.testling.com/Raynos/function-bind diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js new file mode 100644 index 0000000..cc4daec --- /dev/null +++ b/node_modules/function-bind/implementation.js @@ -0,0 +1,52 @@ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js new file mode 100644 index 0000000..3bb6b96 --- /dev/null +++ b/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json new file mode 100644 index 0000000..3990776 --- /dev/null +++ b/node_modules/function-bind/package.json @@ -0,0 +1,102 @@ +{ + "_from": "function-bind@^1.1.1", + "_id": "function-bind@1.1.1", + "_inBundle": false, + "_integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "_location": "/function-bind", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "function-bind@^1.1.1", + "name": "function-bind", + "escapedName": "function-bind", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/has", + "/object.entries/es-abstract", + "/object.values", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "_shasum": "a56899d3ea3c9bab874bb9773b7c5ede92f4895d", + "_spec": "function-bind@^1.1.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Implementation of Function.prototype.bind", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.5.0", + "jscs": "^3.0.7", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/Raynos/function-bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "license": "MIT", + "main": "index", + "name": "function-bind", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/function-bind.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage -- --quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.1" +} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc new file mode 100644 index 0000000..8a56d5b --- /dev/null +++ b/node_modules/function-bind/test/.eslintrc @@ -0,0 +1,9 @@ +{ + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": 0, + "no-magic-numbers": 0, + } +} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js new file mode 100644 index 0000000..2edecce --- /dev/null +++ b/node_modules/function-bind/test/index.js @@ -0,0 +1,252 @@ +// jscs:disable requireUseStrict + +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/node_modules/functional-red-black-tree/.npmignore b/node_modules/functional-red-black-tree/.npmignore new file mode 100644 index 0000000..ddc9ab3 --- /dev/null +++ b/node_modules/functional-red-black-tree/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules/* +*.DS_Store \ No newline at end of file diff --git a/node_modules/functional-red-black-tree/LICENSE b/node_modules/functional-red-black-tree/LICENSE new file mode 100644 index 0000000..8ce206a --- /dev/null +++ b/node_modules/functional-red-black-tree/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2013 Mikola Lysenko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/functional-red-black-tree/README.md b/node_modules/functional-red-black-tree/README.md new file mode 100644 index 0000000..edd19cb --- /dev/null +++ b/node_modules/functional-red-black-tree/README.md @@ -0,0 +1,237 @@ +functional-red-black-tree +========================= +A [fully persistent](http://en.wikipedia.org/wiki/Persistent_data_structure) [red-black tree](http://en.wikipedia.org/wiki/Red%E2%80%93black_tree) written 100% in JavaScript. Works both in node.js and in the browser via [browserify](http://browserify.org/). + +Functional (or fully presistent) data structures allow for non-destructive updates. So if you insert an element into the tree, it returns a new tree with the inserted element rather than destructively updating the existing tree in place. Doing this requires using extra memory, and if one were naive it could cost as much as reallocating the entire tree. Instead, this data structure saves some memory by recycling references to previously allocated subtrees. This requires using only O(log(n)) additional memory per update instead of a full O(n) copy. + +Some advantages of this is that it is possible to apply insertions and removals to the tree while still iterating over previous versions of the tree. Functional and persistent data structures can also be useful in many geometric algorithms like point location within triangulations or ray queries, and can be used to analyze the history of executing various algorithms. This added power though comes at a cost, since it is generally a bit slower to use a functional data structure than an imperative version. However, if your application needs this behavior then you may consider using this module. + +# Install + + npm install functional-red-black-tree + +# Example + +Here is an example of some basic usage: + +```javascript +//Load the library +var createTree = require("functional-red-black-tree") + +//Create a tree +var t1 = createTree() + +//Insert some items into the tree +var t2 = t1.insert(1, "foo") +var t3 = t2.insert(2, "bar") + +//Remove something +var t4 = t3.remove(1) +``` + + +# API + +```javascript +var createTree = require("functional-red-black-tree") +``` + +## Overview + +- [Tree methods](#tree-methods) + - [`var tree = createTree([compare])`](#var-tree-=-createtreecompare) + - [`tree.keys`](#treekeys) + - [`tree.values`](#treevalues) + - [`tree.length`](#treelength) + - [`tree.get(key)`](#treegetkey) + - [`tree.insert(key, value)`](#treeinsertkey-value) + - [`tree.remove(key)`](#treeremovekey) + - [`tree.find(key)`](#treefindkey) + - [`tree.ge(key)`](#treegekey) + - [`tree.gt(key)`](#treegtkey) + - [`tree.lt(key)`](#treeltkey) + - [`tree.le(key)`](#treelekey) + - [`tree.at(position)`](#treeatposition) + - [`tree.begin`](#treebegin) + - [`tree.end`](#treeend) + - [`tree.forEach(visitor(key,value)[, lo[, hi]])`](#treeforEachvisitorkeyvalue-lo-hi) + - [`tree.root`](#treeroot) +- [Node properties](#node-properties) + - [`node.key`](#nodekey) + - [`node.value`](#nodevalue) + - [`node.left`](#nodeleft) + - [`node.right`](#noderight) +- [Iterator methods](#iterator-methods) + - [`iter.key`](#iterkey) + - [`iter.value`](#itervalue) + - [`iter.node`](#iternode) + - [`iter.tree`](#itertree) + - [`iter.index`](#iterindex) + - [`iter.valid`](#itervalid) + - [`iter.clone()`](#iterclone) + - [`iter.remove()`](#iterremove) + - [`iter.update(value)`](#iterupdatevalue) + - [`iter.next()`](#iternext) + - [`iter.prev()`](#iterprev) + - [`iter.hasNext`](#iterhasnext) + - [`iter.hasPrev`](#iterhasprev) + +## Tree methods + +### `var tree = createTree([compare])` +Creates an empty functional tree + +* `compare` is an optional comparison function, same semantics as array.sort() + +**Returns** An empty tree ordered by `compare` + +### `tree.keys` +A sorted array of all the keys in the tree + +### `tree.values` +An array array of all the values in the tree + +### `tree.length` +The number of items in the tree + +### `tree.get(key)` +Retrieves the value associated to the given key + +* `key` is the key of the item to look up + +**Returns** The value of the first node associated to `key` + +### `tree.insert(key, value)` +Creates a new tree with the new pair inserted. + +* `key` is the key of the item to insert +* `value` is the value of the item to insert + +**Returns** A new tree with `key` and `value` inserted + +### `tree.remove(key)` +Removes the first item with `key` in the tree + +* `key` is the key of the item to remove + +**Returns** A new tree with the given item removed if it exists + +### `tree.find(key)` +Returns an iterator pointing to the first item in the tree with `key`, otherwise `null`. + +### `tree.ge(key)` +Find the first item in the tree whose key is `>= key` + +* `key` is the key to search for + +**Returns** An iterator at the given element. + +### `tree.gt(key)` +Finds the first item in the tree whose key is `> key` + +* `key` is the key to search for + +**Returns** An iterator at the given element + +### `tree.lt(key)` +Finds the last item in the tree whose key is `< key` + +* `key` is the key to search for + +**Returns** An iterator at the given element + +### `tree.le(key)` +Finds the last item in the tree whose key is `<= key` + +* `key` is the key to search for + +**Returns** An iterator at the given element + +### `tree.at(position)` +Finds an iterator starting at the given element + +* `position` is the index at which the iterator gets created + +**Returns** An iterator starting at position + +### `tree.begin` +An iterator pointing to the first element in the tree + +### `tree.end` +An iterator pointing to the last element in the tree + +### `tree.forEach(visitor(key,value)[, lo[, hi]])` +Walks a visitor function over the nodes of the tree in order. + +* `visitor(key,value)` is a callback that gets executed on each node. If a truthy value is returned from the visitor, then iteration is stopped. +* `lo` is an optional start of the range to visit (inclusive) +* `hi` is an optional end of the range to visit (non-inclusive) + +**Returns** The last value returned by the callback + +### `tree.root` +Returns the root node of the tree + + +## Node properties +Each node of the tree has the following properties: + +### `node.key` +The key associated to the node + +### `node.value` +The value associated to the node + +### `node.left` +The left subtree of the node + +### `node.right` +The right subtree of the node + +## Iterator methods + +### `iter.key` +The key of the item referenced by the iterator + +### `iter.value` +The value of the item referenced by the iterator + +### `iter.node` +The value of the node at the iterator's current position. `null` is iterator is node valid. + +### `iter.tree` +The tree associated to the iterator + +### `iter.index` +Returns the position of this iterator in the sequence. + +### `iter.valid` +Checks if the iterator is valid + +### `iter.clone()` +Makes a copy of the iterator + +### `iter.remove()` +Removes the item at the position of the iterator + +**Returns** A new binary search tree with `iter`'s item removed + +### `iter.update(value)` +Updates the value of the node in the tree at this iterator + +**Returns** A new binary search tree with the corresponding node updated + +### `iter.next()` +Advances the iterator to the next position + +### `iter.prev()` +Moves the iterator backward one element + +### `iter.hasNext` +If true, then the iterator is not at the end of the sequence + +### `iter.hasPrev` +If true, then the iterator is not at the beginning of the sequence + +# Credits +(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/node_modules/functional-red-black-tree/bench/test.js b/node_modules/functional-red-black-tree/bench/test.js new file mode 100644 index 0000000..41c5a31 --- /dev/null +++ b/node_modules/functional-red-black-tree/bench/test.js @@ -0,0 +1,11 @@ +"use strict" + +var createTree = require("../rbtree.js") + +var t = createTree() + +var s = Date.now() +for(var i=0; i<100000; ++i) { + t = t.insert(Math.random(), Math.random()) +} +console.log(Date.now() - s) \ No newline at end of file diff --git a/node_modules/functional-red-black-tree/package.json b/node_modules/functional-red-black-tree/package.json new file mode 100644 index 0000000..a6b0f32 --- /dev/null +++ b/node_modules/functional-red-black-tree/package.json @@ -0,0 +1,68 @@ +{ + "_from": "functional-red-black-tree@^1.0.1", + "_id": "functional-red-black-tree@1.0.1", + "_inBundle": false, + "_integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "_location": "/functional-red-black-tree", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "functional-red-black-tree@^1.0.1", + "name": "functional-red-black-tree", + "escapedName": "functional-red-black-tree", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "_shasum": "1b0ab3bd553b2a0d6399d29c0e3ea0b252078327", + "_spec": "functional-red-black-tree@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/functional-red-black-tree/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A fully persistent balanced binary search tree", + "devDependencies": { + "iota-array": "^0.0.1", + "tape": "^2.12.0" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/mikolalysenko/functional-red-black-tree#readme", + "keywords": [ + "functional", + "red", + "black", + "tree", + "binary", + "search", + "balance", + "persistent", + "fully", + "dynamic", + "data", + "structure" + ], + "license": "MIT", + "main": "rbtree.js", + "name": "functional-red-black-tree", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/functional-red-black-tree.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/functional-red-black-tree/rbtree.js b/node_modules/functional-red-black-tree/rbtree.js new file mode 100644 index 0000000..5a69a40 --- /dev/null +++ b/node_modules/functional-red-black-tree/rbtree.js @@ -0,0 +1,996 @@ +"use strict" + +module.exports = createRBTree + +var RED = 0 +var BLACK = 1 + +function RBNode(color, key, value, left, right, count) { + this._color = color + this.key = key + this.value = value + this.left = left + this.right = right + this._count = count +} + +function cloneNode(node) { + return new RBNode(node._color, node.key, node.value, node.left, node.right, node._count) +} + +function repaint(color, node) { + return new RBNode(color, node.key, node.value, node.left, node.right, node._count) +} + +function recount(node) { + node._count = 1 + (node.left ? node.left._count : 0) + (node.right ? node.right._count : 0) +} + +function RedBlackTree(compare, root) { + this._compare = compare + this.root = root +} + +var proto = RedBlackTree.prototype + +Object.defineProperty(proto, "keys", { + get: function() { + var result = [] + this.forEach(function(k,v) { + result.push(k) + }) + return result + } +}) + +Object.defineProperty(proto, "values", { + get: function() { + var result = [] + this.forEach(function(k,v) { + result.push(v) + }) + return result + } +}) + +//Returns the number of nodes in the tree +Object.defineProperty(proto, "length", { + get: function() { + if(this.root) { + return this.root._count + } + return 0 + } +}) + +//Insert a new item into the tree +proto.insert = function(key, value) { + var cmp = this._compare + //Find point to insert new node at + var n = this.root + var n_stack = [] + var d_stack = [] + while(n) { + var d = cmp(key, n.key) + n_stack.push(n) + d_stack.push(d) + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + //Rebuild path to leaf node + n_stack.push(new RBNode(RED, key, value, null, null, 1)) + for(var s=n_stack.length-2; s>=0; --s) { + var n = n_stack[s] + if(d_stack[s] <= 0) { + n_stack[s] = new RBNode(n._color, n.key, n.value, n_stack[s+1], n.right, n._count+1) + } else { + n_stack[s] = new RBNode(n._color, n.key, n.value, n.left, n_stack[s+1], n._count+1) + } + } + //Rebalance tree using rotations + //console.log("start insert", key, d_stack) + for(var s=n_stack.length-1; s>1; --s) { + var p = n_stack[s-1] + var n = n_stack[s] + if(p._color === BLACK || n._color === BLACK) { + break + } + var pp = n_stack[s-2] + if(pp.left === p) { + if(p.left === n) { + var y = pp.right + if(y && y._color === RED) { + //console.log("LLr") + p._color = BLACK + pp.right = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("LLb") + pp._color = RED + pp.left = p.right + p._color = BLACK + p.right = pp + n_stack[s-2] = p + n_stack[s-1] = n + recount(pp) + recount(p) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.left === pp) { + ppp.left = p + } else { + ppp.right = p + } + } + break + } + } else { + var y = pp.right + if(y && y._color === RED) { + //console.log("LRr") + p._color = BLACK + pp.right = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("LRb") + p.right = n.left + pp._color = RED + pp.left = n.right + n._color = BLACK + n.left = p + n.right = pp + n_stack[s-2] = n + n_stack[s-1] = p + recount(pp) + recount(p) + recount(n) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.left === pp) { + ppp.left = n + } else { + ppp.right = n + } + } + break + } + } + } else { + if(p.right === n) { + var y = pp.left + if(y && y._color === RED) { + //console.log("RRr", y.key) + p._color = BLACK + pp.left = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("RRb") + pp._color = RED + pp.right = p.left + p._color = BLACK + p.left = pp + n_stack[s-2] = p + n_stack[s-1] = n + recount(pp) + recount(p) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.right === pp) { + ppp.right = p + } else { + ppp.left = p + } + } + break + } + } else { + var y = pp.left + if(y && y._color === RED) { + //console.log("RLr") + p._color = BLACK + pp.left = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("RLb") + p.left = n.right + pp._color = RED + pp.right = n.left + n._color = BLACK + n.right = p + n.left = pp + n_stack[s-2] = n + n_stack[s-1] = p + recount(pp) + recount(p) + recount(n) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.right === pp) { + ppp.right = n + } else { + ppp.left = n + } + } + break + } + } + } + } + //Return new tree + n_stack[0]._color = BLACK + return new RedBlackTree(cmp, n_stack[0]) +} + + +//Visit all nodes inorder +function doVisitFull(visit, node) { + if(node.left) { + var v = doVisitFull(visit, node.left) + if(v) { return v } + } + var v = visit(node.key, node.value) + if(v) { return v } + if(node.right) { + return doVisitFull(visit, node.right) + } +} + +//Visit half nodes in order +function doVisitHalf(lo, compare, visit, node) { + var l = compare(lo, node.key) + if(l <= 0) { + if(node.left) { + var v = doVisitHalf(lo, compare, visit, node.left) + if(v) { return v } + } + var v = visit(node.key, node.value) + if(v) { return v } + } + if(node.right) { + return doVisitHalf(lo, compare, visit, node.right) + } +} + +//Visit all nodes within a range +function doVisit(lo, hi, compare, visit, node) { + var l = compare(lo, node.key) + var h = compare(hi, node.key) + var v + if(l <= 0) { + if(node.left) { + v = doVisit(lo, hi, compare, visit, node.left) + if(v) { return v } + } + if(h > 0) { + v = visit(node.key, node.value) + if(v) { return v } + } + } + if(h > 0 && node.right) { + return doVisit(lo, hi, compare, visit, node.right) + } +} + + +proto.forEach = function rbTreeForEach(visit, lo, hi) { + if(!this.root) { + return + } + switch(arguments.length) { + case 1: + return doVisitFull(visit, this.root) + break + + case 2: + return doVisitHalf(lo, this._compare, visit, this.root) + break + + case 3: + if(this._compare(lo, hi) >= 0) { + return + } + return doVisit(lo, hi, this._compare, visit, this.root) + break + } +} + +//First item in list +Object.defineProperty(proto, "begin", { + get: function() { + var stack = [] + var n = this.root + while(n) { + stack.push(n) + n = n.left + } + return new RedBlackTreeIterator(this, stack) + } +}) + +//Last item in list +Object.defineProperty(proto, "end", { + get: function() { + var stack = [] + var n = this.root + while(n) { + stack.push(n) + n = n.right + } + return new RedBlackTreeIterator(this, stack) + } +}) + +//Find the ith item in the tree +proto.at = function(idx) { + if(idx < 0) { + return new RedBlackTreeIterator(this, []) + } + var n = this.root + var stack = [] + while(true) { + stack.push(n) + if(n.left) { + if(idx < n.left._count) { + n = n.left + continue + } + idx -= n.left._count + } + if(!idx) { + return new RedBlackTreeIterator(this, stack) + } + idx -= 1 + if(n.right) { + if(idx >= n.right._count) { + break + } + n = n.right + } else { + break + } + } + return new RedBlackTreeIterator(this, []) +} + +proto.ge = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d <= 0) { + last_ptr = stack.length + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.gt = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d < 0) { + last_ptr = stack.length + } + if(d < 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.lt = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d > 0) { + last_ptr = stack.length + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.le = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d >= 0) { + last_ptr = stack.length + } + if(d < 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +//Finds the item with key if it exists +proto.find = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d === 0) { + return new RedBlackTreeIterator(this, stack) + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + return new RedBlackTreeIterator(this, []) +} + +//Removes item with key from tree +proto.remove = function(key) { + var iter = this.find(key) + if(iter) { + return iter.remove() + } + return this +} + +//Returns the item at `key` +proto.get = function(key) { + var cmp = this._compare + var n = this.root + while(n) { + var d = cmp(key, n.key) + if(d === 0) { + return n.value + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + return +} + +//Iterator for red black tree +function RedBlackTreeIterator(tree, stack) { + this.tree = tree + this._stack = stack +} + +var iproto = RedBlackTreeIterator.prototype + +//Test if iterator is valid +Object.defineProperty(iproto, "valid", { + get: function() { + return this._stack.length > 0 + } +}) + +//Node of the iterator +Object.defineProperty(iproto, "node", { + get: function() { + if(this._stack.length > 0) { + return this._stack[this._stack.length-1] + } + return null + }, + enumerable: true +}) + +//Makes a copy of an iterator +iproto.clone = function() { + return new RedBlackTreeIterator(this.tree, this._stack.slice()) +} + +//Swaps two nodes +function swapNode(n, v) { + n.key = v.key + n.value = v.value + n.left = v.left + n.right = v.right + n._color = v._color + n._count = v._count +} + +//Fix up a double black node in a tree +function fixDoubleBlack(stack) { + var n, p, s, z + for(var i=stack.length-1; i>=0; --i) { + n = stack[i] + if(i === 0) { + n._color = BLACK + return + } + //console.log("visit node:", n.key, i, stack[i].key, stack[i-1].key) + p = stack[i-1] + if(p.left === n) { + //console.log("left child") + s = p.right + if(s.right && s.right._color === RED) { + //console.log("case 1: right sibling child red") + s = p.right = cloneNode(s) + z = s.right = cloneNode(s.right) + p.right = s.left + s.left = p + s.right = z + s._color = p._color + n._color = BLACK + p._color = BLACK + z._color = BLACK + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = s + } else { + pp.right = s + } + } + stack[i-1] = s + return + } else if(s.left && s.left._color === RED) { + //console.log("case 1: left sibling child red") + s = p.right = cloneNode(s) + z = s.left = cloneNode(s.left) + p.right = z.left + s.left = z.right + z.left = p + z.right = s + z._color = p._color + p._color = BLACK + s._color = BLACK + n._color = BLACK + recount(p) + recount(s) + recount(z) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = z + } else { + pp.right = z + } + } + stack[i-1] = z + return + } + if(s._color === BLACK) { + if(p._color === RED) { + //console.log("case 2: black sibling, red parent", p.right.value) + p._color = BLACK + p.right = repaint(RED, s) + return + } else { + //console.log("case 2: black sibling, black parent", p.right.value) + p.right = repaint(RED, s) + continue + } + } else { + //console.log("case 3: red sibling") + s = cloneNode(s) + p.right = s.left + s.left = p + s._color = p._color + p._color = RED + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = s + } else { + pp.right = s + } + } + stack[i-1] = s + stack[i] = p + if(i+1 < stack.length) { + stack[i+1] = n + } else { + stack.push(n) + } + i = i+2 + } + } else { + //console.log("right child") + s = p.left + if(s.left && s.left._color === RED) { + //console.log("case 1: left sibling child red", p.value, p._color) + s = p.left = cloneNode(s) + z = s.left = cloneNode(s.left) + p.left = s.right + s.right = p + s.left = z + s._color = p._color + n._color = BLACK + p._color = BLACK + z._color = BLACK + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = s + } else { + pp.left = s + } + } + stack[i-1] = s + return + } else if(s.right && s.right._color === RED) { + //console.log("case 1: right sibling child red") + s = p.left = cloneNode(s) + z = s.right = cloneNode(s.right) + p.left = z.right + s.right = z.left + z.right = p + z.left = s + z._color = p._color + p._color = BLACK + s._color = BLACK + n._color = BLACK + recount(p) + recount(s) + recount(z) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = z + } else { + pp.left = z + } + } + stack[i-1] = z + return + } + if(s._color === BLACK) { + if(p._color === RED) { + //console.log("case 2: black sibling, red parent") + p._color = BLACK + p.left = repaint(RED, s) + return + } else { + //console.log("case 2: black sibling, black parent") + p.left = repaint(RED, s) + continue + } + } else { + //console.log("case 3: red sibling") + s = cloneNode(s) + p.left = s.right + s.right = p + s._color = p._color + p._color = RED + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = s + } else { + pp.left = s + } + } + stack[i-1] = s + stack[i] = p + if(i+1 < stack.length) { + stack[i+1] = n + } else { + stack.push(n) + } + i = i+2 + } + } + } +} + +//Removes item at iterator from tree +iproto.remove = function() { + var stack = this._stack + if(stack.length === 0) { + return this.tree + } + //First copy path to node + var cstack = new Array(stack.length) + var n = stack[stack.length-1] + cstack[cstack.length-1] = new RBNode(n._color, n.key, n.value, n.left, n.right, n._count) + for(var i=stack.length-2; i>=0; --i) { + var n = stack[i] + if(n.left === stack[i+1]) { + cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) + } else { + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + } + + //Get node + n = cstack[cstack.length-1] + //console.log("start remove: ", n.value) + + //If not leaf, then swap with previous node + if(n.left && n.right) { + //console.log("moving to leaf") + + //First walk to previous leaf + var split = cstack.length + n = n.left + while(n.right) { + cstack.push(n) + n = n.right + } + //Copy path to leaf + var v = cstack[split-1] + cstack.push(new RBNode(n._color, v.key, v.value, n.left, n.right, n._count)) + cstack[split-1].key = n.key + cstack[split-1].value = n.value + + //Fix up stack + for(var i=cstack.length-2; i>=split; --i) { + n = cstack[i] + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + cstack[split-1].left = cstack[split] + } + //console.log("stack=", cstack.map(function(v) { return v.value })) + + //Remove leaf node + n = cstack[cstack.length-1] + if(n._color === RED) { + //Easy case: removing red leaf + //console.log("RED leaf") + var p = cstack[cstack.length-2] + if(p.left === n) { + p.left = null + } else if(p.right === n) { + p.right = null + } + cstack.pop() + for(var i=0; i 0) { + return this._stack[this._stack.length-1].key + } + return + }, + enumerable: true +}) + +//Returns value +Object.defineProperty(iproto, "value", { + get: function() { + if(this._stack.length > 0) { + return this._stack[this._stack.length-1].value + } + return + }, + enumerable: true +}) + + +//Returns the position of this iterator in the sorted list +Object.defineProperty(iproto, "index", { + get: function() { + var idx = 0 + var stack = this._stack + if(stack.length === 0) { + var r = this.tree.root + if(r) { + return r._count + } + return 0 + } else if(stack[stack.length-1].left) { + idx = stack[stack.length-1].left._count + } + for(var s=stack.length-2; s>=0; --s) { + if(stack[s+1] === stack[s].right) { + ++idx + if(stack[s].left) { + idx += stack[s].left._count + } + } + } + return idx + }, + enumerable: true +}) + +//Advances iterator to next element in list +iproto.next = function() { + var stack = this._stack + if(stack.length === 0) { + return + } + var n = stack[stack.length-1] + if(n.right) { + n = n.right + while(n) { + stack.push(n) + n = n.left + } + } else { + stack.pop() + while(stack.length > 0 && stack[stack.length-1].right === n) { + n = stack[stack.length-1] + stack.pop() + } + } +} + +//Checks if iterator is at end of tree +Object.defineProperty(iproto, "hasNext", { + get: function() { + var stack = this._stack + if(stack.length === 0) { + return false + } + if(stack[stack.length-1].right) { + return true + } + for(var s=stack.length-1; s>0; --s) { + if(stack[s-1].left === stack[s]) { + return true + } + } + return false + } +}) + +//Update value +iproto.update = function(value) { + var stack = this._stack + if(stack.length === 0) { + throw new Error("Can't update empty node!") + } + var cstack = new Array(stack.length) + var n = stack[stack.length-1] + cstack[cstack.length-1] = new RBNode(n._color, n.key, value, n.left, n.right, n._count) + for(var i=stack.length-2; i>=0; --i) { + n = stack[i] + if(n.left === stack[i+1]) { + cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) + } else { + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + } + return new RedBlackTree(this.tree._compare, cstack[0]) +} + +//Moves iterator backward one element +iproto.prev = function() { + var stack = this._stack + if(stack.length === 0) { + return + } + var n = stack[stack.length-1] + if(n.left) { + n = n.left + while(n) { + stack.push(n) + n = n.right + } + } else { + stack.pop() + while(stack.length > 0 && stack[stack.length-1].left === n) { + n = stack[stack.length-1] + stack.pop() + } + } +} + +//Checks if iterator is at start of tree +Object.defineProperty(iproto, "hasPrev", { + get: function() { + var stack = this._stack + if(stack.length === 0) { + return false + } + if(stack[stack.length-1].left) { + return true + } + for(var s=stack.length-1; s>0; --s) { + if(stack[s-1].right === stack[s]) { + return true + } + } + return false + } +}) + +//Default comparison function +function defaultCompare(a, b) { + if(a < b) { + return -1 + } + if(a > b) { + return 1 + } + return 0 +} + +//Build a tree +function createRBTree(compare) { + return new RedBlackTree(compare || defaultCompare, null) +} \ No newline at end of file diff --git a/node_modules/functional-red-black-tree/test/test.js b/node_modules/functional-red-black-tree/test/test.js new file mode 100644 index 0000000..fd945d0 --- /dev/null +++ b/node_modules/functional-red-black-tree/test/test.js @@ -0,0 +1,479 @@ +"use strict" + +var makeTree = require("../rbtree.js") +var tape = require("tape") +var util = require("util") +var iota = require("iota-array") + +var COLORS = [ "r", "b", "bb" ] + +function printTree(tree) { + if(!tree) { + return [] + } + return [ COLORS[tree._color], tree.key, printTree(tree.left), printTree(tree.right) ] +} + +function print(t) { + console.log(util.inspect(printTree(t.root), {depth:12})) +} + +//Ensures the red black axioms are satisfied by tree +function checkTree(tree, t) { + if(!tree.root) { + return + } + t.equals(tree.root._color, 1, "root is black") + function checkNode(node) { + if(!node) { + return [1, 0] + } + if(node._color === 0) { + t.assert(!node.left || node.left._color === 1, "children of red node must be black") + t.assert(!node.right || node.right._color === 1, "children of red node must be black") + } else { + t.equals(node._color, 1, "node color must be red or black") + } + if(node.left) { + t.assert(tree._compare(node.left.key, node.key) <= 0, "left tree order invariant") + } + if(node.right) { + t.assert(tree._compare(node.right.key, node.key) >= 0, "right tree order invariant") + } + var cl = checkNode(node.left) + var cr = checkNode(node.right) + t.equals(cl[0], cr[0], "number of black nodes along all paths to root must be constant") + t.equals(cl[1] + cr[1] + 1, node._count, "item count consistency") + return [cl[0] + node._color, cl[1] + cr[1] + 1] + } + var r = checkNode(tree.root) + t.equals(r[1], tree.length, "tree length") +} + +tape("insert()", function(t) { + var t1 = makeTree() + + var u = t1 + var arr = [] + for(var i=20; i>=0; --i) { + var x = i + var next = u.insert(x, true) + checkTree(u, t) + checkTree(next, t) + t.equals(u.length, arr.length) + arr.push(x) + u = next + } + for(var i=-20; i<0; ++i) { + var x = i + var next = u.insert(x, true) + checkTree(u, t) + checkTree(next, t) + arr.sort(function(a,b) { return a-b }) + var ptr = 0 + u.forEach(function(k,v) { + t.equals(k, arr[ptr++]) + }) + t.equals(ptr, arr.length) + arr.push(x) + u = next + } + + var start = u.begin + for(var i=-20, j=0; j<=40; ++i, ++j) { + t.equals(u.at(j).key, i, "checking at()") + t.equals(start.key, i, "checking iter") + t.equals(start.index, j, "checking index") + t.assert(start.valid, "checking valid") + if(j < 40) { + t.assert(start.hasNext, "hasNext()") + } else { + t.assert(!start.hasNext, "eof hasNext()") + } + start.next() + } + t.assert(!start.valid, "invalid eof iterator") + t.assert(!start.hasNext, "hasNext() at eof fail") + t.equals(start.index, 41, "eof index") + + t.end() +}) + +tape("foreach", function(t) { + var u = iota(31).reduce(function(u, k, v) { + return u.insert(k, v) + }, makeTree()) + + //Check basic foreach + var visit_keys = [] + var visit_vals = [] + u.forEach(function(k,v) { + visit_keys.push(k) + visit_vals.push(v) + }) + t.same(visit_keys, u.keys) + t.same(visit_vals, u.values) + + //Check foreach with termination + visit_keys = [] + visit_vals = [] + t.equals(u.forEach(function(k,v) { + if(k === 5) { + return 1000 + } + visit_keys.push(k) + visit_vals.push(v) + }), 1000) + t.same(visit_keys, u.keys.slice(0, 5)) + t.same(visit_vals, u.values.slice(0, 5)) + + //Check half interval foreach + visit_keys = [] + visit_vals = [] + u.forEach(function(k,v) { + visit_keys.push(k) + visit_vals.push(v) + }, 3) + t.same(visit_keys, u.keys.slice(3)) + t.same(visit_vals, u.values.slice(3)) + + //Check half interval foreach with termination + visit_keys = [] + visit_vals = [] + t.equals(u.forEach(function(k,v) { + if(k === 12) { + return 1000 + } + visit_keys.push(k) + visit_vals.push(v) + }, 3), 1000) + t.same(visit_keys, u.keys.slice(3, 12)) + t.same(visit_vals, u.values.slice(3, 12)) + + + //Check interval foreach + visit_keys = [] + visit_vals = [] + u.forEach(function(k,v) { + visit_keys.push(k) + visit_vals.push(v) + }, 3, 15) + t.same(visit_keys, u.keys.slice(3, 15)) + t.same(visit_vals, u.values.slice(3, 15)) + + //Check interval foreach with termination + visit_keys = [] + visit_vals = [] + t.equals(u.forEach(function(k,v) { + if(k === 12) { + return 1000 + } + visit_keys.push(k) + visit_vals.push(v) + }, 3, 15), 1000) + t.same(visit_keys, u.keys.slice(3, 12)) + t.same(visit_vals, u.values.slice(3, 12)) + + t.end() +}) + +function compareIterators(a, b, t) { + t.equals(a.tree, b.tree, "iter trees") + t.equals(a.valid, b.valid, "iter validity") + if(!b.valid) { + return + } + t.equals(a.node, b.node, "iter node") + t.equals(a.key, b.key, "iter key") + t.equals(a.value, b.value, "iter value") + t.equals(a.index, b.index, "iter index") +} + +tape("iterators", function(t) { + var u = iota(20).reduce(function(u, k, v) { + return u.insert(k, v) + }, makeTree()) + + //Try walking forward + var iter = u.begin + var c = iter.clone() + t.ok(iter.hasNext, "must have next at beginneing") + t.ok(!iter.hasPrev, "must not have predecessor") + for(var i=0; i<20; ++i) { + var v = u.at(i) + compareIterators(iter, v, t) + t.equals(iter.index, i) + iter.next() + } + t.ok(!iter.valid, "must be eof iterator") + + //Check if the clone worked + compareIterators(c, u.begin, t) + + //Try walking backward + var iter = u.end + t.ok(!iter.hasNext, "must not have next") + t.ok(iter.hasPrev, "must have predecessor") + for(var i=19; i>=0; --i) { + var v = u.at(i) + compareIterators(iter, v, t) + t.equals(iter.index, i) + iter.prev() + } + t.ok(!iter.valid, "must be eof iterator") + + t.end() +}) + + +tape("remove()", function(t) { + + var sz = [1, 2, 10, 20, 23, 31, 32, 33] + for(var n=0; n b[0]) { return 1 } + return 0 + }) + + var keys = zipped.map(function(v) { return v[0] }) + var values = zipped.map(function(v) { return v[1] }) + + t.same(u.keys, keys) + t.same(u.values, values) + + t.end() +}) + +tape("searching", function(t) { + + var arr = [0, 1, 1, 1, 1, 2, 3, 4, 5, 6, 6 ] + var u = arr.reduce(function(u, k, v) { + return u.insert(k, v) + }, makeTree()) + + + for(var i=0; i 0, "find repeat") + t.ok(u.find(1).index < 5, "find repeat") + + for(var i=0; i +
+ + +

+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + +## License + +ISC + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg + +[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master +[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master + +[travis-url]: https://travis-ci.org/gulpjs/glob-parent +[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100644 index 0000000..789dbbf --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,41 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100644 index 0000000..aff35f7 --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,90 @@ +{ + "_from": "glob-parent@^5.0.0", + "_id": "glob-parent@5.1.1", + "_inBundle": false, + "_integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "_location": "/glob-parent", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-parent@^5.0.0", + "name": "glob-parent", + "escapedName": "glob-parent", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "_shasum": "b6c1ef417c4e5663ea498f1c45afac6916bbc229", + "_spec": "glob-parent@^5.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "https://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/glob-parent/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "is-glob": "^4.0.1" + }, + "deprecated": false, + "description": "Extract the non-magic parent path from a glob string.", + "devDependencies": { + "coveralls": "^3.0.11", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "mocha": "^6.0.2", + "nyc": "^13.3.0" + }, + "engines": { + "node": ">= 6" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/glob-parent#readme", + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ], + "license": "ISC", + "main": "index.js", + "name": "glob-parent", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glob-parent.git" + }, + "scripts": { + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only" + }, + "version": "5.1.1" +} diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100644 index 0000000..0916a48 --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,375 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/glob/changelog.md b/node_modules/glob/changelog.md new file mode 100644 index 0000000..4163677 --- /dev/null +++ b/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100644 index 0000000..66651bb --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100644 index 0000000..58dec0f --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100644 index 0000000..992d4be --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,79 @@ +{ + "_from": "glob@^7.1.3", + "_id": "glob@7.1.6", + "_inBundle": false, + "_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "_location": "/glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob@^7.1.3", + "name": "glob", + "escapedName": "glob", + "rawSpec": "^7.1.3", + "saveSpec": null, + "fetchSpec": "^7.1.3" + }, + "_requiredBy": [ + "/rimraf" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "_shasum": "141f33b81a7c2492e125594307480c46679278a6", + "_spec": "glob@^7.1.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/rimraf", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "deprecated": false, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.6" +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100644 index 0000000..c952134 --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/globals/globals.json b/node_modules/globals/globals.json new file mode 100644 index 0000000..b85dc3f --- /dev/null +++ b/node_modules/globals/globals.json @@ -0,0 +1,1586 @@ +{ + "builtin": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es5": { + "Array": false, + "Boolean": false, + "constructor": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "propertyIsEnumerable": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false + }, + "es2015": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2017": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "browser": { + "AbortController": false, + "AbortSignal": false, + "addEventListener": false, + "alert": false, + "AnalyserNode": false, + "Animation": false, + "AnimationEffectReadOnly": false, + "AnimationEffectTiming": false, + "AnimationEffectTimingReadOnly": false, + "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, + "applicationCache": false, + "ApplicationCache": false, + "ApplicationCacheErrorEvent": false, + "atob": false, + "Attr": false, + "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioDestinationNode": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, + "AudioProcessingEvent": false, + "AudioScheduledSourceNode": false, + "AudioWorkletGlobalScope ": false, + "AudioWorkletNode": false, + "AudioWorkletProcessor": false, + "BarProp": false, + "BaseAudioContext": false, + "BatteryManager": false, + "BeforeUnloadEvent": false, + "BiquadFilterNode": false, + "Blob": false, + "BlobEvent": false, + "blur": false, + "BroadcastChannel": false, + "btoa": false, + "BudgetService": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "cancelIdleCallback": false, + "CanvasCaptureMediaStreamTrack": false, + "CanvasGradient": false, + "CanvasPattern": false, + "CanvasRenderingContext2D": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "CharacterData": false, + "clearInterval": false, + "clearTimeout": false, + "clientInformation": false, + "ClipboardEvent": false, + "close": false, + "closed": false, + "CloseEvent": false, + "Comment": false, + "CompositionEvent": false, + "confirm": false, + "console": false, + "ConstantSourceNode": false, + "ConvolverNode": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "Credential": false, + "CredentialsContainer": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSS": false, + "CSSConditionRule": false, + "CSSFontFaceRule": false, + "CSSGroupingRule": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSMediaRule": false, + "CSSNamespaceRule": false, + "CSSPageRule": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSSupportsRule": false, + "CustomElementRegistry": false, + "customElements": false, + "CustomEvent": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, + "defaultstatus": false, + "defaultStatus": false, + "DelayNode": false, + "DeviceMotionEvent": false, + "DeviceOrientationEvent": false, + "devicePixelRatio": false, + "dispatchEvent": false, + "document": false, + "Document": false, + "DocumentFragment": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMParser": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, + "DragEvent": false, + "DynamicsCompressorNode": false, + "Element": false, + "ErrorEvent": false, + "event": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "external": false, + "fetch": false, + "File": false, + "FileList": false, + "FileReader": false, + "find": false, + "focus": false, + "FocusEvent": false, + "FontFace": false, + "FontFaceSetLoadEvent": false, + "FormData": false, + "frameElement": false, + "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadButton": false, + "GamepadEvent": false, + "getComputedStyle": false, + "getSelection": false, + "HashChangeEvent": false, + "Headers": false, + "history": false, + "History": false, + "HTMLAllCollection": false, + "HTMLAnchorElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, + "HTMLBaseElement": false, + "HTMLBodyElement": false, + "HTMLBRElement": false, + "HTMLButtonElement": false, + "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLContentElement": false, + "HTMLDataElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, + "HTMLDirectoryElement": false, + "HTMLDivElement": false, + "HTMLDListElement": false, + "HTMLDocument": false, + "HTMLElement": false, + "HTMLEmbedElement": false, + "HTMLFieldSetElement": false, + "HTMLFontElement": false, + "HTMLFormControlsCollection": false, + "HTMLFormElement": false, + "HTMLFrameElement": false, + "HTMLFrameSetElement": false, + "HTMLHeadElement": false, + "HTMLHeadingElement": false, + "HTMLHRElement": false, + "HTMLHtmlElement": false, + "HTMLIFrameElement": false, + "HTMLImageElement": false, + "HTMLInputElement": false, + "HTMLLabelElement": false, + "HTMLLegendElement": false, + "HTMLLIElement": false, + "HTMLLinkElement": false, + "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, + "HTMLMenuElement": false, + "HTMLMetaElement": false, + "HTMLMeterElement": false, + "HTMLModElement": false, + "HTMLObjectElement": false, + "HTMLOListElement": false, + "HTMLOptGroupElement": false, + "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, + "HTMLParagraphElement": false, + "HTMLParamElement": false, + "HTMLPictureElement": false, + "HTMLPreElement": false, + "HTMLProgressElement": false, + "HTMLQuoteElement": false, + "HTMLScriptElement": false, + "HTMLSelectElement": false, + "HTMLShadowElement": false, + "HTMLSlotElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, + "HTMLStyleElement": false, + "HTMLTableCaptionElement": false, + "HTMLTableCellElement": false, + "HTMLTableColElement": false, + "HTMLTableElement": false, + "HTMLTableRowElement": false, + "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, + "HTMLTextAreaElement": false, + "HTMLTimeElement": false, + "HTMLTitleElement": false, + "HTMLTrackElement": false, + "HTMLUListElement": false, + "HTMLUnknownElement": false, + "HTMLVideoElement": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "IdleDeadline": false, + "IIRFilterNode": false, + "Image": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageCapture": false, + "ImageData": false, + "indexedDB": false, + "innerHeight": false, + "innerWidth": false, + "InputEvent": false, + "IntersectionObserver": false, + "IntersectionObserverEntry": false, + "Intl": false, + "isSecureContext": false, + "KeyboardEvent": false, + "KeyframeEffect": false, + "KeyframeEffectReadOnly": false, + "length": false, + "localStorage": false, + "location": true, + "Location": false, + "locationbar": false, + "matchMedia": false, + "MediaDeviceInfo": false, + "MediaDevices": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyMessageEvent": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaRecorder": false, + "MediaSettingsRange": false, + "MediaSource": false, + "MediaStream": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "MediaStreamTrackEvent": false, + "menubar": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, + "MouseEvent": false, + "moveBy": false, + "moveTo": false, + "MutationEvent": false, + "MutationObserver": false, + "MutationRecord": false, + "name": false, + "NamedNodeMap": false, + "NavigationPreloadManager": false, + "navigator": false, + "Navigator": false, + "NetworkInformation": false, + "Node": false, + "NodeFilter": false, + "NodeIterator": false, + "NodeList": false, + "Notification": false, + "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, + "OffscreenCanvas": true, + "onabort": true, + "onafterprint": true, + "onanimationend": true, + "onanimationiteration": true, + "onanimationstart": true, + "onappinstalled": true, + "onauxclick": true, + "onbeforeinstallprompt": true, + "onbeforeprint": true, + "onbeforeunload": true, + "onblur": true, + "oncancel": true, + "oncanplay": true, + "oncanplaythrough": true, + "onchange": true, + "onclick": true, + "onclose": true, + "oncontextmenu": true, + "oncuechange": true, + "ondblclick": true, + "ondevicemotion": true, + "ondeviceorientation": true, + "ondeviceorientationabsolute": true, + "ondrag": true, + "ondragend": true, + "ondragenter": true, + "ondragleave": true, + "ondragover": true, + "ondragstart": true, + "ondrop": true, + "ondurationchange": true, + "onemptied": true, + "onended": true, + "onerror": true, + "onfocus": true, + "ongotpointercapture": true, + "onhashchange": true, + "oninput": true, + "oninvalid": true, + "onkeydown": true, + "onkeypress": true, + "onkeyup": true, + "onlanguagechange": true, + "onload": true, + "onloadeddata": true, + "onloadedmetadata": true, + "onloadstart": true, + "onlostpointercapture": true, + "onmessage": true, + "onmessageerror": true, + "onmousedown": true, + "onmouseenter": true, + "onmouseleave": true, + "onmousemove": true, + "onmouseout": true, + "onmouseover": true, + "onmouseup": true, + "onmousewheel": true, + "onoffline": true, + "ononline": true, + "onpagehide": true, + "onpageshow": true, + "onpause": true, + "onplay": true, + "onplaying": true, + "onpointercancel": true, + "onpointerdown": true, + "onpointerenter": true, + "onpointerleave": true, + "onpointermove": true, + "onpointerout": true, + "onpointerover": true, + "onpointerup": true, + "onpopstate": true, + "onprogress": true, + "onratechange": true, + "onrejectionhandled": true, + "onreset": true, + "onresize": true, + "onscroll": true, + "onsearch": true, + "onseeked": true, + "onseeking": true, + "onselect": true, + "onstalled": true, + "onstorage": true, + "onsubmit": true, + "onsuspend": true, + "ontimeupdate": true, + "ontoggle": true, + "ontransitionend": true, + "onunhandledrejection": true, + "onunload": true, + "onvolumechange": true, + "onwaiting": true, + "onwheel": true, + "open": false, + "openDatabase": false, + "opener": false, + "Option": false, + "origin": false, + "OscillatorNode": false, + "outerHeight": false, + "outerWidth": false, + "PageTransitionEvent": false, + "pageXOffset": false, + "pageYOffset": false, + "PannerNode": false, + "parent": false, + "Path2D": false, + "PaymentAddress": false, + "PaymentRequest": false, + "PaymentRequestUpdateEvent": false, + "PaymentResponse": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceLongTaskTiming": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceNavigationTiming": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformancePaintTiming": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "personalbar": false, + "PhotoCapabilities": false, + "Plugin": false, + "PluginArray": false, + "PointerEvent": false, + "PopStateEvent": false, + "postMessage": false, + "Presentation": false, + "PresentationAvailability": false, + "PresentationConnection": false, + "PresentationConnectionAvailableEvent": false, + "PresentationConnectionCloseEvent": false, + "PresentationConnectionList": false, + "PresentationReceiver": false, + "PresentationRequest": false, + "print": false, + "ProcessingInstruction": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "prompt": false, + "PushManager": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queueMicrotask": false, + "RadioNodeList": false, + "Range": false, + "ReadableStream": false, + "registerProcessor": false, + "RemotePlayback": false, + "removeEventListener": false, + "Request": false, + "requestAnimationFrame": false, + "requestIdleCallback": false, + "resizeBy": false, + "ResizeObserver": false, + "ResizeObserverEntry": false, + "resizeTo": false, + "Response": false, + "RTCCertificate": false, + "RTCDataChannel": false, + "RTCDataChannelEvent": false, + "RTCDtlsTransport": false, + "RTCIceCandidate": false, + "RTCIceGatherer": false, + "RTCIceTransport": false, + "RTCPeerConnection": false, + "RTCPeerConnectionIceEvent": false, + "RTCRtpContributingSource": false, + "RTCRtpReceiver": false, + "RTCRtpSender": false, + "RTCSctpTransport": false, + "RTCSessionDescription": false, + "RTCStatsReport": false, + "RTCTrackEvent": false, + "screen": false, + "Screen": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, + "screenX": false, + "screenY": false, + "ScriptProcessorNode": false, + "scroll": false, + "scrollbars": false, + "scrollBy": false, + "scrollTo": false, + "scrollX": false, + "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, + "sessionStorage": false, + "setInterval": false, + "setTimeout": false, + "ShadowRoot": false, + "SharedWorker": false, + "SourceBuffer": false, + "SourceBufferList": false, + "speechSynthesis": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, + "StaticRange": false, + "status": false, + "statusbar": false, + "StereoPannerNode": false, + "stop": false, + "Storage": false, + "StorageEvent": false, + "StorageManager": false, + "styleMedia": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubtleCrypto": false, + "SVGAElement": false, + "SVGAngle": false, + "SVGAnimatedAngle": false, + "SVGAnimatedBoolean": false, + "SVGAnimatedEnumeration": false, + "SVGAnimatedInteger": false, + "SVGAnimatedLength": false, + "SVGAnimatedLengthList": false, + "SVGAnimatedNumber": false, + "SVGAnimatedNumberList": false, + "SVGAnimatedPreserveAspectRatio": false, + "SVGAnimatedRect": false, + "SVGAnimatedString": false, + "SVGAnimatedTransformList": false, + "SVGAnimateElement": false, + "SVGAnimateMotionElement": false, + "SVGAnimateTransformElement": false, + "SVGAnimationElement": false, + "SVGCircleElement": false, + "SVGClipPathElement": false, + "SVGComponentTransferFunctionElement": false, + "SVGDefsElement": false, + "SVGDescElement": false, + "SVGDiscardElement": false, + "SVGElement": false, + "SVGEllipseElement": false, + "SVGFEBlendElement": false, + "SVGFEColorMatrixElement": false, + "SVGFEComponentTransferElement": false, + "SVGFECompositeElement": false, + "SVGFEConvolveMatrixElement": false, + "SVGFEDiffuseLightingElement": false, + "SVGFEDisplacementMapElement": false, + "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, + "SVGFEFloodElement": false, + "SVGFEFuncAElement": false, + "SVGFEFuncBElement": false, + "SVGFEFuncGElement": false, + "SVGFEFuncRElement": false, + "SVGFEGaussianBlurElement": false, + "SVGFEImageElement": false, + "SVGFEMergeElement": false, + "SVGFEMergeNodeElement": false, + "SVGFEMorphologyElement": false, + "SVGFEOffsetElement": false, + "SVGFEPointLightElement": false, + "SVGFESpecularLightingElement": false, + "SVGFESpotLightElement": false, + "SVGFETileElement": false, + "SVGFETurbulenceElement": false, + "SVGFilterElement": false, + "SVGForeignObjectElement": false, + "SVGGElement": false, + "SVGGeometryElement": false, + "SVGGradientElement": false, + "SVGGraphicsElement": false, + "SVGImageElement": false, + "SVGLength": false, + "SVGLengthList": false, + "SVGLinearGradientElement": false, + "SVGLineElement": false, + "SVGMarkerElement": false, + "SVGMaskElement": false, + "SVGMatrix": false, + "SVGMetadataElement": false, + "SVGMPathElement": false, + "SVGNumber": false, + "SVGNumberList": false, + "SVGPathElement": false, + "SVGPatternElement": false, + "SVGPoint": false, + "SVGPointList": false, + "SVGPolygonElement": false, + "SVGPolylineElement": false, + "SVGPreserveAspectRatio": false, + "SVGRadialGradientElement": false, + "SVGRect": false, + "SVGRectElement": false, + "SVGScriptElement": false, + "SVGSetElement": false, + "SVGStopElement": false, + "SVGStringList": false, + "SVGStyleElement": false, + "SVGSVGElement": false, + "SVGSwitchElement": false, + "SVGSymbolElement": false, + "SVGTextContentElement": false, + "SVGTextElement": false, + "SVGTextPathElement": false, + "SVGTextPositioningElement": false, + "SVGTitleElement": false, + "SVGTransform": false, + "SVGTransformList": false, + "SVGTSpanElement": false, + "SVGUnitTypes": false, + "SVGUseElement": false, + "SVGViewElement": false, + "TaskAttributionTiming": false, + "Text": false, + "TextDecoder": false, + "TextEncoder": false, + "TextEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, + "TimeRanges": false, + "toolbar": false, + "top": false, + "Touch": false, + "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransitionEvent": false, + "TreeWalker": false, + "UIEvent": false, + "URL": false, + "URLSearchParams": false, + "ValidityState": false, + "visualViewport": false, + "VisualViewport": false, + "VTTCue": false, + "WaveShaperNode": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "WebSocket": false, + "WheelEvent": false, + "window": false, + "Window": false, + "Worker": false, + "WritableStream": false, + "XMLDocument": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestUpload": false, + "XMLSerializer": false, + "XPathEvaluator": false, + "XPathExpression": false, + "XPathResult": false, + "XSLTProcessor": false + }, + "worker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "clearInterval": false, + "clearTimeout": false, + "close": true, + "console": false, + "fetch": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": true, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onoffline": true, + "ononline": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": true, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + }, + "node": { + "__dirname": false, + "__filename": false, + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "exports": true, + "global": false, + "Intl": false, + "module": false, + "process": false, + "queueMicrotask": false, + "require": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false + }, + "nodeBuiltin": { + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "global": false, + "Intl": false, + "process": false, + "queueMicrotask": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false + }, + "commonjs": { + "exports": true, + "global": false, + "module": false, + "require": false + }, + "amd": { + "define": false, + "require": false + }, + "mocha": { + "after": false, + "afterEach": false, + "before": false, + "beforeEach": false, + "context": false, + "describe": false, + "it": false, + "mocha": false, + "run": false, + "setup": false, + "specify": false, + "suite": false, + "suiteSetup": false, + "suiteTeardown": false, + "teardown": false, + "test": false, + "xcontext": false, + "xdescribe": false, + "xit": false, + "xspecify": false + }, + "jasmine": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "expectAsync": false, + "fail": false, + "fdescribe": false, + "fit": false, + "it": false, + "jasmine": false, + "pending": false, + "runs": false, + "spyOn": false, + "spyOnAllFunctions": false, + "spyOnProperty": false, + "waits": false, + "waitsFor": false, + "xdescribe": false, + "xit": false + }, + "jest": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fdescribe": false, + "fit": false, + "it": false, + "jest": false, + "pit": false, + "require": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false + }, + "qunit": { + "asyncTest": false, + "deepEqual": false, + "equal": false, + "expect": false, + "module": false, + "notDeepEqual": false, + "notEqual": false, + "notOk": false, + "notPropEqual": false, + "notStrictEqual": false, + "ok": false, + "propEqual": false, + "QUnit": false, + "raises": false, + "start": false, + "stop": false, + "strictEqual": false, + "test": false, + "throws": false + }, + "phantomjs": { + "console": true, + "exports": true, + "phantom": true, + "require": true, + "WebPage": true + }, + "couch": { + "emit": false, + "exports": false, + "getRow": false, + "log": false, + "module": false, + "provides": false, + "require": false, + "respond": false, + "send": false, + "start": false, + "sum": false + }, + "rhino": { + "defineClass": false, + "deserialize": false, + "gc": false, + "help": false, + "importClass": false, + "importPackage": false, + "java": false, + "load": false, + "loadClass": false, + "Packages": false, + "print": false, + "quit": false, + "readFile": false, + "readUrl": false, + "runCommand": false, + "seal": false, + "serialize": false, + "spawn": false, + "sync": false, + "toint32": false, + "version": false + }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "java": false, + "Java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, + "wsh": { + "ActiveXObject": true, + "CollectGarbage": true, + "Debug": true, + "Enumerator": true, + "GetObject": true, + "RuntimeObject": true, + "ScriptEngine": true, + "ScriptEngineBuildVersion": true, + "ScriptEngineMajorVersion": true, + "ScriptEngineMinorVersion": true, + "VBArray": true, + "WScript": true, + "WSH": true, + "XDomainRequest": true + }, + "jquery": { + "$": false, + "jQuery": false + }, + "yui": { + "YAHOO": false, + "YAHOO_config": false, + "YUI": false, + "YUI_config": false + }, + "shelljs": { + "cat": false, + "cd": false, + "chmod": false, + "config": false, + "cp": false, + "dirs": false, + "echo": false, + "env": false, + "error": false, + "exec": false, + "exit": false, + "find": false, + "grep": false, + "ln": false, + "ls": false, + "mkdir": false, + "mv": false, + "popd": false, + "pushd": false, + "pwd": false, + "rm": false, + "sed": false, + "set": false, + "target": false, + "tempdir": false, + "test": false, + "touch": false, + "which": false + }, + "prototypejs": { + "$": false, + "$$": false, + "$A": false, + "$break": false, + "$continue": false, + "$F": false, + "$H": false, + "$R": false, + "$w": false, + "Abstract": false, + "Ajax": false, + "Autocompleter": false, + "Builder": false, + "Class": false, + "Control": false, + "Draggable": false, + "Draggables": false, + "Droppables": false, + "Effect": false, + "Element": false, + "Enumerable": false, + "Event": false, + "Field": false, + "Form": false, + "Hash": false, + "Insertion": false, + "ObjectRange": false, + "PeriodicalExecuter": false, + "Position": false, + "Prototype": false, + "Scriptaculous": false, + "Selector": false, + "Sortable": false, + "SortableObserver": false, + "Sound": false, + "Template": false, + "Toggle": false, + "Try": false + }, + "meteor": { + "_": false, + "$": false, + "Accounts": false, + "AccountsClient": false, + "AccountsCommon": false, + "AccountsServer": false, + "App": false, + "Assets": false, + "Blaze": false, + "check": false, + "Cordova": false, + "DDP": false, + "DDPRateLimiter": false, + "DDPServer": false, + "Deps": false, + "EJSON": false, + "Email": false, + "HTTP": false, + "Log": false, + "Match": false, + "Meteor": false, + "Mongo": false, + "MongoInternals": false, + "Npm": false, + "Package": false, + "Plugin": false, + "process": false, + "Random": false, + "ReactiveDict": false, + "ReactiveVar": false, + "Router": false, + "ServiceConfiguration": false, + "Session": false, + "share": false, + "Spacebars": false, + "Template": false, + "Tinytest": false, + "Tracker": false, + "UI": false, + "Utils": false, + "WebApp": false, + "WebAppInternals": false + }, + "mongo": { + "_isWindows": false, + "_rand": false, + "BulkWriteResult": false, + "cat": false, + "cd": false, + "connect": false, + "db": false, + "getHostName": false, + "getMemInfo": false, + "hostname": false, + "ISODate": false, + "listFiles": false, + "load": false, + "ls": false, + "md5sumFile": false, + "mkdir": false, + "Mongo": false, + "NumberInt": false, + "NumberLong": false, + "ObjectId": false, + "PlanCache": false, + "print": false, + "printjson": false, + "pwd": false, + "quit": false, + "removeFile": false, + "rs": false, + "sh": false, + "UUID": false, + "version": false, + "WriteResult": false + }, + "applescript": { + "$": false, + "Application": false, + "Automation": false, + "console": false, + "delay": false, + "Library": false, + "ObjC": false, + "ObjectSpecifier": false, + "Path": false, + "Progress": false, + "Ref": false + }, + "serviceworker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "clearInterval": false, + "clearTimeout": false, + "Client": false, + "clients": false, + "Clients": false, + "close": true, + "console": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "fetch": false, + "FetchEvent": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": false, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onfetch": true, + "oninstall": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onnotificationclick": true, + "onnotificationclose": true, + "onoffline": true, + "ononline": true, + "onpush": true, + "onpushsubscriptionchange": true, + "onrejectionhandled": true, + "onsync": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "registration": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerMessageEvent": false, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "skipWaiting": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "WindowClient": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + }, + "atomtest": { + "advanceClock": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findAll": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "resumeTest": false, + "triggerEvent": false, + "visit": false, + "wait": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "by": false, + "By": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "shared-node-browser": { + "clearInterval": false, + "clearTimeout": false, + "console": false, + "setInterval": false, + "setTimeout": false, + "URL": false, + "URLSearchParams": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "greasemonkey": { + "cloneInto": false, + "createObjectIn": false, + "exportFunction": false, + "GM": false, + "GM_addStyle": false, + "GM_deleteValue": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false + }, + "devtools": { + "$": false, + "$_": false, + "$$": false, + "$0": false, + "$1": false, + "$2": false, + "$3": false, + "$4": false, + "$x": false, + "chrome": false, + "clear": false, + "copy": false, + "debug": false, + "dir": false, + "dirxml": false, + "getEventListeners": false, + "inspect": false, + "keys": false, + "monitor": false, + "monitorEvents": false, + "profile": false, + "profileEnd": false, + "queryObjects": false, + "table": false, + "undebug": false, + "unmonitor": false, + "unmonitorEvents": false, + "values": false + } +} diff --git a/node_modules/globals/index.d.ts b/node_modules/globals/index.d.ts new file mode 100644 index 0000000..a842e4c --- /dev/null +++ b/node_modules/globals/index.d.ts @@ -0,0 +1,6 @@ +import {ReadonlyDeep} from 'type-fest'; +import globalsJson = require('./globals.json'); + +declare const globals: ReadonlyDeep; + +export = globals; diff --git a/node_modules/globals/index.js b/node_modules/globals/index.js new file mode 100644 index 0000000..a951582 --- /dev/null +++ b/node_modules/globals/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./globals.json'); diff --git a/node_modules/globals/license b/node_modules/globals/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/globals/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/globals/package.json b/node_modules/globals/package.json new file mode 100644 index 0000000..5898900 --- /dev/null +++ b/node_modules/globals/package.json @@ -0,0 +1,85 @@ +{ + "_from": "globals@^12.1.0", + "_id": "globals@12.4.0", + "_inBundle": false, + "_integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "_location": "/globals", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "globals@^12.1.0", + "name": "globals", + "escapedName": "globals", + "rawSpec": "^12.1.0", + "saveSpec": null, + "fetchSpec": "^12.1.0" + }, + "_requiredBy": [ + "/@eslint/eslintrc", + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "_shasum": "a18813576a41b00a24a97e7f815918c2e19925f8", + "_spec": "globals@^12.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/globals/issues" + }, + "bundleDependencies": false, + "dependencies": { + "type-fest": "^0.8.1" + }, + "deprecated": false, + "description": "Global identifiers from different JavaScript environments", + "devDependencies": { + "ava": "^2.2.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "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" + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + }, + "version": "12.4.0", + "xo": { + "ignores": [ + "get-browser-globals.js" + ] + } +} diff --git a/node_modules/globals/readme.md b/node_modules/globals/readme.md new file mode 100644 index 0000000..fdcfa08 --- /dev/null +++ b/node_modules/globals/readme.md @@ -0,0 +1,56 @@ +# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals) + +> Global identifiers from different JavaScript environments + +Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. + +It's just a [JSON file](globals.json), so use it in whatever environment you like. + +**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + +## Install + +``` +$ npm install globals +``` + +## Usage + +```js +const globals = require('globals'); + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + … +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + +For Node.js this package provides two sets of globals: + +- `globals.nodeBuiltin`: Globals available to all code running in Node.js. + These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`. + See: https://nodejs.org/api/globals.html +- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope"). + See: https://nodejs.org/api/modules.html#modules_the_module_scope + +When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..9d2c803 --- /dev/null +++ b/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..5273a50 --- /dev/null +++ b/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000..028356c --- /dev/null +++ b/node_modules/graceful-fs/clone.js @@ -0,0 +1,19 @@ +'use strict' + +module.exports = clone + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..de3df47 --- /dev/null +++ b/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,354 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + retry() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + retry() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) +} + +function retry () { + var elem = fs[gracefulQueue].shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000..d617b50 --- /dev/null +++ b/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..4e42268 --- /dev/null +++ b/node_modules/graceful-fs/package.json @@ -0,0 +1,79 @@ +{ + "_from": "graceful-fs@^4.1.2", + "_id": "graceful-fs@4.2.4", + "_inBundle": false, + "_integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "_location": "/graceful-fs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "graceful-fs@^4.1.2", + "name": "graceful-fs", + "escapedName": "graceful-fs", + "rawSpec": "^4.1.2", + "saveSpec": null, + "fetchSpec": "^4.1.2" + }, + "_requiredBy": [ + "/load-json-file" + ], + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "_shasum": "2256bde14d3632958c465ebc96dc467ca07a29fb", + "_spec": "graceful-fs@^4.1.2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/load-json-file", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A drop-in replacement for fs, making various improvements.", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^12.7.0" + }, + "directories": { + "test": "test" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "main": "graceful-fs.js", + "name": "graceful-fs", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "scripts": { + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "node test.js | tap -" + }, + "version": "4.2.4" +} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..a5808d2 --- /dev/null +++ b/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,342 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + read.__proto__ = fs$read + return read + })(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/node_modules/has-flag/index.js b/node_modules/has-flag/index.js new file mode 100644 index 0000000..5139728 --- /dev/null +++ b/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; diff --git a/node_modules/has-flag/license b/node_modules/has-flag/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/has-flag/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/has-flag/package.json b/node_modules/has-flag/package.json new file mode 100644 index 0000000..08e08d3 --- /dev/null +++ b/node_modules/has-flag/package.json @@ -0,0 +1,76 @@ +{ + "_from": "has-flag@^3.0.0", + "_id": "has-flag@3.0.0", + "_inBundle": false, + "_integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "_location": "/has-flag", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-flag@^3.0.0", + "name": "has-flag", + "escapedName": "has-flag", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/supports-color" + ], + "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "_shasum": "b5d454dc2199ae225699f3467e5a07f3b955bafd", + "_spec": "has-flag@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/supports-color", + "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" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-flag#readme", + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "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" +} diff --git a/node_modules/has-flag/readme.md b/node_modules/has-flag/readme.md new file mode 100644 index 0000000..677893c --- /dev/null +++ b/node_modules/has-flag/readme.md @@ -0,0 +1,70 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + + +## Install + +``` +$ npm install has-flag +``` + + +## Usage + +```js +// foo.js +const hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js -f --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean for whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `string[]`
+Default: `process.argv` + +CLI arguments. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/has-symbols/.eslintrc b/node_modules/has-symbols/.eslintrc new file mode 100644 index 0000000..2d9a66a --- /dev/null +++ b/node_modules/has-symbols/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "multiline-comment-style": 0, + } +} diff --git a/node_modules/has-symbols/.github/FUNDING.yml b/node_modules/has-symbols/.github/FUNDING.yml new file mode 100644 index 0000000..04cf87e --- /dev/null +++ b/node_modules/has-symbols/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/has-symbols +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/has-symbols/.github/workflows/rebase.yml b/node_modules/has-symbols/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/has-symbols/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/has-symbols/.travis.yml b/node_modules/has-symbols/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/has-symbols/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/has-symbols/CHANGELOG.md b/node_modules/has-symbols/CHANGELOG.md new file mode 100644 index 0000000..4dcac04 --- /dev/null +++ b/node_modules/has-symbols/CHANGELOG.md @@ -0,0 +1,34 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-17 + +### Commits + +- [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229) +- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b) +- [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c) +- [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91) +- [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4) +- Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193) +- [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0) +- [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0) + +## v1.0.0 - 2016-09-19 + +### Commits + +- Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d) +- package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a) +- Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c) +- Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb) +- read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c) diff --git a/node_modules/has-symbols/LICENSE b/node_modules/has-symbols/LICENSE new file mode 100644 index 0000000..df31cbf --- /dev/null +++ b/node_modules/has-symbols/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/has-symbols/README.md b/node_modules/has-symbols/README.md new file mode 100644 index 0000000..b27b31a --- /dev/null +++ b/node_modules/has-symbols/README.md @@ -0,0 +1,45 @@ +# has-symbols [![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] + +Determine if the JS environment has Symbol support. Supports spec, or shams. + +## Example + +```js +var hasSymbols = require('has-symbols'); + +hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. + +var hasSymbolsKinda = require('has-symbols/shams'); +hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. +``` + +## Supported Symbol shams + - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) + - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/has-symbols +[2]: http://versionbadg.es/ljharb/has-symbols.svg +[3]: https://travis-ci.org/ljharb/has-symbols.svg +[4]: https://travis-ci.org/ljharb/has-symbols +[5]: https://david-dm.org/ljharb/has-symbols.svg +[6]: https://david-dm.org/ljharb/has-symbols +[7]: https://david-dm.org/ljharb/has-symbols/dev-status.svg +[8]: https://david-dm.org/ljharb/has-symbols#info=devDependencies +[9]: https://ci.testling.com/ljharb/has-symbols.png +[10]: https://ci.testling.com/ljharb/has-symbols +[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/has-symbols.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/has-symbols.svg +[downloads-url]: http://npm-stat.com/charts.html?package=has-symbols diff --git a/node_modules/has-symbols/index.js b/node_modules/has-symbols/index.js new file mode 100644 index 0000000..f72159e --- /dev/null +++ b/node_modules/has-symbols/index.js @@ -0,0 +1,13 @@ +'use strict'; + +var origSymbol = global.Symbol; +var hasSymbolSham = require('./shams'); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; diff --git a/node_modules/has-symbols/package.json b/node_modules/has-symbols/package.json new file mode 100644 index 0000000..d41a887 --- /dev/null +++ b/node_modules/has-symbols/package.json @@ -0,0 +1,127 @@ +{ + "_from": "has-symbols@^1.0.1", + "_id": "has-symbols@1.0.1", + "_inBundle": false, + "_integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "_location": "/has-symbols", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-symbols@^1.0.1", + "name": "has-symbols", + "escapedName": "has-symbols", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/is-regex", + "/is-symbol", + "/object.assign", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "_shasum": "9f5214758a44196c406d9bd76cebf81ec2dd31e8", + "_spec": "has-symbols@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/object.assign", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/ljharb/has-symbols/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Determine if the JS environment has Symbol support. Supports spec, or shams.", + "devDependencies": { + "@ljharb/eslint-config": "^15.0.1", + "auto-changelog": "^1.16.2", + "core-js": "^2.6.10", + "eslint": "^6.6.0", + "get-own-property-symbols": "^0.9.4", + "safe-publish-latest": "^1.1.4", + "tape": "^4.11.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/has-symbols#readme", + "keywords": [ + "Symbol", + "symbols", + "typeof", + "sham", + "polyfill", + "native", + "core-js", + "ES6" + ], + "license": "MIT", + "main": "index.js", + "name": "has-symbols", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/has-symbols.git" + }, + "scripts": { + "lint": "eslint *.js", + "posttest": "npx aud", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run --silent lint", + "test": "npm run --silent tests-only", + "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", + "test:shams:corejs": "node test/shams/core-js.js", + "test:shams:getownpropertysymbols": "node test/shams/get-own-property-symbols.js", + "test:staging": "node --harmony --es-staging test", + "test:stock": "node test", + "tests-only": "npm run --silent test:stock && npm run --silent test:staging && npm run --silent test:shams", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.0.1" +} diff --git a/node_modules/has-symbols/shams.js b/node_modules/has-symbols/shams.js new file mode 100644 index 0000000..9f80f79 --- /dev/null +++ b/node_modules/has-symbols/shams.js @@ -0,0 +1,42 @@ +'use strict'; + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; diff --git a/node_modules/has-symbols/test/index.js b/node_modules/has-symbols/test/index.js new file mode 100644 index 0000000..fc32aff --- /dev/null +++ b/node_modules/has-symbols/test/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('../'); +var runSymbolTests = require('./tests'); + +test('interface', function (t) { + t.equal(typeof hasSymbols, 'function', 'is a function'); + t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean'); + t.end(); +}); + +test('Symbols are supported', { skip: !hasSymbols() }, function (t) { + runSymbolTests(t); + t.end(); +}); + +test('Symbols are not supported', { skip: hasSymbols() }, function (t) { + t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined'); + t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist'); + t.end(); +}); diff --git a/node_modules/has-symbols/test/shams/core-js.js b/node_modules/has-symbols/test/shams/core-js.js new file mode 100644 index 0000000..df5365c --- /dev/null +++ b/node_modules/has-symbols/test/shams/core-js.js @@ -0,0 +1,28 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + return; +} + +var hasSymbols = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); + require('core-js/fn/symbol'); + require('core-js/fn/symbol/to-string-tag'); + + require('../tests')(t); + + var hasSymbolsAfter = hasSymbols(); + t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/node_modules/has-symbols/test/shams/get-own-property-symbols.js b/node_modules/has-symbols/test/shams/get-own-property-symbols.js new file mode 100644 index 0000000..9191b24 --- /dev/null +++ b/node_modules/has-symbols/test/shams/get-own-property-symbols.js @@ -0,0 +1,28 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + return; +} + +var hasSymbols = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); + + require('get-own-property-symbols'); + + require('../tests')(t); + + var hasSymbolsAfter = hasSymbols(); + t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/node_modules/has-symbols/test/tests.js b/node_modules/has-symbols/test/tests.js new file mode 100644 index 0000000..93ff0ea --- /dev/null +++ b/node_modules/has-symbols/test/tests.js @@ -0,0 +1,54 @@ +'use strict'; + +module.exports = function runSymbolTests(t) { + t.equal(typeof Symbol, 'function', 'global Symbol is a function'); + + if (typeof Symbol !== 'function') { return false }; + + t.notEqual(Symbol(), Symbol(), 'two symbols are not equal'); + + /* + t.equal( + Symbol.prototype.toString.call(Symbol('foo')), + Symbol.prototype.toString.call(Symbol('foo')), + 'two symbols with the same description stringify the same' + ); + */ + + var foo = Symbol('foo'); + + /* + t.notEqual( + String(foo), + String(Symbol('bar')), + 'two symbols with different descriptions do not stringify the same' + ); + */ + + t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function'); + // t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol'); + + t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function'); + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + t.notEqual(typeof sym, 'string', 'Symbol is not a string'); + t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly'); + t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly'); + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { t.fail('symbol property key was found in for..in of object'); } + + t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object'); + t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object'); + t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable'); + t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), { + configurable: true, + enumerable: true, + value: 42, + writable: true + }, 'property descriptor is correct'); +}; diff --git a/node_modules/has/LICENSE-MIT b/node_modules/has/LICENSE-MIT new file mode 100644 index 0000000..ae7014d --- /dev/null +++ b/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/node_modules/has/README.md b/node_modules/has/README.md new file mode 100644 index 0000000..635e3a4 --- /dev/null +++ b/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/node_modules/has/package.json b/node_modules/has/package.json new file mode 100644 index 0000000..ddf1904 --- /dev/null +++ b/node_modules/has/package.json @@ -0,0 +1,82 @@ +{ + "_from": "has@^1.0.3", + "_id": "has@1.0.3", + "_inBundle": false, + "_integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "_location": "/has", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has@^1.0.3", + "name": "has", + "escapedName": "has", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/eslint-plugin-import", + "/object.entries", + "/object.entries/es-abstract", + "/object.values", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "_shasum": "722d7cbfc1f6aa8241f16dd814e011e1f41e8796", + "_spec": "has@^1.0.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Thiago de Arruda", + "email": "tpadilha84@gmail.com" + }, + "bugs": { + "url": "https://github.com/tarruda/has/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "function-bind": "^1.1.1" + }, + "deprecated": false, + "description": "Object.prototype.hasOwnProperty.call shortcut", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "eslint": "^4.19.1", + "tape": "^4.9.0" + }, + "engines": { + "node": ">= 0.4.0" + }, + "homepage": "https://github.com/tarruda/has", + "license": "MIT", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" + } + ], + "main": "./src", + "name": "has", + "repository": { + "type": "git", + "url": "git://github.com/tarruda/has.git" + }, + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "tape test" + }, + "version": "1.0.3" +} diff --git a/node_modules/has/src/index.js b/node_modules/has/src/index.js new file mode 100644 index 0000000..dd92dd9 --- /dev/null +++ b/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/node_modules/has/test/index.js b/node_modules/has/test/index.js new file mode 100644 index 0000000..43d480b --- /dev/null +++ b/node_modules/has/test/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var test = require('tape'); +var has = require('../'); + +test('has', function (t) { + t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); + t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); + t.end(); +}); diff --git a/node_modules/hosted-git-info/CHANGELOG.md b/node_modules/hosted-git-info/CHANGELOG.md new file mode 100644 index 0000000..4f86601 --- /dev/null +++ b/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,141 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [2.8.8](https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8) (2020-02-29) + + +### Bug Fixes + +* [#61](https://github.com/npm/hosted-git-info/issues/61) & [#65](https://github.com/npm/hosted-git-info/issues/65) addressing issues w/ url.URL implmentation which regressed node 6 support ([5038b18](https://github.com/npm/hosted-git-info/commit/5038b18)), closes [#66](https://github.com/npm/hosted-git-info/issues/66) + + + + +## [2.8.7](https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7) (2020-02-26) + + +### Bug Fixes + +* Do not attempt to use url.URL when unavailable ([2d0bb66](https://github.com/npm/hosted-git-info/commit/2d0bb66)), closes [#61](https://github.com/npm/hosted-git-info/issues/61) [#62](https://github.com/npm/hosted-git-info/issues/62) +* Do not pass scp-style URLs to the WhatWG url.URL ([f2cdfcf](https://github.com/npm/hosted-git-info/commit/f2cdfcf)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) + + + + +## [2.8.6](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6) (2020-02-25) + + + + +## [2.8.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07) + + +### Bug Fixes + +* updated pathmatch for gitlab ([e8325b5](https://github.com/npm/hosted-git-info/commit/e8325b5)), closes [#51](https://github.com/npm/hosted-git-info/issues/51) +* updated pathmatch for gitlab ([ffe056f](https://github.com/npm/hosted-git-info/commit/ffe056f)) + + + + +## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) + + + + +## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12) + + + + +## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05) + + +### Bug Fixes + +* http protocol use sshurl by default ([3b1d629](https://github.com/npm/hosted-git-info/commit/3b1d629)), closes [#48](https://github.com/npm/hosted-git-info/issues/48) + + + + +## [2.8.1](https://github.com/npm/hosted-git-info/compare/v2.8.0...v2.8.1) (2019-08-05) + + +### Bug Fixes + +* ignore noCommittish on tarball url generation ([5d4a8d7](https://github.com/npm/hosted-git-info/commit/5d4a8d7)) +* use gist tarball url that works for anonymous gists ([1692435](https://github.com/npm/hosted-git-info/commit/1692435)) + + + + +# [2.8.0](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.0) (2019-08-05) + + +### Bug Fixes + +* Allow slashes in gitlab project section ([bbcf7b2](https://github.com/npm/hosted-git-info/commit/bbcf7b2)), closes [#46](https://github.com/npm/hosted-git-info/issues/46) [#43](https://github.com/npm/hosted-git-info/issues/43) +* **git-host:** disallow URI-encoded slash (%2F) in `path` ([3776fa5](https://github.com/npm/hosted-git-info/commit/3776fa5)), closes [#44](https://github.com/npm/hosted-git-info/issues/44) +* **gitlab:** Do not URL encode slashes in project name for GitLab https URL ([cbf04f9](https://github.com/npm/hosted-git-info/commit/cbf04f9)), closes [#47](https://github.com/npm/hosted-git-info/issues/47) +* do not allow invalid gist urls ([d5cf830](https://github.com/npm/hosted-git-info/commit/d5cf830)) +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([e518222](https://github.com/npm/hosted-git-info/commit/e518222)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### Features + +* give these objects a name ([60abaea](https://github.com/npm/hosted-git-info/commit/60abaea)) + + + + +## [2.7.1](https://github.com/npm/hosted-git-info/compare/v2.7.0...v2.7.1) (2018-07-07) + + +### Bug Fixes + +* **index:** Guard against non-string types ([5bc580d](https://github.com/npm/hosted-git-info/commit/5bc580d)) +* **parse:** Crash on strings that parse to having no host ([c931482](https://github.com/npm/hosted-git-info/commit/c931482)), closes [#35](https://github.com/npm/hosted-git-info/issues/35) + + + + +# [2.7.0](https://github.com/npm/hosted-git-info/compare/v2.6.1...v2.7.0) (2018-07-06) + + +### Bug Fixes + +* **github tarball:** update github tarballtemplate ([6efd582](https://github.com/npm/hosted-git-info/commit/6efd582)), closes [#34](https://github.com/npm/hosted-git-info/issues/34) +* **gitlab docs:** switched to lowercase anchors for readmes ([701bcd1](https://github.com/npm/hosted-git-info/commit/701bcd1)) + + +### Features + +* **all:** Support www. prefixes on hostnames ([3349575](https://github.com/npm/hosted-git-info/commit/3349575)), closes [#32](https://github.com/npm/hosted-git-info/issues/32) + + + + +## [2.6.1](https://github.com/npm/hosted-git-info/compare/v2.6.0...v2.6.1) (2018-06-25) + +### Bug Fixes + +* **Revert:** "compat: remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25))" ([cce5a62](https://github.com/npm/hosted-git-info/commit/cce5a62)) +* **Revert:** "git-host: fix forgotten extend()" ([a815ec9](https://github.com/npm/hosted-git-info/commit/a815ec9)) + + + + +# [2.6.0](https://github.com/npm/hosted-git-info/compare/v2.5.0...v2.6.0) (2018-03-07) + + +### Bug Fixes + +* **compat:** remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25)) ([627ab55](https://github.com/npm/hosted-git-info/commit/627ab55)) +* **git-host:** fix forgotten extend() ([eba1f7b](https://github.com/npm/hosted-git-info/commit/eba1f7b)) + + +### Features + +* **browse:** fragment support for browse() ([#28](https://github.com/npm/hosted-git-info/issues/28)) ([cd5e5bb](https://github.com/npm/hosted-git-info/commit/cd5e5bb)) diff --git a/node_modules/hosted-git-info/LICENSE b/node_modules/hosted-git-info/LICENSE new file mode 100644 index 0000000..4505576 --- /dev/null +++ b/node_modules/hosted-git-info/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/hosted-git-info/README.md b/node_modules/hosted-git-info/README.md new file mode 100644 index 0000000..7b723f6 --- /dev/null +++ b/node_modules/hosted-git-info/README.md @@ -0,0 +1,133 @@ +# hosted-git-info + +This will let you identify and transform various git hosts URLs between +protocols. It also can tell you what the URL is for the raw path for +particular file for direct access without git. + +## Example + +```javascript +var hostedGitInfo = require("hosted-git-info") +var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) +/* info looks like: +{ + type: "github", + domain: "github.com", + user: "npm", + project: "hosted-git-info" +} +*/ +``` + +If the URL can't be matched with a git host, `null` will be returned. We +can match git, ssh and https urls. Additionally, we can match ssh connect +strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, +`github:npm/hosted-git-info`). Github specifically, is detected in the case +of a third, unprefixed, form: `npm/hosted-git-info`. + +If it does match, the returned object has properties of: + +* info.type -- The short name of the service +* info.domain -- The domain for git protocol use +* info.user -- The name of the user/org on the git host +* info.project -- The name of the project on the git host + +## Version Contract + +The major version will be bumped any time… + +* The constructor stops accepting URLs that it previously accepted. +* A method is removed. +* A method can no longer accept the number and type of arguments it previously accepted. +* A method can return a different type than it currently returns. + +Implications: + +* I do not consider the specific format of the urls returned from, say + `.https()` to be a part of the contract. The contract is that it will + return a string that can be used to fetch the repo via HTTPS. But what + that string looks like, specifically, can change. +* Dropping support for a hosted git provider would constitute a breaking + change. + +## Usage + +### var info = hostedGitInfo.fromUrl(gitSpecifier[, options]) + +* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one. +* *options* is an optional object. It can have the following properties: + * *noCommittish* — If true then committishes won't be included in generated URLs. + * *noGitPlus* — If true then `git+` won't be prefixed on URLs. + +## Methods + +All of the methods take the same options as the `fromUrl` factory. Options +provided to a method override those provided to the constructor. + +* info.file(path, opts) + +Given the path of a file relative to the repository, returns a URL for +directly fetching it from the githost. If no committish was set then +`master` will be used as the default. + +For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` +would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` + +* info.shortcut(opts) + +eg, `github:npm/hosted-git-info` + +* info.browse(path, fragment, opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/REAMDE.md#supported-hosts` + +* info.bugs(opts) + +eg, `https://github.com/npm/hosted-git-info/issues` + +* info.docs(opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` + +* info.https(opts) + +eg, `git+https://github.com/npm/hosted-git-info.git` + +* info.sshurl(opts) + +eg, `git+ssh://git@github.com/npm/hosted-git-info.git` + +* info.ssh(opts) + +eg, `git@github.com:npm/hosted-git-info.git` + +* info.path(opts) + +eg, `npm/hosted-git-info` + +* info.tarball(opts) + +eg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz` + +* info.getDefaultRepresentation() + +Returns the default output type. The default output type is based on the +string you passed in to be parsed + +* info.toString(opts) + +Uses the getDefaultRepresentation to call one of the other methods to get a URL for +this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give +you a normalized version of the URL that still uses the same protocol. + +Shortcuts will still be returned as shortcuts, but the special case github +form of `org/project` will be normalized to `github:org/project`. + +SSH connect strings will be normalized into `git+ssh` URLs. + +## Supported hosts + +Currently this supports Github, Bitbucket and Gitlab. Pull requests for +additional hosts welcome. diff --git a/node_modules/hosted-git-info/git-host-info.js b/node_modules/hosted-git-info/git-host-info.js new file mode 100644 index 0000000..8147e33 --- /dev/null +++ b/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,79 @@ +'use strict' + +var gitHosts = module.exports = { + github: { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'github.com', + 'treepath': 'tree', + 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', + 'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}' + }, + bitbucket: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'bitbucket.org', + 'treepath': 'src', + 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' + }, + gitlab: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gitlab.com', + 'treepath': 'tree', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}', + 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}', + 'pathmatch': /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ + }, + gist: { + 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gist.github.com', + 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/, + 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', + 'bugstemplate': 'https://{domain}/{project}', + 'gittemplate': 'git://{domain}/{project}.git{#committish}', + 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{project}{/committish}', + 'browsefiletemplate': 'https://{domain}/{project}{/committish}{#path}', + 'docstemplate': 'https://{domain}/{project}{/committish}', + 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', + 'shortcuttemplate': '{type}:{project}{#committish}', + 'pathtemplate': '{project}{#committish}', + 'tarballtemplate': 'https://codeload.github.com/gist/{project}/tar.gz/{committish}', + 'hashformat': function (fragment) { + return 'file-' + formatHashFragment(fragment) + } + } +} + +var gitHostDefaults = { + 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', + 'browsefiletemplate': 'https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}', + 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', + 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', + 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', + 'shortcuttemplate': '{type}:{user}/{project}{#committish}', + 'pathtemplate': '{user}/{project}{#committish}', + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/, + 'hashformat': formatHashFragment +} + +Object.keys(gitHosts).forEach(function (name) { + Object.keys(gitHostDefaults).forEach(function (key) { + if (gitHosts[name][key]) return + gitHosts[name][key] = gitHostDefaults[key] + }) + gitHosts[name].protocols_re = RegExp('^(' + + gitHosts[name].protocols.map(function (protocol) { + return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') + }).join('|') + '):$') +}) + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} diff --git a/node_modules/hosted-git-info/git-host.js b/node_modules/hosted-git-info/git-host.js new file mode 100644 index 0000000..9616fba --- /dev/null +++ b/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,156 @@ +'use strict' +var gitHosts = require('./git-host-info.js') +/* eslint-disable node/no-deprecated-api */ + +// copy-pasta util._extend from node's source, to avoid pulling +// the whole util module into peoples' webpack bundles. +/* istanbul ignore next */ +var extend = Object.assign || function _extend (target, source) { + // Don't do anything if source isn't an object + if (source === null || typeof source !== 'object') return target + + var keys = Object.keys(source) + var i = keys.length + while (i--) { + target[keys[i]] = source[keys[i]] + } + return target +} + +module.exports = GitHost +function GitHost (type, user, auth, project, committish, defaultRepresentation, opts) { + var gitHostInfo = this + gitHostInfo.type = type + Object.keys(gitHosts[type]).forEach(function (key) { + gitHostInfo[key] = gitHosts[type][key] + }) + gitHostInfo.user = user + gitHostInfo.auth = auth + gitHostInfo.project = project + gitHostInfo.committish = committish + gitHostInfo.default = defaultRepresentation + gitHostInfo.opts = opts || {} +} + +GitHost.prototype.hash = function () { + return this.committish ? '#' + this.committish : '' +} + +GitHost.prototype._fill = function (template, opts) { + if (!template) return + var vars = extend({}, opts) + vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : '' + opts = extend(extend({}, this.opts), opts) + var self = this + Object.keys(this).forEach(function (key) { + if (self[key] != null && vars[key] == null) vars[key] = self[key] + }) + var rawAuth = vars.auth + var rawcommittish = vars.committish + var rawFragment = vars.fragment + var rawPath = vars.path + var rawProject = vars.project + Object.keys(vars).forEach(function (key) { + var value = vars[key] + if ((key === 'path' || key === 'project') && typeof value === 'string') { + vars[key] = value.split('/').map(function (pathComponent) { + return encodeURIComponent(pathComponent) + }).join('/') + } else { + vars[key] = encodeURIComponent(value) + } + }) + vars['auth@'] = rawAuth ? rawAuth + '@' : '' + vars['#fragment'] = rawFragment ? '#' + this.hashformat(rawFragment) : '' + vars.fragment = vars.fragment ? vars.fragment : '' + vars['#path'] = rawPath ? '#' + this.hashformat(rawPath) : '' + vars['/path'] = vars.path ? '/' + vars.path : '' + vars.projectPath = rawProject.split('/').map(encodeURIComponent).join('/') + if (opts.noCommittish) { + vars['#committish'] = '' + vars['/tree/committish'] = '' + vars['/committish'] = '' + vars.committish = '' + } else { + vars['#committish'] = rawcommittish ? '#' + rawcommittish : '' + vars['/tree/committish'] = vars.committish + ? '/' + vars.treepath + '/' + vars.committish + : '' + vars['/committish'] = vars.committish ? '/' + vars.committish : '' + vars.committish = vars.committish || 'master' + } + var res = template + Object.keys(vars).forEach(function (key) { + res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) + }) + if (opts.noGitPlus) { + return res.replace(/^git[+]/, '') + } else { + return res + } +} + +GitHost.prototype.ssh = function (opts) { + return this._fill(this.sshtemplate, opts) +} + +GitHost.prototype.sshurl = function (opts) { + return this._fill(this.sshurltemplate, opts) +} + +GitHost.prototype.browse = function (P, F, opts) { + if (typeof P === 'string') { + if (typeof F !== 'string') { + opts = F + F = null + } + return this._fill(this.browsefiletemplate, extend({ + fragment: F, + path: P + }, opts)) + } else { + return this._fill(this.browsetemplate, P) + } +} + +GitHost.prototype.docs = function (opts) { + return this._fill(this.docstemplate, opts) +} + +GitHost.prototype.bugs = function (opts) { + return this._fill(this.bugstemplate, opts) +} + +GitHost.prototype.https = function (opts) { + return this._fill(this.httpstemplate, opts) +} + +GitHost.prototype.git = function (opts) { + return this._fill(this.gittemplate, opts) +} + +GitHost.prototype.shortcut = function (opts) { + return this._fill(this.shortcuttemplate, opts) +} + +GitHost.prototype.path = function (opts) { + return this._fill(this.pathtemplate, opts) +} + +GitHost.prototype.tarball = function (opts_) { + var opts = extend({}, opts_, { noCommittish: false }) + return this._fill(this.tarballtemplate, opts) +} + +GitHost.prototype.file = function (P, opts) { + return this._fill(this.filetemplate, extend({ path: P }, opts)) +} + +GitHost.prototype.getDefaultRepresentation = function () { + return this.default +} + +GitHost.prototype.toString = function (opts) { + if (this.default && typeof this[this.default] === 'function') return this[this.default](opts) + return this.sshurl(opts) +} diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/index.js new file mode 100644 index 0000000..21e53fe --- /dev/null +++ b/node_modules/hosted-git-info/index.js @@ -0,0 +1,148 @@ +'use strict' +var url = require('url') +var gitHosts = require('./git-host-info.js') +var GitHost = module.exports = require('./git-host.js') + +var protocolToRepresentationMap = { + 'git+ssh:': 'sshurl', + 'git+https:': 'https', + 'ssh:': 'sshurl', + 'git:': 'git' +} + +function protocolToRepresentation (protocol) { + return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) +} + +var authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +var cache = {} + +module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') return + var key = giturl + JSON.stringify(opts || {}) + + if (!(key in cache)) { + cache[key] = fromUrl(giturl, opts) + } + + return cache[key] +} + +function fromUrl (giturl, opts) { + if (giturl == null || giturl === '') return + var url = fixupUnqualifiedGist( + isGitHubShorthand(giturl) ? 'github:' + giturl : giturl + ) + var parsed = parseGitUrl(url) + var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) + var matches = Object.keys(gitHosts).map(function (gitHostName) { + try { + var gitHostInfo = gitHosts[gitHostName] + var auth = null + if (parsed.auth && authProtocols[parsed.protocol]) { + auth = parsed.auth + } + var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null + var user = null + var project = null + var defaultRepresentation = null + if (shortcutMatch && shortcutMatch[1] === gitHostName) { + user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) + project = decodeURIComponent(shortcutMatch[3]) + defaultRepresentation = 'shortcut' + } else { + if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return + if (!gitHostInfo.protocols_re.test(parsed.protocol)) return + if (!parsed.path) return + var pathmatch = gitHostInfo.pathmatch + var matched = parsed.path.match(pathmatch) + if (!matched) return + /* istanbul ignore else */ + if (matched[1] !== null && matched[1] !== undefined) { + user = decodeURIComponent(matched[1].replace(/^:/, '')) + } + project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) + } catch (ex) { + /* istanbul ignore else */ + if (ex instanceof URIError) { + } else throw ex + } + }).filter(function (gitHostInfo) { return gitHostInfo }) + if (matches.length !== 1) return + return matches[0] +} + +function isGitHubShorthand (arg) { + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) +} + +function fixupUnqualifiedGist (giturl) { + // necessary for round-tripping gists + var parsed = url.parse(giturl) + if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { + return parsed.protocol + '/' + parsed.host + } else { + return giturl + } +} + +function parseGitUrl (giturl) { + var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + if (!matched) { + var legacy = url.parse(giturl) + // If we don't have url.URL, then sorry, this is just not fixable. + // This affects Node <= 6.12. + if (legacy.auth && typeof url.URL === 'function') { + // git urls can be in the form of scp-style/ssh-connect strings, like + // git+ssh://user@host.com:some/path, which the legacy url parser + // supports, but WhatWG url.URL class does not. However, the legacy + // parser de-urlencodes the username and password, so something like + // https://user%3An%40me:p%40ss%3Aword@x.com/ becomes + // https://user:n@me:p@ss:word@x.com/ which is all kinds of wrong. + // Pull off just the auth and host, so we dont' get the confusing + // scp-style URL, then pass that to the WhatWG parser to get the + // auth properly escaped. + var authmatch = giturl.match(/[^@]+@[^:/]+/) + /* istanbul ignore else - this should be impossible */ + if (authmatch) { + var whatwg = new url.URL(authmatch[0]) + legacy.auth = whatwg.username || '' + if (whatwg.password) legacy.auth += ':' + whatwg.password + } + } + return legacy + } + return { + protocol: 'git+ssh:', + slashes: true, + auth: matched[1], + host: matched[2], + port: null, + hostname: matched[2], + hash: matched[4], + search: null, + query: null, + pathname: '/' + matched[3], + path: '/' + matched[3], + href: 'git+ssh://' + matched[1] + '@' + matched[2] + + '/' + matched[3] + (matched[4] || '') + } +} diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json new file mode 100644 index 0000000..b3e1699 --- /dev/null +++ b/node_modules/hosted-git-info/package.json @@ -0,0 +1,69 @@ +{ + "_from": "hosted-git-info@^2.1.4", + "_id": "hosted-git-info@2.8.8", + "_inBundle": false, + "_integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "_location": "/hosted-git-info", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "hosted-git-info@^2.1.4", + "name": "hosted-git-info", + "escapedName": "hosted-git-info", + "rawSpec": "^2.1.4", + "saveSpec": null, + "fetchSpec": "^2.1.4" + }, + "_requiredBy": [ + "/normalize-package-data" + ], + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "_shasum": "7539bd4bc1e0e0a895815a2e0262420b12858488", + "_spec": "hosted-git-info@^2.1.4", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/normalize-package-data", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/npm/hosted-git-info/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^12.7.0" + }, + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ], + "homepage": "https://github.com/npm/hosted-git-info", + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" + ], + "license": "ISC", + "main": "index.js", + "name": "hosted-git-info", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/hosted-git-info.git" + }, + "scripts": { + "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", + "posttest": "standard", + "prerelease": "npm t", + "release": "standard-version -s", + "test": "tap -J --coverage=90 --no-esm test/*.js", + "test:coverage": "tap --coverage-report=html -J --coverage=90 --no-esm test/*.js" + }, + "version": "2.8.8" +} diff --git a/node_modules/ignore/CHANGELOG.md b/node_modules/ignore/CHANGELOG.md new file mode 100644 index 0000000..2b25013 --- /dev/null +++ b/node_modules/ignore/CHANGELOG.md @@ -0,0 +1,19 @@ +# `node-ignore` 4 ChangeLog + +# 4.x + +## 2018-06-22, Version 4.0.0 + +- **SEMVER-MAJOR**: Drop support for node < 6 by default. +- **FEATURE**: supports the missing character ranges and sets, such as `*.[a-z]` and `*.[jJ][pP][gG]` +- **FEATURE**: new option: `ignorecase` to make `ignore` case sensitive. +- **FEATURE**: supports question mark which matches a single character. +- **PATCH**: fixes typescript declaration. + +## ~ 2018-08-09, Version 4.0.1 - 4.0.5 + +- **PATCH**: updates README.md about frequent asked quesions from github issues. + +## 2018-08-12, Version 4.0.6 + +- **PATCH**: `Object.prototype` methods will not ruin the result any more. diff --git a/node_modules/ignore/LICENSE-MIT b/node_modules/ignore/LICENSE-MIT new file mode 100755 index 0000000..825533e --- /dev/null +++ b/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/ignore/README.md b/node_modules/ignore/README.md new file mode 100755 index 0000000..c4d8230 --- /dev/null +++ b/node_modules/ignore/README.md @@ -0,0 +1,307 @@ + + + + + + + + + + + + + +
LinuxOS XWindowsCoverageDownloads
+ + Build Status + + + Windows Build Status + + + Coverage Status + + + npm module downloads per month +
+ +# ignore + +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). + +Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. + +##### Tested on + +- Linux + Node: `0.8` - `7.x` +- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +Actually, `ignore` does not rely on any versions of node specially. + +Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). + +## Table Of Main Contents + +- [Usage](#usage) +- [`Pathname` Conventions](#pathname-conventions) +- [Guide for 2.x -> 3.x](#upgrade-2x---3x) +- [Guide for 3.x -> 4.x](#upgrade-3x---4x) +- See Also: + - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. + +## Usage + +```js +import ignore from 'ignore' +const ig = ignore().add(['.abc/*', '!.abc/d/']) +``` + +### Filter the given paths + +```js +const paths = [ + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] + +ig.filter(paths) // ['.abc/d/e.js'] +ig.ignores('.abc/a.js') // true +``` + +### As the filter function + +```js +paths.filter(ig.createFilter()); // ['.abc/d/e.js'] +``` + +### Win32 paths will be handled + +```js +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] +``` + +## Why another ignore? + +- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. + +- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so + - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. + - `ignore` don't cares about sub-modules of git projects. + +- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - Prevent re-including a file if a parent directory of that file is excluded. + - Handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` + - All test cases are verified with the result of `git check-ignore`. + +# Methods + +## .add(pattern: string | Ignore): this +## .add(patterns: Array): this + +- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance +- **patterns** `Array` Array of ignore patterns. + +Adds a rule or several rules to the current manager. + +Returns `this` + +Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. + +```js +ignore().add('#abc').ignores('#abc') // false +ignore().add('\#abc').ignores('#abc') // true +``` + +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: + +```js +ignore() +.add(fs.readFileSync(filenameOfGitignore).toString()) +.filter(filenames) +``` + +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +## .addIgnoreFile(path) + +REMOVED in `3.x` for now. + +To upgrade `ignore@2.x` up to `3.x`, use + +```js +import fs from 'fs' + +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` + +instead. + +## .filter(paths: Array): Array + +```ts +type Pathname = string +``` + +Filters the given array of pathnames, and returns the filtered array. + +- **paths** `Array.` The array of `pathname`s to be filtered. + +### `Pathname` Conventions: + +#### 1. `Pathname` should be a `path.relative()`d pathname + +`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. + +```js +// WRONG +ig.ignores('./abc') + +// WRONG, for it will never happen. +// If the gitignore rule locates at the root directory, +// `'/abc'` should be changed to `'abc'`. +// ``` +// path.relative('/', '/abc') -> 'abc' +// ``` +ig.ignores('/abc') + +// Right +ig.ignores('abc') + +// Right +ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' +``` + +In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. + +Suppose the dir structure is: + +``` +/path/to/your/repo + |-- a + | |-- a.js + | + |-- .b + | + |-- .c + |-- .DS_store +``` + +Then the `paths` might be like this: + +```js +[ + 'a/a.js' + '.b', + '.c/.DS_store' +] +``` + +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: + +```js +import glob from 'glob' + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + let filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) +``` + +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so for the example below: + +```js +ig.add('config/') + +// `ig` does NOT know if 'config' is a normal file, directory or something +ig.ignores('config') // And it returns `false` + +ig.ignores('config/') // returns `true` +``` + +Specially for people who develop some library based on `node-ignore`, it is important to understand that. + +## .ignores(pathname: Pathname): boolean + +> new in 3.2.0 + +Returns `Boolean` whether `pathname` should be ignored. + +```js +ig.ignores('.abc/a.js') // true +``` + +## .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +## `options.ignorecase` since 4.0.0 + +Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (default value), otherwise case sensitive. + +```js +const ig = ignore({ + ignorecase: false +}) + +ig.add('*.png') + +ig.ignores('*.PNG') // false +``` + +**** + +# Upgrade Guide + +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + +## Upgrade 3.x -> 4.x + +Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: + +```js +var ignore = require('ignore/legacy') +``` + +**** + +# Collaborators + +- [@whitecolor](https://github.com/whitecolor) *Alex* +- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [@azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [@JanMattner](https://github.com/JanMattner) *Jan Mattner* +- [@ntwb](https://github.com/ntwb) *Stephen Edgar* +- [@kasperisager](https://github.com/kasperisager) *Kasper Isager* +- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* diff --git a/node_modules/ignore/index.d.ts b/node_modules/ignore/index.d.ts new file mode 100644 index 0000000..be9d5f8 --- /dev/null +++ b/node_modules/ignore/index.d.ts @@ -0,0 +1,45 @@ +interface Ignore { + /** + * Adds a rule rules to the current manager. + * @param {string | Ignore} pattern + * @returns IgnoreBase + */ + add(pattern: string | Ignore): Ignore + /** + * Adds several rules to the current manager. + * @param {string[]} patterns + * @returns IgnoreBase + */ + add(patterns: (string | Ignore)[]): Ignore + + /** + * Filters the given array of pathnames, and returns the filtered array. + * NOTICE that each path here should be a relative path to the root of your repository. + * @param paths the array of paths to be filtered. + * @returns The filtered array of paths + */ + filter(paths: string[]): string[] + /** + * Creates a filter function which could filter + * an array of paths with Array.prototype.filter. + */ + createFilter(): (path: string) => boolean + + /** + * Returns Boolean whether pathname should be ignored. + * @param {string} pathname a path to check + * @returns boolean + */ + ignores(pathname: string): boolean +} + +interface Options { + ignorecase?: boolean +} + +/** + * Creates new ignore manager. + */ +declare function ignore(options?: Options): Ignore + +export default ignore diff --git a/node_modules/ignore/index.js b/node_modules/ignore/index.js new file mode 100755 index 0000000..62c5cf7 --- /dev/null +++ b/node_modules/ignore/index.js @@ -0,0 +1,463 @@ +// A simple implementation of make-array +function make_array (subject) { + return Array.isArray(subject) + ? subject + : [subject] +} + +const REGEX_BLANK_LINE = /^\s+$/ +const REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_LEADING_EXCAPED_HASH = /^\\#/ +const SLASH = '/' +const KEY_IGNORE = typeof Symbol !== 'undefined' + ? Symbol.for('node-ignore') + /* istanbul ignore next */ + : 'node-ignore' + +const define = (object, key, value) => + Object.defineProperty(object, key, {value}) + +const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +const sanitizeRange = range => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) + ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : '' +) + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +const DEFAULT_REPLACER_PREFIX = [ + + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a \ ) -> (a ) + /\\?\s+$/, + match => match.indexOf('\\') === 0 + ? ' ' + : '' + ], + + // replace (\ ) with ' ' + [ + /\\\s/g, + () => ' ' + ], + + // Escape metacharacters + // which is written down by users but means special for regular expressions. + + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\^$.|*+(){]/g, + match => `\\${match}` + ], + + [ + // > [abc] matches any character inside the brackets + // > (in this case a, b, or c); + /\[([^\]/]*)($|\])/g, + (match, p1, p2) => p2 === ']' + ? `[${sanitizeRange(p1)}]` + : `\\${match}` + ], + + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => '[^/]' + ], + + // leading slash + [ + + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => '^' + ], + + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => '\\/' + ], + + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + + // '**/foo' <-> 'foo' + () => '^(?:.*\\/)?' + ] +] + +const DEFAULT_REPLACER_SUFFIX = [ + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer () { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^' + } + ], + + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + + // Check if it is not the last `'/**'` + (match, index, str) => index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+' + ], + + // intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip this rule + /(^|[^\\]+)\\\*(?=.+)/g, + + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (match, p1) => `${p1}[^\\/]*` + ], + + // trailing wildcard + [ + /(\^|\\\/)?\\\*$/, + (match, p1) => { + const prefix = p1 + // '\^': + // '/*' does not match '' + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + } + ], + + [ + // unescape + /\\\\\\/g, + () => '\\' + ] +] + +const POSITIVE_REPLACERS = [ + ...DEFAULT_REPLACER_PREFIX, + + // 'f' + // matches + // - /f(end) + // - /f/ + // - (start)f(end) + // - (start)f/ + // doesn't match + // - oof + // - foo + // pseudo: + // -> (^|/)f(/|$) + + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*/])$/, + + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + match => `${match}(?=$|\\/)` + ], + + ...DEFAULT_REPLACER_SUFFIX +] + +const NEGATIVE_REPLACERS = [ + ...DEFAULT_REPLACER_PREFIX, + + // #24, #38 + // The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) + // A negative pattern without a trailing wildcard should not + // re-include the things inside that directory. + + // eg: + // ['node_modules/*', '!node_modules'] + // should ignore `node_modules/a.js` + [ + /(?:[^*])$/, + match => `${match}(?=$|\\/$)` + ], + + ...DEFAULT_REPLACER_SUFFIX +] + +// A simple cache, because an ignore rule only has only one certain meaning +const cache = Object.create(null) + +// @param {pattern} +const make_regex = (pattern, negative, ignorecase) => { + const r = cache[pattern] + if (r) { + return r + } + + const replacers = negative + ? NEGATIVE_REPLACERS + : POSITIVE_REPLACERS + + const source = replacers.reduce( + (prev, current) => prev.replace(current[0], current[1].bind(pattern)), + pattern + ) + + return cache[pattern] = ignorecase + ? new RegExp(source, 'i') + : new RegExp(source) +} + +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern + && typeof pattern === 'string' + && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0 + +const createRule = (pattern, ignorecase) => { + const origin = pattern + let negative = false + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true + pattern = pattern.substr(1) + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#') + + const regex = make_regex(pattern, negative, ignorecase) + + return { + origin, + pattern, + negative, + regex + } +} + +class IgnoreBase { + constructor ({ + ignorecase = true + } = {}) { + this._rules = [] + this._ignorecase = ignorecase + define(this, KEY_IGNORE, true) + this._initCache() + } + + _initCache () { + this._cache = Object.create(null) + } + + // @param {Array.|string|Ignore} pattern + add (pattern) { + this._added = false + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g) + } + + make_array(pattern).forEach(this._addPattern, this) + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache() + } + + return this + } + + // legacy + addPattern (pattern) { + return this.add(pattern) + } + + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } + + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignorecase) + this._added = true + this._rules.push(rule) + } + } + + filter (paths) { + return make_array(paths).filter(path => this._filter(path)) + } + + createFilter () { + return path => this._filter(path) + } + + ignores (path) { + return !this._filter(path) + } + + // @returns `Boolean` true if the `path` is NOT ignored + _filter (path, slices) { + if (!path) { + return false + } + + if (path in this._cache) { + return this._cache[path] + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH) + } + + slices.pop() + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) + && this._test(path) + + // Or only test the path + : this._test(path) + } + + // @returns {Boolean} true if a file is NOT ignored + _test (path) { + // Explicitly define variable type by setting matched to `0` + let matched = 0 + + this._rules.forEach(rule => { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path) + } + }) + + return !matched + } +} + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( + // Detect `process` so that it can run in browsers. + typeof process !== 'undefined' + && ( + process.env && process.env.IGNORE_TEST_WIN32 + || process.platform === 'win32' + ) +) { + const filter = IgnoreBase.prototype._filter + + /* eslint no-control-regex: "off" */ + const make_posix = str => /^\\\\\?\\/.test(str) + || /[^\x00-\x80]+/.test(str) + ? str + : str.replace(/\\/g, '/') + + IgnoreBase.prototype._filter = function filterWin32 (path, slices) { + path = make_posix(path) + return filter.call(this, path, slices) + } +} + +module.exports = options => new IgnoreBase(options) diff --git a/node_modules/ignore/legacy.js b/node_modules/ignore/legacy.js new file mode 100644 index 0000000..14f377d --- /dev/null +++ b/node_modules/ignore/legacy.js @@ -0,0 +1,466 @@ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// A simple implementation of make-array +function make_array(subject) { + return Array.isArray(subject) ? subject : [subject]; +} + +var REGEX_BLANK_LINE = /^\s+$/; +var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_LEADING_EXCAPED_HASH = /^\\#/; +var SLASH = '/'; +var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') +/* istanbul ignore next */ +: 'node-ignore'; + +var define = function define(object, key, value) { + return Object.defineProperty(object, key, { value }); +}; + +var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +var sanitizeRange = function sanitizeRange(range) { + return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) { + return from.charCodeAt(0) <= to.charCodeAt(0) ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : ''; + }); +}; + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +var DEFAULT_REPLACER_PREFIX = [ + +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a \ ) -> (a ) +/\\?\s+$/, function (match) { + return match.indexOf('\\') === 0 ? ' ' : ''; +}], + +// replace (\ ) with ' ' +[/\\\s/g, function () { + return ' '; +}], + +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\^$.|*+(){]/g, function (match) { + return `\\${match}`; +}], [ +// > [abc] matches any character inside the brackets +// > (in this case a, b, or c); +/\[([^\]/]*)($|\])/g, function (match, p1, p2) { + return p2 === ']' ? `[${sanitizeRange(p1)}]` : `\\${match}`; +}], [ +// > a question mark (?) matches a single character +/(?!\\)\?/g, function () { + return '[^/]'; +}], + +// leading slash +[ + +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], + +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly +// > under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, + +// '**/foo' <-> 'foo' +function () { + return '^(?:.*\\/)?'; +}]]; + +var DEFAULT_REPLACER_SUFFIX = [ +// starting +[ +// there will be no leading '/' +// (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^^])/, function startingReplacer() { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^'; +}], + +// two globstars +[ +// Use lookahead assertions so that we could match more than one `'/**'` +/\\\/\\\*\\\*(?=\\\/|$)/g, + +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer + +// Check if it is not the last `'/**'` +function (match, index, str) { + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], + +// intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule +/(^|[^\\]+)\\\*(?=.+)/g, + +// '*.js' matches '.js' +// '*.js' doesn't match 'abc' +function (match, p1) { + return `${p1}[^\\/]*`; +}], + +// trailing wildcard +[/(\^|\\\/)?\\\*$/, function (match, p1) { + var prefix = p1 + // '\^': + // '/*' does not match '' + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + + return `${prefix}(?=$|\\/$)`; +}], [ +// unescape +/\\\\\\/g, function () { + return '\\'; +}]]; + +var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ + +// 'f' +// matches +// - /f(end) +// - /f/ +// - (start)f(end) +// - (start)f/ +// doesn't match +// - oof +// - foo +// pseudo: +// -> (^|/)f(/|$) + +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*/])$/, + +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return `${match}(?=$|\\/)`; +}]], DEFAULT_REPLACER_SUFFIX); + +var NEGATIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ + +// #24, #38 +// The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) +// A negative pattern without a trailing wildcard should not +// re-include the things inside that directory. + +// eg: +// ['node_modules/*', '!node_modules'] +// should ignore `node_modules/a.js` +[/(?:[^*])$/, function (match) { + return `${match}(?=$|\\/$)`; +}]], DEFAULT_REPLACER_SUFFIX); + +// A simple cache, because an ignore rule only has only one certain meaning +var cache = Object.create(null); + +// @param {pattern} +var make_regex = function make_regex(pattern, negative, ignorecase) { + var r = cache[pattern]; + if (r) { + return r; + } + + var replacers = negative ? NEGATIVE_REPLACERS : POSITIVE_REPLACERS; + + var source = replacers.reduce(function (prev, current) { + return prev.replace(current[0], current[1].bind(pattern)); + }, pattern); + + return cache[pattern] = ignorecase ? new RegExp(source, 'i') : new RegExp(source); +}; + +// > A blank line matches no files, so it can serve as a separator for readability. +var checkPattern = function checkPattern(pattern) { + return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; +}; + +var createRule = function createRule(pattern, ignorecase) { + var origin = pattern; + var negative = false; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true; + pattern = pattern.substr(1); + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#'); + + var regex = make_regex(pattern, negative, ignorecase); + + return { + origin, + pattern, + negative, + regex + }; +}; + +var IgnoreBase = function () { + function IgnoreBase() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$ignorecase = _ref.ignorecase, + ignorecase = _ref$ignorecase === undefined ? true : _ref$ignorecase; + + _classCallCheck(this, IgnoreBase); + + this._rules = []; + this._ignorecase = ignorecase; + define(this, KEY_IGNORE, true); + this._initCache(); + } + + _createClass(IgnoreBase, [{ + key: '_initCache', + value: function _initCache() { + this._cache = Object.create(null); + } + + // @param {Array.|string|Ignore} pattern + + }, { + key: 'add', + value: function add(pattern) { + this._added = false; + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g); + } + + make_array(pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + + return this; + } + + // legacy + + }, { + key: 'addPattern', + value: function addPattern(pattern) { + return this.add(pattern); + } + }, { + key: '_addPattern', + value: function _addPattern(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + + if (checkPattern(pattern)) { + var rule = createRule(pattern, this._ignorecase); + this._added = true; + this._rules.push(rule); + } + } + }, { + key: 'filter', + value: function filter(paths) { + var _this = this; + + return make_array(paths).filter(function (path) { + return _this._filter(path); + }); + } + }, { + key: 'createFilter', + value: function createFilter() { + var _this2 = this; + + return function (path) { + return _this2._filter(path); + }; + } + }, { + key: 'ignores', + value: function ignores(path) { + return !this._filter(path); + } + + // @returns `Boolean` true if the `path` is NOT ignored + + }, { + key: '_filter', + value: function _filter(path, slices) { + if (!path) { + return false; + } + + if (path in this._cache) { + return this._cache[path]; + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + } + + slices.pop(); + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) + + // Or only test the path + : this._test(path); + } + + // @returns {Boolean} true if a file is NOT ignored + + }, { + key: '_test', + value: function _test(path) { + // Explicitly define variable type by setting matched to `0` + var matched = 0; + + this._rules.forEach(function (rule) { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path); + } + }); + + return !matched; + } + }]); + + return IgnoreBase; +}(); + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ + + +if ( +// Detect `process` so that it can run in browsers. +typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { + var filter = IgnoreBase.prototype._filter; + + /* eslint no-control-regex: "off" */ + var make_posix = function make_posix(str) { + return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') + ); + }; + + IgnoreBase.prototype._filter = function filterWin32(path, slices) { + path = make_posix(path); + return filter.call(this, path, slices); + }; +} + +module.exports = function (options) { + return new IgnoreBase(options); +}; diff --git a/node_modules/ignore/package.json b/node_modules/ignore/package.json new file mode 100644 index 0000000..3934e40 --- /dev/null +++ b/node_modules/ignore/package.json @@ -0,0 +1,93 @@ +{ + "_from": "ignore@^4.0.6", + "_id": "ignore@4.0.6", + "_inBundle": false, + "_integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "_location": "/ignore", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ignore@^4.0.6", + "name": "ignore", + "escapedName": "ignore", + "rawSpec": "^4.0.6", + "saveSpec": null, + "fetchSpec": "^4.0.6" + }, + "_requiredBy": [ + "/@eslint/eslintrc", + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "_shasum": "750e3db5862087b4737ebac8207ffd1ef27b25fc", + "_spec": "ignore@^4.0.6", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "kael" + }, + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Ignore is a manager and filter for .gitignore rules.", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.7.0", + "codecov": "^3.0.4", + "eslint": "^5.3.0", + "eslint-config-ostai": "^1.3.2", + "eslint-plugin-import": "^2.13.0", + "mkdirp": "^0.5.1", + "pre-suf": "^1.1.0", + "rimraf": "^2.6.2", + "spawn-sync": "^2.0.0", + "tap": "^12.0.1", + "tmp": "0.0.33", + "typescript": "^3.0.1" + }, + "engines": { + "node": ">= 4" + }, + "files": [ + "legacy.js", + "index.js", + "index.d.ts", + "LICENSE-MIT" + ], + "homepage": "https://github.com/kaelzhang/node-ignore#readme", + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "fnmatch", + "glob", + "asterisks", + "regular-expression" + ], + "license": "MIT", + "name": "ignore", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" + }, + "scripts": { + "build": "babel -o legacy.js index.js", + "posttest": "tap --coverage-report=html && codecov", + "prepublish": "npm run build", + "test": "npm run test-no-cov", + "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", + "test:git": "tap test/git-check-ignore.js", + "test:ignore": "tap test/ignore.js --coverage", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts" + }, + "version": "4.0.6" +} diff --git a/node_modules/import-fresh/index.d.ts b/node_modules/import-fresh/index.d.ts new file mode 100644 index 0000000..708737b --- /dev/null +++ b/node_modules/import-fresh/index.d.ts @@ -0,0 +1,28 @@ +/** +Import a module while bypassing the cache. + +@example +``` +// foo.js +let i = 0; +module.exports = () => ++i; + +// index.js +import importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 +``` +*/ +declare function importFresh(moduleId: string): unknown; + +export = importFresh; diff --git a/node_modules/import-fresh/index.js b/node_modules/import-fresh/index.js new file mode 100644 index 0000000..425ed98 --- /dev/null +++ b/node_modules/import-fresh/index.js @@ -0,0 +1,32 @@ +'use strict'; +const path = require('path'); +const resolveFrom = require('resolve-from'); +const parentModule = require('parent-module'); + +module.exports = moduleId => { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } + + const parentPath = parentModule(__filename); + + const filePath = resolveFrom(path.dirname(parentPath), moduleId); + + const oldModule = require.cache[filePath]; + // Delete itself from module parent + if (oldModule && oldModule.parent) { + let i = oldModule.parent.children.length; + + while (i--) { + if (oldModule.parent.children[i].id === filePath) { + oldModule.parent.children.splice(i, 1); + } + } + } + + delete require.cache[filePath]; // Delete module from cache + + const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step + + return parent === undefined ? require(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require +}; diff --git a/node_modules/import-fresh/license b/node_modules/import-fresh/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/import-fresh/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/import-fresh/package.json b/node_modules/import-fresh/package.json new file mode 100644 index 0000000..c6d7fd8 --- /dev/null +++ b/node_modules/import-fresh/package.json @@ -0,0 +1,75 @@ +{ + "_from": "import-fresh@^3.0.0", + "_id": "import-fresh@3.2.1", + "_inBundle": false, + "_integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "_location": "/import-fresh", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "import-fresh@^3.0.0", + "name": "import-fresh", + "escapedName": "import-fresh", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/@eslint/eslintrc", + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "_shasum": "633ff618506e793af5ac91bf48b72677e15cbe66", + "_spec": "import-fresh@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/import-fresh/issues" + }, + "bundleDependencies": false, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "deprecated": false, + "description": "Import a module while bypassing the cache", + "devDependencies": { + "ava": "^1.0.1", + "heapdump": "^0.3.12", + "tsd": "^0.7.3", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/import-fresh#readme", + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "license": "MIT", + "name": "import-fresh", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/import-fresh.git" + }, + "scripts": { + "heapdump": "node heapdump.js", + "test": "xo && ava && tsd" + }, + "version": "3.2.1" +} diff --git a/node_modules/import-fresh/readme.md b/node_modules/import-fresh/readme.md new file mode 100644 index 0000000..0bfa1c9 --- /dev/null +++ b/node_modules/import-fresh/readme.md @@ -0,0 +1,52 @@ +# import-fresh [![Build Status](https://travis-ci.org/sindresorhus/import-fresh.svg?branch=master)](https://travis-ci.org/sindresorhus/import-fresh) + +> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching) + +Useful for testing purposes when you need to freshly import a module. + + +## Install + +``` +$ npm install import-fresh +``` + + +## Usage + +```js +// foo.js +let i = 0; +module.exports = () => ++i; +``` + +```js +const importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 +``` + + +## import-fresh for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of import-fresh and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-import-fresh?utm_source=npm-import-fresh&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily diff --git a/node_modules/imurmurhash/README.md b/node_modules/imurmurhash/README.md new file mode 100644 index 0000000..f35b20a --- /dev/null +++ b/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/imurmurhash/imurmurhash.js b/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 0000000..e63146a --- /dev/null +++ b/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/node_modules/imurmurhash/imurmurhash.min.js b/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 0000000..dc0ee88 --- /dev/null +++ b/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/node_modules/imurmurhash/package.json b/node_modules/imurmurhash/package.json new file mode 100644 index 0000000..3bddbd7 --- /dev/null +++ b/node_modules/imurmurhash/package.json @@ -0,0 +1,63 @@ +{ + "_from": "imurmurhash@^0.1.4", + "_id": "imurmurhash@0.1.4", + "_inBundle": false, + "_integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "_location": "/imurmurhash", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "imurmurhash@^0.1.4", + "name": "imurmurhash", + "escapedName": "imurmurhash", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_spec": "imurmurhash@^0.1.4", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "An incremental implementation of MurmurHash3", + "devDependencies": {}, + "engines": { + "node": ">=0.8.19" + }, + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "homepage": "https://github.com/jensyt/imurmurhash-js", + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "license": "MIT", + "main": "imurmurhash.js", + "name": "imurmurhash", + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "version": "0.1.4" +} diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md new file mode 100644 index 0000000..6dc8929 --- /dev/null +++ b/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js new file mode 100644 index 0000000..48202b3 --- /dev/null +++ b/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json new file mode 100644 index 0000000..8a84afc --- /dev/null +++ b/node_modules/inflight/package.json @@ -0,0 +1,58 @@ +{ + "_from": "inflight@^1.0.4", + "_id": "inflight@1.0.6", + "_inBundle": false, + "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "_location": "/inflight", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inflight@^1.0.4", + "name": "inflight", + "escapedName": "inflight", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "_spec": "inflight@^1.0.4", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "deprecated": false, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^7.1.2" + }, + "files": [ + "inflight.js" + ], + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "name": "inflight", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "scripts": { + "test": "tap test.js --100" + }, + "version": "1.0.6" +} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js new file mode 100644 index 0000000..f71f2d9 --- /dev/null +++ b/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..86bbb3d --- /dev/null +++ b/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json new file mode 100644 index 0000000..04cb288 --- /dev/null +++ b/node_modules/inherits/package.json @@ -0,0 +1,61 @@ +{ + "_from": "inherits@2", + "_id": "inherits@2.0.4", + "_inBundle": false, + "_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "_location": "/inherits", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inherits@2", + "name": "inherits", + "escapedName": "inherits", + "rawSpec": "2", + "saveSpec": null, + "fetchSpec": "2" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "_shasum": "0fa2c64f932917c3433a0ded55363aae37416b7c", + "_spec": "inherits@2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/glob", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "tap" + }, + "version": "2.0.4" +} diff --git a/node_modules/is-arrayish/.editorconfig b/node_modules/is-arrayish/.editorconfig new file mode 100644 index 0000000..4c017f8 --- /dev/null +++ b/node_modules/is-arrayish/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.coffee] +indent_style = space + +[{package.json,*.yml}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/node_modules/is-arrayish/.istanbul.yml b/node_modules/is-arrayish/.istanbul.yml new file mode 100644 index 0000000..19fbec3 --- /dev/null +++ b/node_modules/is-arrayish/.istanbul.yml @@ -0,0 +1,4 @@ +instrumentation: + excludes: + - test.js + - test/**/* diff --git a/node_modules/is-arrayish/.npmignore b/node_modules/is-arrayish/.npmignore new file mode 100644 index 0000000..8d5eacb --- /dev/null +++ b/node_modules/is-arrayish/.npmignore @@ -0,0 +1,5 @@ +/coverage/ +/test.js +/test/ +*.sw[a-p] +/node_modules/ diff --git a/node_modules/is-arrayish/.travis.yml b/node_modules/is-arrayish/.travis.yml new file mode 100644 index 0000000..5a04243 --- /dev/null +++ b/node_modules/is-arrayish/.travis.yml @@ -0,0 +1,17 @@ +language: node_js + +script: + - node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- --compilers coffee:coffee-script/register + - cat coverage/lcov.info | node_modules/.bin/coveralls +node_js: + - "0.10" + - "0.11" + - "0.12" + - "iojs" +os: + - linux + - osx + +notifications: + slack: + secure: oOt8QGzdrPDsTMcyahtIq5Q+0U1iwfgJgFCxBLsomQ0bpIMn+y5m4viJydA2UinHPGc944HS3LMZS9iKQyv+DjTgbhUyNXqeVjtxCwRe37f5rKQlXVvdfmjHk2kln4H8DcK3r5Qd/+2hd9BeMsp2GImTrkRSud1CZQlhhe5IgZOboSoWpGVMMy1iazWT06tAtiB2LRVhmsdUaFZDWAhGZ+UAvCPf+mnBOAylIj+U0GDrofhfTi25RK0gddG2f/p2M1HCu49O6wECGWkt2hVei233DkNJyLLLJVcvmhf+aXkV5TjMyaoxh/HdcV4DrA7KvYuWmWWKsINa9hlwAsdd/FYmJ6PjRkKWas2JoQ1C+qOzDxyQvn3CaUZFKD99pdsq0rBBZujqXQKZZ/hWb/CE74BI6fKmqQkiEPaD/7uADj04FEg6HVBZaMCyauOaK5b3VC97twbALZ1qVxYV6mU+zSEvnUbpnjjvRO0fSl9ZHA+rzkW73kX3GmHY0wAozEZbSy7QLuZlQ2QtHmBLr+APaGMdL1sFF9qFfzqKy0WDbSE0WS6hpAEJpTsjYmeBrnI8UmK3m++iEgyQPvZoH9LhUT+ek7XIfHZMe04BmC6wuO24/RfpmR6bQK9VMarFCYlBiWxg/z30vkP0KTpUi3o/cqFm7/Noxc0i2LVqM3E0Sy4= diff --git a/node_modules/is-arrayish/LICENSE b/node_modules/is-arrayish/LICENSE new file mode 100644 index 0000000..0a5f461 --- /dev/null +++ b/node_modules/is-arrayish/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 JD Ballard + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-arrayish/README.md b/node_modules/is-arrayish/README.md new file mode 100644 index 0000000..7d36072 --- /dev/null +++ b/node_modules/is-arrayish/README.md @@ -0,0 +1,16 @@ +# node-is-arrayish [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-is-arrayish.svg?style=flat-square)](https://travis-ci.org/Qix-/node-is-arrayish) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-is-arrayish.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-is-arrayish) +> Determines if an object can be used like an Array + +## Example +```javascript +var isArrayish = require('is-arrayish'); + +isArrayish([]); // true +isArrayish({__proto__: []}); // true +isArrayish({}); // false +isArrayish({length:10}); // false +``` + +## License +Licensed under the [MIT License](http://opensource.org/licenses/MIT). +You can find a copy of it in [LICENSE](LICENSE). diff --git a/node_modules/is-arrayish/index.js b/node_modules/is-arrayish/index.js new file mode 100644 index 0000000..5b97186 --- /dev/null +++ b/node_modules/is-arrayish/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function isArrayish(obj) { + if (!obj) { + return false; + } + + return obj instanceof Array || Array.isArray(obj) || + (obj.length >= 0 && obj.splice instanceof Function); +}; diff --git a/node_modules/is-arrayish/package.json b/node_modules/is-arrayish/package.json new file mode 100644 index 0000000..9f7f79f --- /dev/null +++ b/node_modules/is-arrayish/package.json @@ -0,0 +1,66 @@ +{ + "_from": "is-arrayish@^0.2.1", + "_id": "is-arrayish@0.2.1", + "_inBundle": false, + "_integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "_location": "/is-arrayish", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-arrayish@^0.2.1", + "name": "is-arrayish", + "escapedName": "is-arrayish", + "rawSpec": "^0.2.1", + "saveSpec": null, + "fetchSpec": "^0.2.1" + }, + "_requiredBy": [ + "/error-ex" + ], + "_resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "_shasum": "77c99840527aa8ecb1a8ba697b80645a7a926a9d", + "_spec": "is-arrayish@^0.2.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/error-ex", + "author": { + "name": "Qix", + "url": "http://github.com/qix-" + }, + "bugs": { + "url": "https://github.com/qix-/node-is-arrayish/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Determines if an object can be used as an array", + "devDependencies": { + "coffee-script": "^1.9.3", + "coveralls": "^2.11.2", + "istanbul": "^0.3.17", + "mocha": "^2.2.5", + "should": "^7.0.1", + "xo": "^0.6.1" + }, + "homepage": "https://github.com/qix-/node-is-arrayish#readme", + "keywords": [ + "is", + "array", + "duck", + "type", + "arrayish", + "similar", + "proto", + "prototype", + "type" + ], + "license": "MIT", + "name": "is-arrayish", + "repository": { + "type": "git", + "url": "git+https://github.com/qix-/node-is-arrayish.git" + }, + "scripts": { + "pretest": "xo", + "test": "mocha --compilers coffee:coffee-script/register" + }, + "version": "0.2.1" +} diff --git a/node_modules/is-callable/.editorconfig b/node_modules/is-callable/.editorconfig new file mode 100644 index 0000000..4623631 --- /dev/null +++ b/node_modules/is-callable/.editorconfig @@ -0,0 +1,21 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 +max_line_length = off + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/is-callable/.eslintrc b/node_modules/is-callable/.eslintrc new file mode 100644 index 0000000..bd4525c --- /dev/null +++ b/node_modules/is-callable/.eslintrc @@ -0,0 +1,21 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-statements": [2, 12], + "max-statements-per-line": [2, { "max": 2 }], + "operator-linebreak": [2, "before"], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "no-throw-literal": 0, + }, + }, + ], +} diff --git a/node_modules/is-callable/.github/FUNDING.yml b/node_modules/is-callable/.github/FUNDING.yml new file mode 100644 index 0000000..0fdebd0 --- /dev/null +++ b/node_modules/is-callable/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/is-callable +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/is-callable/.github/main.workflow b/node_modules/is-callable/.github/main.workflow new file mode 100644 index 0000000..0494481 --- /dev/null +++ b/node_modules/is-callable/.github/main.workflow @@ -0,0 +1,14 @@ +workflow "Autorebase branch on merge commits" { + on = "push" + resolves = ["rebase"] +} + +workflow "Autorebase PR on merge commits" { + on = "pull_request" + resolves = ["rebase"] +} + + action "rebase" { + uses = "ljharb/rebase@latest" + secrets = ["GITHUB_TOKEN"] +} diff --git a/node_modules/is-callable/.github/workflows/rebase.yml b/node_modules/is-callable/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/is-callable/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/is-callable/.istanbul.yml b/node_modules/is-callable/.istanbul.yml new file mode 100644 index 0000000..9affe0b --- /dev/null +++ b/node_modules/is-callable/.istanbul.yml @@ -0,0 +1,47 @@ +verbose: false +instrumentation: + root: . + extensions: + - .js + - .jsx + default-excludes: true + excludes: [] + variable: __coverage__ + compact: true + preserve-comments: false + complete-copy: false + save-baseline: false + baseline-file: ./coverage/coverage-baseline.raw.json + include-all-sources: false + include-pid: false + es-modules: false + auto-wrap: false +reporting: + print: summary + reports: + - html + dir: ./coverage + summarizer: pkg + report-config: {} + watermarks: + statements: [50, 80] + functions: [50, 80] + branches: [50, 80] + lines: [50, 80] +hooks: + hook-run-in-context: false + post-require-hook: null + handle-sigint: false +check: + global: + statements: 100 + lines: 100 + branches: 100 + functions: 100 + excludes: [] + each: + statements: 100 + lines: 100 + branches: 100 + functions: 100 + excludes: [] diff --git a/node_modules/is-callable/.travis.yml b/node_modules/is-callable/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/is-callable/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/is-callable/CHANGELOG.md b/node_modules/is-callable/CHANGELOG.md new file mode 100644 index 0000000..8690a22 --- /dev/null +++ b/node_modules/is-callable/CHANGELOG.md @@ -0,0 +1,86 @@ +1.2.2 / 2020-09-21 +================= + * [Fix] include actual fix from 579179e + * [Dev Deps] update `eslint` + +1.2.1 / 2020-09-09 +================= + * [Fix] phantomjs‘ Reflect.apply does not throw properly on a bad array-like + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [meta] fix eclint error + +1.2.0 / 2020-06-02 +================= + * [New] use `Reflect.apply`‑based callability detection + * [readme] add install instructions (#55) + * [meta] only run `aud` on prod deps + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `make-arrow-function`, `make-generator-function`; add `aud`, `safe-publish-latest`, `make-async-function` + * [Tests] add tests for function proxies (#53, #25) + +1.1.5 / 2019-12-18 +================= + * [meta] remove unused Makefile and associated utilities + * [meta] add `funding` field; add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `tape`, `covert`, `rimraf` + * [Tests] use shared travis configs + * [Tests] use `eccheck` over `editorconfig-tools` + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + * [Tests] remove `jscs` + * [actions] add automatic rebasing / merge commit blocking + +1.1.4 / 2018-07-02 +================= + * [Fix] improve `class` and arrow function detection (#30, #31) + * [Tests] on all latest node minors; improve matrix + * [Dev Deps] update all dev deps + +1.1.3 / 2016-02-27 +================= + * [Fix] ensure “class “ doesn’t screw up “class” detection + * [Tests] up to `node` `v5.7`, `v4.3` + * [Dev Deps] update to `eslint` v2, `@ljharb/eslint-config`, `jscs` + +1.1.2 / 2016-01-15 +================= + * [Fix] Make sure comments don’t screw up “class” detection (#4) + * [Tests] up to `node` `v5.3` + * [Tests] Add `parallelshell`, run both `--es-staging` and stock tests at once + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Refactor] convert `isNonES6ClassFn` into `isES6ClassFn` + +1.1.1 / 2015-11-30 +================= + * [Fix] do not throw when a non-function has a function in its [[Prototype]] (#2) + * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `jscs`, `nsp`, `semver` + * [Tests] up to `node` `v5.1` + * [Tests] no longer allow node 0.8 to fail. + * [Tests] fix npm upgrades in older nodes + +1.1.0 / 2015-10-02 +================= + * [Fix] Some browsers report TypedArray constructors as `typeof object` + * [New] return false for "class" constructors, when possible. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `eslint`, `editorconfig-tools`, `nsp`, `tape`, `semver`, `jscs`, `covert`, `make-arrow-function` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + +1.0.4 / 2015-01-30 +================= + * If @@toStringTag is not present, use the old-school Object#toString test. + +1.0.3 / 2015-01-29 +================= + * Add tests to ensure arrow functions are callable. + * Refactor to aid optimization of non-try/catch code. + +1.0.2 / 2015-01-29 +================= + * Fix broken package.json + +1.0.1 / 2015-01-29 +================= + * Add early exit for typeof not "function" + +1.0.0 / 2015-01-29 +================= + * Initial release. diff --git a/node_modules/is-callable/LICENSE b/node_modules/is-callable/LICENSE new file mode 100644 index 0000000..b43df44 --- /dev/null +++ b/node_modules/is-callable/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/is-callable/README.md b/node_modules/is-callable/README.md new file mode 100644 index 0000000..b5c965c --- /dev/null +++ b/node_modules/is-callable/README.md @@ -0,0 +1,68 @@ +# is-callable [![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] + +[![browser support][9]][10] + +Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag. + +## Example + +```js +var isCallable = require('is-callable'); +var assert = require('assert'); + +assert.notOk(isCallable(undefined)); +assert.notOk(isCallable(null)); +assert.notOk(isCallable(false)); +assert.notOk(isCallable(true)); +assert.notOk(isCallable([])); +assert.notOk(isCallable({})); +assert.notOk(isCallable(/a/g)); +assert.notOk(isCallable(new RegExp('a', 'g'))); +assert.notOk(isCallable(new Date())); +assert.notOk(isCallable(42)); +assert.notOk(isCallable(NaN)); +assert.notOk(isCallable(Infinity)); +assert.notOk(isCallable(new Number(42))); +assert.notOk(isCallable('foo')); +assert.notOk(isCallable(Object('foo'))); + +assert.ok(isCallable(function () {})); +assert.ok(isCallable(function* () {})); +assert.ok(isCallable(x => x * x)); +``` + +## Install + +Install with + +``` +npm install is-callable +``` + +## Tests + +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-callable +[2]: http://versionbadg.es/ljharb/is-callable.svg +[3]: https://travis-ci.org/ljharb/is-callable.svg +[4]: https://travis-ci.org/ljharb/is-callable +[5]: https://david-dm.org/ljharb/is-callable.svg +[6]: https://david-dm.org/ljharb/is-callable +[7]: https://david-dm.org/ljharb/is-callable/dev-status.svg +[8]: https://david-dm.org/ljharb/is-callable#info=devDependencies +[9]: https://ci.testling.com/ljharb/is-callable.png +[10]: https://ci.testling.com/ljharb/is-callable +[11]: https://nodei.co/npm/is-callable.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/is-callable.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-callable.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-callable diff --git a/node_modules/is-callable/index.js b/node_modules/is-callable/index.js new file mode 100644 index 0000000..f1f6c44 --- /dev/null +++ b/node_modules/is-callable/index.js @@ -0,0 +1,70 @@ +'use strict'; + +var fnToStr = Function.prototype.toString; +var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; +var badArrayLike; +var isCallableMarker; +if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { + try { + badArrayLike = Object.defineProperty({}, 'length', { + get: function () { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + // eslint-disable-next-line no-throw-literal + reflectApply(function () { throw 42; }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } +} else { + reflectApply = null; +} + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +module.exports = reflectApply + ? function isCallable(value) { + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { return false; } + } + return !isES6ClassFn(value); + } + : function isCallable(value) { + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + return strClass === fnClass || strClass === genClass; + }; diff --git a/node_modules/is-callable/package.json b/node_modules/is-callable/package.json new file mode 100644 index 0000000..9651627 --- /dev/null +++ b/node_modules/is-callable/package.json @@ -0,0 +1,136 @@ +{ + "_from": "is-callable@^1.2.2", + "_id": "is-callable@1.2.2", + "_inBundle": false, + "_integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "_location": "/is-callable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-callable@^1.2.2", + "name": "is-callable", + "escapedName": "is-callable", + "rawSpec": "^1.2.2", + "saveSpec": null, + "fetchSpec": "^1.2.2" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/es-to-primitive", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "_shasum": "c7c6715cd22d4ddb48d3e19970223aceabb080d9", + "_spec": "is-callable@^1.2.2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "bugs": { + "url": "https://github.com/ljharb/is-callable/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.", + "devDependencies": { + "@ljharb/eslint-config": "^17.2.0", + "aud": "^1.1.2", + "covert": "^1.1.1", + "eclint": "^2.8.1", + "eslint": "^7.9.0", + "foreach": "^2.0.5", + "istanbul": "1.1.0-alpha.1", + "istanbul-merge": "^1.1.1", + "make-arrow-function": "^1.2.0", + "make-async-function": "^1.0.0", + "make-generator-function": "^2.0.0", + "rimraf": "^2.7.1", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "greenkeeper": { + "ignore": [ + "rimraf" + ] + }, + "homepage": "https://github.com/ljharb/is-callable#readme", + "keywords": [ + "Function", + "function", + "callable", + "generator", + "generator function", + "arrow", + "arrow function", + "ES6", + "toStringTag", + "@@toStringTag" + ], + "license": "MIT", + "main": "index.js", + "name": "is-callable", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/is-callable.git" + }, + "scripts": { + "coverage": "npm run --silent istanbul", + "covert": "covert test", + "covert:quiet": "covert test --quiet", + "istanbul": "npm run --silent istanbul:clean && npm run --silent istanbul:std && npm run --silent istanbul:harmony && npm run --silent istanbul:merge && istanbul check", + "istanbul:clean": "rimraf coverage coverage-std coverage-harmony", + "istanbul:harmony": "node --harmony ./node_modules/istanbul/lib/cli.js cover test --dir coverage-harmony", + "istanbul:merge": "istanbul-merge --out coverage/coverage.raw.json coverage-harmony/coverage.raw.json coverage-std/coverage.raw.json && istanbul report html", + "istanbul:std": "istanbul cover test --report html --dir coverage-std", + "lint": "eslint .", + "posttest": "npx aud --production", + "prelint": "eclint check *", + "prepublish": "safe-publish-latest", + "pretest": "npm run --silent lint", + "test": "npm run --silent tests-only", + "test:staging": "node --es-staging test", + "test:stock": "node test", + "tests-only": "npm run --silent test:stock && npm run --silent test:staging" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.2.2" +} diff --git a/node_modules/is-callable/test/index.js b/node_modules/is-callable/test/index.js new file mode 100644 index 0000000..d56366d --- /dev/null +++ b/node_modules/is-callable/test/index.js @@ -0,0 +1,190 @@ +'use strict'; + +/* globals Proxy */ +/* eslint no-magic-numbers: 1 */ + +var test = require('tape'); +var isCallable = require('../'); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; +var generators = require('make-generator-function')(); +var arrows = require('make-arrow-function').list(); +var asyncs = require('make-async-function').list(); +var weirdlyCommentedArrowFn; +try { + /* eslint-disable no-new-func */ + weirdlyCommentedArrowFn = Function('return cl/*/**/=>/**/ass - 1;')(); + /* eslint-enable no-new-func */ +} catch (e) { /**/ } +var forEach = require('foreach'); + +var noop = function () {}; +var classFake = function classFake() { }; // eslint-disable-line func-name-matching +var returnClass = function () { return ' class '; }; +var return3 = function () { return 3; }; +/* for coverage */ +noop(); +classFake(); +returnClass(); +return3(); +/* end for coverage */ + +var proxy; +if (typeof Proxy === 'function') { + try { + proxy = new Proxy(function () {}, {}); + // for coverage + proxy(); + String(proxy); + } catch (_) { + // If `Reflect` is supported, then `Function.prototype.toString` isn't used for callability detection. + if (typeof Reflect !== 'object') { + // Older engines throw a `TypeError` when `Function.prototype.toString` is called on a Proxy object. + proxy = null; + } + } +} + +var invokeFunction = function invokeFunctionString(str) { + var result; + try { + /* eslint-disable no-new-func */ + var fn = Function(str); + /* eslint-enable no-new-func */ + result = fn(); + } catch (e) {} + return result; +}; + +var classConstructor = invokeFunction('"use strict"; return class Foo {}'); + +var commentedClass = invokeFunction('"use strict"; return class/*kkk*/\n//blah\n Bar\n//blah\n {}'); +var commentedClassOneLine = invokeFunction('"use strict"; return class/**/A{}'); +var classAnonymous = invokeFunction('"use strict"; return class{}'); +var classAnonymousCommentedOneLine = invokeFunction('"use strict"; return class/*/*/{}'); + +test('not callables', function (t) { + t.test('non-number/string primitives', function (st) { + st.notOk(isCallable(), 'undefined is not callable'); + st.notOk(isCallable(null), 'null is not callable'); + st.notOk(isCallable(false), 'false is not callable'); + st.notOk(isCallable(true), 'true is not callable'); + st.end(); + }); + + t.notOk(isCallable([]), 'array is not callable'); + t.notOk(isCallable({}), 'object is not callable'); + t.notOk(isCallable(/a/g), 'regex literal is not callable'); + t.notOk(isCallable(new RegExp('a', 'g')), 'regex object is not callable'); + t.notOk(isCallable(new Date()), 'new Date() is not callable'); + + t.test('numbers', function (st) { + st.notOk(isCallable(42), 'number is not callable'); + st.notOk(isCallable(Object(42)), 'number object is not callable'); + st.notOk(isCallable(NaN), 'NaN is not callable'); + st.notOk(isCallable(Infinity), 'Infinity is not callable'); + st.end(); + }); + + t.test('strings', function (st) { + st.notOk(isCallable('foo'), 'string primitive is not callable'); + st.notOk(isCallable(Object('foo')), 'string object is not callable'); + st.end(); + }); + + t.test('non-function with function in its [[Prototype]] chain', function (st) { + var Foo = function Bar() {}; + Foo.prototype = noop; + st.equal(true, isCallable(Foo), 'sanity check: Foo is callable'); + st.equal(false, isCallable(new Foo()), 'instance of Foo is not callable'); + st.end(); + }); + + t.end(); +}); + +test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) { + var fakeFunction = { + toString: function () { return String(return3); }, + valueOf: return3 + }; + fakeFunction[Symbol.toStringTag] = 'Function'; + t.equal(String(fakeFunction), String(return3)); + t.equal(Number(fakeFunction), return3()); + t.notOk(isCallable(fakeFunction), 'fake Function with @@toStringTag "Function" is not callable'); + t.end(); +}); + +var typedArrayNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array' +]; + +test('Functions', function (t) { + t.ok(isCallable(noop), 'function is callable'); + t.ok(isCallable(classFake), 'function with name containing "class" is callable'); + t.ok(isCallable(returnClass), 'function with string " class " is callable'); + t.ok(isCallable(isCallable), 'isCallable is callable'); + t.end(); +}); + +test('Typed Arrays', function (st) { + forEach(typedArrayNames, function (typedArray) { + /* istanbul ignore if : covered in node 0.6 */ + if (typeof global[typedArray] === 'undefined') { + st.comment('# SKIP typed array "' + typedArray + '" not supported'); + } else { + st.ok(isCallable(global[typedArray]), typedArray + ' is callable'); + } + }); + st.end(); +}); + +test('Generators', { skip: generators.length === 0 }, function (t) { + forEach(generators, function (genFn) { + t.ok(isCallable(genFn), 'generator function ' + genFn + ' is callable'); + }); + t.end(); +}); + +test('Arrow functions', { skip: arrows.length === 0 }, function (t) { + forEach(arrows, function (arrowFn) { + t.ok(isCallable(arrowFn), 'arrow function ' + arrowFn + ' is callable'); + }); + t.ok(isCallable(weirdlyCommentedArrowFn), 'weirdly commented arrow functions are callable'); + t.end(); +}); + +test('"Class" constructors', { skip: !classConstructor || !commentedClass || !commentedClassOneLine || !classAnonymous }, function (t) { + t.notOk(isCallable(classConstructor), 'class constructors are not callable'); + t.notOk(isCallable(commentedClass), 'class constructors with comments in the signature are not callable'); + t.notOk(isCallable(commentedClassOneLine), 'one-line class constructors with comments in the signature are not callable'); + t.notOk(isCallable(classAnonymous), 'anonymous class constructors are not callable'); + t.notOk(isCallable(classAnonymousCommentedOneLine), 'anonymous one-line class constructors with comments in the signature are not callable'); + t.end(); +}); + +test('`async function`s', { skip: asyncs.length === 0 }, function (t) { + forEach(asyncs, function (asyncFn) { + t.ok(isCallable(asyncFn), '`async function` ' + asyncFn + ' is callable'); + }); + t.end(); +}); + +test('proxies of functions', { skip: !proxy }, function (t) { + t.ok(isCallable(proxy), 'proxies of functions are callable'); + t.end(); +}); + +test('throwing functions', function (t) { + t.plan(1); + + var thrower = function (a) { return a.b; }; + t.ok(isCallable(thrower), 'a function that throws is callable'); +}); diff --git a/node_modules/is-date-object/.eslintrc b/node_modules/is-date-object/.eslintrc new file mode 100644 index 0000000..1228f97 --- /dev/null +++ b/node_modules/is-date-object/.eslintrc @@ -0,0 +1,9 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-statements": [2, 12] + } +} diff --git a/node_modules/is-date-object/.github/FUNDING.yml b/node_modules/is-date-object/.github/FUNDING.yml new file mode 100644 index 0000000..9cfa9fd --- /dev/null +++ b/node_modules/is-date-object/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/is-date-object +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/is-date-object/.github/workflows/rebase.yml b/node_modules/is-date-object/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/is-date-object/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/is-date-object/.jscs.json b/node_modules/is-date-object/.jscs.json new file mode 100644 index 0000000..b4d9b8b --- /dev/null +++ b/node_modules/is-date-object/.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": 1 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/is-date-object/.travis.yml b/node_modules/is-date-object/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/is-date-object/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/is-date-object/CHANGELOG.md b/node_modules/is-date-object/CHANGELOG.md new file mode 100644 index 0000000..ff802bb --- /dev/null +++ b/node_modules/is-date-object/CHANGELOG.md @@ -0,0 +1,76 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.2](https://github.com/inspect-js/is-date-object/compare/v1.0.1...v1.0.2) - 2019-12-19 + +### Commits + +- [Tests] use shared travis-ci configs [`8a378b8`](https://github.com/inspect-js/is-date-object/commit/8a378b8fd6a4202fffc9ec193aca02efe937bc35) +- [Tests] on all node minors; use `nvm install-latest-npm`; fix scripts; improve matrix [`6e97a21`](https://github.com/inspect-js/is-date-object/commit/6e97a21276cf448ce424fb9ea13edd4587f289f1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `is`, `jscs`, `nsp`, `semver`, `tape` [`8472b90`](https://github.com/inspect-js/is-date-object/commit/8472b90f82e5153c22e7a8a7726a5cc6110e93d7) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`ae73e38`](https://github.com/inspect-js/is-date-object/commit/ae73e3890df7da0bc4449088e30340cb4df3294d) +- [meta] add `auto-changelog` [`82f8f47`](https://github.com/inspect-js/is-date-object/commit/82f8f473a6ee45e2b66810cb743e0122c18381c5) +- [meta] remove unused Makefile and associated utilities [`788a2cd`](https://github.com/inspect-js/is-date-object/commit/788a2cdfd0bc8f1903967219897f6d00c4c6a26b) +- [Tests] up to `node` `v11.4`, `v10.14`, `v8.14`, `v6.15` [`b9caf7c`](https://github.com/inspect-js/is-date-object/commit/b9caf7c814e5e2549454cb444f8b739f9ce1a388) +- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v8.15`, `v6.17`; use `nvm install-latest-npm` [`cda0abc`](https://github.com/inspect-js/is-date-object/commit/cda0abc04a21c9b5ec72eabd010155c988032056) +- [Tests] up to `node` `v12.10`, `v10.16`, `v8.16` [`49bc482`](https://github.com/inspect-js/is-date-object/commit/49bc482fd9f71436b663c07144083a8423697299) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `tape`; add `safe-publish-latest` [`f77fec4`](https://github.com/inspect-js/is-date-object/commit/f77fec48057e156b2276b4c14cf303306116b9f6) +- [actions] add automatic rebasing / merge commit blocking [`68605fc`](https://github.com/inspect-js/is-date-object/commit/68605fcb6bc0341ff0aae14a94bf5d18e1bc73be) +- [meta] create FUNDING.yml [`4f82d88`](https://github.com/inspect-js/is-date-object/commit/4f82d88e1e6ac1b97f0ce96aa0aa057ad758a581) +- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`3cbf28a`](https://github.com/inspect-js/is-date-object/commit/3cbf28a185ced940cfce8a09fa8479cc83575876) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config@`, `is`, `semver`, `tape` [`abf9fb0`](https://github.com/inspect-js/is-date-object/commit/abf9fb0d55ef0697e64e888d74f2e5fe53d7cdcb) +- [Tests] switch from `nsp` to `npm audit` [`6543c7d`](https://github.com/inspect-js/is-date-object/commit/6543c7d559d1fb79215b46c8b79e0e3e2a83f5de) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`ba5d2d7`](https://github.com/inspect-js/is-date-object/commit/ba5d2d7fc0975d7c03b8f2b7f43a09af93e365ba) +- [Dev Deps] update `eslint`, `nsp`, `semver`, `tape` [`c1e3525`](https://github.com/inspect-js/is-date-object/commit/c1e3525afa76a696f7cf1b58aab7f55d220b2c20) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`14e4824`](https://github.com/inspect-js/is-date-object/commit/14e4824188c85207ed3b86627b09e9f64b135db7) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` [`68ead64`](https://github.com/inspect-js/is-date-object/commit/68ead64a07e0de282ea3cd38e12cc8b0e0f6d3cd) +- [Dev Deps] update `eslint`, semver`, `tape`, `semver` [`f55453f`](https://github.com/inspect-js/is-date-object/commit/f55453f200903277465d7e9307a9c49120a4f419) +- Only apps should have lockfiles [`6c848eb`](https://github.com/inspect-js/is-date-object/commit/6c848eba982cc58053d4cca08c01f12a433f3695) +- [Tests] remove `jscs` [`3fd3a62`](https://github.com/inspect-js/is-date-object/commit/3fd3a62121607ad074b7fc977f3fc6575b66f755) +- [Dev Deps] update `eslint`, `tape` [`77d3130`](https://github.com/inspect-js/is-date-object/commit/77d3130a0039e5dae24c17de790dd510c265edc6) +- [meta] add `funding` field [`9ef6d58`](https://github.com/inspect-js/is-date-object/commit/9ef6d5888bf829a5812b3b091dc99839d48c355e) + +## [v1.0.1](https://github.com/inspect-js/is-date-object/compare/v1.0.0...v1.0.1) - 2015-09-27 + +### Commits + +- Update `tape`, `semver`, `eslint`; use my personal shared `eslint` config. [`731aa13`](https://github.com/inspect-js/is-date-object/commit/731aa134b0b8dc84e302d0b2264a415cb456ccab) +- Update `is`, `tape`, `covert`, `jscs`, `editorconfig-tools`, `nsp`, `eslint`, `semver` [`53e43a6`](https://github.com/inspect-js/is-date-object/commit/53e43a627dd01757cf3d469599f3dffd9d72b150) +- Update `eslint` [`d2fc304`](https://github.com/inspect-js/is-date-object/commit/d2fc3046f087b0026448ffde0cf46b1f741cbd4e) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`c9568df`](https://github.com/inspect-js/is-date-object/commit/c9568df228fa698dc6fcc9553b5d612e7ee427aa) +- Test on latest `node` and `io.js` versions. [`a21d537`](https://github.com/inspect-js/is-date-object/commit/a21d537562166ebd18bde3a262fd157dd774ae17) +- Update `nsp`, `eslint`, `semver` [`9e1d908`](https://github.com/inspect-js/is-date-object/commit/9e1d9087c0c79c34fcb2abfc701cdfa1efcb327c) +- Update `covert`, `jscs`, `eslint`, `semver` [`f198f6b`](https://github.com/inspect-js/is-date-object/commit/f198f6b997912da10a3d821a089e1581edc730a0) +- [Dev Deps] update `tape`, `jscs`, `eslint` [`ab9bdbb`](https://github.com/inspect-js/is-date-object/commit/ab9bdbbc189cef033346508db47cd1feb04a69d3) +- If `@@toStringTag` is not present, use the old-school `Object#toString` test. [`c03afce`](https://github.com/inspect-js/is-date-object/commit/c03afce001368b29eb929900075749b113a252c8) +- [Dev Deps] update `jscs`, `nsp`, `tape`, `eslint`, `@ljharb/eslint-config` [`9d94ccb`](https://github.com/inspect-js/is-date-object/commit/9d94ccbab4160d2fa649123e37951d86b69a8b15) +- [Dev Deps] update `is`, `eslint`, `@ljharb/eslint-config`, `semver` [`35cbff7`](https://github.com/inspect-js/is-date-object/commit/35cbff7f7c8216fbb79c799f74b2336eaf0d726a) +- Test up to `io.js` `v2.3` [`be5d11e`](https://github.com/inspect-js/is-date-object/commit/be5d11e7ebd9473d7ae554179b3769082485f6f4) +- [Tests] on `io.js` `v3.3`, up to `node` `v4.1` [`20221a3`](https://github.com/inspect-js/is-date-object/commit/20221a34858d2b21e23bdc2c08df23f0bc08d11e) +- [Tests] up to `io.js` `v3.2 ` [`7009b4a`](https://github.com/inspect-js/is-date-object/commit/7009b4a9999e14eacbdf6068afd82f478473f007) +- Test on `io.js` `v2.1` [`68b29b1`](https://github.com/inspect-js/is-date-object/commit/68b29b19a07e6589a7ca37ab764be28f144ac88e) +- Remove `editorconfig-tools` [`8d3972c`](https://github.com/inspect-js/is-date-object/commit/8d3972c1795fdcfd337680e11ab610e4885fb079) +- [Dev Deps] update `tape` [`204945d`](https://github.com/inspect-js/is-date-object/commit/204945d8658a3513ca6315ddf795e4034adb4545) +- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`7bff214`](https://github.com/inspect-js/is-date-object/commit/7bff214dcb2317b96219921476f990814afbb401) +- Test on `io.js` `v2.5` [`92f7bd6`](https://github.com/inspect-js/is-date-object/commit/92f7bd6747e3259b0ddc9c287876f46a9cd4c270) +- Test on `io.js` `v2.4` [`ebb34bf`](https://github.com/inspect-js/is-date-object/commit/ebb34bf1f58949768063f86ac012f1ca5d7cf6d9) +- Fix tests for faked @@toStringTag [`3b9c26c`](https://github.com/inspect-js/is-date-object/commit/3b9c26c15040af6a87f8d77ce6c85a7bef7a4304) +- Test on `io.js` `v3.0` [`5eedf4b`](https://github.com/inspect-js/is-date-object/commit/5eedf4bea76380a08813fd0977469c2480302a82) + +## v1.0.0 - 2015-01-28 + +### Commits + +- Dotfiles. [`5b6a929`](https://github.com/inspect-js/is-date-object/commit/5b6a9298c6f70882e78e66d64c9c019f85790f52) +- `make release` [`e8d40ce`](https://github.com/inspect-js/is-date-object/commit/e8d40ceca85acd0aa4b2753faa6e41c0c54cf6c3) +- package.json [`a107259`](https://github.com/inspect-js/is-date-object/commit/a1072591ea510a2998298be6cef827b123f4643f) +- Read me [`eb92695`](https://github.com/inspect-js/is-date-object/commit/eb92695664bdee8fc49891cd73aa2f41075f53cb) +- Initial commit [`4fc7755`](https://github.com/inspect-js/is-date-object/commit/4fc7755ff12f1d7a55cf841d486bf6b2350fe5a0) +- Tests. [`b6f432f`](https://github.com/inspect-js/is-date-object/commit/b6f432fb6801c5ff8d89cfec7601d59478e23dd1) +- Implementation. [`dd0fd96`](https://github.com/inspect-js/is-date-object/commit/dd0fd96c4016a66cec7cd59db0fde37c2ef3cdb5) diff --git a/node_modules/is-date-object/LICENSE b/node_modules/is-date-object/LICENSE new file mode 100644 index 0000000..b43df44 --- /dev/null +++ b/node_modules/is-date-object/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/is-date-object/README.md b/node_modules/is-date-object/README.md new file mode 100644 index 0000000..55b0c59 --- /dev/null +++ b/node_modules/is-date-object/README.md @@ -0,0 +1,53 @@ +# is-date-object [![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] + +[![browser support][9]][10] + +Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag. + +## Example + +```js +var isDate = require('is-date-object'); +var assert = require('assert'); + +assert.notOk(isDate(undefined)); +assert.notOk(isDate(null)); +assert.notOk(isDate(false)); +assert.notOk(isDate(true)); +assert.notOk(isDate(42)); +assert.notOk(isDate('foo')); +assert.notOk(isDate(function () {})); +assert.notOk(isDate([])); +assert.notOk(isDate({})); +assert.notOk(isDate(/a/g)); +assert.notOk(isDate(new RegExp('a', 'g'))); + +assert.ok(isDate(new Date())); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-date-object +[2]: http://versionbadg.es/ljharb/is-date-object.svg +[3]: https://travis-ci.org/ljharb/is-date-object.svg +[4]: https://travis-ci.org/ljharb/is-date-object +[5]: https://david-dm.org/ljharb/is-date-object.svg +[6]: https://david-dm.org/ljharb/is-date-object +[7]: https://david-dm.org/ljharb/is-date-object/dev-status.svg +[8]: https://david-dm.org/ljharb/is-date-object#info=devDependencies +[9]: https://ci.testling.com/ljharb/is-date-object.png +[10]: https://ci.testling.com/ljharb/is-date-object +[11]: https://nodei.co/npm/is-date-object.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/is-date-object.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-date-object.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-date-object diff --git a/node_modules/is-date-object/index.js b/node_modules/is-date-object/index.js new file mode 100644 index 0000000..285ec4c --- /dev/null +++ b/node_modules/is-date-object/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var getDay = Date.prototype.getDay; +var tryDateObject = function tryDateGetDayCall(value) { + try { + getDay.call(value); + return true; + } catch (e) { + return false; + } +}; + +var toStr = Object.prototype.toString; +var dateClass = '[object Date]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +module.exports = function isDateObject(value) { + if (typeof value !== 'object' || value === null) { + return false; + } + return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; +}; diff --git a/node_modules/is-date-object/package.json b/node_modules/is-date-object/package.json new file mode 100644 index 0000000..2eaec28 --- /dev/null +++ b/node_modules/is-date-object/package.json @@ -0,0 +1,104 @@ +{ + "_from": "is-date-object@^1.0.1", + "_id": "is-date-object@1.0.2", + "_inBundle": false, + "_integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "_location": "/is-date-object", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-date-object@^1.0.1", + "name": "is-date-object", + "escapedName": "is-date-object", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/es-to-primitive" + ], + "_resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "_shasum": "bda736f2cd8fd06d32844e7743bfa7494c3bfd7e", + "_spec": "is-date-object@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-to-primitive", + "author": { + "name": "Jordan Harband" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/ljharb/is-date-object/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", + "devDependencies": { + "@ljharb/eslint-config": "^15.0.2", + "auto-changelog": "^1.16.2", + "covert": "^1.1.1", + "eslint": "^6.7.2", + "foreach": "^2.0.5", + "indexof": "^0.0.1", + "is": "^3.3.0", + "safe-publish-latest": "^1.1.4", + "tape": "^4.12.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/is-date-object#readme", + "keywords": [ + "Date", + "ES6", + "toStringTag", + "@@toStringTag", + "Date object" + ], + "license": "MIT", + "main": "index.js", + "name": "is-date-object", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/is-date-object.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "lint": "eslint .", + "posttest": "npx aud", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node --harmony --es-staging test", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.0.2" +} diff --git a/node_modules/is-date-object/test/index.js b/node_modules/is-date-object/test/index.js new file mode 100644 index 0000000..b9d27c5 --- /dev/null +++ b/node_modules/is-date-object/test/index.js @@ -0,0 +1,36 @@ +'use strict'; + +var test = require('tape'); +var isDate = require('../'); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('') === 'symbol'; + +test('not Dates', function (t) { + t.notOk(isDate(), 'undefined is not Date'); + t.notOk(isDate(null), 'null is not Date'); + t.notOk(isDate(false), 'false is not Date'); + t.notOk(isDate(true), 'true is not Date'); + t.notOk(isDate(42), 'number is not Date'); + t.notOk(isDate('foo'), 'string is not Date'); + t.notOk(isDate([]), 'array is not Date'); + t.notOk(isDate({}), 'object is not Date'); + t.notOk(isDate(function () {}), 'function is not Date'); + t.notOk(isDate(/a/g), 'regex literal is not Date'); + t.notOk(isDate(new RegExp('a', 'g')), 'regex object is not Date'); + t.end(); +}); + +test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) { + var realDate = new Date(); + var fakeDate = { + toString: function () { return String(realDate); }, + valueOf: function () { return realDate.getTime(); } + }; + fakeDate[Symbol.toStringTag] = 'Date'; + t.notOk(isDate(fakeDate), 'fake Date with @@toStringTag "Date" is not Date'); + t.end(); +}); + +test('Dates', function (t) { + t.ok(isDate(new Date()), 'new Date() is Date'); + t.end(); +}); diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 0000000..0416af5 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 0000000..c1d986f --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 0000000..aea9073 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,100 @@ +{ + "_from": "is-extglob@^2.1.1", + "_id": "is-extglob@2.1.1", + "_inBundle": false, + "_integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "_location": "/is-extglob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extglob@^2.1.1", + "name": "is-extglob", + "escapedName": "is-extglob", + "rawSpec": "^2.1.1", + "saveSpec": null, + "fetchSpec": "^2.1.1" + }, + "_requiredBy": [ + "/is-glob" + ], + "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "_shasum": "a88c02535791f02ed37c76a1b9ea9773c833f8c2", + "_spec": "is-extglob@^2.1.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/is-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if a string has an extglob.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-extglob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extglob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.1" +} diff --git a/node_modules/is-fullwidth-code-point/index.js b/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 0000000..d506327 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { + return false; + } + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { + return true; + } + + return false; +}; diff --git a/node_modules/is-fullwidth-code-point/license b/node_modules/is-fullwidth-code-point/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-fullwidth-code-point/package.json b/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 0000000..50cb34c --- /dev/null +++ b/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,78 @@ +{ + "_from": "is-fullwidth-code-point@^2.0.0", + "_id": "is-fullwidth-code-point@2.0.0", + "_inBundle": false, + "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "_location": "/is-fullwidth-code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-fullwidth-code-point@^2.0.0", + "name": "is-fullwidth-code-point", + "escapedName": "is-fullwidth-code-point", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/slice-ansi", + "/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", + "_spec": "is-fullwidth-code-point@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/slice-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/is-fullwidth-code-point/readme.md b/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 0000000..093b028 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 0000000..59444eb --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Linux Build Status](https://img.shields.io/travis/micromatch/is-glob.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/is-glob) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/is-glob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/is-glob) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 0000000..5582651 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,48 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; +var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var regex = strictRegex; + var match; + + // optionally relax regex + if (options && options.strict === false) { + regex = relaxedRegex; + } + + while ((match = regex.exec(str))) { + if (match[2]) return true; + var idx = match.index + match[0].length; + + // if an open bracket/brace/paren is escaped, + // set the index to the next closing character + var open = match[1]; + var close = open ? chars[open] : null; + if (open && close) { + var n = str.indexOf(close, idx); + if (n !== -1) { + idx = n + 1; + } + } + + str = str.slice(idx); + } + return false; +}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 0000000..5187d48 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,122 @@ +{ + "_from": "is-glob@^4.0.0", + "_id": "is-glob@4.0.1", + "_inBundle": false, + "_integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "_location": "/is-glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-glob@^4.0.0", + "name": "is-glob", + "escapedName": "is-glob", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/eslint", + "/glob-parent" + ], + "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "_shasum": "7567dbe9f2f5e2467bc77ab83c4a29482407a5dc", + "_spec": "is-glob@^4.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Daniel Perez", + "url": "https://tuvistavie.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "is-extglob": "^2.1.1" + }, + "deprecated": false, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/micromatch/is-glob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + }, + "version": "4.0.1" +} diff --git a/node_modules/is-negative-zero/.eslintrc b/node_modules/is-negative-zero/.eslintrc new file mode 100644 index 0000000..955c229 --- /dev/null +++ b/node_modules/is-negative-zero/.eslintrc @@ -0,0 +1,10 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-statements": [2, 14], + "no-extra-parens": [1] + } +} diff --git a/node_modules/is-negative-zero/.jscs.json b/node_modules/is-negative-zero/.jscs.json new file mode 100644 index 0000000..7abfe0b --- /dev/null +++ b/node_modules/is-negative-zero/.jscs.json @@ -0,0 +1,104 @@ +{ + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": "allButReserved", + + "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": true, + + "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": 1 + }, + + "requirePaddingNewLinesAfterUseStrict": true +} + diff --git a/node_modules/is-negative-zero/.npmignore b/node_modules/is-negative-zero/.npmignore new file mode 100644 index 0000000..a72b52e --- /dev/null +++ b/node_modules/is-negative-zero/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules diff --git a/node_modules/is-negative-zero/.travis.yml b/node_modules/is-negative-zero/.travis.yml new file mode 100644 index 0000000..a94508b --- /dev/null +++ b/node_modules/is-negative-zero/.travis.yml @@ -0,0 +1,46 @@ +language: node_js +node_js: + - "iojs-v2.4" + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm' +sudo: false +matrix: + fast_finish: true + allow_failures: + - node_js: "iojs-v2.3" + - node_js: "iojs-v2.2" + - node_js: "iojs-v2.1" + - node_js: "iojs-v2.0" + - node_js: "iojs-v1.7" + - node_js: "iojs-v1.6" + - node_js: "iojs-v1.5" + - node_js: "iojs-v1.4" + - node_js: "iojs-v1.3" + - node_js: "iojs-v1.2" + - node_js: "iojs-v1.1" + - node_js: "iojs-v1.0" + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.8" + - node_js: "0.6" + - node_js: "0.4" diff --git a/node_modules/is-negative-zero/LICENSE b/node_modules/is-negative-zero/LICENSE new file mode 100644 index 0000000..47b7b50 --- /dev/null +++ b/node_modules/is-negative-zero/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is-negative-zero/README.md b/node_modules/is-negative-zero/README.md new file mode 100644 index 0000000..18b0684 --- /dev/null +++ b/node_modules/is-negative-zero/README.md @@ -0,0 +1,56 @@ +#is-negative-zero [![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] + +[![browser support][9]][10] + +Is this value negative zero? === will lie to you. + +## Example + +```js +var isNegativeZero = require('is-negative-zero'); +var assert = require('assert'); + +assert.notOk(isNegativeZero(undefined)); +assert.notOk(isNegativeZero(null)); +assert.notOk(isNegativeZero(false)); +assert.notOk(isNegativeZero(true)); +assert.notOk(isNegativeZero(0)); +assert.notOk(isNegativeZero(42)); +assert.notOk(isNegativeZero(Infinity)); +assert.notOk(isNegativeZero(-Infinity)); +assert.notOk(isNegativeZero(NaN)); +assert.notOk(isNegativeZero('foo')); +assert.notOk(isNegativeZero(function () {})); +assert.notOk(isNegativeZero([])); +assert.notOk(isNegativeZero({})); + +assert.ok(isNegativeZero(-0)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-negative-zero +[2]: http://vb.teelaun.ch/ljharb/is-negative-zero.svg +[3]: https://travis-ci.org/ljharb/is-negative-zero.svg +[4]: https://travis-ci.org/ljharb/is-negative-zero +[5]: https://david-dm.org/ljharb/is-negative-zero.svg +[6]: https://david-dm.org/ljharb/is-negative-zero +[7]: https://david-dm.org/ljharb/is-negative-zero/dev-status.svg +[8]: https://david-dm.org/ljharb/is-negative-zero#info=devDependencies +[9]: https://ci.testling.com/ljharb/is-negative-zero.png +[10]: https://ci.testling.com/ljharb/is-negative-zero +[11]: https://nodei.co/npm/is-negative-zero.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/is-negative-zero.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-negative-zero.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-negative-zero + diff --git a/node_modules/is-negative-zero/index.js b/node_modules/is-negative-zero/index.js new file mode 100644 index 0000000..400e5d1 --- /dev/null +++ b/node_modules/is-negative-zero/index.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function isNegativeZero(number) { + return number === 0 && (1 / number) === -Infinity; +}; + diff --git a/node_modules/is-negative-zero/package.json b/node_modules/is-negative-zero/package.json new file mode 100644 index 0000000..078cbba --- /dev/null +++ b/node_modules/is-negative-zero/package.json @@ -0,0 +1,91 @@ +{ + "_from": "is-negative-zero@^2.0.0", + "_id": "is-negative-zero@2.0.0", + "_inBundle": false, + "_integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "_location": "/is-negative-zero", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-negative-zero@^2.0.0", + "name": "is-negative-zero", + "escapedName": "is-negative-zero", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "_shasum": "9553b121b0fac28869da9ed459e20c7543788461", + "_spec": "is-negative-zero@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Jordan Harband" + }, + "bugs": { + "url": "https://github.com/ljharb/is-negative-zero/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Is this value negative zero? === will lie to you", + "devDependencies": { + "@ljharb/eslint-config": "^1.0.3", + "covert": "^1.1.0", + "eslint": "^1.0.0-rc-3", + "jscs": "^1.13.1", + "tape": "^4.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "homepage": "https://github.com/ljharb/is-negative-zero", + "keywords": [ + "is", + "negative", + "zero", + "negative zero", + "number", + "positive", + "0", + "-0" + ], + "license": "MIT", + "main": "index.js", + "name": "is-negative-zero", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/is-negative-zero.git" + }, + "scripts": { + "coverage": "covert test.js", + "coverage-quiet": "covert test.js --quiet", + "eslint": "eslint *.js", + "jscs": "jscs *.js", + "lint": "npm run jscs && npm run eslint", + "test": "npm run lint && node test.js && npm run coverage-quiet" + }, + "testling": { + "files": "test.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..12.0", + "opera/15.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "2.0.0" +} diff --git a/node_modules/is-negative-zero/test.js b/node_modules/is-negative-zero/test.js new file mode 100644 index 0000000..18c3f7c --- /dev/null +++ b/node_modules/is-negative-zero/test.js @@ -0,0 +1,28 @@ +'use strict'; + +var test = require('tape'); +var isNegativeZero = require('./'); + +test('not negative zero', function (t) { + t.notOk(isNegativeZero(), 'undefined is not negative zero'); + t.notOk(isNegativeZero(null), 'null is not negative zero'); + t.notOk(isNegativeZero(false), 'false is not negative zero'); + t.notOk(isNegativeZero(true), 'true is not negative zero'); + t.notOk(isNegativeZero(0), 'positive zero is not negative zero'); + t.notOk(isNegativeZero(Infinity), 'Infinity is not negative zero'); + t.notOk(isNegativeZero(-Infinity), '-Infinity is not negative zero'); + t.notOk(isNegativeZero(NaN), 'NaN is not negative zero'); + t.notOk(isNegativeZero('foo'), 'string is not negative zero'); + t.notOk(isNegativeZero([]), 'array is not negative zero'); + t.notOk(isNegativeZero({}), 'object is not negative zero'); + t.notOk(isNegativeZero(function () {}), 'function is not negative zero'); + t.notOk(isNegativeZero(-1), '-1 is not negative zero'); + + t.end(); +}); + +test('negative zero', function (t) { + t.ok(isNegativeZero(-0), 'negative zero is negative zero'); + t.end(); +}); + diff --git a/node_modules/is-regex/.editorconfig b/node_modules/is-regex/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/is-regex/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/is-regex/.eslintrc b/node_modules/is-regex/.eslintrc new file mode 100644 index 0000000..1f6f127 --- /dev/null +++ b/node_modules/is-regex/.eslintrc @@ -0,0 +1,19 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": [1], + "operator-linebreak": [2, "before"], + }, + + "overrides": [ + { + "files": ["test/**/*.js"], + "globals": { + "Proxy": false, + }, + }, + ], +} diff --git a/node_modules/is-regex/.github/workflows/rebase.yml b/node_modules/is-regex/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/is-regex/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/is-regex/.travis.yml b/node_modules/is-regex/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/is-regex/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/is-regex/CHANGELOG.md b/node_modules/is-regex/CHANGELOG.md new file mode 100644 index 0000000..8e0f466 --- /dev/null +++ b/node_modules/is-regex/CHANGELOG.md @@ -0,0 +1,163 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.1](https://github.com/inspect-js/is-regex/compare/v1.1.0...v1.1.1) - 2020-08-03 + +### Commits + +- [Performance] Re-add lastIndex check to improve performance [`d8495cd`](https://github.com/inspect-js/is-regex/commit/d8495cd22d475ddca250818921b6088f631c1972) +- [Dev Deps] update `auto-changelog`, `eslint` [`778fa6b`](https://github.com/inspect-js/is-regex/commit/778fa6b9d2b182ee6d73993e103532855e956f85) + +## [v1.1.0](https://github.com/inspect-js/is-regex/compare/v1.0.5...v1.1.0) - 2020-06-03 + +### Commits + +- [New] use `badStringifier`‑based RegExp detection [`31eff67`](https://github.com/inspect-js/is-regex/commit/31eff673243d65c3d6c05848c0eb52f5380f1be3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`fc91458`](https://github.com/inspect-js/is-regex/commit/fc914588187b8bb00d8d792c84f06a6e15d883c1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`; add `safe-publish-latest` [`d43ed83`](https://github.com/inspect-js/is-regex/commit/d43ed83db54ea727bb0b1b77a50af79d1edb8a6d) +- [Dev Deps] update `auto-changelog`, `tape`; add `aud` [`56647d1`](https://github.com/inspect-js/is-regex/commit/56647d196be34ef3c118ad67726e75169fbcb875) +- [meta] only run `aud` on prod deps [`e0865b8`](https://github.com/inspect-js/is-regex/commit/e0865b8360b0ac1b9d17b7b81ae5f339e5c9036b) + +## [v1.0.5](https://github.com/inspect-js/is-regex/compare/v1.0.4...v1.0.5) - 2019-12-15 + +### Commits + +- [Tests] use shared travis-ci configs [`af728b2`](https://github.com/inspect-js/is-regex/commit/af728b21c5cc9e41234fb4015594bffdcfff597c) +- [Tests] remove `jscs` [`1b8cfe8`](https://github.com/inspect-js/is-regex/commit/1b8cfe8cfb14820c196775f19d370276e4034791) +- [meta] add `auto-changelog` [`c3131d8`](https://github.com/inspect-js/is-regex/commit/c3131d8ab5d06ea5fa05a4bb2ad28bbfb81668ad) +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`, `v4.8`; newer npm fails on older nodes [`660b658`](https://github.com/inspect-js/is-regex/commit/660b6585d1a9607dbdae879b70ce2f6a5684616c) +- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS [`7c25218`](https://github.com/inspect-js/is-regex/commit/7c25218d540ab17c18e4ae333677c5725806a778) +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`fa95547`](https://github.com/inspect-js/is-regex/commit/fa955478950a5ba0a920010d5daaa29487500b30) +- [meta] remove unused Makefile and associated utilities [`9fd2a29`](https://github.com/inspect-js/is-regex/commit/9fd2a29dc57ed125f3d61e94f6254a9dd8ee0044) +- [Tests] up to `node` `v11.3`, `v10.14`, `v8.14`, `v6.15` [`7f2ac41`](https://github.com/inspect-js/is-regex/commit/7f2ac41ef5dc4d53bfe2fb1c24486c688a2537bd) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`6fa2b0f`](https://github.com/inspect-js/is-regex/commit/6fa2b0fe171a5b02086a06679a92d989e83a8b8e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`697e1de`](https://github.com/inspect-js/is-regex/commit/697e1de1c9e69f08e591cc0040d81fdbbde6fe4e) +- [actions] add automatic rebasing / merge commit blocking [`ad86dc9`](https://github.com/inspect-js/is-regex/commit/ad86dc97a52e4f66fbfb3b8c9c78da3963588b54) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `nsp`, `replace`, `semver`, `tape` [`5c99c8e`](https://github.com/inspect-js/is-regex/commit/5c99c8e384d5ce2ef434be5853c301477cf35456) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace`, `semver`, `tape` [`bb63686`](https://github.com/inspect-js/is-regex/commit/bb63686a9d0fc586d121549cf484da95edec3b0a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config@`, `replace`, `semver`, `tape` [`ddf3670`](https://github.com/inspect-js/is-regex/commit/ddf36705e5f7bd29832721e4a23abf06195032c6) +- [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config` [`e7b5a62`](https://github.com/inspect-js/is-regex/commit/e7b5a626eef3b9648c7d52d4620ce2e2a98a9ab8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`c803db5`](https://github.com/inspect-js/is-regex/commit/c803db5cd94cf9e0a559617adbc1e4c9d22007ff) +- [Tests] switch from `nsp` to `npm audit` [`b7239be`](https://github.com/inspect-js/is-regex/commit/b7239be9da263a0f7066f79d087eaf700a9613e9) +- [Dev Deps] update `eslint`, `nsp`, `semver`, `tape` [`347ee6c`](https://github.com/inspect-js/is-regex/commit/347ee6c67ba0f56b03f21a5abe743658f6515963) +- Only apps should have lockfiles. [`3866575`](https://github.com/inspect-js/is-regex/commit/38665755ecf028061f15816059e26023890a0dc7) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`d099a39`](https://github.com/inspect-js/is-regex/commit/d099a3943eb7e156a3e64fb8b74e11d7c83a4bec) +- [meta] add `funding` field [`741aecd`](https://github.com/inspect-js/is-regex/commit/741aecd92cd49868b3606c8cc99ce299e5f3c7d5) +- [Tests] use `eclint` instead of `editorconfig-tools` [`bc6aa75`](https://github.com/inspect-js/is-regex/commit/bc6aa7539e506788709b96f7bf3d7549850a81c3) +- [Tests] on `node` `v10.1` [`262226f`](https://github.com/inspect-js/is-regex/commit/262226f08fa34dff9a8dffd16daabb3dc6e262eb) +- [Dev Deps] update `eslint` [`31fd719`](https://github.com/inspect-js/is-regex/commit/31fd719dd59a6111ca710cdb0d19a8adadf9b8c6) +- [Deps] update `has` [`e9e25a3`](https://github.com/inspect-js/is-regex/commit/e9e25a3de7e89faaa6aadf5010477074140e8218) +- [Dev Deps] update `replace` [`aeeb968`](https://github.com/inspect-js/is-regex/commit/aeeb968bf5a4fc07f0fa6905f2c699fc563b6c32) +- [Tests] set audit level [`2a6290e`](https://github.com/inspect-js/is-regex/commit/2a6290e78b58bf14b734d7998fe53b4a84db5e44) +- [Tests] remove `nsp` [`fc74c2b`](https://github.com/inspect-js/is-regex/commit/fc74c2bb6970a7f3280abe6eff3b492d77d89c9f) + +## [v1.0.4](https://github.com/inspect-js/is-regex/compare/v1.0.3...v1.0.4) - 2017-02-18 + +### Fixed + +- [Fix] ensure that `lastIndex` is not mutated [`#3`](https://github.com/inspect-js/is-regex/issues/3) + +### Commits + +- Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`c4a41c3`](https://github.com/inspect-js/is-regex/commit/c4a41c3a8203a3919b01cd0d1b577daadf30a452) +- [Tests] on all node minors; improve test matrix [`58d7508`](https://github.com/inspect-js/is-regex/commit/58d7508a36eb92bd76717486b9e78bde502ffe3e) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`7290076`](https://github.com/inspect-js/is-regex/commit/729007606e9ed162953d1f5812c37eb06c554ec2) +- Update `covert`, `jscs`, `eslint`, `semver` [`dabc729`](https://github.com/inspect-js/is-regex/commit/dabc729cfc4458264c6f7642004d41dd5c214bfd) +- Update `eslint` [`a946b05`](https://github.com/inspect-js/is-regex/commit/a946b051159396b4311c564880f96e3d00e8b8e2) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`1744dde`](https://github.com/inspect-js/is-regex/commit/1744dde77526841f216fa2c1c866c5a82b1638c0) +- [Refactor] when try/catch is needed, bail early if the value lacks an own `lastIndex` data property. [`288ad93`](https://github.com/inspect-js/is-regex/commit/288ad93dbfed9f6828de20de67105ee6d6504425) +- Update `editorconfig-tools`, `eslint`, `semver`, `replace` [`4d895c6`](https://github.com/inspect-js/is-regex/commit/4d895c68a0cdbb5803185928963c15147aad0404) +- Update `eslint`, `tape`, `semver` [`f387f03`](https://github.com/inspect-js/is-regex/commit/f387f03b260b56372bfca301d4e79c4067633854) +- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. [`55e480f`](https://github.com/inspect-js/is-regex/commit/55e480f407cafb6c21a6c32aef04ccaa3ba4216c) +- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`89d9528`](https://github.com/inspect-js/is-regex/commit/89d95285b364913ebcd8ac7e0872570fe009a5d3) +- [Dev Deps] update `jscs` [`eb222a8`](https://github.com/inspect-js/is-regex/commit/eb222a8435e59909354f3700fd4880e4ce1cb13e) +- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`c65429c`](https://github.com/inspect-js/is-regex/commit/c65429cea0366508c10ad2ab773af7b83a34fc81) +- Update `nsp`, `eslint` [`c60fbd8`](https://github.com/inspect-js/is-regex/commit/c60fbd8680f7fb3508ec3c5be8ebb788672516c8) +- Update `eslint`, `semver` [`6a62116`](https://github.com/inspect-js/is-regex/commit/6a621168c63616bf004ca8b1f885b4eb8a58a3e5) +- [Tests] on `node` `v7.5`, `v4.7` [`e764651`](https://github.com/inspect-js/is-regex/commit/e764651336f5da5e239e9fe8869f3a3201c19d2b) +- Test up to `io.js` `v2.1` [`3bf326a`](https://github.com/inspect-js/is-regex/commit/3bf326a9bcd530fd16c9fc806e249a68e25ab7e3) +- Test on the latest `io.js` versions. [`693d047`](https://github.com/inspect-js/is-regex/commit/693d0477631c5d7671f6c99eca5594ffffa75771) +- [Refactor] use an early return instead of a ternary. [`31eaca2`](https://github.com/inspect-js/is-regex/commit/31eaca28b7d0aaac0599fe7a569b93b842f8ab16) +- Test on `io.js` `v2.2` [`c18c55a`](https://github.com/inspect-js/is-regex/commit/c18c55aee6358d70531f935e98851e42b698d93c) +- Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. [`a1c237d`](https://github.com/inspect-js/is-regex/commit/a1c237d35f880fe0bcbc9275254611a6a2300aaf) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`aa3ea0f`](https://github.com/inspect-js/is-regex/commit/aa3ea0f148af31d75f7ef8a800412729d82def04) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`d97831d`](https://github.com/inspect-js/is-regex/commit/d97831d0e2ccd3d00d1f7354b7f81e2575f90953) +- [Dev Deps] Update `tape`, `eslint` [`95e6def`](https://github.com/inspect-js/is-regex/commit/95e6defe3178c45dc9df16e474e558979d5f5c05) +- Update `eslint`, `nsp` [`3844c93`](https://github.com/inspect-js/is-regex/commit/3844c935cfe7c52fae0dc74d27e884c417cb4616) +- Update `tape`, `jscs` [`0d6dac8`](https://github.com/inspect-js/is-regex/commit/0d6dac818ed251910171965932f021291919e770) +- Fix tests for faked @@toStringTag [`2ebef9f`](https://github.com/inspect-js/is-regex/commit/2ebef9f0759843e9a063de7a512b46e3e7daea7e) +- Test up to `io.js` `v3.0` [`ec1d2d4`](https://github.com/inspect-js/is-regex/commit/ec1d2d44481fa0fa11448527da8030c99fe47a12) +- [Refactor] bail earlier when the value is falsy. [`a9e333e`](https://github.com/inspect-js/is-regex/commit/a9e333e2ac8912ca05b7e31d30e4eea683c0da4b) +- [Dev Deps] update `tape` [`8cdcaae`](https://github.com/inspect-js/is-regex/commit/8cdcaae07be8c790cdb99849e6076ea7702a4c84) +- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`281c4ef`](https://github.com/inspect-js/is-regex/commit/281c4efeb71c86dd380e741bcaee3f7dbf956151) +- Test on `io.js` `v2.4` [`4d54c68`](https://github.com/inspect-js/is-regex/commit/4d54c68a81b5332a3b76259d8aa8f514be5efd13) +- Test on `io.js` `v2.3` [`23170f5`](https://github.com/inspect-js/is-regex/commit/23170f5cae632d0377de73bd2febc53db8aebbc9) +- Test on `iojs-v1.6` [`4487ad0`](https://github.com/inspect-js/is-regex/commit/4487ad0194a5684223bfa2690da4e0a441f7132a) + +## [v1.0.3](https://github.com/inspect-js/is-regex/compare/v1.0.2...v1.0.3) - 2015-01-29 + +### Commits + +- Update npm run scripts. [`dc528dd`](https://github.com/inspect-js/is-regex/commit/dc528dd25e775089bc0a3f5a8f7ae7ffc4cdf52a) +- Add toStringTag tests. [`f48a83a`](https://github.com/inspect-js/is-regex/commit/f48a83a78720b78ab60ca586c16f6f3dbcfec825) +- If @@toStringTag is not present, use the old-school Object#toString test. [`50b0ffd`](https://github.com/inspect-js/is-regex/commit/50b0ffd9c7fdbd54aee8cde1b07e680ae84f6a0d) + +## [v1.0.2](https://github.com/inspect-js/is-regex/compare/v1.0.1...v1.0.2) - 2015-01-29 + +### Commits + +- `make release` [`a1de7ec`](https://github.com/inspect-js/is-regex/commit/a1de7eca4cecc8015fd27804669f8fc61bd16a68) +- Improve optimization by separating the try/catch, and bailing out early when not typeof "object". [`5ab7632`](https://github.com/inspect-js/is-regex/commit/5ab76322a348487fa8b16761e83f6824c3c27d11) + +## [v1.0.1](https://github.com/inspect-js/is-regex/compare/v1.0.0...v1.0.1) - 2015-01-28 + +### Commits + +- Using my standard jscs.json file [`1f1733a`](https://github.com/inspect-js/is-regex/commit/1f1733ac8433cdcceb25356f86b74136a4477cb9) +- Adding `npm run lint` [`51ea70f`](https://github.com/inspect-js/is-regex/commit/51ea70fa7e461d022f611c195f343ea8d0333d71) +- Use RegExp#exec to test if something is a regex, which works even with ES6 @@toStringTag. [`042c8c7`](https://github.com/inspect-js/is-regex/commit/042c8c734faade9015932b61f1e8ea4f3a93b1b3) +- Adding license and downloads badges [`366d619`](https://github.com/inspect-js/is-regex/commit/366d61965d3a4119126e78e09b2166bbcddd0c5a) +- Use SVG badges instead of PNG [`6a32e4f`](https://github.com/inspect-js/is-regex/commit/6a32e4fc87d7d3a3787b800dd033c9293aead6df) +- Update `tape`, `jscs` [`f1b9462`](https://github.com/inspect-js/is-regex/commit/f1b9462f86d1b69de07176e7f277f668757ba964) +- Update `jscs` [`1bff23f`](https://github.com/inspect-js/is-regex/commit/1bff23ff0fe88c8263e8bf04cf99e290af96d5b0) +- Update `tape`, `jscs` [`c22ea2e`](https://github.com/inspect-js/is-regex/commit/c22ea2e7967f45618deed01ff5ea483f918be216) +- Update `tape`, `jscs` [`b0479db`](https://github.com/inspect-js/is-regex/commit/b0479db99a1b1b872d1618fb0a71f0c74a78b29b) +- Use consistent quotes [`1a6e347`](https://github.com/inspect-js/is-regex/commit/1a6e34730d9270f3f20519139faa4c4e6ec2e1f5) +- Make travis builds faster. [`090a4ea`](https://github.com/inspect-js/is-regex/commit/090a4ea7c5fa709d108d596e3bc304e6ce973dec) +- Update `tape` [`7d76129`](https://github.com/inspect-js/is-regex/commit/7d7612928bdd43230fbd835db71797249ca24f35) +- Lock covert to v1.0.0. [`9a90b03`](https://github.com/inspect-js/is-regex/commit/9a90b03fb390e66f874223a34c58ba2bb109edd3) +- Updating tape [`bfbc7f5`](https://github.com/inspect-js/is-regex/commit/bfbc7f593a007acd0411152bbb55f724dc4ca935) +- Updating jscs [`13ad511`](https://github.com/inspect-js/is-regex/commit/13ad511d80cd67300c2c0c5387fc4b3b423e2768) +- Updating jscs [`cda1945`](https://github.com/inspect-js/is-regex/commit/cda1945d603dfe99e24d5a909a931d366451bc4d) +- Updating jscs [`de96c99`](https://github.com/inspect-js/is-regex/commit/de96c99d4bf5787df671de6df9138b6547a6545b) +- Running linter as part of tests [`2cb6567`](https://github.com/inspect-js/is-regex/commit/2cb656733b1ed0af14ad11fb584006d22de0c69d) +- Updating covert [`a56ae74`](https://github.com/inspect-js/is-regex/commit/a56ae74ec8d5f0473295a8b10519a18580f16624) +- Updating tape [`ffe47f7`](https://github.com/inspect-js/is-regex/commit/ffe47f7fe9cf6d16896b4bdc286bd1d0805d5c49) + +## [v1.0.0](https://github.com/inspect-js/is-regex/compare/v0.0.0...v1.0.0) - 2014-05-19 + +### Commits + +- Make sure old and unstable nodes don't break Travis [`05da747`](https://github.com/inspect-js/is-regex/commit/05da7478f960dc131ec3ad864e27e8c6b7d74a80) +- toString is a reserved var name in old Opera [`885c48c`](https://github.com/inspect-js/is-regex/commit/885c48c120f921a55f1842b0607d3e7875379821) +- Updating deps [`2ca0e79`](https://github.com/inspect-js/is-regex/commit/2ca0e79a2443ca34d85e8b2ea2e26f55855b74a7) +- Updating tape. [`9678435`](https://github.com/inspect-js/is-regex/commit/96784355611deb0c23b9064be774216d76e3e457) +- Updating covert [`c3bb898`](https://github.com/inspect-js/is-regex/commit/c3bb8985a422e3e0c81f9c43899b6c19a72c755f) +- Updating tape [`7811708`](https://github.com/inspect-js/is-regex/commit/78117089688258b8f939b397b37897b5b3e30f74) +- Testing on node 0.6 again [`dec36ae`](https://github.com/inspect-js/is-regex/commit/dec36ae58a39a3f80e832b702c3e19406363c160) +- Run code coverage as part of tests [`e6f4ebe`](https://github.com/inspect-js/is-regex/commit/e6f4ebec26894543747603f2cb360e839f2ca290) + +## v0.0.0 - 2014-01-15 + +### Commits + +- package.json [`aa60d43`](https://github.com/inspect-js/is-regex/commit/aa60d43d2c8adb9fdd47f5898e5e1e570bd238d8) +- read me [`861e944`](https://github.com/inspect-js/is-regex/commit/861e944de88e84010eaa662ea9ea9f17c90cff8c) +- Initial commit [`d0cdd71`](https://github.com/inspect-js/is-regex/commit/d0cdd71a637d8490b7ee3eaaf75c7e31d0f9242f) +- Tests. [`b533f74`](https://github.com/inspect-js/is-regex/commit/b533f741a88dff002790fb7af054b2a74e72d4da) +- Implementation. [`3c9a8c0`](https://github.com/inspect-js/is-regex/commit/3c9a8c06994003cdfffeb3620f251f4c4cae7755) +- Travis CI [`742c440`](https://github.com/inspect-js/is-regex/commit/742c4407015f9108875fd108fde137f5245e9e7a) diff --git a/node_modules/is-regex/LICENSE b/node_modules/is-regex/LICENSE new file mode 100644 index 0000000..47b7b50 --- /dev/null +++ b/node_modules/is-regex/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is-regex/README.md b/node_modules/is-regex/README.md new file mode 100644 index 0000000..05baa0e --- /dev/null +++ b/node_modules/is-regex/README.md @@ -0,0 +1,54 @@ +#is-regex [![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] + +[![browser support][9]][10] + +Is this value a JS regex? +This module works cross-realm/iframe, and despite ES6 @@toStringTag. + +## Example + +```js +var isRegex = require('is-regex'); +var assert = require('assert'); + +assert.notOk(isRegex(undefined)); +assert.notOk(isRegex(null)); +assert.notOk(isRegex(false)); +assert.notOk(isRegex(true)); +assert.notOk(isRegex(42)); +assert.notOk(isRegex('foo')); +assert.notOk(isRegex(function () {})); +assert.notOk(isRegex([])); +assert.notOk(isRegex({})); + +assert.ok(isRegex(/a/g)); +assert.ok(isRegex(new RegExp('a', 'g'))); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-regex +[2]: http://versionbadg.es/ljharb/is-regex.svg +[3]: https://travis-ci.org/ljharb/is-regex.svg +[4]: https://travis-ci.org/ljharb/is-regex +[5]: https://david-dm.org/ljharb/is-regex.svg +[6]: https://david-dm.org/ljharb/is-regex +[7]: https://david-dm.org/ljharb/is-regex/dev-status.svg +[8]: https://david-dm.org/ljharb/is-regex#info=devDependencies +[9]: https://ci.testling.com/ljharb/is-regex.png +[10]: https://ci.testling.com/ljharb/is-regex +[11]: https://nodei.co/npm/is-regex.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/is-regex.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-regex.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-regex + diff --git a/node_modules/is-regex/index.js b/node_modules/is-regex/index.js new file mode 100644 index 0000000..3db4b92 --- /dev/null +++ b/node_modules/is-regex/index.js @@ -0,0 +1,58 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol'; +var hasOwnProperty; +var regexExec; +var isRegexMarker; +var badStringifier; + +if (hasToStringTag) { + hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); + regexExec = Function.call.bind(RegExp.prototype.exec); + isRegexMarker = {}; + + var throwRegexMarker = function () { + throw isRegexMarker; + }; + badStringifier = { + toString: throwRegexMarker, + valueOf: throwRegexMarker + }; + + if (typeof Symbol.toPrimitive === 'symbol') { + badStringifier[Symbol.toPrimitive] = throwRegexMarker; + } +} + +var toStr = Object.prototype.toString; +var gOPD = Object.getOwnPropertyDescriptor; +var regexClass = '[object RegExp]'; + +module.exports = hasToStringTag + // eslint-disable-next-line consistent-return + ? function isRegex(value) { + if (!value || typeof value !== 'object') { + return false; + } + + var descriptor = gOPD(value, 'lastIndex'); + var hasLastIndexDataProperty = descriptor && hasOwnProperty(descriptor, 'value'); + if (!hasLastIndexDataProperty) { + return false; + } + + try { + regexExec(value, badStringifier); + } catch (e) { + return e === isRegexMarker; + } + } + : function isRegex(value) { + // In older browsers, typeof regex incorrectly returns 'function' + if (!value || (typeof value !== 'object' && typeof value !== 'function')) { + return false; + } + + return toStr.call(value) === regexClass; + }; diff --git a/node_modules/is-regex/package.json b/node_modules/is-regex/package.json new file mode 100644 index 0000000..0c73697 --- /dev/null +++ b/node_modules/is-regex/package.json @@ -0,0 +1,117 @@ +{ + "_from": "is-regex@^1.1.1", + "_id": "is-regex@1.1.1", + "_inBundle": false, + "_integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "_location": "/is-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-regex@^1.1.1", + "name": "is-regex", + "escapedName": "is-regex", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "_shasum": "c6f98aacc546f6cec5468a07b7b153ab564a57b9", + "_spec": "is-regex@^1.1.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "bugs": { + "url": "https://github.com/ljharb/is-regex/issues" + }, + "bundleDependencies": false, + "dependencies": { + "has-symbols": "^1.0.1" + }, + "deprecated": false, + "description": "Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag", + "devDependencies": { + "@ljharb/eslint-config": "^17.1.0", + "aud": "^1.1.2", + "auto-changelog": "^2.2.0", + "covert": "^1.1.1", + "eclint": "^2.8.1", + "eslint": "^7.6.0", + "foreach": "^2.0.5", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/is-regex", + "keywords": [ + "regex", + "regexp", + "is", + "regular expression", + "regular", + "expression" + ], + "license": "MIT", + "main": "index.js", + "name": "is-regex", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/is-regex.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "lint": "eslint .", + "posttest": "npx aud --production", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node --harmony --es-staging test", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..12.0", + "opera/15.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.1.1" +} diff --git a/node_modules/is-regex/test/index.js b/node_modules/is-regex/test/index.js new file mode 100644 index 0000000..934c3d9 --- /dev/null +++ b/node_modules/is-regex/test/index.js @@ -0,0 +1,105 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol'; +var forEach = require('foreach'); +var test = require('tape'); +var isRegex = require('..'); + +test('not regexes', function (t) { + t.notOk(isRegex(), 'undefined is not regex'); + t.notOk(isRegex(null), 'null is not regex'); + t.notOk(isRegex(false), 'false is not regex'); + t.notOk(isRegex(true), 'true is not regex'); + t.notOk(isRegex(42), 'number is not regex'); + t.notOk(isRegex('foo'), 'string is not regex'); + t.notOk(isRegex([]), 'array is not regex'); + t.notOk(isRegex({}), 'object is not regex'); + t.notOk(isRegex(function () {}), 'function is not regex'); + t.end(); +}); + +test('@@toStringTag', { skip: !hasToStringTag }, function (t) { + var regex = /a/g; + var fakeRegex = { + toString: function () { return String(regex); }, + valueOf: function () { return regex; } + }; + fakeRegex[Symbol.toStringTag] = 'RegExp'; + t.notOk(isRegex(fakeRegex), 'fake RegExp with @@toStringTag "RegExp" is not regex'); + t.end(); +}); + +test('regexes', function (t) { + t.ok(isRegex(/a/g), 'regex literal is regex'); + t.ok(isRegex(new RegExp('a', 'g')), 'regex object is regex'); + t.end(); +}); + +test('does not mutate regexes', function (t) { + t.test('lastIndex is a marker object', function (st) { + var regex = /a/; + var marker = {}; + regex.lastIndex = marker; + st.equal(regex.lastIndex, marker, 'lastIndex is the marker object'); + st.ok(isRegex(regex), 'is regex'); + st.equal(regex.lastIndex, marker, 'lastIndex is the marker object after isRegex'); + st.end(); + }); + + t.test('lastIndex is nonzero', function (st) { + var regex = /a/; + regex.lastIndex = 3; + st.equal(regex.lastIndex, 3, 'lastIndex is 3'); + st.ok(isRegex(regex), 'is regex'); + st.equal(regex.lastIndex, 3, 'lastIndex is 3 after isRegex'); + st.end(); + }); + + t.end(); +}); + +test('does not perform operations observable to Proxies', { skip: typeof Proxy !== 'function' }, function (t) { + var Handler = function () { + this.trapCalls = []; + }; + + forEach([ + 'defineProperty', + 'deleteProperty', + 'get', + 'getOwnPropertyDescriptor', + 'getPrototypeOf', + 'has', + 'isExtensible', + 'ownKeys', + 'preventExtensions', + 'set', + 'setPrototypeOf' + ], function (trapName) { + Handler.prototype[trapName] = function () { + this.trapCalls.push(trapName); + return Reflect[trapName].apply(Reflect, arguments); + }; + }); + + t.test('proxy of object', function (st) { + var handler = new Handler(); + var proxy = new Proxy({ lastIndex: 0 }, handler); + + st.equal(isRegex(proxy), false, 'proxy of plain object is not regex'); + st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered'); + st.end(); + }); + + t.test('proxy of RegExp instance', function (st) { + var handler = new Handler(); + var proxy = new Proxy(/a/, handler); + + st.equal(isRegex(proxy), false, 'proxy of RegExp instance is not regex'); + st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/is-string/.eslintrc b/node_modules/is-string/.eslintrc new file mode 100644 index 0000000..5bf1191 --- /dev/null +++ b/node_modules/is-string/.eslintrc @@ -0,0 +1,19 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "max-statements": [2, 15] + }, + + "overrides": [ + { + "files": ["test.js"], + "rules": { + "no-magic-numbers": 0, + }, + }, + ], +} diff --git a/node_modules/is-string/.github/FUNDING.yml b/node_modules/is-string/.github/FUNDING.yml new file mode 100644 index 0000000..519746b --- /dev/null +++ b/node_modules/is-string/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/is-string +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/is-string/.github/workflows/rebase.yml b/node_modules/is-string/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/is-string/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/is-string/.travis.yml b/node_modules/is-string/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/is-string/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/is-string/CHANGELOG.md b/node_modules/is-string/CHANGELOG.md new file mode 100644 index 0000000..217c2ad --- /dev/null +++ b/node_modules/is-string/CHANGELOG.md @@ -0,0 +1,84 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.5](https://github.com/inspect-js/is-string/compare/v1.0.4...v1.0.5) - 2019-12-19 + +### Commits + +- [Tests] use shared travis-ci configs [`4121d6b`](https://github.com/inspect-js/is-string/commit/4121d6b168ae1d54a81791ee6877f9813cab6253) +- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v5.12`, `v4.9`; use `nvm install-latest-npm` [`e7a3e89`](https://github.com/inspect-js/is-string/commit/e7a3e89ccb9638d73f45dbcb2a42e509bd3153c4) +- Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`6c380a7`](https://github.com/inspect-js/is-string/commit/6c380a70011714370e754fa0df95f56cdcaa3e60) +- [Tests] remove `jscs` [`3d49592`](https://github.com/inspect-js/is-string/commit/3d49592b9880fcb1a23b67286445281131a553e3) +- Update `is`, `tape`, `covert`, `jscs`, `editorconfig-tools`, `eslint`, `nsp`, `semver`. [`cc6983d`](https://github.com/inspect-js/is-string/commit/cc6983d06bc98f4ae9b7c9439d5d73c7318d8acd) +- [meta] add `auto-changelog` [`b857897`](https://github.com/inspect-js/is-string/commit/b85789723ce3a7064536598e0fcdd495257c6134) +- [meta] remove unused Makefile and associated utilities [`3f0f51c`](https://github.com/inspect-js/is-string/commit/3f0f51cbae1f97dbe1466eee88d105b3df0d2f0a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `is`, `covert`, `tape`, `semver` [`9d4a95e`](https://github.com/inspect-js/is-string/commit/9d4a95e4473fe8195501878525b5af5948aa45c9) +- Update `eslint` [`e861b4b`](https://github.com/inspect-js/is-string/commit/e861b4bc71f5390670aebdff91119a1f8aeeb88a) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`172e2dd`](https://github.com/inspect-js/is-string/commit/172e2dd1a0b9eb042bcb9a80ff5e774a90ff0695) +- Test on `node` and `io.js` latest. [`fd426cd`](https://github.com/inspect-js/is-string/commit/fd426cd18b22b0d0e1731598125393dcfe0c5704) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` [`23bdf83`](https://github.com/inspect-js/is-string/commit/23bdf83cf42138eba09f45bd0b040b069f9839d4) +- [actions] add automatic rebasing / merge commit blocking [`96153c0`](https://github.com/inspect-js/is-string/commit/96153c0d687a7fda2261f4c02add5d0b41e8aed7) +- [meta] create FUNDING.yml [`66ae246`](https://github.com/inspect-js/is-string/commit/66ae246d6cdaa4ccbc21f7c144b672139b8ccef6) +- [Dev Deps] update `is`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`817361a`](https://github.com/inspect-js/is-string/commit/817361a9673cd1ec9854b52578a980159f7d8701) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `tape` [`fc35d3f`](https://github.com/inspect-js/is-string/commit/fc35d3feb40921bb22e1639903cb7f2fab77814b) +- [Dev Deps] update `jscs` [`886767e`](https://github.com/inspect-js/is-string/commit/886767e04e5ad59ac0bc926a87233cc8546c8b4f) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`3410922`](https://github.com/inspect-js/is-string/commit/341092203c11a3b92eee55a7ecb7b8265e8fcecd) +- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`4d6c73b`](https://github.com/inspect-js/is-string/commit/4d6c73b507bcd39050ef71e554069f72fc5b222a) +- Update `nsp`, `eslint` [`b11de49`](https://github.com/inspect-js/is-string/commit/b11de4910beee1ffe1e67fbe25ec6707ca796b27) +- Update `eslint`, `semver` [`0777977`](https://github.com/inspect-js/is-string/commit/0777977757a85a1db75831d03a14b4b1fde05d7e) +- Only apps should have lockfiles [`78b49ff`](https://github.com/inspect-js/is-string/commit/78b49ffd04d4cd8c57d9e7b485421fbf3641b41b) +- [meta] add `funding` field [`81328a6`](https://github.com/inspect-js/is-string/commit/81328a6ef3eee989164127e4c0c82f1da73d3567) +- [Dev Deps] update `eslint`, `tape` [`fc9a225`](https://github.com/inspect-js/is-string/commit/fc9a225b27935f7c9c2704281d7fddd3614d3cb8) +- [Tests] use `eclint` instead of `editorconfig-tools` [`59c2c61`](https://github.com/inspect-js/is-string/commit/59c2c610dbd8e8ca1e4aa3fa9c9f93205cab9b07) +- [Dev Deps] Update `tape`, `eslint` [`a429816`](https://github.com/inspect-js/is-string/commit/a429816688e23c81948b4ae72324c26c27849b7c) +- Test on `io.js` `v2.2` [`08b476e`](https://github.com/inspect-js/is-string/commit/08b476ed0734a70e3091c04ddd2f173a2df21eb2) +- Test up to `io.js` `v3.0` [`22637ef`](https://github.com/inspect-js/is-string/commit/22637ef9e0030533df85cf1992fc099a88b1924c) +- [meta] add `safe-publish-latest` [`20ccb48`](https://github.com/inspect-js/is-string/commit/20ccb48fd85f0245eb893507d00003090da020d0) +- [Dev Deps] update `tape` [`06b58a0`](https://github.com/inspect-js/is-string/commit/06b58a048c2a820e5611ad2bd9ddfbe893295a57) +- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`ea7cf84`](https://github.com/inspect-js/is-string/commit/ea7cf849b952c924d1687a302098251a7b827c80) +- Test on `io.js` `v2.4` [`66ec3ea`](https://github.com/inspect-js/is-string/commit/66ec3ea390b364583a792799b53857fd186ccc88) +- Test on `io.js` `v2.3` [`ca6e796`](https://github.com/inspect-js/is-string/commit/ca6e796f16ec433b88962162fde8012f28e18f1e) +- Fix tests for faked @@toStringTag [`3cce832`](https://github.com/inspect-js/is-string/commit/3cce8329133dfd233987359df151018b3b136be1) + +## [v1.0.4](https://github.com/inspect-js/is-string/compare/v1.0.3...v1.0.4) - 2015-01-30 + +### Commits + +- If @@toStringTag is not present, use the old-school Object#toString test. [`30675ec`](https://github.com/inspect-js/is-string/commit/30675ecb5c5cc43873918661a414a1d0f8b77325) + +## [v1.0.3](https://github.com/inspect-js/is-string/compare/v1.0.2...v1.0.3) - 2015-01-29 + +### Commits + +- Refactor to aid optimization of non-try/catch code. [`9b2772a`](https://github.com/inspect-js/is-string/commit/9b2772abe09ba8cbaa631322cc226ee906d2db22) + +## [v1.0.2](https://github.com/inspect-js/is-string/compare/v1.0.1...v1.0.2) - 2015-01-29 + +### Commits + +- Fix broken package.json [`dc921d3`](https://github.com/inspect-js/is-string/commit/dc921d332b64e4041162f04e4712b0dc687863a5) + +## [v1.0.1](https://github.com/inspect-js/is-string/compare/v1.0.0...v1.0.1) - 2015-01-29 + +### Commits + +- Fix eslint config. [`c4e05bd`](https://github.com/inspect-js/is-string/commit/c4e05bd171da6002d432e451fd48912db8b048e0) +- Add early exits for typeof "string", or typeof not "object". [`82f41d3`](https://github.com/inspect-js/is-string/commit/82f41d36a599bc6a06152792c84c7683e412c513) + +## v1.0.0 - 2015-01-28 + +### Commits + +- Dotfiles. [`45bc9dd`](https://github.com/inspect-js/is-string/commit/45bc9dd60201722344986a6c7536be9ea9ccefbf) +- `make release` [`23707f5`](https://github.com/inspect-js/is-string/commit/23707f5ecfdf00afb0e57c06ac07f7f49cdeb606) +- package.json [`575ad81`](https://github.com/inspect-js/is-string/commit/575ad811c61b156cfbcc60ff61947183c6ebe6a2) +- Read me [`3f67c9a`](https://github.com/inspect-js/is-string/commit/3f67c9a0725f811845d38646a19322895cd03981) +- Initial commit [`2c26a7a`](https://github.com/inspect-js/is-string/commit/2c26a7a2e41dec77be2c59d5847f29a6ab7c0b29) +- Tests. [`38c987b`](https://github.com/inspect-js/is-string/commit/38c987b8513b0ac03b0897e0fce7de8135d4ee0f) +- Implementation. [`0471d59`](https://github.com/inspect-js/is-string/commit/0471d59078d7f3f77619913ec21c57c0af27114c) diff --git a/node_modules/is-string/LICENSE b/node_modules/is-string/LICENSE new file mode 100644 index 0000000..b43df44 --- /dev/null +++ b/node_modules/is-string/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/is-string/README.md b/node_modules/is-string/README.md new file mode 100644 index 0000000..13895e5 --- /dev/null +++ b/node_modules/is-string/README.md @@ -0,0 +1,57 @@ +# is-string [![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] + +[![browser support][9]][10] + +Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag. + +## Example + +```js +var isString = require('is-string'); +var assert = require('assert'); + +assert.notOk(isString(undefined)); +assert.notOk(isString(null)); +assert.notOk(isString(false)); +assert.notOk(isString(true)); +assert.notOk(isString(function () {})); +assert.notOk(isString([])); +assert.notOk(isString({})); +assert.notOk(isString(/a/g)); +assert.notOk(isString(new RegExp('a', 'g'))); +assert.notOk(isString(new Date())); +assert.notOk(isString(42)); +assert.notOk(isString(NaN)); +assert.notOk(isString(Infinity)); +assert.notOk(isString(new Number(42))); + +assert.ok(isString('foo')); +assert.ok(isString(Object('foo'))); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-string +[2]: http://versionbadg.es/ljharb/is-string.svg +[3]: https://travis-ci.org/ljharb/is-string.svg +[4]: https://travis-ci.org/ljharb/is-string +[5]: https://david-dm.org/ljharb/is-string.svg +[6]: https://david-dm.org/ljharb/is-string +[7]: https://david-dm.org/ljharb/is-string/dev-status.svg +[8]: https://david-dm.org/ljharb/is-string#info=devDependencies +[9]: https://ci.testling.com/ljharb/is-string.png +[10]: https://ci.testling.com/ljharb/is-string +[11]: https://nodei.co/npm/is-string.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/is-string.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-string.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-string diff --git a/node_modules/is-string/index.js b/node_modules/is-string/index.js new file mode 100644 index 0000000..95b7050 --- /dev/null +++ b/node_modules/is-string/index.js @@ -0,0 +1,24 @@ +'use strict'; + +var strValue = String.prototype.valueOf; +var tryStringObject = function tryStringObject(value) { + try { + strValue.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var strClass = '[object String]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +module.exports = function isString(value) { + if (typeof value === 'string') { + return true; + } + if (typeof value !== 'object') { + return false; + } + return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; +}; diff --git a/node_modules/is-string/package.json b/node_modules/is-string/package.json new file mode 100644 index 0000000..397453a --- /dev/null +++ b/node_modules/is-string/package.json @@ -0,0 +1,108 @@ +{ + "_from": "is-string@^1.0.5", + "_id": "is-string@1.0.5", + "_inBundle": false, + "_integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "_location": "/is-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-string@^1.0.5", + "name": "is-string", + "escapedName": "is-string", + "rawSpec": "^1.0.5", + "saveSpec": null, + "fetchSpec": "^1.0.5" + }, + "_requiredBy": [ + "/array-includes" + ], + "_resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "_shasum": "40493ed198ef3ff477b8c7f92f644ec82a5cd3a6", + "_spec": "is-string@^1.0.5", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/array-includes", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/ljharb/is-string/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", + "devDependencies": { + "@ljharb/eslint-config": "^15.0.2", + "auto-changelog": "^1.16.2", + "covert": "^1.1.1", + "eclint": "^2.8.1", + "eslint": "^6.7.2", + "foreach": "^2.0.5", + "indexof": "^0.0.1", + "is": "^3.3.0", + "safe-publish-latest": "^1.1.4", + "tape": "^4.12.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/is-string#readme", + "keywords": [ + "String", + "string", + "ES6", + "toStringTag", + "@@toStringTag", + "String object" + ], + "license": "MIT", + "main": "index.js", + "name": "is-string", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/is-string.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "lint": "eslint .", + "posttest": "npx aud", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node --harmony --es-staging test", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.0.5" +} diff --git a/node_modules/is-string/test/index.js b/node_modules/is-string/test/index.js new file mode 100644 index 0000000..03c0874 --- /dev/null +++ b/node_modules/is-string/test/index.js @@ -0,0 +1,39 @@ +'use strict'; + +var test = require('tape'); +var isString = require('..'); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('') === 'symbol'; + +test('not Strings', function (t) { + t.notOk(isString(), 'undefined is not String'); + t.notOk(isString(null), 'null is not String'); + t.notOk(isString(false), 'false is not String'); + t.notOk(isString(true), 'true is not String'); + t.notOk(isString([]), 'array is not String'); + t.notOk(isString({}), 'object is not String'); + t.notOk(isString(function () {}), 'function is not String'); + t.notOk(isString(/a/g), 'regex literal is not String'); + t.notOk(isString(new RegExp('a', 'g')), 'regex object is not String'); + t.notOk(isString(new Date()), 'new Date() is not String'); + t.notOk(isString(42), 'number is not String'); + t.notOk(isString(Object(42)), 'number object is not String'); + t.notOk(isString(NaN), 'NaN is not String'); + t.notOk(isString(Infinity), 'Infinity is not String'); + t.end(); +}); + +test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) { + var fakeString = { + toString: function () { return '7'; }, + valueOf: function () { return '42'; } + }; + fakeString[Symbol.toStringTag] = 'String'; + t.notOk(isString(fakeString), 'fake String with @@toStringTag "String" is not String'); + t.end(); +}); + +test('Strings', function (t) { + t.ok(isString('foo'), 'string primitive is String'); + t.ok(isString(Object('foo')), 'string object is String'); + t.end(); +}); diff --git a/node_modules/is-symbol/.editorconfig b/node_modules/is-symbol/.editorconfig new file mode 100644 index 0000000..eaa2141 --- /dev/null +++ b/node_modules/is-symbol/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/is-symbol/.eslintrc b/node_modules/is-symbol/.eslintrc new file mode 100644 index 0000000..046dd07 --- /dev/null +++ b/node_modules/is-symbol/.eslintrc @@ -0,0 +1,14 @@ +{ + "root": true, + + "extends": "@ljharb", + + "overrides": [ + { + "files": "test/**", + "rules": { + "no-restricted-properties": 0, + }, + }, + ], +} diff --git a/node_modules/is-symbol/.github/FUNDING.yml b/node_modules/is-symbol/.github/FUNDING.yml new file mode 100644 index 0000000..a65600e --- /dev/null +++ b/node_modules/is-symbol/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/is-symbol +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/is-symbol/.github/workflows/rebase.yml b/node_modules/is-symbol/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/is-symbol/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/is-symbol/.nvmrc b/node_modules/is-symbol/.nvmrc new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/node_modules/is-symbol/.nvmrc @@ -0,0 +1 @@ +node diff --git a/node_modules/is-symbol/.travis.yml b/node_modules/is-symbol/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/is-symbol/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/is-symbol/CHANGELOG.md b/node_modules/is-symbol/CHANGELOG.md new file mode 100644 index 0000000..6c68c59 --- /dev/null +++ b/node_modules/is-symbol/CHANGELOG.md @@ -0,0 +1,86 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.3](https://github.com/inspect-js/is-symbol/compare/v1.0.2...v1.0.3) - 2019-11-21 + +### Commits + +- [Tests] use shared travis-ci configs [`034afdd`](https://github.com/inspect-js/is-symbol/commit/034afdd677c1b72b76751f3e5131acc927a32916) +- [Tests] remove `jscs` [`0c026a0`](https://github.com/inspect-js/is-symbol/commit/0c026a06815e46a33a8a5b4b1be8965d32d38e5c) +- [meta] add `auto-changelog` [`9a1776b`](https://github.com/inspect-js/is-symbol/commit/9a1776bb49f3e6ac12a5b3a447edcc651216891b) +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`23a6db4`](https://github.com/inspect-js/is-symbol/commit/23a6db49a338d19eab19d876745513820bb6a9dc) +- [Tests] up to `node` `v11.7`, `v10.15`, `v8.15`, `v6.16` [`892d92e`](https://github.com/inspect-js/is-symbol/commit/892d92e7c40f3c0577583a98134106181c38bb7e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `tape` [`c2e6d6a`](https://github.com/inspect-js/is-symbol/commit/c2e6d6a71f839522bbd124b7419f5fc42ffff6d3) +- [readme] fix repo URLs [`655c288`](https://github.com/inspect-js/is-symbol/commit/655c288a815856e647dba4b6049b1743cec3533c) +- [actions] add automatic rebasing / merge commit blocking [`97b1229`](https://github.com/inspect-js/is-symbol/commit/97b12296bf8fa1ce0c6121bf3de56c413da10aae) +- [meta] add FUNDING.yml [`94c64a3`](https://github.com/inspect-js/is-symbol/commit/94c64a367a1c34f960cf6007fc65cfbbcba34ba3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape`, `semver` [`71ab543`](https://github.com/inspect-js/is-symbol/commit/71ab543e09b820378362f4f66248addd410c6388) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `tape` [`c6212f9`](https://github.com/inspect-js/is-symbol/commit/c6212f94e28622c94bb37189ffc241ee88b5b1dd) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `object-inspect` [`91bc802`](https://github.com/inspect-js/is-symbol/commit/91bc802e18e63f4e8230ee0148302ce849e2f733) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`8cbe69c`](https://github.com/inspect-js/is-symbol/commit/8cbe69c3fafe9cfbe7d27f710c88d02d2d2c6a00) +- [Tests] use `npm audit` instead of `nsp` [`741b51d`](https://github.com/inspect-js/is-symbol/commit/741b51dac868f6b22736c204910d257bcf4d5044) +- [meta] add `funding` field [`65b58d1`](https://github.com/inspect-js/is-symbol/commit/65b58d1e9fc572712d462d615e6b2418627d8fb9) +- [Deps] update `has-symbols` [`9cb5b2a`](https://github.com/inspect-js/is-symbol/commit/9cb5b2a9a3b89e8e0246be8df4fff3f5ceac7309) + +## [v1.0.2](https://github.com/inspect-js/is-symbol/compare/v1.0.1...v1.0.2) - 2018-09-20 + +### Commits + +- Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`e86aaea`](https://github.com/inspect-js/is-symbol/commit/e86aaea8d81356801ecfc60540523e9b809a55f4) +- [Tests] on all node minors; improve test matrix [`50bc07f`](https://github.com/inspect-js/is-symbol/commit/50bc07f2ff73e5499b02a61f0a00ea48a84ae213) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `semver`, `eslint`, `@ljharb/eslint-config` [`45e17bd`](https://github.com/inspect-js/is-symbol/commit/45e17bdf145846f30122348a94c5e506b90836ba) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9`; use `nvm install-latest-npm` [`44402cb`](https://github.com/inspect-js/is-symbol/commit/44402cb82d4499e947b48b31b14667d1ebe7e2b4) +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`, `v4.8`; improve matrix; old npm breaks on newer nodes [`9047c23`](https://github.com/inspect-js/is-symbol/commit/9047c232857ecb80551a21cc0b1cc4c91d28da1f) +- Update `tape`, `covert`, `jscs`, `semver` [`d57d1ce`](https://github.com/inspect-js/is-symbol/commit/d57d1ce3fc0b740885a1ed5c0738d4a27b29ab07) +- Add `npm run eslint` [`0d75a66`](https://github.com/inspect-js/is-symbol/commit/0d75a6638ad6f7ff7d5bc958531a6328fb13e3fe) +- Update `eslint` [`042fb3a`](https://github.com/inspect-js/is-symbol/commit/042fb3aec590f0c0d205b15812b285ad95cfff6b) +- [Refactor] use `has-symbols` and `object-inspect` [`129bc68`](https://github.com/inspect-js/is-symbol/commit/129bc68dd619b789b9956ac9b63b46257ee1060c) +- [Tests] up to `node` `v10.11`, `v8.12` [`c1822e8`](https://github.com/inspect-js/is-symbol/commit/c1822e84d6cc0cee9f1c2893e91b1aa999ad41db) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`089d2cf`](https://github.com/inspect-js/is-symbol/commit/089d2cf7cad87b75aa534769af11524ad2e79080) +- [Tests] up to `node` `v8.4`; newer npm breaks on older node [`05ce701`](https://github.com/inspect-js/is-symbol/commit/05ce701e3c1be8b3266ffac49806832e410491c1) +- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. [`241e6a6`](https://github.com/inspect-js/is-symbol/commit/241e6a655c0e19e9dcf0ae88e7fddd4cde394c5c) +- Test on latest `node` and `io.js` versions. [`5c8d5de`](https://github.com/inspect-js/is-symbol/commit/5c8d5deb9b7c01a8cdf959082a3d619c19751b0a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` [`06047bf`](https://github.com/inspect-js/is-symbol/commit/06047bf72b20a66c0b455e80856b2d00b1910391) +- [Dev Deps] update `jscs`, `nsp`, `semver`, `eslint`, `@ljharb/eslint-config` [`9d25dd7`](https://github.com/inspect-js/is-symbol/commit/9d25dd79347c89f98207a3bad39f667f1f8a410e) +- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`ce173bd`](https://github.com/inspect-js/is-symbol/commit/ce173bda6e146907e3061a0e70463107d955de35) +- Update `nsp`, `eslint` [`29e5214`](https://github.com/inspect-js/is-symbol/commit/29e52140fac2049b4a32e175787bb3b184a1dd72) +- Update `semver`, `eslint` [`53be884`](https://github.com/inspect-js/is-symbol/commit/53be884c2811f7a4452581003d9cdaf6f9bddd3c) +- [Dev Deps] update `eslint`, `nsp`, `semver`, `tape` [`3bd149c`](https://github.com/inspect-js/is-symbol/commit/3bd149c869c099b07104b06c0692755a01f8298c) +- [Dev Deps] update `jscs` [`69b4231`](https://github.com/inspect-js/is-symbol/commit/69b4231632b170e5ddb350db2f0c59e6cad6f548) +- Test up to `io.js` `v2.1` [`0b61ac7`](https://github.com/inspect-js/is-symbol/commit/0b61ac7ac4de390296aeefb9395549592ea87da4) +- [Dev Deps] update `tape` [`5e1b200`](https://github.com/inspect-js/is-symbol/commit/5e1b2008c910bcdabee299a1ac599143ea07c3f9) +- Only apps should have lockfiles. [`a191ff5`](https://github.com/inspect-js/is-symbol/commit/a191ff5f0320fc16db42fdaa40f0c21d4326255e) +- [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` [`97c87ef`](https://github.com/inspect-js/is-symbol/commit/97c87ef52b966f211e231092a54ef6ed05c99a26) +- Test on `io.js` `v2.2` [`42560e4`](https://github.com/inspect-js/is-symbol/commit/42560e466e17cbbb9fa71c0121f4bbbcf266c887) +- [Dev Deps] Update `tape`, `eslint` [`149b2f2`](https://github.com/inspect-js/is-symbol/commit/149b2f20bde92b2da12ccfeb8988beb2dc95c37c) +- [Tests] fix test messages [`28bd1ed`](https://github.com/inspect-js/is-symbol/commit/28bd1eda310590e13ada19cbd718c85c25d8a0c5) +- Test up to `io.js` `v3.0` [`c0dcc98`](https://github.com/inspect-js/is-symbol/commit/c0dcc98313d17151ec043e5452df306618be865e) +- `node` now supports Symbols now. [`d1853ad`](https://github.com/inspect-js/is-symbol/commit/d1853adf6369ab9d4c4516bdb032c2e42f52f90a) +- [Dev Deps] update `tape` [`f7a6575`](https://github.com/inspect-js/is-symbol/commit/f7a6575fbdef13abcc412c63d22b56943ed85969) +- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`aae9c6a`](https://github.com/inspect-js/is-symbol/commit/aae9c6a724578659976ea74e11ec9fe35608607b) +- Test on `io.js` `v2.4` [`ab8f449`](https://github.com/inspect-js/is-symbol/commit/ab8f4492115270cc00a479915b02ac1bac75dfed) +- Test on `io.js` `v2.3` [`58ce871`](https://github.com/inspect-js/is-symbol/commit/58ce871674e857955b333aa057eeecd68b40e988) + +## [v1.0.1](https://github.com/inspect-js/is-symbol/compare/v1.0.0...v1.0.1) - 2015-01-26 + +### Commits + +- Correct package description. [`f4d15b9`](https://github.com/inspect-js/is-symbol/commit/f4d15b928b4b754b097a84f7c3ceac73c486aceb) + +## v1.0.0 - 2015-01-24 + +### Commits + +- Dotfiles. [`5d9a744`](https://github.com/inspect-js/is-symbol/commit/5d9a7441f724630070e9bd74a995191cafa1064b) +- Tests. [`8af5663`](https://github.com/inspect-js/is-symbol/commit/8af56631950dcee48b36f517837273193a6ba119) +- `make release` [`6293446`](https://github.com/inspect-js/is-symbol/commit/629344654a72e7fc8059607d6a86c64b002c3e5d) +- package.json [`7d4082c`](https://github.com/inspect-js/is-symbol/commit/7d4082ca9502118e70d24f526704d45a1a7f2067) +- Initial commit [`cbb179f`](https://github.com/inspect-js/is-symbol/commit/cbb179f677bd3dcb56ac5e3f0a7a9af503fd8952) +- Read me. [`099a775`](https://github.com/inspect-js/is-symbol/commit/099a775e7e751706283ae1cab7a8635c094773a9) +- Implementation. [`cb51248`](https://github.com/inspect-js/is-symbol/commit/cb51248eedaf55e0b8ad7dacdab179db2d76e96e) diff --git a/node_modules/is-symbol/LICENSE b/node_modules/is-symbol/LICENSE new file mode 100644 index 0000000..b43df44 --- /dev/null +++ b/node_modules/is-symbol/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/is-symbol/Makefile b/node_modules/is-symbol/Makefile new file mode 100644 index 0000000..b9e4fe1 --- /dev/null +++ b/node_modules/is-symbol/Makefile @@ -0,0 +1,61 @@ +# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. +$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) + + # The files that need updating when incrementing the version number. +VERSIONED_FILES := *.js *.json README* + + +# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. +# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment +# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. +export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") +UTILS := semver +# Make sure that all required utilities can be located. +UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) + +# Default target (by virtue of being the first non '.'-prefixed in the file). +.PHONY: _no-target-specified +_no-target-specified: + $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) + +# Lists all targets defined in this makefile. +.PHONY: list +list: + @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort + +# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). +.PHONY: test +test: + @npm test + +.PHONY: _ensure-tag +_ensure-tag: +ifndef TAG + $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) +endif + +CHANGELOG_ERROR = $(error No CHANGELOG specified) +.PHONY: _ensure-changelog +_ensure-changelog: + @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) + +# Ensures that the git workspace is clean. +.PHONY: _ensure-clean +_ensure-clean: + @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } + +# Makes a release; invoke with `make TAG= release`. +.PHONY: release +release: _ensure-tag _ensure-changelog _ensure-clean + @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ + new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ + if printf "$$new_ver" | command grep -q '^[0-9]'; then \ + semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ + semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ + else \ + new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ + fi; \ + printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ + replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ + git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ + git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/node_modules/is-symbol/README.md b/node_modules/is-symbol/README.md new file mode 100644 index 0000000..e59d1ce --- /dev/null +++ b/node_modules/is-symbol/README.md @@ -0,0 +1,44 @@ +#is-symbol [![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] + +[![browser support][9]][10] + +Is this an ES6 Symbol value? + +## Example + +```js +var isSymbol = require('is-symbol'); +assert(!isSymbol(function () {})); +assert(!isSymbol(null)); +assert(!isSymbol(function* () { yield 42; return Infinity; }); + +assert(isSymbol(Symbol.iterator)); +assert(isSymbol(Symbol('foo'))); +assert(isSymbol(Symbol.for('foo'))); +assert(isSymbol(Object(Symbol('foo')))); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-symbol +[2]: http://versionbadg.es/inspect-js/is-symbol.svg +[3]: https://travis-ci.org/inspect-js/is-symbol.svg +[4]: https://travis-ci.org/inspect-js/is-symbol +[5]: https://david-dm.org/inspect-js/is-symbol.svg +[6]: https://david-dm.org/inspect-js/is-symbol +[7]: https://david-dm.org/inspect-js/is-symbol/dev-status.svg +[8]: https://david-dm.org/inspect-js/is-symbol#info=devDependencies +[11]: https://nodei.co/npm/is-symbol.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/is-symbol.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-symbol.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-symbol diff --git a/node_modules/is-symbol/index.js b/node_modules/is-symbol/index.js new file mode 100644 index 0000000..3d653e2 --- /dev/null +++ b/node_modules/is-symbol/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var toStr = Object.prototype.toString; +var hasSymbols = require('has-symbols')(); + +if (hasSymbols) { + var symToStr = Symbol.prototype.toString; + var symStringRegex = /^Symbol\(.*\)$/; + var isSymbolObject = function isRealSymbolObject(value) { + if (typeof value.valueOf() !== 'symbol') { + return false; + } + return symStringRegex.test(symToStr.call(value)); + }; + + module.exports = function isSymbol(value) { + if (typeof value === 'symbol') { + return true; + } + if (toStr.call(value) !== '[object Symbol]') { + return false; + } + try { + return isSymbolObject(value); + } catch (e) { + return false; + } + }; +} else { + + module.exports = function isSymbol(value) { + // this environment does not support Symbols. + return false && value; + }; +} diff --git a/node_modules/is-symbol/package.json b/node_modules/is-symbol/package.json new file mode 100644 index 0000000..4af3244 --- /dev/null +++ b/node_modules/is-symbol/package.json @@ -0,0 +1,105 @@ +{ + "_from": "is-symbol@^1.0.2", + "_id": "is-symbol@1.0.3", + "_inBundle": false, + "_integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "_location": "/is-symbol", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-symbol@^1.0.2", + "name": "is-symbol", + "escapedName": "is-symbol", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/es-to-primitive" + ], + "_resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "_shasum": "38e1014b9e6329be0de9d24a414fd7441ec61937", + "_spec": "is-symbol@^1.0.2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-to-primitive", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/inspect-js/is-symbol/issues" + }, + "bundleDependencies": false, + "dependencies": { + "has-symbols": "^1.0.1" + }, + "deprecated": false, + "description": "Determine if a value is an ES6 Symbol or not.", + "devDependencies": { + "@ljharb/eslint-config": "^15.0.2", + "auto-changelog": "^1.16.2", + "covert": "^1.1.1", + "eslint": "^6.6.0", + "object-inspect": "^1.7.0", + "safe-publish-latest": "^1.1.4", + "semver": "^6.3.0", + "tape": "^4.11.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/inspect-js/is-symbol#readme", + "keywords": [ + "symbol", + "es6", + "is", + "Symbol" + ], + "license": "MIT", + "main": "index.js", + "name": "is-symbol", + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/is-symbol.git" + }, + "scripts": { + "coverage": "covert test", + "lint": "eslint .", + "posttest": "npx aud", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node --es-staging --harmony test", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.0.3" +} diff --git a/node_modules/is-symbol/test/index.js b/node_modules/is-symbol/test/index.js new file mode 100644 index 0000000..e01f035 --- /dev/null +++ b/node_modules/is-symbol/test/index.js @@ -0,0 +1,92 @@ +'use strict'; + +var test = require('tape'); +var isSymbol = require('../index'); + +var forEach = function (arr, func) { + var i; + for (i = 0; i < arr.length; ++i) { + func(arr[i], i, arr); + } +}; + +var hasSymbols = require('has-symbols')(); +var inspect = require('object-inspect'); +var debug = function (v, m) { return inspect(v) + ' ' + m; }; + +test('non-symbol values', function (t) { + var nonSymbols = [ + true, + false, + Object(true), + Object(false), + null, + undefined, + {}, + [], + /a/g, + 'string', + 42, + new Date(), + function () {}, + NaN + ]; + t.plan(nonSymbols.length); + forEach(nonSymbols, function (nonSymbol) { + t.equal(false, isSymbol(nonSymbol), debug(nonSymbol, 'is not a symbol')); + }); + t.end(); +}); + +test('faked symbol values', function (t) { + t.test('real symbol valueOf', { skip: !hasSymbols }, function (st) { + var fakeSymbol = { valueOf: function () { return Symbol('foo'); } }; + st.equal(false, isSymbol(fakeSymbol), 'object with valueOf returning a symbol is not a symbol'); + st.end(); + }); + + t.test('faked @@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (st) { + var fakeSymbol = { valueOf: function () { return Symbol('foo'); } }; + fakeSymbol[Symbol.toStringTag] = 'Symbol'; + st.equal(false, isSymbol(fakeSymbol), 'object with fake Symbol @@toStringTag and valueOf returning a symbol is not a symbol'); + var notSoFakeSymbol = { valueOf: function () { return 42; } }; + notSoFakeSymbol[Symbol.toStringTag] = 'Symbol'; + st.equal(false, isSymbol(notSoFakeSymbol), 'object with fake Symbol @@toStringTag and valueOf not returning a symbol is not a symbol'); + st.end(); + }); + + var fakeSymbolString = { toString: function () { return 'Symbol(foo)'; } }; + t.equal(false, isSymbol(fakeSymbolString), 'object with toString returning Symbol(foo) is not a symbol'); + + t.end(); +}); + +test('Symbol support', { skip: !hasSymbols }, function (t) { + t.test('well-known Symbols', function (st) { + var isWellKnown = function filterer(name) { + return name !== 'for' && name !== 'keyFor' && !(name in filterer); + }; + var wellKnownSymbols = Object.getOwnPropertyNames(Symbol).filter(isWellKnown); + wellKnownSymbols.forEach(function (name) { + var sym = Symbol[name]; + st.equal(true, isSymbol(sym), debug(sym, ' is a symbol')); + }); + st.end(); + }); + + t.test('user-created symbols', function (st) { + var symbols = [ + Symbol(), + Symbol('foo'), + Symbol['for']('foo'), + Object(Symbol('object')) + ]; + symbols.forEach(function (sym) { + st.equal(true, isSymbol(sym), debug(sym, ' is a symbol')); + }); + st.end(); + }); + + t.end(); +}); + diff --git a/node_modules/isarray/.npmignore b/node_modules/isarray/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/isarray/.travis.yml b/node_modules/isarray/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/isarray/Makefile b/node_modules/isarray/Makefile new file mode 100644 index 0000000..787d56e --- /dev/null +++ b/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/node_modules/isarray/README.md b/node_modules/isarray/README.md new file mode 100644 index 0000000..16d2c59 --- /dev/null +++ b/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/isarray/component.json b/node_modules/isarray/component.json new file mode 100644 index 0000000..9e31b68 --- /dev/null +++ b/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/isarray/index.js b/node_modules/isarray/index.js new file mode 100644 index 0000000..a57f634 --- /dev/null +++ b/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json new file mode 100644 index 0000000..ddbaf33 --- /dev/null +++ b/node_modules/isarray/package.json @@ -0,0 +1,73 @@ +{ + "_from": "isarray@^1.0.0", + "_id": "isarray@1.0.0", + "_inBundle": false, + "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "_location": "/isarray", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isarray@^1.0.0", + "name": "isarray", + "escapedName": "isarray", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/eslint-plugin-import/doctrine" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_spec": "isarray@^1.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-plugin-import/node_modules/doctrine", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "browser", + "isarray", + "array" + ], + "license": "MIT", + "main": "index.js", + "name": "isarray", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.0" +} diff --git a/node_modules/isarray/test.js b/node_modules/isarray/test.js new file mode 100644 index 0000000..e0c3444 --- /dev/null +++ b/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/node_modules/isexe/.npmignore b/node_modules/isexe/.npmignore new file mode 100644 index 0000000..c1cb757 --- /dev/null +++ b/node_modules/isexe/.npmignore @@ -0,0 +1,2 @@ +.nyc_output/ +coverage/ diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/isexe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md new file mode 100644 index 0000000..35769e8 --- /dev/null +++ b/node_modules/isexe/README.md @@ -0,0 +1,51 @@ +# isexe + +Minimal module to check if a file is executable, and a normal file. + +Uses `fs.stat` and tests against the `PATHEXT` environment variable on +Windows. + +## USAGE + +```javascript +var isexe = require('isexe') +isexe('some-file-name', function (err, isExe) { + if (err) { + console.error('probably file does not exist or something', err) + } else if (isExe) { + console.error('this thing can be run') + } else { + console.error('cannot be run') + } +}) + +// same thing but synchronous, throws errors +var isExe = isexe.sync('some-file-name') + +// treat errors as just "not executable" +isexe('maybe-missing-file', { ignoreErrors: true }, callback) +var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) +``` + +## API + +### `isexe(path, [options], [callback])` + +Check if the path is executable. If no callback provided, and a +global `Promise` object is available, then a Promise will be returned. + +Will raise whatever errors may be raised by `fs.stat`, unless +`options.ignoreErrors` is set to true. + +### `isexe.sync(path, [options])` + +Same as `isexe` but returns the value and throws any errors raised. + +### Options + +* `ignoreErrors` Treat all errors as "no, this is not executable", but + don't raise them. +* `uid` Number to use as the user id +* `gid` Number to use as the group id +* `pathExt` List of path extensions to use instead of `PATHEXT` + environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js new file mode 100644 index 0000000..553fb32 --- /dev/null +++ b/node_modules/isexe/index.js @@ -0,0 +1,57 @@ +var fs = require('fs') +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = require('./windows.js') +} else { + core = require('./mode.js') +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js new file mode 100644 index 0000000..1995ea4 --- /dev/null +++ b/node_modules/isexe/mode.js @@ -0,0 +1,41 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} + +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json new file mode 100644 index 0000000..d19a451 --- /dev/null +++ b/node_modules/isexe/package.json @@ -0,0 +1,60 @@ +{ + "_from": "isexe@^2.0.0", + "_id": "isexe@2.0.0", + "_inBundle": false, + "_integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "_location": "/isexe", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isexe@^2.0.0", + "name": "isexe", + "escapedName": "isexe", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/which" + ], + "_resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "_shasum": "e8fbf374dc556ff8947a10dcb0572d633f2cfa10", + "_spec": "isexe@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/which", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Minimal module to check if a file is executable.", + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^10.3.0" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/isaacs/isexe#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "name": "isexe", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --100" + }, + "version": "2.0.0" +} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js new file mode 100644 index 0000000..d926df6 --- /dev/null +++ b/node_modules/isexe/test/basic.js @@ -0,0 +1,221 @@ +var t = require('tap') +var fs = require('fs') +var path = require('path') +var fixture = path.resolve(__dirname, 'fixtures') +var meow = fixture + '/meow.cat' +var mine = fixture + '/mine.cat' +var ours = fixture + '/ours.cat' +var fail = fixture + '/fail.false' +var noent = fixture + '/enoent.exe' +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var isWindows = process.platform === 'win32' +var hasAccess = typeof fs.access === 'function' +var winSkip = isWindows && 'windows' +var accessSkip = !hasAccess && 'no fs.access function' +var hasPromise = typeof Promise === 'function' +var promiseSkip = !hasPromise && 'no global Promise' + +function reset () { + delete require.cache[require.resolve('../')] + return require('../') +} + +t.test('setup fixtures', function (t) { + rimraf.sync(fixture) + mkdirp.sync(fixture) + fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') + fs.chmodSync(meow, parseInt('0755', 8)) + fs.writeFileSync(fail, '#!/usr/bin/env false\n') + fs.chmodSync(fail, parseInt('0644', 8)) + fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') + fs.chmodSync(mine, parseInt('0744', 8)) + fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') + fs.chmodSync(ours, parseInt('0754', 8)) + t.end() +}) + +t.test('promise', { skip: promiseSkip }, function (t) { + var isexe = reset() + t.test('meow async', function (t) { + isexe(meow).then(function (is) { + t.ok(is) + t.end() + }) + }) + t.test('fail async', function (t) { + isexe(fail).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.test('noent async', function (t) { + isexe(noent).catch(function (er) { + t.ok(er) + t.end() + }) + }) + t.test('noent ignore async', function (t) { + isexe(noent, { ignoreErrors: true }).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.end() +}) + +t.test('no promise', function (t) { + global.Promise = null + var isexe = reset() + t.throws('try to meow a promise', function () { + isexe(meow) + }) + t.end() +}) + +t.test('access', { skip: accessSkip || winSkip }, function (t) { + runTest(t) +}) + +t.test('mode', { skip: winSkip }, function (t) { + delete fs.access + delete fs.accessSync + var isexe = reset() + t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) + t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) + runTest(t) +}) + +t.test('windows', function (t) { + global.TESTING_WINDOWS = true + var pathExt = '.EXE;.CAT;.CMD;.COM' + t.test('pathExt option', function (t) { + runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) + }) + t.test('pathExt env', function (t) { + process.env.PATHEXT = pathExt + runTest(t) + }) + t.test('no pathExt', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: '', skipFail: true }) + }) + t.test('pathext with empty entry', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: ';' + pathExt, skipFail: true }) + }) + t.end() +}) + +t.test('cleanup', function (t) { + rimraf.sync(fixture) + t.end() +}) + +function runTest (t, options) { + var isexe = reset() + + var optionsIgnore = Object.create(options || {}) + optionsIgnore.ignoreErrors = true + + if (!options || !options.skipFail) { + t.notOk(isexe.sync(fail, options)) + } + t.notOk(isexe.sync(noent, optionsIgnore)) + if (!options) { + t.ok(isexe.sync(meow)) + } else { + t.ok(isexe.sync(meow, options)) + } + + t.ok(isexe.sync(mine, options)) + t.ok(isexe.sync(ours, options)) + t.throws(function () { + isexe.sync(noent, options) + }) + + t.test('meow async', function (t) { + if (!options) { + isexe(meow, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } else { + isexe(meow, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } + }) + + t.test('mine async', function (t) { + isexe(mine, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + t.test('ours async', function (t) { + isexe(ours, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + if (!options || !options.skipFail) { + t.test('fail async', function (t) { + isexe(fail, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + } + + t.test('noent async', function (t) { + isexe(noent, options, function (er, is) { + t.ok(er) + t.notOk(is) + t.end() + }) + }) + + t.test('noent ignore async', function (t) { + isexe(noent, optionsIgnore, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.test('directory is not executable', function (t) { + isexe(__dirname, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.end() +} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js new file mode 100644 index 0000000..3499673 --- /dev/null +++ b/node_modules/isexe/windows.js @@ -0,0 +1,42 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md new file mode 100644 index 0000000..755e6f6 --- /dev/null +++ b/node_modules/js-tokens/CHANGELOG.md @@ -0,0 +1,151 @@ +### Version 4.0.0 (2018-01-28) ### + +- Added: Support for ES2018. The only change needed was recognizing the `s` + regex flag. +- Changed: _All_ tokens returned by the `matchToToken` function now have a + `closed` property. It is set to `undefined` for the tokens where “closed” + doesn’t make sense. This means that all tokens objects have the same shape, + which might improve performance. + +These are the breaking changes: + +- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but + `['/a/s']`. (There are of course other variations of this.) +- Code that rely on some token objects not having the `closed` property could + now behave differently. + + +### Version 3.0.2 (2017-06-28) ### + +- No code changes. Just updates to the readme. + + +### Version 3.0.1 (2017-01-30) ### + +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched + correctly. + + +### Version 3.0.0 (2017-01-11) ### + +This release contains one breaking change, that should [improve performance in +V8][v8-perf]: + +> So how can you, as a JavaScript developer, ensure that your RegExps are fast? +> If you are not interested in hooking into RegExp internals, make sure that +> neither the RegExp instance, nor its prototype is modified in order to get the +> best performance: +> +> ```js +> var re = /./g; +> re.exec(''); // Fast path. +> re.new_property = 'slow'; +> ``` + +This module used to export a single regex, with `.matchToToken` bolted +on, just like in the above example. This release changes the exports of +the module to avoid this issue. + +Before: + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens") +var matchToToken = jsTokens.matchToToken +``` + +After: + +```js +import jsTokens, {matchToToken} from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +var matchToToken = require("js-tokens").matchToToken +``` + +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html + + +### Version 2.0.0 (2016-06-19) ### + +- Added: Support for ES2016. In other words, support for the `**` exponentiation + operator. + +These are the breaking changes: + +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. + + +### Version 1.0.3 (2016-03-27) ### + +- Improved: Made the regex ever so slightly smaller. +- Updated: The readme. + + +### Version 1.0.2 (2015-10-18) ### + +- Improved: Limited npm package contents for a smaller download. Thanks to + @zertosh! + + +### Version 1.0.1 (2015-06-20) ### + +- Fixed: Declared an undeclared variable. + + +### Version 1.0.0 (2015-02-26) ### + +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That + type is now equivalent to the Punctuator token in the ECMAScript + specification. (Backwards-incompatible change.) +- Fixed: A `-` followed by a number is now correctly matched as a punctuator + followed by a number. It used to be matched as just a number, but there is no + such thing as negative number literals. (Possibly backwards-incompatible + change.) + + +### Version 0.4.1 (2015-02-21) ### + +- Added: Support for the regex `u` flag. + + +### Version 0.4.0 (2015-02-21) ### + +- Improved: `jsTokens.matchToToken` performance. +- Added: Support for octal and binary number literals. +- Added: Support for template strings. + + +### Version 0.3.1 (2015-01-06) ### + +- Fixed: Support for unicode spaces. They used to be allowed in names (which is + very confusing), and some unicode newlines were wrongly allowed in strings and + regexes. + + +### Version 0.3.0 (2014-12-19) ### + +- Changed: The `jsTokens.names` array has been replaced with the + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no + longer part of the public API; instead use said function. See this [gist] for + an example. (Backwards-incompatible change.) +- Changed: The empty string is now considered an “invalid” token, instead an + “empty” token (its own group). (Backwards-incompatible change.) +- Removed: component support. (Backwards-incompatible change.) + +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 + + +### Version 0.2.0 (2014-06-19) ### + +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own + category (“functionArrow”), for simplicity. (Backwards-incompatible change.) +- Added: ES6 splats (`...`) are now matched as an operator (instead of three + punctuations). (Backwards-incompatible change.) + + +### Version 0.1.0 (2014-03-08) ### + +- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE new file mode 100644 index 0000000..54aef52 --- /dev/null +++ b/node_modules/js-tokens/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/js-tokens/README.md b/node_modules/js-tokens/README.md new file mode 100644 index 0000000..00cdf16 --- /dev/null +++ b/node_modules/js-tokens/README.md @@ -0,0 +1,240 @@ +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) +======== + +A regex that tokenizes JavaScript. + +```js +var jsTokens = require("js-tokens").default + +var jsString = "var foo=opts.foo;\n..." + +jsString.match(jsTokens) +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] +``` + + +Installation +============ + +`npm install js-tokens` + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +``` + + +Usage +===== + +### `jsTokens` ### + +A regex with the `g` flag that matches JavaScript tokens. + +The regex _always_ matches, even invalid JavaScript and the empty string. + +The next match is always directly after the previous. + +### `var token = matchToToken(match)` ### + +```js +import {matchToToken} from "js-tokens" +// or: +var matchToToken = require("js-tokens").matchToToken +``` + +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: +String, value: String}` object. The following types are available: + +- string +- comment +- regex +- number +- name +- punctuator +- whitespace +- invalid + +Multi-line comments and strings also have a `closed` property indicating if the +token was closed or not (see below). + +Comments and strings both come in several flavors. To distinguish them, check if +the token starts with `//`, `/*`, `'`, `"` or `` ` ``. + +Names are ECMAScript IdentifierNames, that is, including both identifiers and +keywords. You may use [is-keyword-js] to tell them apart. + +Whitespace includes both line terminators and other whitespace. + +[is-keyword-js]: https://github.com/crissdev/is-keyword-js + + +ECMAScript support +================== + +The intention is to always support the latest ECMAScript version whose feature +set has been finalized. + +If adding support for a newer version requires changes, a new version with a +major verion bump will be released. + +Currently, ECMAScript 2018 is supported. + + +Invalid code handling +===================== + +Unterminated strings are still matched as strings. JavaScript strings cannot +contain (unescaped) newlines, so unterminated strings simply end at the end of +the line. Unterminated template strings can contain unescaped newlines, though, +so they go on to the end of input. + +Unterminated multi-line comments are also still matched as comments. They +simply go on to the end of the input. + +Unterminated regex literals are likely matched as division and whatever is +inside the regex. + +Invalid ASCII characters have their own capturing group. + +Invalid non-ASCII characters are treated as names, to simplify the matching of +names (except unicode spaces which are treated as whitespace). Note: See also +the [ES2018](#es2018) section. + +Regex literals may contain invalid regex syntax. They are still matched as +regex literals. They may also contain repeated regex flags, to keep the regex +simple. + +Strings may contain invalid escape sequences. + + +Limitations +=========== + +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be +perfect. But that’s not the point either. + +You may compare jsTokens with [esprima] by using `esprima-compare.js`. +See `npm run esprima-compare`! + +[esprima]: http://esprima.org/ + +### Template string interpolation ### + +Template strings are matched as single tokens, from the starting `` ` `` to the +ending `` ` ``, including interpolations (whose tokens are not matched +individually). + +Matching template string interpolations requires recursive balancing of `{` and +`}`—something that JavaScript regexes cannot do. Only one level of nesting is +supported. + +### Division and regex literals collision ### + +Consider this example: + +```js +var g = 9.82 +var number = bar / 2/g + +var regex = / 2/g +``` + +A human can easily understand that in the `number` line we’re dealing with +division, and in the `regex` line we’re dealing with a regex literal. How come? +Because humans can look at the whole code to put the `/` characters in context. +A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also +look backwards. See the [ES2018](#es2018) section). + +When the `jsTokens` regex scans throught the above, it will see the following +at the end of both the `number` and `regex` rows: + +```js +/ 2/g +``` + +It is then impossible to know if that is a regex literal, or part of an +expression dealing with division. + +Here is a similar case: + +```js +foo /= 2/g +foo(/= 2/g) +``` + +The first line divides the `foo` variable with `2/g`. The second line calls the +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only +sees forwards, it cannot tell the two cases apart. + +There are some cases where we _can_ tell division and regex literals apart, +though. + +First off, we have the simple cases where there’s only one slash in the line: + +```js +var foo = 2/g +foo /= 2 +``` + +Regex literals cannot contain newlines, so the above cases are correctly +identified as division. Things are only problematic when there are more than +one non-comment slash in a single line. + +Secondly, not every character is a valid regex flag. + +```js +var number = bar / 2/e +``` + +The above example is also correctly identified as division, because `e` is not a +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` +(any letter) as flags, but it is not worth it since it increases the amount of +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are +allowed. This means that the above example will be identified as division as +long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 +characters long. + +Lastly, we can look _forward_ for information. + +- If the token following what looks like a regex literal is not valid after a + regex literal, but is valid in a division expression, then the regex literal + is treated as division instead. For example, a flagless regex cannot be + followed by a string, number or name, but all of those three can be the + denominator of a division. +- Generally, if what looks like a regex literal is followed by an operator, the + regex literal is treated as division instead. This is because regexes are + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division + could likely be part of such an expression. + +Please consult the regex source and the test cases for precise information on +when regex or division is matched (should you need to know). In short, you +could sum it up as: + +If the end of a statement looks like a regex literal (even if it isn’t), it +will be treated as one. Otherwise it should work as expected (if you write sane +code). + +### ES2018 ### + +ES2018 added some nice regex improvements to the language. + +- [Unicode property escapes] should allow telling names and invalid non-ASCII + characters apart without blowing up the regex size. +- [Lookbehind assertions] should allow matching telling division and regex + literals apart in more cases. +- [Named capture groups] might simplify some things. + +These things would be nice to do, but are not critical. They probably have to +wait until the oldest maintained Node.js LTS release supports those features. + +[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html +[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html +[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html + + +License +======= + +[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js new file mode 100644 index 0000000..b23a4a0 --- /dev/null +++ b/node_modules/js-tokens/index.js @@ -0,0 +1,23 @@ +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) + +Object.defineProperty(exports, "__esModule", { + value: true +}) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json new file mode 100644 index 0000000..2962f3d --- /dev/null +++ b/node_modules/js-tokens/package.json @@ -0,0 +1,64 @@ +{ + "_from": "js-tokens@^4.0.0", + "_id": "js-tokens@4.0.0", + "_inBundle": false, + "_integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "_location": "/js-tokens", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "js-tokens@^4.0.0", + "name": "js-tokens", + "escapedName": "js-tokens", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/@babel/highlight" + ], + "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "_shasum": "19203fb59991df98e3a287050d4647cdeaf32499", + "_spec": "js-tokens@^4.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/@babel/highlight", + "author": { + "name": "Simon Lydell" + }, + "bugs": { + "url": "https://github.com/lydell/js-tokens/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "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", + "token", + "tokenize", + "regex" + ], + "license": "MIT", + "name": "js-tokens", + "repository": { + "type": "git", + "url": "git+https://github.com/lydell/js-tokens.git" + }, + "scripts": { + "build": "node generate-index.js", + "dev": "npm run build && npm test", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "test": "mocha --ui tdd" + }, + "version": "4.0.0" +} diff --git a/node_modules/js-yaml/CHANGELOG.md b/node_modules/js-yaml/CHANGELOG.md new file mode 100644 index 0000000..b351357 --- /dev/null +++ b/node_modules/js-yaml/CHANGELOG.md @@ -0,0 +1,551 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [3.14.0] - 2020-05-22 +### Changed +- Support `safe/loadAll(input, options)` variant of call. +- CI: drop outdated nodejs versions. +- Dev deps bump. + +### Fixed +- Quote `=` in plain scalars #519. +- Check the node type for `!` tag in case user manually specifies it. +- Verify that there are no null-bytes in input. +- Fix wrong quote position when writing condensed flow, #526. + + +## [3.13.1] - 2019-04-05 +### Security +- Fix possible code execution in (already unsafe) `.load()`, #480. + + +## [3.13.0] - 2019-03-20 +### Security +- Security fix: `safeLoad()` can hang when arrays with nested refs + used as key. Now throws exception for nested arrays. #475. + + +## [3.12.2] - 2019-02-26 +### Fixed +- Fix `noArrayIndent` option for root level, #468. + + +## [3.12.1] - 2019-01-05 +### Added +- Added `noArrayIndent` option, #432. + + +## [3.12.0] - 2018-06-02 +### Changed +- Support arrow functions without a block statement, #421. + + +## [3.11.0] - 2018-03-05 +### Added +- Add arrow functions suport for `!!js/function`. + +### Fixed +- Fix dump in bin/octal/hex formats for negative integers, #399. + + +## [3.10.0] - 2017-09-10 +### Fixed +- Fix `condenseFlow` output (quote keys for sure, instead of spaces), #371, #370. +- Dump astrals as codepoints instead of surrogate pair, #368. + + +## [3.9.1] - 2017-07-08 +### Fixed +- Ensure stack is present for custom errors in node 7.+, #351. + + +## [3.9.0] - 2017-07-08 +### Added +- Add `condenseFlow` option (to create pretty URL query params), #346. + +### Fixed +- Support array return from safeLoadAll/loadAll, #350. + + +## [3.8.4] - 2017-05-08 +### Fixed +- Dumper: prevent space after dash for arrays that wrap, #343. + + +## [3.8.3] - 2017-04-05 +### Fixed +- Should not allow numbers to begin and end with underscore, #335. + + +## [3.8.2] - 2017-03-02 +### Fixed +- Fix `!!float 123` (integers) parse, #333. +- Don't allow leading zeros in floats (except 0, 0.xxx). +- Allow positive exponent without sign in floats. + + +## [3.8.1] - 2017-02-07 +### Changed +- Maintenance: update browserified build. + + +## [3.8.0] - 2017-02-07 +### Fixed +- Fix reported position for `duplicated mapping key` errors. + Now points to block start instead of block end. + (#243, thanks to @shockey). + + +## [3.7.0] - 2016-11-12 +### Added +- Support polymorphism for tags (#300, thanks to @monken). + +### Fixed +- Fix parsing of quotes followed by newlines (#304, thanks to @dplepage). + + +## [3.6.1] - 2016-05-11 +### Fixed +- Fix output cut on a pipe, #286. + + +## [3.6.0] - 2016-04-16 +### Fixed +- Dumper rewrite, fix multiple bugs with trailing `\n`. + Big thanks to @aepsilon! +- Loader: fix leading/trailing newlines in block scalars, @aepsilon. + + +## [3.5.5] - 2016-03-17 +### Fixed +- Date parse fix: don't allow dates with on digit in month and day, #268. + + +## [3.5.4] - 2016-03-09 +### Added +- `noCompatMode` for dumper, to disable quoting YAML 1.1 values. + + +## [3.5.3] - 2016-02-11 +### Changed +- Maintenance release. + + +## [3.5.2] - 2016-01-11 +### Changed +- Maintenance: missed comma in bower config. + + +## [3.5.1] - 2016-01-11 +### Changed +- Removed `inherit` dependency, #239. +- Better browserify workaround for esprima load. +- Demo rewrite. + + +## [3.5.0] - 2016-01-10 +### Fixed +- Dumper. Fold strings only, #217. +- Dumper. `norefs` option, to clone linked objects, #229. +- Loader. Throw a warning for duplicate keys, #166. +- Improved browserify support (mark `esprima` & `Buffer` excluded). + + +## [3.4.6] - 2015-11-26 +### Changed +- Use standalone `inherit` to keep browserified files clear. + + +## [3.4.5] - 2015-11-23 +### Added +- Added `lineWidth` option to dumper. + + +## [3.4.4] - 2015-11-21 +### Fixed +- Fixed floats dump (missed dot for scientific format), #220. +- Allow non-printable characters inside quoted scalars, #192. + + +## [3.4.3] - 2015-10-10 +### Changed +- Maintenance release - deps bump (esprima, argparse). + + +## [3.4.2] - 2015-09-09 +### Fixed +- Fixed serialization of duplicated entries in sequences, #205. + Thanks to @vogelsgesang. + + +## [3.4.1] - 2015-09-05 +### Fixed +- Fixed stacktrace handling in generated errors, for browsers (FF/IE). + + +## [3.4.0] - 2015-08-23 +### Changed +- Don't throw on warnings anymore. Use `onWarning` option to catch. +- Throw error on unknown tags (was warning before). +- Reworked internals of error class. + +### Fixed +- Fixed multiline keys dump, #197. Thanks to @tcr. +- Fixed heading line breaks in some scalars (regression). + + +## [3.3.1] - 2015-05-13 +### Added +- Added `.sortKeys` dumper option, thanks to @rjmunro. + +### Fixed +- Fixed astral characters support, #191. + + +## [3.3.0] - 2015-04-26 +### Changed +- Significantly improved long strings formatting in dumper, thanks to @isaacs. +- Strip BOM if exists. + + +## [3.2.7] - 2015-02-19 +### Changed +- Maintenance release. +- Updated dependencies. +- HISTORY.md -> CHANGELOG.md + + +## [3.2.6] - 2015-02-07 +### Fixed +- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE). +- Fixed demo dates dump (#113, thanks to @Hypercubed). + + +## [3.2.5] - 2014-12-28 +### Fixed +- Fixed resolving of all built-in types on empty nodes. +- Fixed invalid warning on empty lines within quoted scalars and flow collections. +- Fixed bug: Tag on an empty node didn't resolve in some cases. + + +## [3.2.4] - 2014-12-19 +### Fixed +- Fixed resolving of !!null tag on an empty node. + + +## [3.2.3] - 2014-11-08 +### Fixed +- Implemented dumping of objects with circular and cross references. +- Partially fixed aliasing of constructed objects. (see issue #141 for details) + + +## [3.2.2] - 2014-09-07 +### Fixed +- Fixed infinite loop on unindented block scalars. +- Rewritten base64 encode/decode in binary type, to keep code licence clear. + + +## [3.2.1] - 2014-08-24 +### Fixed +- Nothig new. Just fix npm publish error. + + +## [3.2.0] - 2014-08-24 +### Added +- Added input piping support to CLI. + +### Fixed +- Fixed typo, that could cause hand on initial indent (#139). + + +## [3.1.0] - 2014-07-07 +### Changed +- 1.5x-2x speed boost. +- Removed deprecated `require('xxx.yml')` support. +- Significant code cleanup and refactoring. +- Internal API changed. If you used custom types - see updated examples. + Others are not affected. +- Even if the input string has no trailing line break character, + it will be parsed as if it has one. +- Added benchmark scripts. +- Moved bower files to /dist folder +- Bugfixes. + + +## [3.0.2] - 2014-02-27 +### Fixed +- Fixed bug: "constructor" string parsed as `null`. + + +## [3.0.1] - 2013-12-22 +### Fixed +- Fixed parsing of literal scalars. (issue #108) +- Prevented adding unnecessary spaces in object dumps. (issue #68) +- Fixed dumping of objects with very long (> 1024 in length) keys. + + +## [3.0.0] - 2013-12-16 +### Changed +- Refactored code. Changed API for custom types. +- Removed output colors in CLI, dump json by default. +- Removed big dependencies from browser version (esprima, buffer). Load `esprima` manually, if `!!js/function` needed. `!!bin` now returns Array in browser +- AMD support. +- Don't quote dumped strings because of `-` & `?` (if not first char). +- __Deprecated__ loading yaml files via `require()`, as not recommended + behaviour for node. + + +## [2.1.3] - 2013-10-16 +### Fixed +- Fix wrong loading of empty block scalars. + + +## [2.1.2] - 2013-10-07 +### Fixed +- Fix unwanted line breaks in folded scalars. + + +## [2.1.1] - 2013-10-02 +### Fixed +- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 +- Fixed reader bug in JSON-like sequences/mappings. + + +## [2.1.0] - 2013-06-05 +### Added +- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), + JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). +- Add `skipInvalid` dumper option. + +### Changed +- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` + and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. +- Use `safeLoad` for `require` extension. + +### Fixed +- Bug fix: export `NIL` constant from the public interface. + + +## [2.0.5] - 2013-04-26 +### Security +- Close security issue in !!js/function constructor. + Big thanks to @nealpoole for security audit. + + +## [2.0.4] - 2013-04-08 +### Changed +- Updated .npmignore to reduce package size + + +## [2.0.3] - 2013-02-26 +### Fixed +- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) + + +## [2.0.2] - 2013-02-15 +### Fixed +- Fixed input validation: tabs are printable characters. + + +## [2.0.1] - 2013-02-09 +### Fixed +- Fixed error, when options not passed to function cass + + +## [2.0.0] - 2013-02-09 +### Changed +- Full rewrite. New architecture. Fast one-stage parsing. +- Changed custom types API. +- Added YAML dumper. + + +## [1.0.3] - 2012-11-05 +### Fixed +- Fixed utf-8 files loading. + + +## [1.0.2] - 2012-08-02 +### Fixed +- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. +- Fix timstamps incorectly parsed in local time when no time part specified. + + +## [1.0.1] - 2012-07-07 +### Fixed +- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. +- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. + + +## [1.0.0] - 2012-07-01 +### Changed +- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. + Fixes #42. +- `require(filename)` now returns a single document and throws an Error if + file contains more than one document. +- CLI was merged back from js-yaml.bin + + +## [0.3.7] - 2012-02-28 +### Fixed +- Fix export of `addConstructor()`. Closes #39. + + +## [0.3.6] - 2012-02-22 +### Changed +- Removed AMD parts - too buggy to use. Need help to rewrite from scratch + +### Fixed +- Removed YUI compressor warning (renamed `double` variable). Closes #40. + + +## [0.3.5] - 2012-01-10 +### Fixed +- Workagound for .npmignore fuckup under windows. Thanks to airportyh. + + +## [0.3.4] - 2011-12-24 +### Fixed +- Fixes str[] for oldIEs support. +- Adds better has change support for browserified demo. +- improves compact output of Error. Closes #33. + + +## [0.3.3] - 2011-12-20 +### Added +- adds `compact` stringification of Errors. + +### Changed +- jsyaml executable moved to separate module. + + +## [0.3.2] - 2011-12-16 +### Added +- Added jsyaml executable. +- Added !!js/function support. Closes #12. + +### Fixed +- Fixes ug with block style scalars. Closes #26. +- All sources are passing JSLint now. +- Fixes bug in Safari. Closes #28. +- Fixes bug in Opers. Closes #29. +- Improves browser support. Closes #20. + + +## [0.3.1] - 2011-11-18 +### Added +- Added AMD support for browserified version. +- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. +- Added !!js/regexp and !!js/undefined types. Partially solves #12. + +### Changed +- Wrapped browserified js-yaml into closure. + +### Fixed +- Fixed the resolvement of non-specific tags. Closes #17. +- Fixed !!set mapping. +- Fixed month parse in dates. Closes #19. + + +## [0.3.0] - 2011-11-09 +### Added +- Added browserified version. Closes #13. +- Added live demo of browserified version. +- Ported some of the PyYAML tests. See #14. + +### Fixed +- Removed JS.Class dependency. Closes #3. +- Fixed timestamp bug when fraction was given. + + +## [0.2.2] - 2011-11-06 +### Fixed +- Fixed crash on docs without ---. Closes #8. +- Fixed multiline string parse +- Fixed tests/comments for using array as key + + +## [0.2.1] - 2011-11-02 +### Fixed +- Fixed short file read (<4k). Closes #9. + + +## [0.2.0] - 2011-11-02 +### Changed +- First public release + + +[3.14.0]: https://github.com/nodeca/js-yaml/compare/3.13.1...3.14.0 +[3.13.1]: https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1 +[3.13.0]: https://github.com/nodeca/js-yaml/compare/3.12.2...3.13.0 +[3.12.2]: https://github.com/nodeca/js-yaml/compare/3.12.1...3.12.2 +[3.12.1]: https://github.com/nodeca/js-yaml/compare/3.12.0...3.12.1 +[3.12.0]: https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0 +[3.11.0]: https://github.com/nodeca/js-yaml/compare/3.10.0...3.11.0 +[3.10.0]: https://github.com/nodeca/js-yaml/compare/3.9.1...3.10.0 +[3.9.1]: https://github.com/nodeca/js-yaml/compare/3.9.0...3.9.1 +[3.9.0]: https://github.com/nodeca/js-yaml/compare/3.8.4...3.9.0 +[3.8.4]: https://github.com/nodeca/js-yaml/compare/3.8.3...3.8.4 +[3.8.3]: https://github.com/nodeca/js-yaml/compare/3.8.2...3.8.3 +[3.8.2]: https://github.com/nodeca/js-yaml/compare/3.8.1...3.8.2 +[3.8.1]: https://github.com/nodeca/js-yaml/compare/3.8.0...3.8.1 +[3.8.0]: https://github.com/nodeca/js-yaml/compare/3.7.0...3.8.0 +[3.7.0]: https://github.com/nodeca/js-yaml/compare/3.6.1...3.7.0 +[3.6.1]: https://github.com/nodeca/js-yaml/compare/3.6.0...3.6.1 +[3.6.0]: https://github.com/nodeca/js-yaml/compare/3.5.5...3.6.0 +[3.5.5]: https://github.com/nodeca/js-yaml/compare/3.5.4...3.5.5 +[3.5.4]: https://github.com/nodeca/js-yaml/compare/3.5.3...3.5.4 +[3.5.3]: https://github.com/nodeca/js-yaml/compare/3.5.2...3.5.3 +[3.5.2]: https://github.com/nodeca/js-yaml/compare/3.5.1...3.5.2 +[3.5.1]: https://github.com/nodeca/js-yaml/compare/3.5.0...3.5.1 +[3.5.0]: https://github.com/nodeca/js-yaml/compare/3.4.6...3.5.0 +[3.4.6]: https://github.com/nodeca/js-yaml/compare/3.4.5...3.4.6 +[3.4.5]: https://github.com/nodeca/js-yaml/compare/3.4.4...3.4.5 +[3.4.4]: https://github.com/nodeca/js-yaml/compare/3.4.3...3.4.4 +[3.4.3]: https://github.com/nodeca/js-yaml/compare/3.4.2...3.4.3 +[3.4.2]: https://github.com/nodeca/js-yaml/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/nodeca/js-yaml/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/nodeca/js-yaml/compare/3.3.1...3.4.0 +[3.3.1]: https://github.com/nodeca/js-yaml/compare/3.3.0...3.3.1 +[3.3.0]: https://github.com/nodeca/js-yaml/compare/3.2.7...3.3.0 +[3.2.7]: https://github.com/nodeca/js-yaml/compare/3.2.6...3.2.7 +[3.2.6]: https://github.com/nodeca/js-yaml/compare/3.2.5...3.2.6 +[3.2.5]: https://github.com/nodeca/js-yaml/compare/3.2.4...3.2.5 +[3.2.4]: https://github.com/nodeca/js-yaml/compare/3.2.3...3.2.4 +[3.2.3]: https://github.com/nodeca/js-yaml/compare/3.2.2...3.2.3 +[3.2.2]: https://github.com/nodeca/js-yaml/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/nodeca/js-yaml/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/nodeca/js-yaml/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/nodeca/js-yaml/compare/3.0.2...3.1.0 +[3.0.2]: https://github.com/nodeca/js-yaml/compare/3.0.1...3.0.2 +[3.0.1]: https://github.com/nodeca/js-yaml/compare/3.0.0...3.0.1 +[3.0.0]: https://github.com/nodeca/js-yaml/compare/2.1.3...3.0.0 +[2.1.3]: https://github.com/nodeca/js-yaml/compare/2.1.2...2.1.3 +[2.1.2]: https://github.com/nodeca/js-yaml/compare/2.1.1...2.1.2 +[2.1.1]: https://github.com/nodeca/js-yaml/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/nodeca/js-yaml/compare/2.0.5...2.1.0 +[2.0.5]: https://github.com/nodeca/js-yaml/compare/2.0.4...2.0.5 +[2.0.4]: https://github.com/nodeca/js-yaml/compare/2.0.3...2.0.4 +[2.0.3]: https://github.com/nodeca/js-yaml/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/nodeca/js-yaml/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/nodeca/js-yaml/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/js-yaml/compare/1.0.3...2.0.0 +[1.0.3]: https://github.com/nodeca/js-yaml/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/js-yaml/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/js-yaml/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/js-yaml/compare/0.3.7...1.0.0 +[0.3.7]: https://github.com/nodeca/js-yaml/compare/0.3.6...0.3.7 +[0.3.6]: https://github.com/nodeca/js-yaml/compare/0.3.5...0.3.6 +[0.3.5]: https://github.com/nodeca/js-yaml/compare/0.3.4...0.3.5 +[0.3.4]: https://github.com/nodeca/js-yaml/compare/0.3.3...0.3.4 +[0.3.3]: https://github.com/nodeca/js-yaml/compare/0.3.2...0.3.3 +[0.3.2]: https://github.com/nodeca/js-yaml/compare/0.3.1...0.3.2 +[0.3.1]: https://github.com/nodeca/js-yaml/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/nodeca/js-yaml/compare/0.2.2...0.3.0 +[0.2.2]: https://github.com/nodeca/js-yaml/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/nodeca/js-yaml/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/nodeca/js-yaml/releases/tag/0.2.0 diff --git a/node_modules/js-yaml/LICENSE b/node_modules/js-yaml/LICENSE new file mode 100644 index 0000000..09d3a29 --- /dev/null +++ b/node_modules/js-yaml/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2011-2015 by Vitaly Puzrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/js-yaml/README.md b/node_modules/js-yaml/README.md new file mode 100644 index 0000000..246e563 --- /dev/null +++ b/node_modules/js-yaml/README.md @@ -0,0 +1,299 @@ +JS-YAML - YAML 1.2 parser / writer for JavaScript +================================================= + +[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml) +[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) + +__[Online Demo](http://nodeca.github.com/js-yaml/)__ + + +This is an implementation of [YAML](http://yaml.org/), a human-friendly data +serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was +completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. + + +Installation +------------ + +### YAML module for node.js + +``` +npm install js-yaml +``` + + +### CLI executable + +If you want to inspect your YAML files from CLI, install js-yaml globally: + +``` +npm install -g js-yaml +``` + +#### Usage + +``` +usage: js-yaml [-h] [-v] [-c] [-t] file + +Positional arguments: + file File with YAML document(s) + +Optional arguments: + -h, --help Show this help message and exit. + -v, --version Show program's version number and exit. + -c, --compact Display errors in compact mode + -t, --trace Show stack trace on error +``` + + +### Bundled YAML library for browsers + +``` html + + + + +``` + +Browser support was done mostly for the online demo. If you find any errors - feel +free to send pull requests with fixes. Also note, that IE and other old browsers +needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. + +Notes: + +1. We have no resources to support browserified version. Don't expect it to be + well tested. Don't expect fast fixes if something goes wrong there. +2. `!!js/function` in browser bundle will not work by default. If you really need + it - load `esprima` parser first (via amd or directly). +3. `!!bin` in browser will return `Array`, because browsers do not support + node.js `Buffer` and adding Buffer shims is completely useless on practice. + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and +[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more +info. + +``` javascript +const yaml = require('js-yaml'); +const fs = require('fs'); + +// Get document, or throw exception on error +try { + const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### safeLoad (string [ , options ]) + +**Recommended loading way.** Parses `string` as single YAML document. Returns either a +plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. This method is safe for untrusted data. + +options: + +- `filename` _(default: null)_ - string to be used as a file path in + error/warning messages. +- `onWarning` _(default: null)_ - function to call on warning messages. + Loader will call this function with an instance of `YAMLException` for each warning. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. + - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: + http://www.yaml.org/spec/1.2/spec.html#id2802346 + - `JSON_SCHEMA` - all JSON-supported types: + http://www.yaml.org/spec/1.2/spec.html#id2803231 + - `CORE_SCHEMA` - same as `JSON_SCHEMA`: + http://www.yaml.org/spec/1.2/spec.html#id2804923 + - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones + (`!!js/undefined`, `!!js/regexp` and `!!js/function`): + http://yaml.org/type/ + - `DEFAULT_FULL_SCHEMA` - all supported YAML types. +- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. + +NOTE: This function **does not** understand multi-document sources, it throws +exception on those. + +NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. +So, the JSON schema is not as strictly defined in the YAML specification. +It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. +The core schema also has no such restrictions. It allows binary notation for integers. + + +### load (string [ , options ]) + +**Use with care with untrusted sources**. The same as `safeLoad()` but uses +`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: +`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you +must additionally validate object structure to avoid injections: + +``` javascript +const untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; + +// I'm just converting that string, what could possibly go wrong? +require('js-yaml').load(untrusted_code) + '' +``` + + +### safeLoadAll (string [, iterator] [, options ]) + +Same as `safeLoad()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.safeLoadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### loadAll (string [, iterator] [ , options ]) + +Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. + + +### safeDump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will +throw an exception if you try to dump regexps or functions. However, you can +disable exceptions by setting the `skipInvalid` option to `true`. + +options: + +- `indent` _(default: 2)_ - indentation width to use (in spaces). +- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements +- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function + in the safe schema) and skip pairs and single values with such types. +- `flowLevel` (default: -1) - specifies level of nesting, when to switch from + block to flow style for collections. -1 means block style everwhere +- `styles` - "tag" => "style" map. Each tag may have own set of styles. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. +- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a + function, use the function to sort the keys. +- `lineWidth` _(default: `80`)_ - set max line width. +- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 +- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. + +The following table show availlable styles (e.g. "canonical", +"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml +output is shown on the right side after `=>` (default setting) or `->`: + +``` none +!!null + "canonical" -> "~" + "lowercase" => "null" + "uppercase" -> "NULL" + "camelcase" -> "Null" + +!!int + "binary" -> "0b1", "0b101010", "0b1110001111010" + "octal" -> "01", "052", "016172" + "decimal" => "1", "42", "7290" + "hexadecimal" -> "0x1", "0x2A", "0x1C7A" + +!!bool + "lowercase" => "true", "false" + "uppercase" -> "TRUE", "FALSE" + "camelcase" -> "True", "False" + +!!float + "lowercase" => ".nan", '.inf' + "uppercase" -> ".NAN", '.INF' + "camelcase" -> ".NaN", '.Inf' +``` + +Example: + +``` javascript +safeDump (object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +### dump (object [ , options ]) + +Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). + + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScipt types. See also +[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and +[YAML types repository](http://yaml.org/type/). + +``` +!!null '' # null +!!bool 'yes' # bool +!!int '3...' # number +!!float '3.14...' # number +!!binary '...base64...' # buffer +!!timestamp 'YYYY-...' # date +!!omap [ ... ] # array of key-value pairs +!!pairs [ ... ] # array or array pairs +!!set { ... } # array of objects with given keys and null values +!!str '...' # string +!!seq [ ... ] # array +!!map { ... } # object +``` + +**JavaScript-specific tags** + +``` +!!js/regexp /pattern/gim # RegExp +!!js/undefined '' # Undefined +!!js/function 'function () {...}' # Function +``` + +Caveats +------- + +Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects +or arrays as keys, and stringifies (by calling `toString()` method) them at the +moment of adding them. + +``` yaml +--- +? [ foo, bar ] +: - baz +? { foo: bar } +: - baz + - baz +``` + +``` javascript +{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } +``` + +Also, reading of properties on implicit block mapping keys is not supported yet. +So, the following YAML document cannot be loaded. + +``` yaml +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key +``` + + +js-yaml for enterprise +---------------------- + +Available as part of the Tidelift Subscription + +The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/js-yaml/bin/js-yaml.js b/node_modules/js-yaml/bin/js-yaml.js new file mode 100755 index 0000000..e79186b --- /dev/null +++ b/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,132 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +// stdlib +var fs = require('fs'); + + +// 3rd-party +var argparse = require('argparse'); + + +// internal +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + version: require('../package.json').version, + addHelp: true +}); + + +cli.addArgument([ '-c', '--compact' ], { + help: 'Display errors in compact mode', + action: 'storeTrue' +}); + + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.addArgument([ '-j', '--to-json' ], { + help: argparse.Const.SUPPRESS, + dest: 'json', + action: 'storeTrue' +}); + + +cli.addArgument([ '-t', '--trace' ], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + +cli.addArgument([ 'file' ], { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + defaultValue: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parseArgs(); + + +//////////////////////////////////////////////////////////////////////////////// + +function readFile(filename, encoding, callback) { + if (options.file === '-') { + // read from stdin + + var chunks = []; + + process.stdin.on('data', function (chunk) { + chunks.push(chunk); + }); + + process.stdin.on('end', function () { + return callback(null, Buffer.concat(chunks).toString(encoding)); + }); + } else { + fs.readFile(filename, encoding, callback); + } +} + +readFile(options.file, 'utf8', function (error, input) { + var output, isYaml; + + if (error) { + if (error.code === 'ENOENT') { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + + try { + output = JSON.parse(input); + isYaml = false; + } catch (err) { + if (err instanceof SyntaxError) { + try { + output = []; + yaml.loadAll(input, function (doc) { output.push(doc); }, {}); + isYaml = true; + + if (output.length === 0) output = null; + else if (output.length === 1) output = output[0]; + + } catch (e) { + if (options.trace && err.stack) console.error(e.stack); + else console.error(e.toString(options.compact)); + + process.exit(1); + } + } else { + console.error( + options.trace && err.stack || + err.message || + String(err)); + + process.exit(1); + } + } + + if (isYaml) console.log(JSON.stringify(output, null, ' ')); + else console.log(yaml.dump(output)); +}); diff --git a/node_modules/js-yaml/dist/js-yaml.js b/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 0000000..d7287d4 --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,3989 @@ +/* js-yaml 3.14.0 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = 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 */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; + +},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; + +},{}],5:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!state.anchorMap.hasOwnProperty(alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; + +},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; + +},{"./common":2}],7:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; + +},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); + +},{"../schema":7,"./json":12}],9:[function(require,module,exports){ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); + +},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); + +},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); + +},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); + +},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + +},{"./exception":4}],14:[function(require,module,exports){ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +},{"../type":13}],15:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],16:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +},{"../common":2,"../type":13}],17:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + +},{"../common":2,"../type":13}],18:[function(require,module,exports){ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); + +},{"../../type":13}],19:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); + +},{"../../type":13}],20:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); + +},{"../../type":13}],21:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +},{"../type":13}],22:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +},{"../type":13}],23:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],24:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +},{"../type":13}],25:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +},{"../type":13}],26:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +},{"../type":13}],27:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +},{"../type":13}],28:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +},{"../type":13}],29:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +},{"../type":13}],"/":[function(require,module,exports){ +'use strict'; + + +var yaml = require('./lib/js-yaml.js'); + + +module.exports = yaml; + +},{"./lib/js-yaml.js":1}]},{},[])("/") +}); diff --git a/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 0000000..f72401e --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}(function(){return function o(a,s,c){function u(t,e){if(!s[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(l)return l(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var r=s[t]={exports:{}};a[t][0].call(r.exports,function(e){return u(a[t][1][e]||e)},r,r.exports,o,a,s,c)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e=i.flowLevel;switch(V(r,n,i.indent,t,function(e){return function(e,t){for(var n=0,i=e.implicitTypes.length;n"+z(r,i.indent)+J(U(function(t,n){var e,i,r=/(\n+)([^\n]*)/g,o=function(){var e=-1!==(e=t.indexOf("\n"))?e:t.length;return r.lastIndex=e,Q(t.slice(0,e),n)}(),a="\n"===t[0]||" "===t[0];for(;i=r.exec(t);){var s=i[1],c=i[2];e=" "===c[0],o+=s+(a||e||""===c?"":"\n")+Q(c,n),a=e}return o}(r,t),e));case G:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+o+'" style');i=r.represent[o](t,o)}e.dump=i}return 1}}function ee(e,t,n,i,r,o){e.tag=null,e.dump=n,X(e,n,!1)||X(e,n,!0);var a=p.call(e.dump);i=i&&(e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return 1}function te(e,t){var n,i,r=[],o=[];for(!function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o>10),56320+(s-65536&1023)),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else O(p)?(L(e,n,i,!0),B(e,Y(e,!1,t)),n=i=e.position):e.position===e.lineStart&&R(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}}function W(e,t){var n,i,r=e.tag,o=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&45===i&&F(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,K(e,t,A,!1,!0),a.push(e.result),Y(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)N(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(K(e,t,b,!0,r)&&(m?d=e.result:h=e.result),m||(U(e,l,p,f,d,h,o,a),f=d=h=null),Y(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndentu&&(u=e.lineIndent),O(f))l++;else{if(e.lineIndent=t){a=!0,f=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(L(e,r,o,!1),B(e,e.line-s),r=o=e.position,a=!1),E(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}if(L(e,r,o,!1),e.result)return 1;e.kind=l,e.result=p}}(e,p,x===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=s&&W(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&N(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new h(e,t),i=e.indexOf("\0");for(-1!==i&&(n.position=i,N(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.positiont/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var r=e("./common"),o=e("./exception"),a=e("./type");function s(e,t,i){var r=[];return e.include.forEach(function(e){i=s(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function c(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=s(this,"implicit",[]),this.compiledExplicit=s(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|r.indexOf(n.charAt(s));return 0==(t=i%4*6)?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18==t?(a.push(o>>10&255),a.push(o>>2&255)):12==t&&a.push(o>>4&255),c?c.from?c.from(a):new c(a):a},predicate:function(e){return c&&c.isBuffer(e)},represent:function(e){for(var t,n="",i=0,r=e.length,o=u,a=0;a>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2==t?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1==t&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}})},{"../type":13}],15:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type"),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),i="-"===n[0]?-1:1,r=[];return 0<="+-".indexOf(n[0])&&(n=n.slice(1)),".inf"===n?1==i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),n=0,t=1,r.forEach(function(e){n+=e*t,t*=60}),i*n):i*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type");t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; diff --git a/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/js-yaml/lib/js-yaml/exception.js new file mode 100644 index 0000000..b744a1e --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/exception.js @@ -0,0 +1,43 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; diff --git a/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/js-yaml/lib/js-yaml/loader.js new file mode 100644 index 0000000..ef01386 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/loader.js @@ -0,0 +1,1644 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!state.anchorMap.hasOwnProperty(alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; diff --git a/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/js-yaml/lib/js-yaml/mark.js new file mode 100644 index 0000000..47b265c --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/mark.js @@ -0,0 +1,76 @@ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; diff --git a/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/js-yaml/lib/js-yaml/schema.js new file mode 100644 index 0000000..ca7cf47 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema.js @@ -0,0 +1,108 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; diff --git a/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/js-yaml/lib/js-yaml/schema/core.js new file mode 100644 index 0000000..206daab --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/core.js @@ -0,0 +1,18 @@ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js new file mode 100644 index 0000000..a55ef42 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js @@ -0,0 +1,25 @@ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js new file mode 100644 index 0000000..11d89bb --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js @@ -0,0 +1,28 @@ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js new file mode 100644 index 0000000..b7a33eb --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js @@ -0,0 +1,17 @@ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/js-yaml/lib/js-yaml/schema/json.js new file mode 100644 index 0000000..5be3dbf --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/json.js @@ -0,0 +1,25 @@ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/js-yaml/lib/js-yaml/type.js new file mode 100644 index 0000000..90b702a --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type.js @@ -0,0 +1,61 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; diff --git a/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/js-yaml/lib/js-yaml/type/binary.js new file mode 100644 index 0000000..10b1875 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -0,0 +1,138 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/js-yaml/lib/js-yaml/type/bool.js new file mode 100644 index 0000000..cb77459 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -0,0 +1,35 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/js-yaml/lib/js-yaml/type/float.js new file mode 100644 index 0000000..127671b --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -0,0 +1,116 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/js-yaml/lib/js-yaml/type/int.js new file mode 100644 index 0000000..ba61c5f --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -0,0 +1,173 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/js-yaml/lib/js-yaml/type/js/function.js new file mode 100644 index 0000000..8fab8c4 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -0,0 +1,93 @@ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js new file mode 100644 index 0000000..43fa470 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -0,0 +1,60 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js new file mode 100644 index 0000000..95b5569 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js @@ -0,0 +1,28 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/js-yaml/lib/js-yaml/type/map.js new file mode 100644 index 0000000..f327bee --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/js-yaml/lib/js-yaml/type/merge.js new file mode 100644 index 0000000..ae08a86 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -0,0 +1,12 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/js-yaml/lib/js-yaml/type/null.js new file mode 100644 index 0000000..6874daa --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -0,0 +1,34 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/js-yaml/lib/js-yaml/type/omap.js new file mode 100644 index 0000000..b2b5323 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -0,0 +1,44 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/js-yaml/lib/js-yaml/type/pairs.js new file mode 100644 index 0000000..74b5240 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -0,0 +1,53 @@ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/js-yaml/lib/js-yaml/type/seq.js new file mode 100644 index 0000000..be8f77f --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/js-yaml/lib/js-yaml/type/set.js new file mode 100644 index 0000000..f885a32 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -0,0 +1,29 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/js-yaml/lib/js-yaml/type/str.js new file mode 100644 index 0000000..27acc10 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js new file mode 100644 index 0000000..8fa9c58 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -0,0 +1,88 @@ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json new file mode 100644 index 0000000..7aa3a8e --- /dev/null +++ b/node_modules/js-yaml/package.json @@ -0,0 +1,96 @@ +{ + "_from": "js-yaml@^3.13.1", + "_id": "js-yaml@3.14.0", + "_inBundle": false, + "_integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "_location": "/js-yaml", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "js-yaml@^3.13.1", + "name": "js-yaml", + "escapedName": "js-yaml", + "rawSpec": "^3.13.1", + "saveSpec": null, + "fetchSpec": "^3.13.1" + }, + "_requiredBy": [ + "/@eslint/eslintrc", + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "_shasum": "a7a34170f26a21bb162424d8adacb4113a69e482", + "_spec": "js-yaml@^3.13.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Vladimir Zapparov", + "email": "dervus.grim@gmail.com" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "bugs": { + "url": "https://github.com/nodeca/js-yaml/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Aleksey V Zapparov", + "email": "ixti@member.fsf.org", + "url": "http://www.ixti.net/" + }, + { + "name": "Vitaly Puzrin", + "email": "vitaly@rcdesign.ru", + "url": "https://github.com/puzrin" + }, + { + "name": "Martin Grenfell", + "email": "martin.grenfell@gmail.com", + "url": "http://got-ravings.blogspot.com" + } + ], + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "deprecated": false, + "description": "YAML 1.2 parser and serializer", + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "browserify": "^16.2.2", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^1.24.2", + "istanbul": "^0.4.5", + "mocha": "^7.1.2", + "uglify-js": "^3.0.1" + }, + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "jsdelivr": "dist/js-yaml.min.js", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "license": "MIT", + "name": "js-yaml", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/js-yaml.git" + }, + "scripts": { + "test": "make test" + }, + "unpkg": "dist/js-yaml.min.js", + "version": "3.14.0" +} diff --git a/node_modules/json-stable-stringify-without-jsonify/.npmignore b/node_modules/json-stable-stringify-without-jsonify/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/json-stable-stringify-without-jsonify/.travis.yml b/node_modules/json-stable-stringify-without-jsonify/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/json-stable-stringify-without-jsonify/LICENSE b/node_modules/json-stable-stringify-without-jsonify/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/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/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js b/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js new file mode 100644 index 0000000..d5f6675 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/json-stable-stringify-without-jsonify/example/nested.js b/node_modules/json-stable-stringify-without-jsonify/example/nested.js new file mode 100644 index 0000000..9a672fc --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/json-stable-stringify-without-jsonify/example/str.js b/node_modules/json-stable-stringify-without-jsonify/example/str.js new file mode 100644 index 0000000..9b4b3cd --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js b/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js new file mode 100644 index 0000000..09f1c5f --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/json-stable-stringify-without-jsonify/index.js b/node_modules/json-stable-stringify-without-jsonify/index.js new file mode 100644 index 0000000..a6f40c7 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/index.js @@ -0,0 +1,82 @@ +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return JSON.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || JSON.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = JSON.stringify(key) + + colonSeparator + + value; + ; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; diff --git a/node_modules/json-stable-stringify-without-jsonify/package.json b/node_modules/json-stable-stringify-without-jsonify/package.json new file mode 100644 index 0000000..e6a4357 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/package.json @@ -0,0 +1,72 @@ +{ + "_from": "json-stable-stringify-without-jsonify@^1.0.1", + "_id": "json-stable-stringify-without-jsonify@1.0.1", + "_inBundle": false, + "_integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "_location": "/json-stable-stringify-without-jsonify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "json-stable-stringify-without-jsonify@^1.0.1", + "name": "json-stable-stringify-without-jsonify", + "escapedName": "json-stable-stringify-without-jsonify", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "_shasum": "9db7b59496ad3f3cfef30a75142d2d930ad72651", + "_spec": "json-stable-stringify-without-jsonify@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/samn/json-stable-stringify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies", + "devDependencies": { + "tape": "~1.0.4" + }, + "homepage": "https://github.com/samn/json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "sort", + "stable" + ], + "license": "MIT", + "main": "index.js", + "name": "json-stable-stringify-without-jsonify", + "repository": { + "type": "git", + "url": "git://github.com/samn/json-stable-stringify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "ff/5", + "ff/latest", + "chrome/15", + "chrome/latest", + "safari/latest", + "opera/latest" + ] + }, + "version": "1.0.1" +} diff --git a/node_modules/json-stable-stringify-without-jsonify/readme.markdown b/node_modules/json-stable-stringify-without-jsonify/readme.markdown new file mode 100644 index 0000000..e95b468 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/readme.markdown @@ -0,0 +1,132 @@ +# json-stable-stringify + +This is the same as https://github.com/substack/json-stable-stringify but it doesn't depend on libraries without licenses (jsonify). + +deterministic version of `JSON.stringify()` so you can get a consistent hash +from stringified results + +You can also pass in a custom comparison function. + +[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) + +[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) + +# example + +``` js +var stringify = require('json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + +# methods + +``` js +var stringify = require('json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### space + +If you specify `opts.space`, it will indent the output for pretty-printing. +Valid values are strings (e.g. `{space: \t}`) or a number of spaces +(`{space: 3}`). + +For example: + +```js +var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } }; +var s = stringify(obj, { space: ' ' }); +console.log(s); +``` + +which outputs: + +``` +{ + "a": { + "and": [ + 1, + 2, + 3 + ], + "foo": "bar" + }, + "b": 1 +} +``` + +### replacer + +The replacer parameter is a function `opts.replacer(key, value)` that behaves +the same as the replacer +[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter). + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install json-stable-stringify +``` + +# license + +MIT diff --git a/node_modules/json-stable-stringify-without-jsonify/test/cmp.js b/node_modules/json-stable-stringify-without-jsonify/test/cmp.js new file mode 100644 index 0000000..2dbb393 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/test/cmp.js @@ -0,0 +1,11 @@ +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/node_modules/json-stable-stringify-without-jsonify/test/nested.js b/node_modules/json-stable-stringify-without-jsonify/test/nested.js new file mode 100644 index 0000000..052c7d6 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/test/nested.js @@ -0,0 +1,42 @@ +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); + +test('cyclic (default)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + try { + stringify(one); + } catch (ex) { + t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); + } +}); + +test('cyclic (specifically allowed)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); +}); + +test('repeated non-cyclic value', function(t) { + t.plan(1); + var one = { x: 1 }; + var two = { a: one, b: one }; + t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); +}); + +test('acyclic but with reused obj-property pointers', function (t) { + t.plan(1); + var x = { a: 1 } + var y = { b: x, c: x } + t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); +}); diff --git a/node_modules/json-stable-stringify-without-jsonify/test/replacer.js b/node_modules/json-stable-stringify-without-jsonify/test/replacer.js new file mode 100644 index 0000000..98802a7 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/test/replacer.js @@ -0,0 +1,74 @@ +var test = require('tape'); +var stringify = require('../'); + +test('replace root', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { return 'one'; }; + + t.equal(stringify(obj, { replacer: replacer }), '"one"'); +}); + +test('replace numbers', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(value === 1) return 'one'; + if(value === 2) return 'two'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}'); +}); + +test('replace with object', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(key === 'b') return { d: 1 }; + if(value === 1) return 'one'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}'); +}); + +test('replace with undefined', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(value === false) return; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}'); +}); + +test('replace with array', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(key === 'b') return ['one', 'two']; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}'); +}); + +test('replace array item', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: [1,2] }; + var replacer = function(key, value) { + if(value === 1) return 'one'; + if(value === 2) return 'two'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}'); +}); diff --git a/node_modules/json-stable-stringify-without-jsonify/test/space.js b/node_modules/json-stable-stringify-without-jsonify/test/space.js new file mode 100644 index 0000000..2621122 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/test/space.js @@ -0,0 +1,59 @@ +var test = require('tape'); +var stringify = require('../'); + +test('space parameter', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: ' '}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": 2\n' + + '}' + ); +}); + +test('space parameter (with tabs)', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: '\t'}), '' + + '{\n' + + '\t"one": 1,\n' + + '\t"two": 2\n' + + '}' + ); +}); + +test('space parameter (with a number)', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: 3}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": 2\n' + + '}' + ); +}); + +test('space parameter (nested objects)', function (t) { + t.plan(1); + var obj = { one: 1, two: { b: 4, a: [2,3] } }; + t.equal(stringify(obj, {space: ' '}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": {\n' + + ' "a": [\n' + + ' 2,\n' + + ' 3\n' + + ' ],\n' + + ' "b": 4\n' + + ' }\n' + + '}' + ); +}); + +test('space parameter (same as native)', function (t) { + t.plan(1); + // for this test, properties need to be in alphabetical order + var obj = { one: 1, two: { a: [2,3], b: 4 } }; + t.equal(stringify(obj, {space: ' '}), JSON.stringify(obj, null, ' ')); +}); diff --git a/node_modules/json-stable-stringify-without-jsonify/test/str.js b/node_modules/json-stable-stringify-without-jsonify/test/str.js new file mode 100644 index 0000000..67426b9 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/test/str.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); + +test('object with undefined', function (t) { + t.plan(1); + var obj = { a: 3, z: undefined }; + t.equal(stringify(obj), '{"a":3}'); +}); + +test('array with undefined', function (t) { + t.plan(1); + var obj = [4, undefined, 6]; + t.equal(stringify(obj), '[4,null,6]'); +}); + +test('object with empty string', function (t) { + t.plan(1); + var obj = { a: 3, z: '' }; + t.equal(stringify(obj), '{"a":3,"z":""}'); +}); + +test('array with empty string', function (t) { + t.plan(1); + var obj = [4, '', 6]; + t.equal(stringify(obj), '[4,"",6]'); +}); diff --git a/node_modules/json-stable-stringify-without-jsonify/test/to-json.js b/node_modules/json-stable-stringify-without-jsonify/test/to-json.js new file mode 100644 index 0000000..ef9a980 --- /dev/null +++ b/node_modules/json-stable-stringify-without-jsonify/test/to-json.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var stringify = require('../'); + +test('toJSON function', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; + t.equal(stringify(obj), '{"one":1}' ); +}); + +test('toJSON returns string', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; + t.equal(stringify(obj), '"one"'); +}); + +test('toJSON returns array', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; + t.equal(stringify(obj), '["one"]'); +}); diff --git a/node_modules/json5/CHANGELOG.md b/node_modules/json5/CHANGELOG.md new file mode 100644 index 0000000..be9e98d --- /dev/null +++ b/node_modules/json5/CHANGELOG.md @@ -0,0 +1,274 @@ +### v1.0.1 [[code][c1.0.1], [diff][d1.0.1]] + +[c1.0.1]: https://github.com/json5/json5/tree/v1.0.1 +[d1.0.1]: https://github.com/json5/json5/compare/v1.0.0...v1.0.1 + +This release includes a bug fix and minor change. + +- Fix: `parse` throws on unclosed objects and arrays. + +- New: `package.json5` has been removed until an easier way to keep it in sync + with `package.json` is found. + + +### v1.0.0 [[code][c1.0.0], [diff][d1.0.0]] + +[c1.0.0]: https://github.com/json5/json5/tree/v1.0.0 +[d1.0.0]: https://github.com/json5/json5/compare/v0.5.1...v1.0.0 + +This release includes major internal changes and public API enhancements. + +- **Major** JSON5 officially supports Node.js v4 and later. Support for Node.js + v0.10 and v0.12 have been dropped. + +- New: Unicode property names and Unicode escapes in property names are + supported. ([#1]) + +- New: `stringify` outputs trailing commas in objects and arrays when a `space` + option is provided. ([#66]) + +- New: JSON5 allows line and paragraph separator characters (U+2028 and U+2029) + in strings in order to be compatible with JSON. However, ES5 does not allow + these characters in strings, so JSON5 gives a warning when they are parsed and + escapes them when they are stringified. ([#70]) + +- New: `stringify` accepts an options object as its second argument. The + supported options are `replacer`, `space`, and a new `quote` option that + specifies the quote character used in strings. ([#71]) + +- New: The CLI supports STDIN and STDOUT and adds `--out-file`, `--space`, and + `--validate` options. See `json5 --help` for more information. ([#72], [#84], + and [#108]) + +- New: In addition to the white space characters space `\t`, `\v`, `\f`, `\n`, + `\r`, and `\xA0`, the additional white space characters `\u2028`, `\u2029`, + and all other characters in the Space Separator Unicode category are allowed. + +- New: In addition to the character escapes `\'`, `\"`, `\\`, `\b`, `\f`, `\n`, + `\r`, and `\t`, the additional character escapes `\v` and `\0`, hexadecimal + escapes like `\x0F`, and unnecessary escapes like `\a` are allowed in string + values and string property names. + +- New: `stringify` outputs strings with single quotes by default but + intelligently uses double quotes if there are more single quotes than double + quotes inside the string. (i.e. `stringify('Stay here.')` outputs + `'Stay here.'` while `stringify('Let\'s go.')` outputs `"Let's go."`) + +- New: When a character is not allowed in a string, `stringify` outputs a + character escape like `\t` when available, a hexadecimal escape like `\x0F` + when the Unicode code point is less than 256, or a Unicode character escape + like `\u01FF`, in that order. + +- New: `stringify` checks for a `toJSON5` method on objects and, if it exists, + stringifies its return value instead of the object. `toJSON5` overrides + `toJSON` if they both exist. + +- New: To `require` or `import` JSON5 files, use `require('json5/lib/register')` + or `import 'json5/lib/register'`. Previous versions used `json5/lib/require`, + which still exists for backward compatibility but is deprecated and will give + a warning. + +- New: To use JSON5 in browsers, use the file at `dist/index.js` or + `https://unpkg.com/json5@^1.0.0`. + +- Fix: `stringify` properly outputs `Infinity` and `NaN`. ([#67]) + +- Fix: `isWord` no longer becomes a property of `JSON5` after calling + `stringify`. ([#68] and [#89]) + +- Fix: `stringify` no longer throws when an object does not have a `prototype`. + ([#154]) + +- Fix: `stringify` properly handles the `key` argument of `toJSON(key)` methods. + `toJSON5(key)` follows this pattern. + +- Fix: `stringify` accepts `Number` and `String` objects as its `space` + argument. + +- Fix: In addition to a function, `stringify` also accepts an array of keys to + include in the output as its `replacer` argument. Numbers, `Number` objects, + and `String` objects will be converted to a string if they are given as array + values. + + +### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]] + +[c0.5.1]: https://github.com/json5/json5/tree/v0.5.1 +[d0.5.1]: https://github.com/json5/json5/compare/v0.5.0...v0.5.1 + +This release includes a minor fix for indentations when stringifying empty +arrays. + +- Fix: Indents no longer appear in empty arrays when stringified. ([#134]) + + +### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]] + +[c0.5.0]: https://github.com/json5/json5/tree/v0.5.0 +[d0.5.0]: https://github.com/json5/json5/compare/v0.4.0...v0.5.0 + +This release includes major internal changes and public API enhancements. + +- **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for + Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12 + remain. + +- Fix: YUI Compressor no longer fails when compressing json5.js. ([#97]) + +- New: `parse` and the CLI provide line and column numbers when displaying error + messages. ([#101]; awesome work by [@amb26].) + + +### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]] + +[c0.4.0]: https://github.com/json5/json5/tree/v0.4.0 +[d0.4.0]: https://github.com/json5/json5/compare/v0.2.0...v0.4.0 + +Note that v0.3.0 was tagged, but never published to npm, so this v0.4.0 +changelog entry includes v0.3.0 features. + +This is a massive release that adds `stringify` support, among other things. + +- **Major:** `JSON5.stringify()` now exists! + This method is analogous to the native `JSON.stringify()`; + it just avoids quoting keys where possible. + See the [usage documentation](./README.md#usage) for more. + ([#32]; huge thanks and props [@aeisenberg]!) + +- New: `NaN` and `-NaN` are now allowed number literals. + ([#30]; thanks [@rowanhill].) + +- New: Duplicate object keys are now allowed; the last value is used. + This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].) + +- Fix: Properly handle various whitespace and newline cases now. + E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings, + and JSON5 now accepts the same whitespace as JSON (stricter than ES5). + ([#58], [#60], and [#63]; thanks [@jordanbtucker].) + +- New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again. + (They were disallowed in v0.2.0; see below.) + It turns out they *are* valid in ES5, so JSON5 supports them now too. + ([#36]; thanks [@jordanbtucker]!) + + +### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]] + +[c0.2.0]: https://github.com/json5/json5/tree/v0.2.0 +[d0.2.0]: https://github.com/json5/json5/compare/v0.1.0...v0.2.0 + +This release fixes some bugs and adds some more utility features to help you +express data more easily: + +- **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now. + While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid + in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome + and Node), so JSON5 officially rejects them now, too. ([#36]) + +- New: Trailing decimal points in decimal numbers are allowed again. + (They were disallowed in v0.1.0; see below.) + They're allowed by ES5, and differentiating between integers and floats may + make sense on some platforms. ([#16]; thanks [@Midar].) + +- New: `Infinity` and `-Infinity` are now allowed number literals. + ([#30]; thanks [@pepkin88].) + +- New: Plus signs (`+`) in front of numbers are now allowed, since it can + be helpful in some contexts to explicitly mark numbers as positive. + (E.g. when a property represents changes or deltas.) + +- Fix: unescaped newlines in strings are rejected now. + ([#24]; thanks [@Midar].) + + +### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]] + +[c0.1.0]: https://github.com/json5/json5/tree/v0.1.0 +[d0.1.0]: https://github.com/json5/json5/compare/v0.0.1...v0.1.0 + +This release tightens JSON5 support and adds helpful utility features: + +- New: Support hexadecimal numbers. (Thanks [@MaxNanasy].) + +- Fix: Reject octal numbers properly now. Previously, they were accepted but + improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].) + +- **Breaking:** Reject "noctal" numbers now (base-10 numbers that begin with a + leading zero). These are disallowed by both JSON5 and JSON, as well as by + ES5's strict mode. (Thanks [@MaxNanasy].) + +- New: Support leading decimal points in decimal numbers. + (Thanks [@MaxNanasy].) + +- **Breaking:** Reject trailing decimal points in decimal numbers now. These + are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].) + +- **Breaking:** Reject omitted elements in arrays now. These are disallowed by + both JSON5 and JSON. + +- Fix: Throw proper `SyntaxError` instances on errors now. + +- New: Add Node.js `require()` hook. Register via `json5/lib/require`. + +- New: Add Node.js `json5` executable to compile JSON5 files to JSON. + + +### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]] + +[c0.0.1]: https://github.com/json5/json5/tree/v0.0.1 +[d0.0.1]: https://github.com/json5/json5/compare/v0.0.0...v0.0.1 + +This was the first implementation of this JSON5 parser. + +- Support unquoted object keys, including reserved words. Unicode characters + and escape sequences sequences aren't yet supported. + +- Support single-quoted strings. + +- Support multi-line strings. + +- Support trailing commas in arrays and objects. + +- Support comments, both inline and block. + + +### v0.0.0 [[code](https://github.com/json5/json5/tree/v0.0.0)] + +Let's consider this to be Douglas Crockford's original [json_parse.js] — a +parser for the regular JSON format. + + +[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js +[v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240 + +[@MaxNanasy]: https://github.com/MaxNanasy +[@Midar]: https://github.com/Midar +[@pepkin88]: https://github.com/pepkin88 +[@rowanhill]: https://github.com/rowanhill +[@aeisenberg]: https://github.com/aeisenberg +[@jordanbtucker]: https://github.com/jordanbtucker +[@amb26]: https://github.com/amb26 + +[#1]: https://github.com/json5/json5/issues/1 +[#16]: https://github.com/json5/json5/issues/16 +[#24]: https://github.com/json5/json5/issues/24 +[#30]: https://github.com/json5/json5/issues/30 +[#32]: https://github.com/json5/json5/issues/32 +[#36]: https://github.com/json5/json5/issues/36 +[#57]: https://github.com/json5/json5/issues/57 +[#58]: https://github.com/json5/json5/pull/58 +[#60]: https://github.com/json5/json5/pull/60 +[#63]: https://github.com/json5/json5/pull/63 +[#66]: https://github.com/json5/json5/issues/66 +[#67]: https://github.com/json5/json5/issues/67 +[#68]: https://github.com/json5/json5/issues/68 +[#70]: https://github.com/json5/json5/issues/70 +[#71]: https://github.com/json5/json5/issues/71 +[#72]: https://github.com/json5/json5/issues/72 +[#84]: https://github.com/json5/json5/pull/84 +[#89]: https://github.com/json5/json5/pull/89 +[#97]: https://github.com/json5/json5/pull/97 +[#101]: https://github.com/json5/json5/pull/101 +[#108]: https://github.com/json5/json5/pull/108 +[#134]: https://github.com/json5/json5/pull/134 +[#154]: https://github.com/json5/json5/issues/154 diff --git a/node_modules/json5/LICENSE.md b/node_modules/json5/LICENSE.md new file mode 100644 index 0000000..2171aca --- /dev/null +++ b/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/node_modules/json5/README.md b/node_modules/json5/README.md new file mode 100644 index 0000000..8e03554 --- /dev/null +++ b/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 + +## Contibuting +### 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 implentation 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/master/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/node_modules/json5/dist/index.js b/node_modules/json5/dist/index.js new file mode 100644 index 0000000..bfc960b --- /dev/null +++ b/node_modules/json5/dist/index.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";var u,D,F=(function(u,D){Object.defineProperty(D,"__esModule",{value:!0});D.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,D.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\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]|\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]/,D.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\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\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]|\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]/}(u={exports:{}},u.exports),u.exports);(D=F)&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")&&D.default;var e=F.Space_Separator,C=F.ID_Start,A=F.ID_Continue;function r(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||C.test(u)}function t(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||A.test(u)}function E(u){return/[0-9]/.test(u)}function n(u){return/[0-9A-Fa-f]/.test(u)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},o=void 0,a=void 0,B=void 0,c=void 0,s=void 0,f=void 0,d=void 0,l=void 0,v=void 0;var m=void 0,p=void 0,h=void 0,y=void 0,w=void 0;function b(){for(m="default",p="",h=!1,y=1;;){w=g();var u=x[m]();if(u)return u}}function g(){if(o[c])return String.fromCodePoint(o.codePointAt(c))}function S(){var u=g();return"\n"===u?(s++,f=0):u?f+=u.length:f++,u&&(c+=u.length),u}var x={default:function(){switch(w){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void S();case"/":return S(),void(m="comment");case void 0:return S(),N("eof")}if(!function(u){return e.test(u)}(w))return x[a]();S()},comment:function(){switch(w){case"*":return S(),void(m="multiLineComment");case"/":return S(),void(m="singleLineComment")}throw j(S())},multiLineComment:function(){switch(w){case"*":return S(),void(m="multiLineCommentAsterisk");case void 0:throw j(S())}S()},multiLineCommentAsterisk:function(){switch(w){case"*":return void S();case"/":return S(),void(m="default");case void 0:throw j(S())}S(),m="multiLineComment"},singleLineComment:function(){switch(w){case"\n":case"\r":case"\u2028":case"\u2029":return S(),void(m="default");case void 0:return S(),N("eof")}S()},value:function(){switch(w){case"{":case"[":return N("punctuator",S());case"n":return S(),P("ull"),N("null",null);case"t":return S(),P("rue"),N("boolean",!0);case"f":return S(),P("alse"),N("boolean",!1);case"-":case"+":return"-"===S()&&(y=-1),void(m="sign");case".":return p=S(),void(m="decimalPointLeading");case"0":return p=S(),void(m="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return p=S(),void(m="decimalInteger");case"I":return S(),P("nfinity"),N("numeric",1/0);case"N":return S(),P("aN"),N("numeric",NaN);case'"':case"'":return h='"'===S(),p="",void(m="string")}throw j(S())},identifierNameStartEscape:function(){if("u"!==w)throw j(S());S();var u=O();switch(u){case"$":case"_":break;default:if(!r(u))throw L()}p+=u,m="identifierName"},identifierName:function(){switch(w){case"$":case"_":case"‌":case"‍":return void(p+=S());case"\\":return S(),void(m="identifierNameEscape")}if(!t(w))return N("identifier",p);p+=S()},identifierNameEscape:function(){if("u"!==w)throw j(S());S();var u=O();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!t(u))throw L()}p+=u,m="identifierName"},sign:function(){switch(w){case".":return p=S(),void(m="decimalPointLeading");case"0":return p=S(),void(m="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return p=S(),void(m="decimalInteger");case"I":return S(),P("nfinity"),N("numeric",y*(1/0));case"N":return S(),P("aN"),N("numeric",NaN)}throw j(S())},zero:function(){switch(w){case".":return p+=S(),void(m="decimalPoint");case"e":case"E":return p+=S(),void(m="decimalExponent");case"x":case"X":return p+=S(),void(m="hexadecimal")}return N("numeric",0*y)},decimalInteger:function(){switch(w){case".":return p+=S(),void(m="decimalPoint");case"e":case"E":return p+=S(),void(m="decimalExponent")}if(!E(w))return N("numeric",y*Number(p));p+=S()},decimalPointLeading:function(){if(E(w))return p+=S(),void(m="decimalFraction");throw j(S())},decimalPoint:function(){switch(w){case"e":case"E":return p+=S(),void(m="decimalExponent")}return E(w)?(p+=S(),void(m="decimalFraction")):N("numeric",y*Number(p))},decimalFraction:function(){switch(w){case"e":case"E":return p+=S(),void(m="decimalExponent")}if(!E(w))return N("numeric",y*Number(p));p+=S()},decimalExponent:function(){switch(w){case"+":case"-":return p+=S(),void(m="decimalExponentSign")}if(E(w))return p+=S(),void(m="decimalExponentInteger");throw j(S())},decimalExponentSign:function(){if(E(w))return p+=S(),void(m="decimalExponentInteger");throw j(S())},decimalExponentInteger:function(){if(!E(w))return N("numeric",y*Number(p));p+=S()},hexadecimal:function(){if(n(w))return p+=S(),void(m="hexadecimalInteger");throw j(S())},hexadecimalInteger:function(){if(!n(w))return N("numeric",y*Number(p));p+=S()},string:function(){switch(w){case"\\":return S(),void(p+=function(){switch(g()){case"b":return S(),"\b";case"f":return S(),"\f";case"n":return S(),"\n";case"r":return S(),"\r";case"t":return S(),"\t";case"v":return S(),"\v";case"0":if(S(),E(g()))throw j(S());return"\0";case"x":return S(),function(){var u="",D=g();if(!n(D))throw j(S());if(u+=S(),!n(D=g()))throw j(S());return u+=S(),String.fromCodePoint(parseInt(u,16))}();case"u":return S(),O();case"\n":case"\u2028":case"\u2029":return S(),"";case"\r":return S(),"\n"===g()&&S(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw j(S())}return S()}());case'"':return h?(S(),N("string",p)):void(p+=S());case"'":return h?void(p+=S()):(S(),N("string",p));case"\n":case"\r":throw j(S());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+u+"' is not valid ECMAScript; consider escaping")}(w);break;case void 0:throw j(S())}p+=S()},start:function(){switch(w){case"{":case"[":return N("punctuator",S())}m="value"},beforePropertyName:function(){switch(w){case"$":case"_":return p=S(),void(m="identifierName");case"\\":return S(),void(m="identifierNameStartEscape");case"}":return N("punctuator",S());case'"':case"'":return h='"'===S(),void(m="string")}if(r(w))return p+=S(),void(m="identifierName");throw j(S())},afterPropertyName:function(){if(":"===w)return N("punctuator",S());throw j(S())},beforePropertyValue:function(){m="value"},afterPropertyValue:function(){switch(w){case",":case"}":return N("punctuator",S())}throw j(S())},beforeArrayValue:function(){if("]"===w)return N("punctuator",S());m="value"},afterArrayValue:function(){switch(w){case",":case"]":return N("punctuator",S())}throw j(S())},end:function(){throw j(S())}};function N(u,D){return{type:u,value:D,line:s,column:f}}function P(u){var D=!0,F=!1,e=void 0;try{for(var C,A=u[Symbol.iterator]();!(D=(C=A.next()).done);D=!0){var r=C.value;if(g()!==r)throw j(S());S()}}catch(u){F=!0,e=u}finally{try{!D&&A.return&&A.return()}finally{if(F)throw e}}}function O(){for(var u="",D=4;D-- >0;){if(!n(g()))throw j(S());u+=S()}return String.fromCodePoint(parseInt(u,16))}var I={start:function(){if("eof"===d.type)throw J();_()},beforePropertyName:function(){switch(d.type){case"identifier":case"string":return l=d.value,void(a="afterPropertyName");case"punctuator":return void V();case"eof":throw J()}},afterPropertyName:function(){if("eof"===d.type)throw J();a="beforePropertyValue"},beforePropertyValue:function(){if("eof"===d.type)throw J();_()},beforeArrayValue:function(){if("eof"===d.type)throw J();"punctuator"!==d.type||"]"!==d.value?_():V()},afterPropertyValue:function(){if("eof"===d.type)throw J();switch(d.value){case",":return void(a="beforePropertyName");case"}":V()}},afterArrayValue:function(){if("eof"===d.type)throw J();switch(d.value){case",":return void(a="beforeArrayValue");case"]":V()}},end:function(){}};function _(){var u=void 0;switch(d.type){case"punctuator":switch(d.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=d.value}if(void 0===v)v=u;else{var D=B[B.length-1];Array.isArray(D)?D.push(u):D[l]=u}if(null!==u&&"object"===(void 0===u?"undefined":i(u)))B.push(u),a=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var F=B[B.length-1];a=null==F?"end":Array.isArray(F)?"afterArrayValue":"afterPropertyValue"}}function V(){B.pop();var u=B[B.length-1];a=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function j(u){return k(void 0===u?"JSON5: invalid end of input at "+s+":"+f:"JSON5: invalid character '"+function(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 F=u.charCodeAt(0).toString(16);return"\\x"+("00"+F).substring(F.length)}return u}(u)+"' at "+s+":"+f)}function J(){return k("JSON5: invalid end of input at "+s+":"+f)}function L(){return k("JSON5: invalid identifier character at "+s+":"+(f-=5))}function k(u){var D=new SyntaxError(u);return D.lineNumber=s,D.columnNumber=f,D}return{parse:function(u,D){o=String(u),a="start",B=[],c=0,s=1,f=0,d=void 0,l=void 0,v=void 0;do{d=b(),I[a]()}while("eof"!==d.type);return"function"==typeof D?function u(D,F,e){var C=D[F];if(null!=C&&"object"===(void 0===C?"undefined":i(C)))for(var A in C){var r=u(C,A,e);void 0===r?delete C[A]:C[A]=r}return e.call(D,F,C)}({"":v},"",D):v},stringify:function(u,D,F){var e=[],C="",A=void 0,E=void 0,n="",o=void 0;if(null==D||"object"!==(void 0===D?"undefined":i(D))||Array.isArray(D)||(F=D.space,o=D.quote,D=D.replacer),"function"==typeof D)E=D;else if(Array.isArray(D)){A=[];var a=!0,B=!1,c=void 0;try{for(var s,f=D[Symbol.iterator]();!(a=(s=f.next()).done);a=!0){var d=s.value,l=void 0;"string"==typeof d?l=d:("number"==typeof d||d instanceof String||d instanceof Number)&&(l=String(d)),void 0!==l&&A.indexOf(l)<0&&A.push(l)}}catch(u){B=!0,c=u}finally{try{!a&&f.return&&f.return()}finally{if(B)throw c}}}return F instanceof Number?F=Number(F):F instanceof String&&(F=String(F)),"number"==typeof F?F>0&&(F=Math.min(10,Math.floor(F)),n=" ".substr(0,F)):"string"==typeof F&&(n=F.substr(0,10)),v("",{"":u});function v(u,D){var F=D[u];switch(null!=F&&("function"==typeof F.toJSON5?F=F.toJSON5(u):"function"==typeof F.toJSON&&(F=F.toJSON(u))),E&&(F=E.call(D,u,F)),F instanceof Number?F=Number(F):F instanceof String?F=String(F):F instanceof Boolean&&(F=F.valueOf()),F){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof F?m(F):"number"==typeof F?String(F):"object"===(void 0===F?"undefined":i(F))?Array.isArray(F)?function(u){if(e.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");e.push(u);var D=C;C+=n;for(var F=[],A=0;A=0)throw TypeError("Converting circular structure to JSON5");e.push(u);var D=C;C+=n;var F=A||Object.keys(u),r=[],t=!0,E=!1,i=void 0;try{for(var o,a=F[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var B=o.value,c=v(B,u);if(void 0!==c){var s=p(B)+":";""!==n&&(s+=" "),s+=c,r.push(s)}}}catch(u){E=!0,i=u}finally{try{!t&&a.return&&a.return()}finally{if(E)throw i}}var f=void 0;if(0===r.length)f="{}";else{var d=void 0;if(""===n)d=r.join(","),f="{"+d+"}";else{var l=",\n"+C;d=r.join(l),f="{\n"+C+d+",\n"+D+"}"}}return e.pop(),C=D,f}(F):void 0}function m(u){var D={"'":.1,'"':.2},F={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},e="",C=!0,A=!1,r=void 0;try{for(var t,E=u[Symbol.iterator]();!(C=(t=E.next()).done);C=!0){var n=t.value;switch(n){case"'":case'"':D[n]++,e+=n;continue}if(F[n])e+=F[n];else if(n<" "){var i=n.charCodeAt(0).toString(16);e+="\\x"+("00"+i).substring(i.length)}else e+=n}}catch(u){A=!0,r=u}finally{try{!C&&E.return&&E.return()}finally{if(A)throw r}}var a=o||Object.keys(D).reduce(function(u,F){return D[u]\n\n If is not provided, then STDIN is used.\n\n Options:\n\n -s, --space The number of spaces to indent or \'t\' for tabs\n -o, --out-file [file] Output to the specified file, otherwise STDOUT\n -v, --validate Validate JSON5 but do not output JSON\n -V, --version Output the version number\n -h, --help Output usage information')} \ No newline at end of file diff --git a/node_modules/json5/lib/index.js b/node_modules/json5/lib/index.js new file mode 100644 index 0000000..c943e65 --- /dev/null +++ b/node_modules/json5/lib/index.js @@ -0,0 +1 @@ +'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _parse=require('./parse');var _parse2=_interopRequireDefault(_parse);var _stringify=require('./stringify');var _stringify2=_interopRequireDefault(_stringify);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={parse:_parse2.default,stringify:_stringify2.default};module.exports=exports['default']; \ No newline at end of file diff --git a/node_modules/json5/lib/parse.js b/node_modules/json5/lib/parse.js new file mode 100644 index 0000000..a1f756f --- /dev/null +++ b/node_modules/json5/lib/parse.js @@ -0,0 +1 @@ +'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};exports.default=parse;var _util=require('./util');var util=_interopRequireWildcard(_util);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}var source=void 0;var parseState=void 0;var stack=void 0;var pos=void 0;var line=void 0;var column=void 0;var token=void 0;var key=void 0;var root=void 0;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();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==='undefined'?'undefined':_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=void 0;var buffer=void 0;var doubleQuote=void 0;var _sign=void 0;var c=void 0;function lex(){lexState='default';buffer='';doubleQuote=false;_sign=1;for(;;){c=peek();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(){switch(c){case'\t':case'\x0B':case'\f':case' ':case'\xA0':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}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(){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());}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(){throw invalidChar(read())}};function newToken(type,value){return{type:type,value:value,line:line,column:column}}function literal(s){var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _c=_step.value;var p=peek();if(p!==_c){throw invalidChar(read())}read()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}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'\x0B';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 _c2=peek();if(!util.isHexDigit(_c2)){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':pop();return;case'eof':throw invalidEOF();}},afterPropertyName:function afterPropertyName(){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(){if(token.type==='eof'){throw invalidEOF()}switch(token.value){case',':parseState='beforePropertyName';return;case'}':pop();}},afterArrayValue:function afterArrayValue(){if(token.type==='eof'){throw invalidEOF()}switch(token.value){case',':parseState='beforeArrayValue';return;case']':pop();}},end:function end(){}};function push(){var value=void 0;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;}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==='undefined'?'undefined':_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'}}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)}function invalidIdentifier(){column-=5;return syntaxError('JSON5: invalid identifier character at '+line+':'+column)}function separatorChar(c){console.warn('JSON5: \''+c+'\' is not valid ECMAScript; consider escaping')}function formatChar(c){var replacements={'\'':'\\\'','"':'\\"','\\':'\\\\','\b':'\\b','\f':'\\f','\n':'\\n','\r':'\\r','\t':'\\t','\x0B':'\\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}module.exports=exports['default']; \ No newline at end of file diff --git a/node_modules/json5/lib/register.js b/node_modules/json5/lib/register.js new file mode 100644 index 0000000..aa16e96 --- /dev/null +++ b/node_modules/json5/lib/register.js @@ -0,0 +1 @@ +'use strict';var _fs=require('fs');var _fs2=_interopRequireDefault(_fs);var _=require('./');var _2=_interopRequireDefault(_);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}require.extensions['.json5']=function(module,filename){var content=_fs2.default.readFileSync(filename,'utf8');try{module.exports=_2.default.parse(content)}catch(err){err.message=filename+': '+err.message;throw err}}; \ No newline at end of file diff --git a/node_modules/json5/lib/require.js b/node_modules/json5/lib/require.js new file mode 100644 index 0000000..dfdc039 --- /dev/null +++ b/node_modules/json5/lib/require.js @@ -0,0 +1 @@ +"use strict";require("./register");console.warn("'json5/require' is deprecated. Please use 'json5/register' instead."); \ No newline at end of file diff --git a/node_modules/json5/lib/stringify.js b/node_modules/json5/lib/stringify.js new file mode 100644 index 0000000..ce6917e --- /dev/null +++ b/node_modules/json5/lib/stringify.js @@ -0,0 +1 @@ +'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};exports.default=stringify;var _util=require('./util');var util=_interopRequireWildcard(_util);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function stringify(value,replacer,space){var stack=[];var indent='';var propertyList=void 0;var replacerFunc=void 0;var gap='';var quote=void 0;if(replacer!=null&&(typeof replacer==='undefined'?'undefined':_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=[];var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=replacer[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;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)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}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==='undefined'?'undefined':_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','\x0B':'\\v','\0':'\\0','\u2028':'\\u2028','\u2029':'\\u2029'};var product='';var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=value[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c=_step2.value;switch(c){case'\'':case'"':quotes[c]++;product+=c;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}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var quoteChar=quote||Object.keys(quotes).reduce(function(a,b){return quotes[a]=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=[];var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=keys[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var key=_step3.value;var propertyString=serializeProperty(key,value);if(propertyString!==undefined){var member=serializeKey(key)+':';if(gap!==''){member+=' '}member+=propertyString;partial.push(member)}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}var final=void 0;if(partial.length===0){final='{}'}else{var properties=void 0;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=0){throw TypeError('Converting circular structure to JSON5')}stack.push(value);var stepback=indent;indent=indent+gap;var partial=[];for(var i=0;i='a'&&c<='z'||c>='A'&&c<='Z'||c==='$'||c==='_'||unicode.ID_Start.test(c)}function isIdContinueChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c>='0'&&c<='9'||c==='$'||c==='_'||c==='\u200C'||c==='\u200D'||unicode.ID_Continue.test(c)}function isDigit(c){return /[0-9]/.test(c)}function isHexDigit(c){return /[0-9A-Fa-f]/.test(c)} \ No newline at end of file diff --git a/node_modules/json5/package.json b/node_modules/json5/package.json new file mode 100644 index 0000000..ee82cc7 --- /dev/null +++ b/node_modules/json5/package.json @@ -0,0 +1,115 @@ +{ + "_from": "json5@^1.0.1", + "_id": "json5@1.0.1", + "_inBundle": false, + "_integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "_location": "/json5", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "json5@^1.0.1", + "name": "json5", + "escapedName": "json5", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/tsconfig-paths" + ], + "_resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "_shasum": "779fb0018604fa854eacbf6252180d83543e3dbe", + "_spec": "json5@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/tsconfig-paths", + "author": { + "name": "Aseem Kishore", + "email": "aseem.kishore@gmail.com" + }, + "bin": { + "json5": "lib/cli.js" + }, + "browser": "dist/index.js", + "bugs": { + "url": "https://github.com/json5/json5/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Max Nanasy", + "email": "max.nanasy@gmail.com" + }, + { + "name": "Andrew Eisenberg", + "email": "andrew@eisenberg.as" + }, + { + "name": "Jordan Tucker", + "email": "jordanbtucker@gmail.com" + } + ], + "dependencies": { + "minimist": "^1.2.0" + }, + "deprecated": false, + "description": "JSON for humans.", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-external-helpers": "^6.22.0", + "babel-plugin-istanbul": "^4.1.5", + "babel-preset-env": "^1.6.1", + "babel-register": "^6.26.0", + "babelrc-rollup": "^3.0.0", + "coveralls": "^3.0.0", + "cross-env": "^5.1.4", + "del": "^3.0.0", + "eslint": "^4.18.2", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-promise": "^3.7.0", + "eslint-plugin-standard": "^3.0.1", + "mocha": "^5.0.4", + "nyc": "^11.4.1", + "regenerate": "^1.3.3", + "rollup": "^0.56.5", + "rollup-plugin-babel": "^3.0.3", + "rollup-plugin-commonjs": "^9.0.0", + "rollup-plugin-node-resolve": "^3.2.0", + "rollup-plugin-uglify": "^3.0.0", + "sinon": "^4.4.2", + "unicode-9.0.0": "^0.7.5" + }, + "files": [ + "lib/", + "dist/" + ], + "homepage": "http://json5.org/", + "keywords": [ + "json", + "json5", + "es5", + "es2015", + "ecmascript" + ], + "license": "MIT", + "main": "lib/index.js", + "name": "json5", + "repository": { + "type": "git", + "url": "git+https://github.com/json5/json5.git" + }, + "scripts": { + "build": "babel-node build/build.js && babel src -d lib && rollup -c", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "lint": "eslint --fix build src", + "prepublishOnly": "npm run lint && npm test && npm run production", + "pretest": "cross-env NODE_ENV=test npm run build", + "preversion": "npm run lint && npm test && npm run production", + "production": "cross-env NODE_ENV=production npm run build", + "test": "nyc --reporter=html --reporter=text mocha" + }, + "version": "1.0.1" +} diff --git a/node_modules/levn/LICENSE b/node_modules/levn/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/levn/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/levn/README.md b/node_modules/levn/README.md new file mode 100644 index 0000000..7ab008d --- /dev/null +++ b/node_modules/levn/README.md @@ -0,0 +1,196 @@ +# levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) +__Light ECMAScript (JavaScript) Value Notation__ +Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments). + +Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.4.1. + +__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose. + + npm install levn + +For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev). + + +## Quick Examples + +```js +var parse = require('levn').parse; +parse('Number', '2'); // 2 +parse('String', '2'); // '2' +parse('String', 'levn'); // 'levn' +parse('String', 'a b'); // 'a b' +parse('Boolean', 'true'); // true + +parse('Date', '#2011-11-11#'); // (Date object) +parse('Date', '2011-11-11'); // (Date object) +parse('RegExp', '/[a-z]/gi'); // /[a-z]/gi +parse('RegExp', 're'); // /re/ +parse('Int', '2'); // 2 + +parse('Number | String', 'str'); // 'str' +parse('Number | String', '2'); // 2 + +parse('[Number]', '[1,2,3]'); // [1,2,3] +parse('(String, Boolean)', '(hi, false)'); // ['hi', false] +parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2} + +// at the top level, you can ommit surrounding delimiters +parse('[Number]', '1,2,3'); // [1,2,3] +parse('(String, Boolean)', 'hi, false'); // ['hi', false] +parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2} + +// wildcard - auto choose type +parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}] +``` +## Usage + +`require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions. + +```js +// parse(type, input, options); +parse('[Number]', '1,2,3'); // [1, 2, 3] + +// parsedTypeParse(parsedType, input, options); +var parsedType = require('type-check').parseType('[Number]'); +parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] +``` + +### parse(type, input, options) + +`parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value. + +##### arguments +* type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against +* input - `String` - the value written in the [levn format](#levn-format) +* options - `Maybe Object` - an optional parameter specifying additional [options](#options) + +##### returns +`*` - the resulting JavaScript value + +##### example +```js +parse('[Number]', '1,2,3'); // [1, 2, 3] +``` + +### parsedTypeParse(parsedType, input, options) + +`parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function. + +##### arguments +* type - `Object` - the type in the parsed type format which to check against +* input - `String` - the value written in the [levn format](#levn-format) +* options - `Maybe Object` - an optional parameter specifying additional [options](#options) + +##### returns +`*` - the resulting JavaScript value + +##### example +```js +var parsedType = require('type-check').parseType('[Number]'); +parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] +``` + +## Levn Format + +Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`. + +If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options). + +* `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"` +* `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')` +* `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi` +* `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents +* `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`. +* `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`). +* `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`. +* Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`. + +If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information: + +* If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`. +* If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`. +* If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`. +* If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`. +* If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`). +* If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`. + +If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list. + +Whitespace between special characters and elements is inconsequential. + +## Options + +Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions. + +### Explicit + +A `Boolean`. By default it is `false`. + +__Example:__ + +```js +parse('RegExp', 're', {explicit: false}); // /re/ +parse('RegExp', 're', {explicit: true}); // Error: ... does not type check... +parse('RegExp | String', 're', {explicit: true}); // 're' +``` + +`explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section. + +### customTypes + +An `Object`. Empty `{}` by default. + +__Example:__ + +```js +var options = { + customTypes: { + Even: { + typeOf: 'Number', + validate: function (x) { + return x % 2 === 0; + }, + cast: function (x) { + return {type: 'Just', value: parseInt(x)}; + } + } + } +} +parse('Even', '2', options); // 2 +parse('Even', '3', options); // Error: Value: "3" does not type check... +``` + +__Another Example:__ +```js +function Person(name, age){ + this.name = name; + this.age = age; +} +var options = { + customTypes: { + Person: { + typeOf: 'Object', + validate: function (x) { + x instanceof Person; + }, + cast: function (value, options, typesCast) { + var name, age; + if ({}.toString.call(value).slice(8, -1) !== 'Object') { + return {type: 'Nothing'}; + } + name = typesCast(value.name, [{type: 'String'}], options); + age = typesCast(value.age, [{type: 'Numger'}], options); + return {type: 'Just', value: new Person(name, age)}; + } + } +} +parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25} +``` + +`customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check. + +`cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`. You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly. + +## Technical About + +`levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/levn/lib/cast.js b/node_modules/levn/lib/cast.js new file mode 100644 index 0000000..92cb9a6 --- /dev/null +++ b/node_modules/levn/lib/cast.js @@ -0,0 +1,327 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var parsedTypeCheck, types, toString$ = {}.toString; + parsedTypeCheck = require('type-check').parsedTypeCheck; + types = { + '*': function(value, options){ + switch (toString$.call(value).slice(8, -1)) { + case 'Array': + return typeCast(value, { + type: 'Array' + }, options); + case 'Object': + return typeCast(value, { + type: 'Object' + }, options); + default: + return { + type: 'Just', + value: typesCast(value, [ + { + type: 'Undefined' + }, { + type: 'Null' + }, { + type: 'NaN' + }, { + type: 'Boolean' + }, { + type: 'Number' + }, { + type: 'Date' + }, { + type: 'RegExp' + }, { + type: 'Array' + }, { + type: 'Object' + }, { + type: 'String' + } + ], (options.explicit = true, options)) + }; + } + }, + Undefined: function(it){ + if (it === 'undefined' || it === void 8) { + return { + type: 'Just', + value: void 8 + }; + } else { + return { + type: 'Nothing' + }; + } + }, + Null: function(it){ + if (it === 'null') { + return { + type: 'Just', + value: null + }; + } else { + return { + type: 'Nothing' + }; + } + }, + NaN: function(it){ + if (it === 'NaN') { + return { + type: 'Just', + value: NaN + }; + } else { + return { + type: 'Nothing' + }; + } + }, + Boolean: function(it){ + if (it === 'true') { + return { + type: 'Just', + value: true + }; + } else if (it === 'false') { + return { + type: 'Just', + value: false + }; + } else { + return { + type: 'Nothing' + }; + } + }, + Number: function(it){ + return { + type: 'Just', + value: +it + }; + }, + Int: function(it){ + return { + type: 'Just', + value: +it + }; + }, + Float: function(it){ + return { + type: 'Just', + value: +it + }; + }, + Date: function(value, options){ + var that; + if (that = /^\#([\s\S]*)\#$/.exec(value)) { + return { + type: 'Just', + value: new Date(+that[1] || that[1]) + }; + } else if (options.explicit) { + return { + type: 'Nothing' + }; + } else { + return { + type: 'Just', + value: new Date(+value || value) + }; + } + }, + RegExp: function(value, options){ + var that; + if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) { + return { + type: 'Just', + value: new RegExp(that[1], that[2]) + }; + } else if (options.explicit) { + return { + type: 'Nothing' + }; + } else { + return { + type: 'Just', + value: new RegExp(value) + }; + } + }, + Array: function(value, options){ + return castArray(value, { + of: [{ + type: '*' + }] + }, options); + }, + Object: function(value, options){ + return castFields(value, { + of: {} + }, options); + }, + String: function(it){ + var replace, that; + if (toString$.call(it).slice(8, -1) !== 'String') { + return { + type: 'Nothing' + }; + } + replace = function(value, quote){ + return value.replace(/\\([^u]|u[0-9a-fA-F]{4})/g, function(all, escaped){ + switch (escaped[0]) { + case quote: + return quote; + case '\\': + return '\\'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'u': + return JSON.parse("\"" + all + "\""); + default: + return escaped; + } + }); + }; + if (that = it.match(/^'([\s\S]*)'$/)) { + return { + type: 'Just', + value: replace(that[1], "'") + }; + } else if (that = it.match(/^"([\s\S]*)"$/)) { + return { + type: 'Just', + value: replace(that[1], '"') + }; + } else { + return { + type: 'Just', + value: it + }; + } + } + }; + function castArray(node, type, options){ + var typeOf, element; + if (toString$.call(node).slice(8, -1) !== 'Array') { + return { + type: 'Nothing' + }; + } + typeOf = type.of; + return { + type: 'Just', + value: (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { + element = ref$[i$]; + results$.push(typesCast(element, typeOf, options)); + } + return results$; + }()) + }; + } + function castTuple(node, type, options){ + var result, i, i$, ref$, len$, types, cast; + if (toString$.call(node).slice(8, -1) !== 'Array') { + return { + type: 'Nothing' + }; + } + result = []; + i = 0; + for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { + types = ref$[i$]; + cast = typesCast(node[i], types, options); + if (toString$.call(cast).slice(8, -1) !== 'Undefined') { + result.push(cast); + } + i++; + } + if (node.length <= i) { + return { + type: 'Just', + value: result + }; + } else { + return { + type: 'Nothing' + }; + } + } + function castFields(node, type, options){ + var typeOf, key, value; + if (toString$.call(node).slice(8, -1) !== 'Object') { + return { + type: 'Nothing' + }; + } + typeOf = type.of; + return { + type: 'Just', + value: (function(){ + var ref$, resultObj$ = {}; + for (key in ref$ = node) { + value = ref$[key]; + resultObj$[typesCast(key, [{ + type: 'String' + }], options)] = typesCast(value, typeOf[key] || [{ + type: '*' + }], options); + } + return resultObj$; + }()) + }; + } + function typeCast(node, typeObj, options){ + var type, structure, castFunc, ref$; + type = typeObj.type, structure = typeObj.structure; + if (type) { + castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 8) || types[type]; + if (!castFunc) { + throw new Error("Type not defined: " + type + "."); + } + return castFunc(node, options, typesCast); + } else { + switch (structure) { + case 'array': + return castArray(node, typeObj, options); + case 'tuple': + return castTuple(node, typeObj, options); + case 'fields': + return castFields(node, typeObj, options); + } + } + } + function typesCast(node, types, options){ + var i$, len$, type, ref$, valueType, value; + for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { + type = types[i$]; + ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value; + if (valueType === 'Nothing') { + continue; + } + if (parsedTypeCheck([type], value, { + customTypes: options.customTypes + })) { + return value; + } + } + throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + "."); + } + module.exports = function(node, types, options){ + if (!options.explicit && types.length === 1 && types[0].type === 'String') { + return node; + } + return typesCast(node, types, options); + }; +}).call(this); diff --git a/node_modules/levn/lib/index.js b/node_modules/levn/lib/index.js new file mode 100644 index 0000000..b8b6684 --- /dev/null +++ b/node_modules/levn/lib/index.js @@ -0,0 +1,22 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var parseString, cast, parseType, VERSION, parsedTypeParse, parse; + parseString = require('./parse-string'); + cast = require('./cast'); + parseType = require('type-check').parseType; + VERSION = '0.4.1'; + parsedTypeParse = function(parsedType, string, options){ + options == null && (options = {}); + options.explicit == null && (options.explicit = false); + options.customTypes == null && (options.customTypes = {}); + return cast(parseString(parsedType, string, options), parsedType, options); + }; + parse = function(type, string, options){ + return parsedTypeParse(parseType(type), string, options); + }; + module.exports = { + VERSION: VERSION, + parse: parse, + parsedTypeParse: parsedTypeParse + }; +}).call(this); diff --git a/node_modules/levn/lib/parse-string.js b/node_modules/levn/lib/parse-string.js new file mode 100644 index 0000000..eaed2f0 --- /dev/null +++ b/node_modules/levn/lib/parse-string.js @@ -0,0 +1,113 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var reject, special, tokenRegex; + reject = require('prelude-ls').reject; + function consumeOp(tokens, op){ + if (tokens[0] === op) { + return tokens.shift(); + } else { + throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + "."); + } + } + function maybeConsumeOp(tokens, op){ + if (tokens[0] === op) { + return tokens.shift(); + } + } + function consumeList(tokens, arg$, hasDelimiters){ + var open, close, result, untilTest; + open = arg$[0], close = arg$[1]; + if (hasDelimiters) { + consumeOp(tokens, open); + } + result = []; + untilTest = "," + (hasDelimiters ? close : ''); + while (tokens.length && (hasDelimiters && tokens[0] !== close)) { + result.push(consumeElement(tokens, untilTest)); + maybeConsumeOp(tokens, ','); + } + if (hasDelimiters) { + consumeOp(tokens, close); + } + return result; + } + function consumeArray(tokens, hasDelimiters){ + return consumeList(tokens, ['[', ']'], hasDelimiters); + } + function consumeTuple(tokens, hasDelimiters){ + return consumeList(tokens, ['(', ')'], hasDelimiters); + } + function consumeFields(tokens, hasDelimiters){ + var result, untilTest, key; + if (hasDelimiters) { + consumeOp(tokens, '{'); + } + result = {}; + untilTest = "," + (hasDelimiters ? '}' : ''); + while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { + key = consumeValue(tokens, ':'); + consumeOp(tokens, ':'); + result[key] = consumeElement(tokens, untilTest); + maybeConsumeOp(tokens, ','); + } + if (hasDelimiters) { + consumeOp(tokens, '}'); + } + return result; + } + function consumeValue(tokens, untilTest){ + var out; + untilTest == null && (untilTest = ''); + out = ''; + while (tokens.length && -1 === untilTest.indexOf(tokens[0])) { + out += tokens.shift(); + } + return out; + } + function consumeElement(tokens, untilTest){ + switch (tokens[0]) { + case '[': + return consumeArray(tokens, true); + case '(': + return consumeTuple(tokens, true); + case '{': + return consumeFields(tokens, true); + default: + return consumeValue(tokens, untilTest); + } + } + function consumeTopLevel(tokens, types, options){ + var ref$, type, structure, origTokens, result, finalResult, x$, y$; + ref$ = types[0], type = ref$.type, structure = ref$.structure; + origTokens = tokens.concat(); + if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) { + result = structure === 'array' || type === 'Array' + ? consumeArray(tokens, tokens[0] === '[') + : structure === 'tuple' + ? consumeTuple(tokens, tokens[0] === '(') + : consumeFields(tokens, tokens[0] === '{'); + finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array' + ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$) + : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result; + } else { + finalResult = consumeElement(tokens); + } + return finalResult; + } + special = /\[\]\(\)}{:,/.source; + tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*'); + module.exports = function(types, string, options){ + var tokens, node; + options == null && (options = {}); + if (!options.explicit && types.length === 1 && types[0].type === 'String') { + return string; + } + tokens = reject(not$, string.split(tokenRegex)); + node = consumeTopLevel(tokens, types, options); + if (!node) { + throw new Error("Error parsing '" + string + "'."); + } + return node; + }; + function not$(x){ return !x; } +}).call(this); diff --git a/node_modules/levn/package.json b/node_modules/levn/package.json new file mode 100644 index 0000000..e61bfa9 --- /dev/null +++ b/node_modules/levn/package.json @@ -0,0 +1,77 @@ +{ + "_from": "levn@^0.4.1", + "_id": "levn@0.4.1", + "_inBundle": false, + "_integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "_location": "/levn", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "levn@^0.4.1", + "name": "levn", + "escapedName": "levn", + "rawSpec": "^0.4.1", + "saveSpec": null, + "fetchSpec": "^0.4.1" + }, + "_requiredBy": [ + "/eslint", + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "_shasum": "ae4562c007473b932a6200d403268dd2fffc6ade", + "_spec": "levn@^0.4.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/levn/issues" + }, + "bundleDependencies": false, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "deprecated": false, + "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "homepage": "https://github.com/gkz/levn", + "keywords": [ + "levn", + "light", + "ecmascript", + "value", + "notation", + "json", + "typed", + "human", + "concise", + "typed", + "flexible" + ], + "license": "MIT", + "main": "./lib/", + "name": "levn", + "repository": { + "type": "git", + "url": "git://github.com/gkz/levn.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.4.1" +} diff --git a/node_modules/load-json-file/index.js b/node_modules/load-json-file/index.js new file mode 100644 index 0000000..b2767e3 --- /dev/null +++ b/node_modules/load-json-file/index.js @@ -0,0 +1,11 @@ +'use strict'; +const path = require('path'); +const fs = require('graceful-fs'); +const stripBom = require('strip-bom'); +const parseJson = require('parse-json'); +const pify = require('pify'); + +const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); + +module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); +module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); diff --git a/node_modules/load-json-file/license b/node_modules/load-json-file/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/load-json-file/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/load-json-file/package.json b/node_modules/load-json-file/package.json new file mode 100644 index 0000000..759ae61 --- /dev/null +++ b/node_modules/load-json-file/package.json @@ -0,0 +1,75 @@ +{ + "_from": "load-json-file@^2.0.0", + "_id": "load-json-file@2.0.0", + "_inBundle": false, + "_integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "_location": "/load-json-file", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "load-json-file@^2.0.0", + "name": "load-json-file", + "escapedName": "load-json-file", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "_shasum": "7947e42149af80d696cbf797bcaabcfe1fe29ca8", + "_spec": "load-json-file@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/load-json-file/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "deprecated": false, + "description": "Read and parse a JSON file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/load-json-file#readme", + "keywords": [ + "read", + "json", + "parse", + "file", + "fs", + "graceful", + "load" + ], + "license": "MIT", + "name": "load-json-file", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/load-json-file.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/load-json-file/readme.md b/node_modules/load-json-file/readme.md new file mode 100644 index 0000000..3319c26 --- /dev/null +++ b/node_modules/load-json-file/readme.md @@ -0,0 +1,45 @@ +# load-json-file [![Build Status](https://travis-ci.org/sindresorhus/load-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/load-json-file) + +> Read and parse a JSON file + +[Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json). + + +## Install + +``` +$ npm install --save load-json-file +``` + + +## Usage + +```js +const loadJsonFile = require('load-json-file'); + +loadJsonFile('foo.json').then(json => { + console.log(json); + //=> {foo: true} +}); +``` + + +## API + +### loadJsonFile(filepath) + +Returns a promise for the parsed JSON. + +### loadJsonFile.sync(filepath) + +Returns the parsed JSON. + + +## Related + +- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/locate-path/index.js b/node_modules/locate-path/index.js new file mode 100644 index 0000000..32b108d --- /dev/null +++ b/node_modules/locate-path/index.js @@ -0,0 +1,24 @@ +'use strict'; +const path = require('path'); +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +module.exports = (iterable, opts) => { + opts = Object.assign({ + cwd: process.cwd() + }, opts); + + return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); +}; + +module.exports.sync = (iterable, opts) => { + opts = Object.assign({ + cwd: process.cwd() + }, opts); + + for (const el of iterable) { + if (pathExists.sync(path.resolve(opts.cwd, el))) { + return el; + } + } +}; diff --git a/node_modules/locate-path/license b/node_modules/locate-path/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/locate-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/locate-path/package.json b/node_modules/locate-path/package.json new file mode 100644 index 0000000..eb1f152 --- /dev/null +++ b/node_modules/locate-path/package.json @@ -0,0 +1,79 @@ +{ + "_from": "locate-path@^2.0.0", + "_id": "locate-path@2.0.0", + "_inBundle": false, + "_integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "_location": "/locate-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "locate-path@^2.0.0", + "name": "locate-path", + "escapedName": "locate-path", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/find-up" + ], + "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "_shasum": "2b568b265eec944c6d9c0de9c3dbbbca0354cd8e", + "_spec": "locate-path@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/locate-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "deprecated": false, + "description": "Get the first path that exists on disk of multiple paths", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/locate-path#readme", + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "license": "MIT", + "name": "locate-path", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/locate-path.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/locate-path/readme.md b/node_modules/locate-path/readme.md new file mode 100644 index 0000000..f7b337b --- /dev/null +++ b/node_modules/locate-path/readme.md @@ -0,0 +1,99 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install --save locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // only this one actually exists on disk + 'pony.png' +]; + +locatePath(files).then(foundPath => { + console.log(foundPath); + //=> 'rainbow' +}); +``` + + +## API + +### locatePath(input, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory. + +### locatePath.sync(input, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/lodash/LICENSE b/node_modules/lodash/LICENSE new file mode 100644 index 0000000..77c42f1 --- /dev/null +++ b/node_modules/lodash/LICENSE @@ -0,0 +1,47 @@ +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash/README.md b/node_modules/lodash/README.md new file mode 100644 index 0000000..e1c9950 --- /dev/null +++ b/node_modules/lodash/README.md @@ -0,0 +1,39 @@ +# lodash v4.17.20 + +The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. + +## Installation + +Using npm: +```shell +$ npm i -g npm +$ npm i --save lodash +``` + +In Node.js: +```js +// Load the full build. +var _ = require('lodash'); +// Load the core build. +var _ = require('lodash/core'); +// Load the FP build for immutable auto-curried iteratee-first data-last methods. +var fp = require('lodash/fp'); + +// Load method categories. +var array = require('lodash/array'); +var object = require('lodash/fp/object'); + +// Cherry-pick methods for smaller browserify/rollup/webpack bundles. +var at = require('lodash/at'); +var curryN = require('lodash/fp/curryN'); +``` + +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. + +## Support + +Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.
+Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/node_modules/lodash/_DataView.js b/node_modules/lodash/_DataView.js new file mode 100644 index 0000000..ac2d57c --- /dev/null +++ b/node_modules/lodash/_DataView.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; diff --git a/node_modules/lodash/_Hash.js b/node_modules/lodash/_Hash.js new file mode 100644 index 0000000..b504fe3 --- /dev/null +++ b/node_modules/lodash/_Hash.js @@ -0,0 +1,32 @@ +var hashClear = require('./_hashClear'), + hashDelete = require('./_hashDelete'), + hashGet = require('./_hashGet'), + hashHas = require('./_hashHas'), + hashSet = require('./_hashSet'); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; diff --git a/node_modules/lodash/_LazyWrapper.js b/node_modules/lodash/_LazyWrapper.js new file mode 100644 index 0000000..81786c7 --- /dev/null +++ b/node_modules/lodash/_LazyWrapper.js @@ -0,0 +1,28 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ +function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} + +// Ensure `LazyWrapper` is an instance of `baseLodash`. +LazyWrapper.prototype = baseCreate(baseLodash.prototype); +LazyWrapper.prototype.constructor = LazyWrapper; + +module.exports = LazyWrapper; diff --git a/node_modules/lodash/_ListCache.js b/node_modules/lodash/_ListCache.js new file mode 100644 index 0000000..26895c3 --- /dev/null +++ b/node_modules/lodash/_ListCache.js @@ -0,0 +1,32 @@ +var listCacheClear = require('./_listCacheClear'), + listCacheDelete = require('./_listCacheDelete'), + listCacheGet = require('./_listCacheGet'), + listCacheHas = require('./_listCacheHas'), + listCacheSet = require('./_listCacheSet'); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; diff --git a/node_modules/lodash/_LodashWrapper.js b/node_modules/lodash/_LodashWrapper.js new file mode 100644 index 0000000..c1e4d9d --- /dev/null +++ b/node_modules/lodash/_LodashWrapper.js @@ -0,0 +1,22 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ +function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; +} + +LodashWrapper.prototype = baseCreate(baseLodash.prototype); +LodashWrapper.prototype.constructor = LodashWrapper; + +module.exports = LodashWrapper; diff --git a/node_modules/lodash/_Map.js b/node_modules/lodash/_Map.js new file mode 100644 index 0000000..b73f29a --- /dev/null +++ b/node_modules/lodash/_Map.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; diff --git a/node_modules/lodash/_MapCache.js b/node_modules/lodash/_MapCache.js new file mode 100644 index 0000000..4a4eea7 --- /dev/null +++ b/node_modules/lodash/_MapCache.js @@ -0,0 +1,32 @@ +var mapCacheClear = require('./_mapCacheClear'), + mapCacheDelete = require('./_mapCacheDelete'), + mapCacheGet = require('./_mapCacheGet'), + mapCacheHas = require('./_mapCacheHas'), + mapCacheSet = require('./_mapCacheSet'); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; diff --git a/node_modules/lodash/_Promise.js b/node_modules/lodash/_Promise.js new file mode 100644 index 0000000..247b9e1 --- /dev/null +++ b/node_modules/lodash/_Promise.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; diff --git a/node_modules/lodash/_Set.js b/node_modules/lodash/_Set.js new file mode 100644 index 0000000..b3c8dcb --- /dev/null +++ b/node_modules/lodash/_Set.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; diff --git a/node_modules/lodash/_SetCache.js b/node_modules/lodash/_SetCache.js new file mode 100644 index 0000000..6468b06 --- /dev/null +++ b/node_modules/lodash/_SetCache.js @@ -0,0 +1,27 @@ +var MapCache = require('./_MapCache'), + setCacheAdd = require('./_setCacheAdd'), + setCacheHas = require('./_setCacheHas'); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; diff --git a/node_modules/lodash/_Stack.js b/node_modules/lodash/_Stack.js new file mode 100644 index 0000000..80b2cf1 --- /dev/null +++ b/node_modules/lodash/_Stack.js @@ -0,0 +1,27 @@ +var ListCache = require('./_ListCache'), + stackClear = require('./_stackClear'), + stackDelete = require('./_stackDelete'), + stackGet = require('./_stackGet'), + stackHas = require('./_stackHas'), + stackSet = require('./_stackSet'); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; diff --git a/node_modules/lodash/_Symbol.js b/node_modules/lodash/_Symbol.js new file mode 100644 index 0000000..a013f7c --- /dev/null +++ b/node_modules/lodash/_Symbol.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; diff --git a/node_modules/lodash/_Uint8Array.js b/node_modules/lodash/_Uint8Array.js new file mode 100644 index 0000000..2fb30e1 --- /dev/null +++ b/node_modules/lodash/_Uint8Array.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; diff --git a/node_modules/lodash/_WeakMap.js b/node_modules/lodash/_WeakMap.js new file mode 100644 index 0000000..567f86c --- /dev/null +++ b/node_modules/lodash/_WeakMap.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; diff --git a/node_modules/lodash/_apply.js b/node_modules/lodash/_apply.js new file mode 100644 index 0000000..36436dd --- /dev/null +++ b/node_modules/lodash/_apply.js @@ -0,0 +1,21 @@ +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; diff --git a/node_modules/lodash/_arrayAggregator.js b/node_modules/lodash/_arrayAggregator.js new file mode 100644 index 0000000..d96c3ca --- /dev/null +++ b/node_modules/lodash/_arrayAggregator.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; +} + +module.exports = arrayAggregator; diff --git a/node_modules/lodash/_arrayEach.js b/node_modules/lodash/_arrayEach.js new file mode 100644 index 0000000..2c5f579 --- /dev/null +++ b/node_modules/lodash/_arrayEach.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; diff --git a/node_modules/lodash/_arrayEachRight.js b/node_modules/lodash/_arrayEachRight.js new file mode 100644 index 0000000..976ca5c --- /dev/null +++ b/node_modules/lodash/_arrayEachRight.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; diff --git a/node_modules/lodash/_arrayEvery.js b/node_modules/lodash/_arrayEvery.js new file mode 100644 index 0000000..e26a918 --- /dev/null +++ b/node_modules/lodash/_arrayEvery.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; diff --git a/node_modules/lodash/_arrayFilter.js b/node_modules/lodash/_arrayFilter.js new file mode 100644 index 0000000..75ea254 --- /dev/null +++ b/node_modules/lodash/_arrayFilter.js @@ -0,0 +1,25 @@ +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; diff --git a/node_modules/lodash/_arrayIncludes.js b/node_modules/lodash/_arrayIncludes.js new file mode 100644 index 0000000..3737a6d --- /dev/null +++ b/node_modules/lodash/_arrayIncludes.js @@ -0,0 +1,17 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; diff --git a/node_modules/lodash/_arrayIncludesWith.js b/node_modules/lodash/_arrayIncludesWith.js new file mode 100644 index 0000000..235fd97 --- /dev/null +++ b/node_modules/lodash/_arrayIncludesWith.js @@ -0,0 +1,22 @@ +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; diff --git a/node_modules/lodash/_arrayLikeKeys.js b/node_modules/lodash/_arrayLikeKeys.js new file mode 100644 index 0000000..b2ec9ce --- /dev/null +++ b/node_modules/lodash/_arrayLikeKeys.js @@ -0,0 +1,49 @@ +var baseTimes = require('./_baseTimes'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isIndex = require('./_isIndex'), + isTypedArray = require('./isTypedArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; diff --git a/node_modules/lodash/_arrayMap.js b/node_modules/lodash/_arrayMap.js new file mode 100644 index 0000000..22b2246 --- /dev/null +++ b/node_modules/lodash/_arrayMap.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; diff --git a/node_modules/lodash/_arrayPush.js b/node_modules/lodash/_arrayPush.js new file mode 100644 index 0000000..7d742b3 --- /dev/null +++ b/node_modules/lodash/_arrayPush.js @@ -0,0 +1,20 @@ +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; diff --git a/node_modules/lodash/_arrayReduce.js b/node_modules/lodash/_arrayReduce.js new file mode 100644 index 0000000..de8b79b --- /dev/null +++ b/node_modules/lodash/_arrayReduce.js @@ -0,0 +1,26 @@ +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +module.exports = arrayReduce; diff --git a/node_modules/lodash/_arrayReduceRight.js b/node_modules/lodash/_arrayReduceRight.js new file mode 100644 index 0000000..22d8976 --- /dev/null +++ b/node_modules/lodash/_arrayReduceRight.js @@ -0,0 +1,24 @@ +/** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; +} + +module.exports = arrayReduceRight; diff --git a/node_modules/lodash/_arraySample.js b/node_modules/lodash/_arraySample.js new file mode 100644 index 0000000..fcab010 --- /dev/null +++ b/node_modules/lodash/_arraySample.js @@ -0,0 +1,15 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ +function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; +} + +module.exports = arraySample; diff --git a/node_modules/lodash/_arraySampleSize.js b/node_modules/lodash/_arraySampleSize.js new file mode 100644 index 0000000..8c7e364 --- /dev/null +++ b/node_modules/lodash/_arraySampleSize.js @@ -0,0 +1,17 @@ +var baseClamp = require('./_baseClamp'), + copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); +} + +module.exports = arraySampleSize; diff --git a/node_modules/lodash/_arrayShuffle.js b/node_modules/lodash/_arrayShuffle.js new file mode 100644 index 0000000..46313a3 --- /dev/null +++ b/node_modules/lodash/_arrayShuffle.js @@ -0,0 +1,15 @@ +var copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); +} + +module.exports = arrayShuffle; diff --git a/node_modules/lodash/_arraySome.js b/node_modules/lodash/_arraySome.js new file mode 100644 index 0000000..6fd02fd --- /dev/null +++ b/node_modules/lodash/_arraySome.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; diff --git a/node_modules/lodash/_asciiSize.js b/node_modules/lodash/_asciiSize.js new file mode 100644 index 0000000..11d29c3 --- /dev/null +++ b/node_modules/lodash/_asciiSize.js @@ -0,0 +1,12 @@ +var baseProperty = require('./_baseProperty'); + +/** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +var asciiSize = baseProperty('length'); + +module.exports = asciiSize; diff --git a/node_modules/lodash/_asciiToArray.js b/node_modules/lodash/_asciiToArray.js new file mode 100644 index 0000000..8e3dd5b --- /dev/null +++ b/node_modules/lodash/_asciiToArray.js @@ -0,0 +1,12 @@ +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +module.exports = asciiToArray; diff --git a/node_modules/lodash/_asciiWords.js b/node_modules/lodash/_asciiWords.js new file mode 100644 index 0000000..d765f0f --- /dev/null +++ b/node_modules/lodash/_asciiWords.js @@ -0,0 +1,15 @@ +/** Used to match words composed of alphanumeric characters. */ +var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + +/** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function asciiWords(string) { + return string.match(reAsciiWord) || []; +} + +module.exports = asciiWords; diff --git a/node_modules/lodash/_assignMergeValue.js b/node_modules/lodash/_assignMergeValue.js new file mode 100644 index 0000000..cb1185e --- /dev/null +++ b/node_modules/lodash/_assignMergeValue.js @@ -0,0 +1,20 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignMergeValue; diff --git a/node_modules/lodash/_assignValue.js b/node_modules/lodash/_assignValue.js new file mode 100644 index 0000000..4083957 --- /dev/null +++ b/node_modules/lodash/_assignValue.js @@ -0,0 +1,28 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; diff --git a/node_modules/lodash/_assocIndexOf.js b/node_modules/lodash/_assocIndexOf.js new file mode 100644 index 0000000..5b77a2b --- /dev/null +++ b/node_modules/lodash/_assocIndexOf.js @@ -0,0 +1,21 @@ +var eq = require('./eq'); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; diff --git a/node_modules/lodash/_baseAggregator.js b/node_modules/lodash/_baseAggregator.js new file mode 100644 index 0000000..4bc9e91 --- /dev/null +++ b/node_modules/lodash/_baseAggregator.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; +} + +module.exports = baseAggregator; diff --git a/node_modules/lodash/_baseAssign.js b/node_modules/lodash/_baseAssign.js new file mode 100644 index 0000000..e5c4a1a --- /dev/null +++ b/node_modules/lodash/_baseAssign.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keys = require('./keys'); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/node_modules/lodash/_baseAssignIn.js b/node_modules/lodash/_baseAssignIn.js new file mode 100644 index 0000000..6624f90 --- /dev/null +++ b/node_modules/lodash/_baseAssignIn.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keysIn = require('./keysIn'); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; diff --git a/node_modules/lodash/_baseAssignValue.js b/node_modules/lodash/_baseAssignValue.js new file mode 100644 index 0000000..d6f66ef --- /dev/null +++ b/node_modules/lodash/_baseAssignValue.js @@ -0,0 +1,25 @@ +var defineProperty = require('./_defineProperty'); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; diff --git a/node_modules/lodash/_baseAt.js b/node_modules/lodash/_baseAt.js new file mode 100644 index 0000000..90e4237 --- /dev/null +++ b/node_modules/lodash/_baseAt.js @@ -0,0 +1,23 @@ +var get = require('./get'); + +/** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ +function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; +} + +module.exports = baseAt; diff --git a/node_modules/lodash/_baseClamp.js b/node_modules/lodash/_baseClamp.js new file mode 100644 index 0000000..a1c5692 --- /dev/null +++ b/node_modules/lodash/_baseClamp.js @@ -0,0 +1,22 @@ +/** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; diff --git a/node_modules/lodash/_baseClone.js b/node_modules/lodash/_baseClone.js new file mode 100644 index 0000000..69f8705 --- /dev/null +++ b/node_modules/lodash/_baseClone.js @@ -0,0 +1,166 @@ +var Stack = require('./_Stack'), + arrayEach = require('./_arrayEach'), + assignValue = require('./_assignValue'), + baseAssign = require('./_baseAssign'), + baseAssignIn = require('./_baseAssignIn'), + cloneBuffer = require('./_cloneBuffer'), + copyArray = require('./_copyArray'), + copySymbols = require('./_copySymbols'), + copySymbolsIn = require('./_copySymbolsIn'), + getAllKeys = require('./_getAllKeys'), + getAllKeysIn = require('./_getAllKeysIn'), + getTag = require('./_getTag'), + initCloneArray = require('./_initCloneArray'), + initCloneByTag = require('./_initCloneByTag'), + initCloneObject = require('./_initCloneObject'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isMap = require('./isMap'), + isObject = require('./isObject'), + isSet = require('./isSet'), + keys = require('./keys'), + keysIn = require('./keysIn'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; diff --git a/node_modules/lodash/_baseConforms.js b/node_modules/lodash/_baseConforms.js new file mode 100644 index 0000000..947e20d --- /dev/null +++ b/node_modules/lodash/_baseConforms.js @@ -0,0 +1,18 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ +function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; +} + +module.exports = baseConforms; diff --git a/node_modules/lodash/_baseConformsTo.js b/node_modules/lodash/_baseConformsTo.js new file mode 100644 index 0000000..e449cb8 --- /dev/null +++ b/node_modules/lodash/_baseConformsTo.js @@ -0,0 +1,27 @@ +/** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ +function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; +} + +module.exports = baseConformsTo; diff --git a/node_modules/lodash/_baseCreate.js b/node_modules/lodash/_baseCreate.js new file mode 100644 index 0000000..ffa6a52 --- /dev/null +++ b/node_modules/lodash/_baseCreate.js @@ -0,0 +1,30 @@ +var isObject = require('./isObject'); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; diff --git a/node_modules/lodash/_baseDelay.js b/node_modules/lodash/_baseDelay.js new file mode 100644 index 0000000..1486d69 --- /dev/null +++ b/node_modules/lodash/_baseDelay.js @@ -0,0 +1,21 @@ +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ +function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); +} + +module.exports = baseDelay; diff --git a/node_modules/lodash/_baseDifference.js b/node_modules/lodash/_baseDifference.js new file mode 100644 index 0000000..343ac19 --- /dev/null +++ b/node_modules/lodash/_baseDifference.js @@ -0,0 +1,67 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; diff --git a/node_modules/lodash/_baseEach.js b/node_modules/lodash/_baseEach.js new file mode 100644 index 0000000..512c067 --- /dev/null +++ b/node_modules/lodash/_baseEach.js @@ -0,0 +1,14 @@ +var baseForOwn = require('./_baseForOwn'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; diff --git a/node_modules/lodash/_baseEachRight.js b/node_modules/lodash/_baseEachRight.js new file mode 100644 index 0000000..0a8feec --- /dev/null +++ b/node_modules/lodash/_baseEachRight.js @@ -0,0 +1,14 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEachRight = createBaseEach(baseForOwnRight, true); + +module.exports = baseEachRight; diff --git a/node_modules/lodash/_baseEvery.js b/node_modules/lodash/_baseEvery.js new file mode 100644 index 0000000..fa52f7b --- /dev/null +++ b/node_modules/lodash/_baseEvery.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; diff --git a/node_modules/lodash/_baseExtremum.js b/node_modules/lodash/_baseExtremum.js new file mode 100644 index 0000000..9d6aa77 --- /dev/null +++ b/node_modules/lodash/_baseExtremum.js @@ -0,0 +1,32 @@ +var isSymbol = require('./isSymbol'); + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +module.exports = baseExtremum; diff --git a/node_modules/lodash/_baseFill.js b/node_modules/lodash/_baseFill.js new file mode 100644 index 0000000..46ef9c7 --- /dev/null +++ b/node_modules/lodash/_baseFill.js @@ -0,0 +1,32 @@ +var toInteger = require('./toInteger'), + toLength = require('./toLength'); + +/** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ +function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; +} + +module.exports = baseFill; diff --git a/node_modules/lodash/_baseFilter.js b/node_modules/lodash/_baseFilter.js new file mode 100644 index 0000000..4678477 --- /dev/null +++ b/node_modules/lodash/_baseFilter.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; diff --git a/node_modules/lodash/_baseFindIndex.js b/node_modules/lodash/_baseFindIndex.js new file mode 100644 index 0000000..e3f5d8a --- /dev/null +++ b/node_modules/lodash/_baseFindIndex.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; diff --git a/node_modules/lodash/_baseFindKey.js b/node_modules/lodash/_baseFindKey.js new file mode 100644 index 0000000..2e430f3 --- /dev/null +++ b/node_modules/lodash/_baseFindKey.js @@ -0,0 +1,23 @@ +/** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ +function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; +} + +module.exports = baseFindKey; diff --git a/node_modules/lodash/_baseFlatten.js b/node_modules/lodash/_baseFlatten.js new file mode 100644 index 0000000..4b1e009 --- /dev/null +++ b/node_modules/lodash/_baseFlatten.js @@ -0,0 +1,38 @@ +var arrayPush = require('./_arrayPush'), + isFlattenable = require('./_isFlattenable'); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; diff --git a/node_modules/lodash/_baseFor.js b/node_modules/lodash/_baseFor.js new file mode 100644 index 0000000..d946590 --- /dev/null +++ b/node_modules/lodash/_baseFor.js @@ -0,0 +1,16 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; diff --git a/node_modules/lodash/_baseForOwn.js b/node_modules/lodash/_baseForOwn.js new file mode 100644 index 0000000..503d523 --- /dev/null +++ b/node_modules/lodash/_baseForOwn.js @@ -0,0 +1,16 @@ +var baseFor = require('./_baseFor'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; diff --git a/node_modules/lodash/_baseForOwnRight.js b/node_modules/lodash/_baseForOwnRight.js new file mode 100644 index 0000000..a4b10e6 --- /dev/null +++ b/node_modules/lodash/_baseForOwnRight.js @@ -0,0 +1,16 @@ +var baseForRight = require('./_baseForRight'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; diff --git a/node_modules/lodash/_baseForRight.js b/node_modules/lodash/_baseForRight.js new file mode 100644 index 0000000..32842cd --- /dev/null +++ b/node_modules/lodash/_baseForRight.js @@ -0,0 +1,15 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseForRight = createBaseFor(true); + +module.exports = baseForRight; diff --git a/node_modules/lodash/_baseFunctions.js b/node_modules/lodash/_baseFunctions.js new file mode 100644 index 0000000..d23bc9b --- /dev/null +++ b/node_modules/lodash/_baseFunctions.js @@ -0,0 +1,19 @@ +var arrayFilter = require('./_arrayFilter'), + isFunction = require('./isFunction'); + +/** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ +function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); +} + +module.exports = baseFunctions; diff --git a/node_modules/lodash/_baseGet.js b/node_modules/lodash/_baseGet.js new file mode 100644 index 0000000..a194913 --- /dev/null +++ b/node_modules/lodash/_baseGet.js @@ -0,0 +1,24 @@ +var castPath = require('./_castPath'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; diff --git a/node_modules/lodash/_baseGetAllKeys.js b/node_modules/lodash/_baseGetAllKeys.js new file mode 100644 index 0000000..8ad204e --- /dev/null +++ b/node_modules/lodash/_baseGetAllKeys.js @@ -0,0 +1,20 @@ +var arrayPush = require('./_arrayPush'), + isArray = require('./isArray'); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; diff --git a/node_modules/lodash/_baseGetTag.js b/node_modules/lodash/_baseGetTag.js new file mode 100644 index 0000000..b927ccc --- /dev/null +++ b/node_modules/lodash/_baseGetTag.js @@ -0,0 +1,28 @@ +var Symbol = require('./_Symbol'), + getRawTag = require('./_getRawTag'), + objectToString = require('./_objectToString'); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; diff --git a/node_modules/lodash/_baseGt.js b/node_modules/lodash/_baseGt.js new file mode 100644 index 0000000..502d273 --- /dev/null +++ b/node_modules/lodash/_baseGt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +module.exports = baseGt; diff --git a/node_modules/lodash/_baseHas.js b/node_modules/lodash/_baseHas.js new file mode 100644 index 0000000..1b73032 --- /dev/null +++ b/node_modules/lodash/_baseHas.js @@ -0,0 +1,19 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); +} + +module.exports = baseHas; diff --git a/node_modules/lodash/_baseHasIn.js b/node_modules/lodash/_baseHasIn.js new file mode 100644 index 0000000..2e0d042 --- /dev/null +++ b/node_modules/lodash/_baseHasIn.js @@ -0,0 +1,13 @@ +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; diff --git a/node_modules/lodash/_baseInRange.js b/node_modules/lodash/_baseInRange.js new file mode 100644 index 0000000..ec95666 --- /dev/null +++ b/node_modules/lodash/_baseInRange.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ +function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); +} + +module.exports = baseInRange; diff --git a/node_modules/lodash/_baseIndexOf.js b/node_modules/lodash/_baseIndexOf.js new file mode 100644 index 0000000..167e706 --- /dev/null +++ b/node_modules/lodash/_baseIndexOf.js @@ -0,0 +1,20 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictIndexOf = require('./_strictIndexOf'); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; diff --git a/node_modules/lodash/_baseIndexOfWith.js b/node_modules/lodash/_baseIndexOfWith.js new file mode 100644 index 0000000..f815fe0 --- /dev/null +++ b/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; diff --git a/node_modules/lodash/_baseIntersection.js b/node_modules/lodash/_baseIntersection.js new file mode 100644 index 0000000..c1d250c --- /dev/null +++ b/node_modules/lodash/_baseIntersection.js @@ -0,0 +1,74 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; diff --git a/node_modules/lodash/_baseInverter.js b/node_modules/lodash/_baseInverter.js new file mode 100644 index 0000000..fbc337f --- /dev/null +++ b/node_modules/lodash/_baseInverter.js @@ -0,0 +1,21 @@ +var baseForOwn = require('./_baseForOwn'); + +/** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ +function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; +} + +module.exports = baseInverter; diff --git a/node_modules/lodash/_baseInvoke.js b/node_modules/lodash/_baseInvoke.js new file mode 100644 index 0000000..49bcf3c --- /dev/null +++ b/node_modules/lodash/_baseInvoke.js @@ -0,0 +1,24 @@ +var apply = require('./_apply'), + castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ +function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); +} + +module.exports = baseInvoke; diff --git a/node_modules/lodash/_baseIsArguments.js b/node_modules/lodash/_baseIsArguments.js new file mode 100644 index 0000000..b3562cc --- /dev/null +++ b/node_modules/lodash/_baseIsArguments.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; diff --git a/node_modules/lodash/_baseIsArrayBuffer.js b/node_modules/lodash/_baseIsArrayBuffer.js new file mode 100644 index 0000000..a2c4f30 --- /dev/null +++ b/node_modules/lodash/_baseIsArrayBuffer.js @@ -0,0 +1,17 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +var arrayBufferTag = '[object ArrayBuffer]'; + +/** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ +function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; +} + +module.exports = baseIsArrayBuffer; diff --git a/node_modules/lodash/_baseIsDate.js b/node_modules/lodash/_baseIsDate.js new file mode 100644 index 0000000..ba67c78 --- /dev/null +++ b/node_modules/lodash/_baseIsDate.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var dateTag = '[object Date]'; + +/** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ +function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; +} + +module.exports = baseIsDate; diff --git a/node_modules/lodash/_baseIsEqual.js b/node_modules/lodash/_baseIsEqual.js new file mode 100644 index 0000000..00a68a4 --- /dev/null +++ b/node_modules/lodash/_baseIsEqual.js @@ -0,0 +1,28 @@ +var baseIsEqualDeep = require('./_baseIsEqualDeep'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; diff --git a/node_modules/lodash/_baseIsEqualDeep.js b/node_modules/lodash/_baseIsEqualDeep.js new file mode 100644 index 0000000..e3cfd6a --- /dev/null +++ b/node_modules/lodash/_baseIsEqualDeep.js @@ -0,0 +1,83 @@ +var Stack = require('./_Stack'), + equalArrays = require('./_equalArrays'), + equalByTag = require('./_equalByTag'), + equalObjects = require('./_equalObjects'), + getTag = require('./_getTag'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isTypedArray = require('./isTypedArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; diff --git a/node_modules/lodash/_baseIsMap.js b/node_modules/lodash/_baseIsMap.js new file mode 100644 index 0000000..02a4021 --- /dev/null +++ b/node_modules/lodash/_baseIsMap.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; diff --git a/node_modules/lodash/_baseIsMatch.js b/node_modules/lodash/_baseIsMatch.js new file mode 100644 index 0000000..72494be --- /dev/null +++ b/node_modules/lodash/_baseIsMatch.js @@ -0,0 +1,62 @@ +var Stack = require('./_Stack'), + baseIsEqual = require('./_baseIsEqual'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; diff --git a/node_modules/lodash/_baseIsNaN.js b/node_modules/lodash/_baseIsNaN.js new file mode 100644 index 0000000..316f1eb --- /dev/null +++ b/node_modules/lodash/_baseIsNaN.js @@ -0,0 +1,12 @@ +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; diff --git a/node_modules/lodash/_baseIsNative.js b/node_modules/lodash/_baseIsNative.js new file mode 100644 index 0000000..8702330 --- /dev/null +++ b/node_modules/lodash/_baseIsNative.js @@ -0,0 +1,47 @@ +var isFunction = require('./isFunction'), + isMasked = require('./_isMasked'), + isObject = require('./isObject'), + toSource = require('./_toSource'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; diff --git a/node_modules/lodash/_baseIsRegExp.js b/node_modules/lodash/_baseIsRegExp.js new file mode 100644 index 0000000..6cd7c1a --- /dev/null +++ b/node_modules/lodash/_baseIsRegExp.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var regexpTag = '[object RegExp]'; + +/** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ +function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; +} + +module.exports = baseIsRegExp; diff --git a/node_modules/lodash/_baseIsSet.js b/node_modules/lodash/_baseIsSet.js new file mode 100644 index 0000000..6dee367 --- /dev/null +++ b/node_modules/lodash/_baseIsSet.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; diff --git a/node_modules/lodash/_baseIsTypedArray.js b/node_modules/lodash/_baseIsTypedArray.js new file mode 100644 index 0000000..1edb32f --- /dev/null +++ b/node_modules/lodash/_baseIsTypedArray.js @@ -0,0 +1,60 @@ +var baseGetTag = require('./_baseGetTag'), + isLength = require('./isLength'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; diff --git a/node_modules/lodash/_baseIteratee.js b/node_modules/lodash/_baseIteratee.js new file mode 100644 index 0000000..995c257 --- /dev/null +++ b/node_modules/lodash/_baseIteratee.js @@ -0,0 +1,31 @@ +var baseMatches = require('./_baseMatches'), + baseMatchesProperty = require('./_baseMatchesProperty'), + identity = require('./identity'), + isArray = require('./isArray'), + property = require('./property'); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; diff --git a/node_modules/lodash/_baseKeys.js b/node_modules/lodash/_baseKeys.js new file mode 100644 index 0000000..45e9e6f --- /dev/null +++ b/node_modules/lodash/_baseKeys.js @@ -0,0 +1,30 @@ +var isPrototype = require('./_isPrototype'), + nativeKeys = require('./_nativeKeys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; diff --git a/node_modules/lodash/_baseKeysIn.js b/node_modules/lodash/_baseKeysIn.js new file mode 100644 index 0000000..ea8a0a1 --- /dev/null +++ b/node_modules/lodash/_baseKeysIn.js @@ -0,0 +1,33 @@ +var isObject = require('./isObject'), + isPrototype = require('./_isPrototype'), + nativeKeysIn = require('./_nativeKeysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; diff --git a/node_modules/lodash/_baseLodash.js b/node_modules/lodash/_baseLodash.js new file mode 100644 index 0000000..f76c790 --- /dev/null +++ b/node_modules/lodash/_baseLodash.js @@ -0,0 +1,10 @@ +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; diff --git a/node_modules/lodash/_baseLt.js b/node_modules/lodash/_baseLt.js new file mode 100644 index 0000000..8674d29 --- /dev/null +++ b/node_modules/lodash/_baseLt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ +function baseLt(value, other) { + return value < other; +} + +module.exports = baseLt; diff --git a/node_modules/lodash/_baseMap.js b/node_modules/lodash/_baseMap.js new file mode 100644 index 0000000..0bf5cea --- /dev/null +++ b/node_modules/lodash/_baseMap.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'), + isArrayLike = require('./isArrayLike'); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; diff --git a/node_modules/lodash/_baseMatches.js b/node_modules/lodash/_baseMatches.js new file mode 100644 index 0000000..e56582a --- /dev/null +++ b/node_modules/lodash/_baseMatches.js @@ -0,0 +1,22 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'), + matchesStrictComparable = require('./_matchesStrictComparable'); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; diff --git a/node_modules/lodash/_baseMatchesProperty.js b/node_modules/lodash/_baseMatchesProperty.js new file mode 100644 index 0000000..24afd89 --- /dev/null +++ b/node_modules/lodash/_baseMatchesProperty.js @@ -0,0 +1,33 @@ +var baseIsEqual = require('./_baseIsEqual'), + get = require('./get'), + hasIn = require('./hasIn'), + isKey = require('./_isKey'), + isStrictComparable = require('./_isStrictComparable'), + matchesStrictComparable = require('./_matchesStrictComparable'), + toKey = require('./_toKey'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; diff --git a/node_modules/lodash/_baseMean.js b/node_modules/lodash/_baseMean.js new file mode 100644 index 0000000..fa9e00a --- /dev/null +++ b/node_modules/lodash/_baseMean.js @@ -0,0 +1,20 @@ +var baseSum = require('./_baseSum'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ +function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; +} + +module.exports = baseMean; diff --git a/node_modules/lodash/_baseMerge.js b/node_modules/lodash/_baseMerge.js new file mode 100644 index 0000000..c98b5eb --- /dev/null +++ b/node_modules/lodash/_baseMerge.js @@ -0,0 +1,42 @@ +var Stack = require('./_Stack'), + assignMergeValue = require('./_assignMergeValue'), + baseFor = require('./_baseFor'), + baseMergeDeep = require('./_baseMergeDeep'), + isObject = require('./isObject'), + keysIn = require('./keysIn'), + safeGet = require('./_safeGet'); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; diff --git a/node_modules/lodash/_baseMergeDeep.js b/node_modules/lodash/_baseMergeDeep.js new file mode 100644 index 0000000..4679e8d --- /dev/null +++ b/node_modules/lodash/_baseMergeDeep.js @@ -0,0 +1,94 @@ +var assignMergeValue = require('./_assignMergeValue'), + cloneBuffer = require('./_cloneBuffer'), + cloneTypedArray = require('./_cloneTypedArray'), + copyArray = require('./_copyArray'), + initCloneObject = require('./_initCloneObject'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'), + isBuffer = require('./isBuffer'), + isFunction = require('./isFunction'), + isObject = require('./isObject'), + isPlainObject = require('./isPlainObject'), + isTypedArray = require('./isTypedArray'), + safeGet = require('./_safeGet'), + toPlainObject = require('./toPlainObject'); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; diff --git a/node_modules/lodash/_baseNth.js b/node_modules/lodash/_baseNth.js new file mode 100644 index 0000000..0403c2a --- /dev/null +++ b/node_modules/lodash/_baseNth.js @@ -0,0 +1,20 @@ +var isIndex = require('./_isIndex'); + +/** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ +function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; +} + +module.exports = baseNth; diff --git a/node_modules/lodash/_baseOrderBy.js b/node_modules/lodash/_baseOrderBy.js new file mode 100644 index 0000000..775a017 --- /dev/null +++ b/node_modules/lodash/_baseOrderBy.js @@ -0,0 +1,49 @@ +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'), + isArray = require('./isArray'); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @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, baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; diff --git a/node_modules/lodash/_basePick.js b/node_modules/lodash/_basePick.js new file mode 100644 index 0000000..09b458a --- /dev/null +++ b/node_modules/lodash/_basePick.js @@ -0,0 +1,19 @@ +var basePickBy = require('./_basePickBy'), + hasIn = require('./hasIn'); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; diff --git a/node_modules/lodash/_basePickBy.js b/node_modules/lodash/_basePickBy.js new file mode 100644 index 0000000..85be68c --- /dev/null +++ b/node_modules/lodash/_basePickBy.js @@ -0,0 +1,30 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'), + castPath = require('./_castPath'); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; diff --git a/node_modules/lodash/_baseProperty.js b/node_modules/lodash/_baseProperty.js new file mode 100644 index 0000000..496281e --- /dev/null +++ b/node_modules/lodash/_baseProperty.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; diff --git a/node_modules/lodash/_basePropertyDeep.js b/node_modules/lodash/_basePropertyDeep.js new file mode 100644 index 0000000..1e5aae5 --- /dev/null +++ b/node_modules/lodash/_basePropertyDeep.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; diff --git a/node_modules/lodash/_basePropertyOf.js b/node_modules/lodash/_basePropertyOf.js new file mode 100644 index 0000000..4617399 --- /dev/null +++ b/node_modules/lodash/_basePropertyOf.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = basePropertyOf; diff --git a/node_modules/lodash/_basePullAll.js b/node_modules/lodash/_basePullAll.js new file mode 100644 index 0000000..305720e --- /dev/null +++ b/node_modules/lodash/_basePullAll.js @@ -0,0 +1,51 @@ +var arrayMap = require('./_arrayMap'), + baseIndexOf = require('./_baseIndexOf'), + baseIndexOfWith = require('./_baseIndexOfWith'), + baseUnary = require('./_baseUnary'), + copyArray = require('./_copyArray'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; +} + +module.exports = basePullAll; diff --git a/node_modules/lodash/_basePullAt.js b/node_modules/lodash/_basePullAt.js new file mode 100644 index 0000000..c3e9e71 --- /dev/null +++ b/node_modules/lodash/_basePullAt.js @@ -0,0 +1,37 @@ +var baseUnset = require('./_baseUnset'), + isIndex = require('./_isIndex'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ +function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; +} + +module.exports = basePullAt; diff --git a/node_modules/lodash/_baseRandom.js b/node_modules/lodash/_baseRandom.js new file mode 100644 index 0000000..94f76a7 --- /dev/null +++ b/node_modules/lodash/_baseRandom.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeRandom = Math.random; + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +module.exports = baseRandom; diff --git a/node_modules/lodash/_baseRange.js b/node_modules/lodash/_baseRange.js new file mode 100644 index 0000000..0fb8e41 --- /dev/null +++ b/node_modules/lodash/_baseRange.js @@ -0,0 +1,28 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +module.exports = baseRange; diff --git a/node_modules/lodash/_baseReduce.js b/node_modules/lodash/_baseReduce.js new file mode 100644 index 0000000..5a1f8b5 --- /dev/null +++ b/node_modules/lodash/_baseReduce.js @@ -0,0 +1,23 @@ +/** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ +function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; +} + +module.exports = baseReduce; diff --git a/node_modules/lodash/_baseRepeat.js b/node_modules/lodash/_baseRepeat.js new file mode 100644 index 0000000..ee44c31 --- /dev/null +++ b/node_modules/lodash/_baseRepeat.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; diff --git a/node_modules/lodash/_baseRest.js b/node_modules/lodash/_baseRest.js new file mode 100644 index 0000000..d0dc4bd --- /dev/null +++ b/node_modules/lodash/_baseRest.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; diff --git a/node_modules/lodash/_baseSample.js b/node_modules/lodash/_baseSample.js new file mode 100644 index 0000000..58582b9 --- /dev/null +++ b/node_modules/lodash/_baseSample.js @@ -0,0 +1,15 @@ +var arraySample = require('./_arraySample'), + values = require('./values'); + +/** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ +function baseSample(collection) { + return arraySample(values(collection)); +} + +module.exports = baseSample; diff --git a/node_modules/lodash/_baseSampleSize.js b/node_modules/lodash/_baseSampleSize.js new file mode 100644 index 0000000..5c90ec5 --- /dev/null +++ b/node_modules/lodash/_baseSampleSize.js @@ -0,0 +1,18 @@ +var baseClamp = require('./_baseClamp'), + shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); +} + +module.exports = baseSampleSize; diff --git a/node_modules/lodash/_baseSet.js b/node_modules/lodash/_baseSet.js new file mode 100644 index 0000000..99f4fbf --- /dev/null +++ b/node_modules/lodash/_baseSet.js @@ -0,0 +1,51 @@ +var assignValue = require('./_assignValue'), + castPath = require('./_castPath'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + 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; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; diff --git a/node_modules/lodash/_baseSetData.js b/node_modules/lodash/_baseSetData.js new file mode 100644 index 0000000..c409947 --- /dev/null +++ b/node_modules/lodash/_baseSetData.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + metaMap = require('./_metaMap'); + +/** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; +}; + +module.exports = baseSetData; diff --git a/node_modules/lodash/_baseSetToString.js b/node_modules/lodash/_baseSetToString.js new file mode 100644 index 0000000..89eaca3 --- /dev/null +++ b/node_modules/lodash/_baseSetToString.js @@ -0,0 +1,22 @@ +var constant = require('./constant'), + defineProperty = require('./_defineProperty'), + identity = require('./identity'); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; diff --git a/node_modules/lodash/_baseShuffle.js b/node_modules/lodash/_baseShuffle.js new file mode 100644 index 0000000..023077a --- /dev/null +++ b/node_modules/lodash/_baseShuffle.js @@ -0,0 +1,15 @@ +var shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function baseShuffle(collection) { + return shuffleSelf(values(collection)); +} + +module.exports = baseShuffle; diff --git a/node_modules/lodash/_baseSlice.js b/node_modules/lodash/_baseSlice.js new file mode 100644 index 0000000..786f6c9 --- /dev/null +++ b/node_modules/lodash/_baseSlice.js @@ -0,0 +1,31 @@ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; diff --git a/node_modules/lodash/_baseSome.js b/node_modules/lodash/_baseSome.js new file mode 100644 index 0000000..58f3f44 --- /dev/null +++ b/node_modules/lodash/_baseSome.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; diff --git a/node_modules/lodash/_baseSortBy.js b/node_modules/lodash/_baseSortBy.js new file mode 100644 index 0000000..a25c92e --- /dev/null +++ b/node_modules/lodash/_baseSortBy.js @@ -0,0 +1,21 @@ +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; diff --git a/node_modules/lodash/_baseSortedIndex.js b/node_modules/lodash/_baseSortedIndex.js new file mode 100644 index 0000000..638c366 --- /dev/null +++ b/node_modules/lodash/_baseSortedIndex.js @@ -0,0 +1,42 @@ +var baseSortedIndexBy = require('./_baseSortedIndexBy'), + identity = require('./identity'), + isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + +/** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); +} + +module.exports = baseSortedIndex; diff --git a/node_modules/lodash/_baseSortedIndexBy.js b/node_modules/lodash/_baseSortedIndexBy.js new file mode 100644 index 0000000..c247b37 --- /dev/null +++ b/node_modules/lodash/_baseSortedIndexBy.js @@ -0,0 +1,67 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeMin = Math.min; + +/** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + 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; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); +} + +module.exports = baseSortedIndexBy; diff --git a/node_modules/lodash/_baseSortedUniq.js b/node_modules/lodash/_baseSortedUniq.js new file mode 100644 index 0000000..802159a --- /dev/null +++ b/node_modules/lodash/_baseSortedUniq.js @@ -0,0 +1,30 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; +} + +module.exports = baseSortedUniq; diff --git a/node_modules/lodash/_baseSum.js b/node_modules/lodash/_baseSum.js new file mode 100644 index 0000000..a9e84c1 --- /dev/null +++ b/node_modules/lodash/_baseSum.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ +function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; +} + +module.exports = baseSum; diff --git a/node_modules/lodash/_baseTimes.js b/node_modules/lodash/_baseTimes.js new file mode 100644 index 0000000..0603fc3 --- /dev/null +++ b/node_modules/lodash/_baseTimes.js @@ -0,0 +1,20 @@ +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; diff --git a/node_modules/lodash/_baseToNumber.js b/node_modules/lodash/_baseToNumber.js new file mode 100644 index 0000000..04859f3 --- /dev/null +++ b/node_modules/lodash/_baseToNumber.js @@ -0,0 +1,24 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ +function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; +} + +module.exports = baseToNumber; diff --git a/node_modules/lodash/_baseToPairs.js b/node_modules/lodash/_baseToPairs.js new file mode 100644 index 0000000..bff1991 --- /dev/null +++ b/node_modules/lodash/_baseToPairs.js @@ -0,0 +1,18 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; diff --git a/node_modules/lodash/_baseToString.js b/node_modules/lodash/_baseToString.js new file mode 100644 index 0000000..ada6ad2 --- /dev/null +++ b/node_modules/lodash/_baseToString.js @@ -0,0 +1,37 @@ +var Symbol = require('./_Symbol'), + arrayMap = require('./_arrayMap'), + isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; diff --git a/node_modules/lodash/_baseUnary.js b/node_modules/lodash/_baseUnary.js new file mode 100644 index 0000000..98639e9 --- /dev/null +++ b/node_modules/lodash/_baseUnary.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; diff --git a/node_modules/lodash/_baseUniq.js b/node_modules/lodash/_baseUniq.js new file mode 100644 index 0000000..aea459d --- /dev/null +++ b/node_modules/lodash/_baseUniq.js @@ -0,0 +1,72 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + cacheHas = require('./_cacheHas'), + createSet = require('./_createSet'), + setToArray = require('./_setToArray'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; diff --git a/node_modules/lodash/_baseUnset.js b/node_modules/lodash/_baseUnset.js new file mode 100644 index 0000000..eefc6e3 --- /dev/null +++ b/node_modules/lodash/_baseUnset.js @@ -0,0 +1,20 @@ +var castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; diff --git a/node_modules/lodash/_baseUpdate.js b/node_modules/lodash/_baseUpdate.js new file mode 100644 index 0000000..92a6237 --- /dev/null +++ b/node_modules/lodash/_baseUpdate.js @@ -0,0 +1,18 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'); + +/** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); +} + +module.exports = baseUpdate; diff --git a/node_modules/lodash/_baseValues.js b/node_modules/lodash/_baseValues.js new file mode 100644 index 0000000..b95faad --- /dev/null +++ b/node_modules/lodash/_baseValues.js @@ -0,0 +1,19 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; diff --git a/node_modules/lodash/_baseWhile.js b/node_modules/lodash/_baseWhile.js new file mode 100644 index 0000000..07eac61 --- /dev/null +++ b/node_modules/lodash/_baseWhile.js @@ -0,0 +1,26 @@ +var baseSlice = require('./_baseSlice'); + +/** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ +function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); +} + +module.exports = baseWhile; diff --git a/node_modules/lodash/_baseWrapperValue.js b/node_modules/lodash/_baseWrapperValue.js new file mode 100644 index 0000000..443e0df --- /dev/null +++ b/node_modules/lodash/_baseWrapperValue.js @@ -0,0 +1,25 @@ +var LazyWrapper = require('./_LazyWrapper'), + arrayPush = require('./_arrayPush'), + arrayReduce = require('./_arrayReduce'); + +/** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ +function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); +} + +module.exports = baseWrapperValue; diff --git a/node_modules/lodash/_baseXor.js b/node_modules/lodash/_baseXor.js new file mode 100644 index 0000000..8e69338 --- /dev/null +++ b/node_modules/lodash/_baseXor.js @@ -0,0 +1,36 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseUniq = require('./_baseUniq'); + +/** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ +function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); +} + +module.exports = baseXor; diff --git a/node_modules/lodash/_baseZipObject.js b/node_modules/lodash/_baseZipObject.js new file mode 100644 index 0000000..401f85b --- /dev/null +++ b/node_modules/lodash/_baseZipObject.js @@ -0,0 +1,23 @@ +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; diff --git a/node_modules/lodash/_cacheHas.js b/node_modules/lodash/_cacheHas.js new file mode 100644 index 0000000..2dec892 --- /dev/null +++ b/node_modules/lodash/_cacheHas.js @@ -0,0 +1,13 @@ +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; diff --git a/node_modules/lodash/_castArrayLikeObject.js b/node_modules/lodash/_castArrayLikeObject.js new file mode 100644 index 0000000..92c75fa --- /dev/null +++ b/node_modules/lodash/_castArrayLikeObject.js @@ -0,0 +1,14 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; diff --git a/node_modules/lodash/_castFunction.js b/node_modules/lodash/_castFunction.js new file mode 100644 index 0000000..98c91ae --- /dev/null +++ b/node_modules/lodash/_castFunction.js @@ -0,0 +1,14 @@ +var identity = require('./identity'); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; diff --git a/node_modules/lodash/_castPath.js b/node_modules/lodash/_castPath.js new file mode 100644 index 0000000..017e4c1 --- /dev/null +++ b/node_modules/lodash/_castPath.js @@ -0,0 +1,21 @@ +var isArray = require('./isArray'), + isKey = require('./_isKey'), + stringToPath = require('./_stringToPath'), + toString = require('./toString'); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; diff --git a/node_modules/lodash/_castRest.js b/node_modules/lodash/_castRest.js new file mode 100644 index 0000000..213c66f --- /dev/null +++ b/node_modules/lodash/_castRest.js @@ -0,0 +1,14 @@ +var baseRest = require('./_baseRest'); + +/** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +var castRest = baseRest; + +module.exports = castRest; diff --git a/node_modules/lodash/_castSlice.js b/node_modules/lodash/_castSlice.js new file mode 100644 index 0000000..071faeb --- /dev/null +++ b/node_modules/lodash/_castSlice.js @@ -0,0 +1,18 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +module.exports = castSlice; diff --git a/node_modules/lodash/_charsEndIndex.js b/node_modules/lodash/_charsEndIndex.js new file mode 100644 index 0000000..07908ff --- /dev/null +++ b/node_modules/lodash/_charsEndIndex.js @@ -0,0 +1,19 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsEndIndex; diff --git a/node_modules/lodash/_charsStartIndex.js b/node_modules/lodash/_charsStartIndex.js new file mode 100644 index 0000000..b17afd2 --- /dev/null +++ b/node_modules/lodash/_charsStartIndex.js @@ -0,0 +1,20 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ +function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsStartIndex; diff --git a/node_modules/lodash/_cloneArrayBuffer.js b/node_modules/lodash/_cloneArrayBuffer.js new file mode 100644 index 0000000..c3d8f6e --- /dev/null +++ b/node_modules/lodash/_cloneArrayBuffer.js @@ -0,0 +1,16 @@ +var Uint8Array = require('./_Uint8Array'); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; diff --git a/node_modules/lodash/_cloneBuffer.js b/node_modules/lodash/_cloneBuffer.js new file mode 100644 index 0000000..27c4810 --- /dev/null +++ b/node_modules/lodash/_cloneBuffer.js @@ -0,0 +1,35 @@ +var root = require('./_root'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; diff --git a/node_modules/lodash/_cloneDataView.js b/node_modules/lodash/_cloneDataView.js new file mode 100644 index 0000000..9c9b7b0 --- /dev/null +++ b/node_modules/lodash/_cloneDataView.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; diff --git a/node_modules/lodash/_cloneRegExp.js b/node_modules/lodash/_cloneRegExp.js new file mode 100644 index 0000000..64a30df --- /dev/null +++ b/node_modules/lodash/_cloneRegExp.js @@ -0,0 +1,17 @@ +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; diff --git a/node_modules/lodash/_cloneSymbol.js b/node_modules/lodash/_cloneSymbol.js new file mode 100644 index 0000000..bede39f --- /dev/null +++ b/node_modules/lodash/_cloneSymbol.js @@ -0,0 +1,18 @@ +var Symbol = require('./_Symbol'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; diff --git a/node_modules/lodash/_cloneTypedArray.js b/node_modules/lodash/_cloneTypedArray.js new file mode 100644 index 0000000..7aad84d --- /dev/null +++ b/node_modules/lodash/_cloneTypedArray.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; diff --git a/node_modules/lodash/_compareAscending.js b/node_modules/lodash/_compareAscending.js new file mode 100644 index 0000000..8dc2791 --- /dev/null +++ b/node_modules/lodash/_compareAscending.js @@ -0,0 +1,41 @@ +var isSymbol = require('./isSymbol'); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; diff --git a/node_modules/lodash/_compareMultiple.js b/node_modules/lodash/_compareMultiple.js new file mode 100644 index 0000000..ad61f0f --- /dev/null +++ b/node_modules/lodash/_compareMultiple.js @@ -0,0 +1,44 @@ +var compareAscending = require('./_compareAscending'); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; diff --git a/node_modules/lodash/_composeArgs.js b/node_modules/lodash/_composeArgs.js new file mode 100644 index 0000000..1ce40f4 --- /dev/null +++ b/node_modules/lodash/_composeArgs.js @@ -0,0 +1,39 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; +} + +module.exports = composeArgs; diff --git a/node_modules/lodash/_composeArgsRight.js b/node_modules/lodash/_composeArgsRight.js new file mode 100644 index 0000000..8dc588d --- /dev/null +++ b/node_modules/lodash/_composeArgsRight.js @@ -0,0 +1,41 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; +} + +module.exports = composeArgsRight; diff --git a/node_modules/lodash/_copyArray.js b/node_modules/lodash/_copyArray.js new file mode 100644 index 0000000..cd94d5d --- /dev/null +++ b/node_modules/lodash/_copyArray.js @@ -0,0 +1,20 @@ +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; diff --git a/node_modules/lodash/_copyObject.js b/node_modules/lodash/_copyObject.js new file mode 100644 index 0000000..2f2a5c2 --- /dev/null +++ b/node_modules/lodash/_copyObject.js @@ -0,0 +1,40 @@ +var assignValue = require('./_assignValue'), + baseAssignValue = require('./_baseAssignValue'); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; diff --git a/node_modules/lodash/_copySymbols.js b/node_modules/lodash/_copySymbols.js new file mode 100644 index 0000000..c35944a --- /dev/null +++ b/node_modules/lodash/_copySymbols.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbols = require('./_getSymbols'); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; diff --git a/node_modules/lodash/_copySymbolsIn.js b/node_modules/lodash/_copySymbolsIn.js new file mode 100644 index 0000000..fdf20a7 --- /dev/null +++ b/node_modules/lodash/_copySymbolsIn.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbolsIn = require('./_getSymbolsIn'); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; diff --git a/node_modules/lodash/_coreJsData.js b/node_modules/lodash/_coreJsData.js new file mode 100644 index 0000000..f8e5b4e --- /dev/null +++ b/node_modules/lodash/_coreJsData.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; diff --git a/node_modules/lodash/_countHolders.js b/node_modules/lodash/_countHolders.js new file mode 100644 index 0000000..718fcda --- /dev/null +++ b/node_modules/lodash/_countHolders.js @@ -0,0 +1,21 @@ +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; +} + +module.exports = countHolders; diff --git a/node_modules/lodash/_createAggregator.js b/node_modules/lodash/_createAggregator.js new file mode 100644 index 0000000..0be42c4 --- /dev/null +++ b/node_modules/lodash/_createAggregator.js @@ -0,0 +1,23 @@ +var arrayAggregator = require('./_arrayAggregator'), + baseAggregator = require('./_baseAggregator'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ +function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; +} + +module.exports = createAggregator; diff --git a/node_modules/lodash/_createAssigner.js b/node_modules/lodash/_createAssigner.js new file mode 100644 index 0000000..1f904c5 --- /dev/null +++ b/node_modules/lodash/_createAssigner.js @@ -0,0 +1,37 @@ +var baseRest = require('./_baseRest'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; diff --git a/node_modules/lodash/_createBaseEach.js b/node_modules/lodash/_createBaseEach.js new file mode 100644 index 0000000..d24fdd1 --- /dev/null +++ b/node_modules/lodash/_createBaseEach.js @@ -0,0 +1,32 @@ +var isArrayLike = require('./isArrayLike'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; diff --git a/node_modules/lodash/_createBaseFor.js b/node_modules/lodash/_createBaseFor.js new file mode 100644 index 0000000..94cbf29 --- /dev/null +++ b/node_modules/lodash/_createBaseFor.js @@ -0,0 +1,25 @@ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; diff --git a/node_modules/lodash/_createBind.js b/node_modules/lodash/_createBind.js new file mode 100644 index 0000000..07cb99f --- /dev/null +++ b/node_modules/lodash/_createBind.js @@ -0,0 +1,28 @@ +var createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBind; diff --git a/node_modules/lodash/_createCaseFirst.js b/node_modules/lodash/_createCaseFirst.js new file mode 100644 index 0000000..fe8ea48 --- /dev/null +++ b/node_modules/lodash/_createCaseFirst.js @@ -0,0 +1,33 @@ +var castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringToArray = require('./_stringToArray'), + toString = require('./toString'); + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +module.exports = createCaseFirst; diff --git a/node_modules/lodash/_createCompounder.js b/node_modules/lodash/_createCompounder.js new file mode 100644 index 0000000..8d4cee2 --- /dev/null +++ b/node_modules/lodash/_createCompounder.js @@ -0,0 +1,24 @@ +var arrayReduce = require('./_arrayReduce'), + deburr = require('./deburr'), + words = require('./words'); + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]"; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; +} + +module.exports = createCompounder; diff --git a/node_modules/lodash/_createCtor.js b/node_modules/lodash/_createCtor.js new file mode 100644 index 0000000..9047aa5 --- /dev/null +++ b/node_modules/lodash/_createCtor.js @@ -0,0 +1,37 @@ +var baseCreate = require('./_baseCreate'), + isObject = require('./isObject'); + +/** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ +function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; +} + +module.exports = createCtor; diff --git a/node_modules/lodash/_createCurry.js b/node_modules/lodash/_createCurry.js new file mode 100644 index 0000000..f06c2cd --- /dev/null +++ b/node_modules/lodash/_createCurry.js @@ -0,0 +1,46 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + createHybrid = require('./_createHybrid'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; +} + +module.exports = createCurry; diff --git a/node_modules/lodash/_createFind.js b/node_modules/lodash/_createFind.js new file mode 100644 index 0000000..8859ff8 --- /dev/null +++ b/node_modules/lodash/_createFind.js @@ -0,0 +1,25 @@ +var baseIteratee = require('./_baseIteratee'), + isArrayLike = require('./isArrayLike'), + keys = require('./keys'); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; diff --git a/node_modules/lodash/_createFlow.js b/node_modules/lodash/_createFlow.js new file mode 100644 index 0000000..baaddbf --- /dev/null +++ b/node_modules/lodash/_createFlow.js @@ -0,0 +1,78 @@ +var LodashWrapper = require('./_LodashWrapper'), + flatRest = require('./_flatRest'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + isArray = require('./isArray'), + isLaziable = require('./_isLaziable'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ +function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); +} + +module.exports = createFlow; diff --git a/node_modules/lodash/_createHybrid.js b/node_modules/lodash/_createHybrid.js new file mode 100644 index 0000000..b671bd1 --- /dev/null +++ b/node_modules/lodash/_createHybrid.js @@ -0,0 +1,92 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + countHolders = require('./_countHolders'), + createCtor = require('./_createCtor'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + reorder = require('./_reorder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_ARY_FLAG = 128, + WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} + +module.exports = createHybrid; diff --git a/node_modules/lodash/_createInverter.js b/node_modules/lodash/_createInverter.js new file mode 100644 index 0000000..6c0c562 --- /dev/null +++ b/node_modules/lodash/_createInverter.js @@ -0,0 +1,17 @@ +var baseInverter = require('./_baseInverter'); + +/** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ +function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; +} + +module.exports = createInverter; diff --git a/node_modules/lodash/_createMathOperation.js b/node_modules/lodash/_createMathOperation.js new file mode 100644 index 0000000..f1e238a --- /dev/null +++ b/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,38 @@ +var baseToNumber = require('./_baseToNumber'), + baseToString = require('./_baseToString'); + +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; +} + +module.exports = createMathOperation; diff --git a/node_modules/lodash/_createOver.js b/node_modules/lodash/_createOver.js new file mode 100644 index 0000000..3b94551 --- /dev/null +++ b/node_modules/lodash/_createOver.js @@ -0,0 +1,27 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + baseUnary = require('./_baseUnary'), + flatRest = require('./_flatRest'); + +/** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ +function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); +} + +module.exports = createOver; diff --git a/node_modules/lodash/_createPadding.js b/node_modules/lodash/_createPadding.js new file mode 100644 index 0000000..2124612 --- /dev/null +++ b/node_modules/lodash/_createPadding.js @@ -0,0 +1,33 @@ +var baseRepeat = require('./_baseRepeat'), + baseToString = require('./_baseToString'), + castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringSize = require('./_stringSize'), + stringToArray = require('./_stringToArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +module.exports = createPadding; diff --git a/node_modules/lodash/_createPartial.js b/node_modules/lodash/_createPartial.js new file mode 100644 index 0000000..e16c248 --- /dev/null +++ b/node_modules/lodash/_createPartial.js @@ -0,0 +1,43 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ +function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; +} + +module.exports = createPartial; diff --git a/node_modules/lodash/_createRange.js b/node_modules/lodash/_createRange.js new file mode 100644 index 0000000..9f52c77 --- /dev/null +++ b/node_modules/lodash/_createRange.js @@ -0,0 +1,30 @@ +var baseRange = require('./_baseRange'), + isIterateeCall = require('./_isIterateeCall'), + toFinite = require('./toFinite'); + +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; +} + +module.exports = createRange; diff --git a/node_modules/lodash/_createRecurry.js b/node_modules/lodash/_createRecurry.js new file mode 100644 index 0000000..eb29fb2 --- /dev/null +++ b/node_modules/lodash/_createRecurry.js @@ -0,0 +1,56 @@ +var isLaziable = require('./_isLaziable'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); +} + +module.exports = createRecurry; diff --git a/node_modules/lodash/_createRelationalOperation.js b/node_modules/lodash/_createRelationalOperation.js new file mode 100644 index 0000000..a17c6b5 --- /dev/null +++ b/node_modules/lodash/_createRelationalOperation.js @@ -0,0 +1,20 @@ +var toNumber = require('./toNumber'); + +/** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ +function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; +} + +module.exports = createRelationalOperation; diff --git a/node_modules/lodash/_createRound.js b/node_modules/lodash/_createRound.js new file mode 100644 index 0000000..88be5df --- /dev/null +++ b/node_modules/lodash/_createRound.js @@ -0,0 +1,35 @@ +var root = require('./_root'), + toInteger = require('./toInteger'), + toNumber = require('./toNumber'), + toString = require('./toString'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite, + nativeMin = Math.min; + +/** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; +} + +module.exports = createRound; diff --git a/node_modules/lodash/_createSet.js b/node_modules/lodash/_createSet.js new file mode 100644 index 0000000..0f644ee --- /dev/null +++ b/node_modules/lodash/_createSet.js @@ -0,0 +1,19 @@ +var Set = require('./_Set'), + noop = require('./noop'), + setToArray = require('./_setToArray'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; diff --git a/node_modules/lodash/_createToPairs.js b/node_modules/lodash/_createToPairs.js new file mode 100644 index 0000000..568417a --- /dev/null +++ b/node_modules/lodash/_createToPairs.js @@ -0,0 +1,30 @@ +var baseToPairs = require('./_baseToPairs'), + getTag = require('./_getTag'), + mapToArray = require('./_mapToArray'), + setToPairs = require('./_setToPairs'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; diff --git a/node_modules/lodash/_createWrap.js b/node_modules/lodash/_createWrap.js new file mode 100644 index 0000000..33f0633 --- /dev/null +++ b/node_modules/lodash/_createWrap.js @@ -0,0 +1,106 @@ +var baseSetData = require('./_baseSetData'), + createBind = require('./_createBind'), + createCurry = require('./_createCurry'), + createHybrid = require('./_createHybrid'), + createPartial = require('./_createPartial'), + getData = require('./_getData'), + mergeData = require('./_mergeData'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'), + toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); +} + +module.exports = createWrap; diff --git a/node_modules/lodash/_customDefaultsAssignIn.js b/node_modules/lodash/_customDefaultsAssignIn.js new file mode 100644 index 0000000..1f49e6f --- /dev/null +++ b/node_modules/lodash/_customDefaultsAssignIn.js @@ -0,0 +1,29 @@ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +module.exports = customDefaultsAssignIn; diff --git a/node_modules/lodash/_customDefaultsMerge.js b/node_modules/lodash/_customDefaultsMerge.js new file mode 100644 index 0000000..4cab317 --- /dev/null +++ b/node_modules/lodash/_customDefaultsMerge.js @@ -0,0 +1,28 @@ +var baseMerge = require('./_baseMerge'), + isObject = require('./isObject'); + +/** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ +function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; +} + +module.exports = customDefaultsMerge; diff --git a/node_modules/lodash/_customOmitClone.js b/node_modules/lodash/_customOmitClone.js new file mode 100644 index 0000000..968db2e --- /dev/null +++ b/node_modules/lodash/_customOmitClone.js @@ -0,0 +1,16 @@ +var isPlainObject = require('./isPlainObject'); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; diff --git a/node_modules/lodash/_deburrLetter.js b/node_modules/lodash/_deburrLetter.js new file mode 100644 index 0000000..3e531ed --- /dev/null +++ b/node_modules/lodash/_deburrLetter.js @@ -0,0 +1,71 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\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', + // Latin Extended-A block. + '\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' +}; + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +module.exports = deburrLetter; diff --git a/node_modules/lodash/_defineProperty.js b/node_modules/lodash/_defineProperty.js new file mode 100644 index 0000000..b6116d9 --- /dev/null +++ b/node_modules/lodash/_defineProperty.js @@ -0,0 +1,11 @@ +var getNative = require('./_getNative'); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; diff --git a/node_modules/lodash/_equalArrays.js b/node_modules/lodash/_equalArrays.js new file mode 100644 index 0000000..824228c --- /dev/null +++ b/node_modules/lodash/_equalArrays.js @@ -0,0 +1,84 @@ +var SetCache = require('./_SetCache'), + arraySome = require('./_arraySome'), + cacheHas = require('./_cacheHas'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + 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) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; diff --git a/node_modules/lodash/_equalByTag.js b/node_modules/lodash/_equalByTag.js new file mode 100644 index 0000000..71919e8 --- /dev/null +++ b/node_modules/lodash/_equalByTag.js @@ -0,0 +1,112 @@ +var Symbol = require('./_Symbol'), + Uint8Array = require('./_Uint8Array'), + eq = require('./eq'), + equalArrays = require('./_equalArrays'), + mapToArray = require('./_mapToArray'), + setToArray = require('./_setToArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; diff --git a/node_modules/lodash/_equalObjects.js b/node_modules/lodash/_equalObjects.js new file mode 100644 index 0000000..cdaacd2 --- /dev/null +++ b/node_modules/lodash/_equalObjects.js @@ -0,0 +1,90 @@ +var getAllKeys = require('./_getAllKeys'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + 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; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; diff --git a/node_modules/lodash/_escapeHtmlChar.js b/node_modules/lodash/_escapeHtmlChar.js new file mode 100644 index 0000000..7ca68ee --- /dev/null +++ b/node_modules/lodash/_escapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map characters to HTML entities. */ +var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +/** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +var escapeHtmlChar = basePropertyOf(htmlEscapes); + +module.exports = escapeHtmlChar; diff --git a/node_modules/lodash/_escapeStringChar.js b/node_modules/lodash/_escapeStringChar.js new file mode 100644 index 0000000..44eca96 --- /dev/null +++ b/node_modules/lodash/_escapeStringChar.js @@ -0,0 +1,22 @@ +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +module.exports = escapeStringChar; diff --git a/node_modules/lodash/_flatRest.js b/node_modules/lodash/_flatRest.js new file mode 100644 index 0000000..94ab6cc --- /dev/null +++ b/node_modules/lodash/_flatRest.js @@ -0,0 +1,16 @@ +var flatten = require('./flatten'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; diff --git a/node_modules/lodash/_freeGlobal.js b/node_modules/lodash/_freeGlobal.js new file mode 100644 index 0000000..bbec998 --- /dev/null +++ b/node_modules/lodash/_freeGlobal.js @@ -0,0 +1,4 @@ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; diff --git a/node_modules/lodash/_getAllKeys.js b/node_modules/lodash/_getAllKeys.js new file mode 100644 index 0000000..a9ce699 --- /dev/null +++ b/node_modules/lodash/_getAllKeys.js @@ -0,0 +1,16 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbols = require('./_getSymbols'), + keys = require('./keys'); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; diff --git a/node_modules/lodash/_getAllKeysIn.js b/node_modules/lodash/_getAllKeysIn.js new file mode 100644 index 0000000..1b46678 --- /dev/null +++ b/node_modules/lodash/_getAllKeysIn.js @@ -0,0 +1,17 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbolsIn = require('./_getSymbolsIn'), + keysIn = require('./keysIn'); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; diff --git a/node_modules/lodash/_getData.js b/node_modules/lodash/_getData.js new file mode 100644 index 0000000..a1fe7b7 --- /dev/null +++ b/node_modules/lodash/_getData.js @@ -0,0 +1,15 @@ +var metaMap = require('./_metaMap'), + noop = require('./noop'); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; diff --git a/node_modules/lodash/_getFuncName.js b/node_modules/lodash/_getFuncName.js new file mode 100644 index 0000000..21e15b3 --- /dev/null +++ b/node_modules/lodash/_getFuncName.js @@ -0,0 +1,31 @@ +var realNames = require('./_realNames'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ +function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; +} + +module.exports = getFuncName; diff --git a/node_modules/lodash/_getHolder.js b/node_modules/lodash/_getHolder.js new file mode 100644 index 0000000..65e94b5 --- /dev/null +++ b/node_modules/lodash/_getHolder.js @@ -0,0 +1,13 @@ +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getHolder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getHolder; diff --git a/node_modules/lodash/_getMapData.js b/node_modules/lodash/_getMapData.js new file mode 100644 index 0000000..17f6303 --- /dev/null +++ b/node_modules/lodash/_getMapData.js @@ -0,0 +1,18 @@ +var isKeyable = require('./_isKeyable'); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; diff --git a/node_modules/lodash/_getMatchData.js b/node_modules/lodash/_getMatchData.js new file mode 100644 index 0000000..2cc70f9 --- /dev/null +++ b/node_modules/lodash/_getMatchData.js @@ -0,0 +1,24 @@ +var isStrictComparable = require('./_isStrictComparable'), + keys = require('./keys'); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; diff --git a/node_modules/lodash/_getNative.js b/node_modules/lodash/_getNative.js new file mode 100644 index 0000000..97a622b --- /dev/null +++ b/node_modules/lodash/_getNative.js @@ -0,0 +1,17 @@ +var baseIsNative = require('./_baseIsNative'), + getValue = require('./_getValue'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; diff --git a/node_modules/lodash/_getPrototype.js b/node_modules/lodash/_getPrototype.js new file mode 100644 index 0000000..e808612 --- /dev/null +++ b/node_modules/lodash/_getPrototype.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; diff --git a/node_modules/lodash/_getRawTag.js b/node_modules/lodash/_getRawTag.js new file mode 100644 index 0000000..49a95c9 --- /dev/null +++ b/node_modules/lodash/_getRawTag.js @@ -0,0 +1,46 @@ +var Symbol = require('./_Symbol'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; diff --git a/node_modules/lodash/_getSymbols.js b/node_modules/lodash/_getSymbols.js new file mode 100644 index 0000000..7d6eafe --- /dev/null +++ b/node_modules/lodash/_getSymbols.js @@ -0,0 +1,30 @@ +var arrayFilter = require('./_arrayFilter'), + stubArray = require('./stubArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; diff --git a/node_modules/lodash/_getSymbolsIn.js b/node_modules/lodash/_getSymbolsIn.js new file mode 100644 index 0000000..cec0855 --- /dev/null +++ b/node_modules/lodash/_getSymbolsIn.js @@ -0,0 +1,25 @@ +var arrayPush = require('./_arrayPush'), + getPrototype = require('./_getPrototype'), + getSymbols = require('./_getSymbols'), + stubArray = require('./stubArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; diff --git a/node_modules/lodash/_getTag.js b/node_modules/lodash/_getTag.js new file mode 100644 index 0000000..deaf89d --- /dev/null +++ b/node_modules/lodash/_getTag.js @@ -0,0 +1,58 @@ +var DataView = require('./_DataView'), + Map = require('./_Map'), + Promise = require('./_Promise'), + Set = require('./_Set'), + WeakMap = require('./_WeakMap'), + baseGetTag = require('./_baseGetTag'), + toSource = require('./_toSource'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; diff --git a/node_modules/lodash/_getValue.js b/node_modules/lodash/_getValue.js new file mode 100644 index 0000000..5f7d773 --- /dev/null +++ b/node_modules/lodash/_getValue.js @@ -0,0 +1,13 @@ +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; diff --git a/node_modules/lodash/_getView.js b/node_modules/lodash/_getView.js new file mode 100644 index 0000000..df1e5d4 --- /dev/null +++ b/node_modules/lodash/_getView.js @@ -0,0 +1,33 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ +function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; +} + +module.exports = getView; diff --git a/node_modules/lodash/_getWrapDetails.js b/node_modules/lodash/_getWrapDetails.js new file mode 100644 index 0000000..3bcc6e4 --- /dev/null +++ b/node_modules/lodash/_getWrapDetails.js @@ -0,0 +1,17 @@ +/** Used to match wrap detail comments. */ +var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + +/** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ +function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; +} + +module.exports = getWrapDetails; diff --git a/node_modules/lodash/_hasPath.js b/node_modules/lodash/_hasPath.js new file mode 100644 index 0000000..93dbde1 --- /dev/null +++ b/node_modules/lodash/_hasPath.js @@ -0,0 +1,39 @@ +var castPath = require('./_castPath'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isIndex = require('./_isIndex'), + isLength = require('./isLength'), + toKey = require('./_toKey'); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; diff --git a/node_modules/lodash/_hasUnicode.js b/node_modules/lodash/_hasUnicode.js new file mode 100644 index 0000000..cb6ca15 --- /dev/null +++ b/node_modules/lodash/_hasUnicode.js @@ -0,0 +1,26 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +module.exports = hasUnicode; diff --git a/node_modules/lodash/_hasUnicodeWord.js b/node_modules/lodash/_hasUnicodeWord.js new file mode 100644 index 0000000..95d52c4 --- /dev/null +++ b/node_modules/lodash/_hasUnicodeWord.js @@ -0,0 +1,15 @@ +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ +function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); +} + +module.exports = hasUnicodeWord; diff --git a/node_modules/lodash/_hashClear.js b/node_modules/lodash/_hashClear.js new file mode 100644 index 0000000..5d4b70c --- /dev/null +++ b/node_modules/lodash/_hashClear.js @@ -0,0 +1,15 @@ +var nativeCreate = require('./_nativeCreate'); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; diff --git a/node_modules/lodash/_hashDelete.js b/node_modules/lodash/_hashDelete.js new file mode 100644 index 0000000..ea9dabf --- /dev/null +++ b/node_modules/lodash/_hashDelete.js @@ -0,0 +1,17 @@ +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; diff --git a/node_modules/lodash/_hashGet.js b/node_modules/lodash/_hashGet.js new file mode 100644 index 0000000..1fc2f34 --- /dev/null +++ b/node_modules/lodash/_hashGet.js @@ -0,0 +1,30 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; diff --git a/node_modules/lodash/_hashHas.js b/node_modules/lodash/_hashHas.js new file mode 100644 index 0000000..281a551 --- /dev/null +++ b/node_modules/lodash/_hashHas.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; diff --git a/node_modules/lodash/_hashSet.js b/node_modules/lodash/_hashSet.js new file mode 100644 index 0000000..e105528 --- /dev/null +++ b/node_modules/lodash/_hashSet.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; diff --git a/node_modules/lodash/_initCloneArray.js b/node_modules/lodash/_initCloneArray.js new file mode 100644 index 0000000..078c15a --- /dev/null +++ b/node_modules/lodash/_initCloneArray.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; diff --git a/node_modules/lodash/_initCloneByTag.js b/node_modules/lodash/_initCloneByTag.js new file mode 100644 index 0000000..f69a008 --- /dev/null +++ b/node_modules/lodash/_initCloneByTag.js @@ -0,0 +1,77 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'), + cloneDataView = require('./_cloneDataView'), + cloneRegExp = require('./_cloneRegExp'), + cloneSymbol = require('./_cloneSymbol'), + cloneTypedArray = require('./_cloneTypedArray'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; diff --git a/node_modules/lodash/_initCloneObject.js b/node_modules/lodash/_initCloneObject.js new file mode 100644 index 0000000..5a13e64 --- /dev/null +++ b/node_modules/lodash/_initCloneObject.js @@ -0,0 +1,18 @@ +var baseCreate = require('./_baseCreate'), + getPrototype = require('./_getPrototype'), + isPrototype = require('./_isPrototype'); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; diff --git a/node_modules/lodash/_insertWrapDetails.js b/node_modules/lodash/_insertWrapDetails.js new file mode 100644 index 0000000..e790808 --- /dev/null +++ b/node_modules/lodash/_insertWrapDetails.js @@ -0,0 +1,23 @@ +/** Used to match wrap detail comments. */ +var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + +/** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ +function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); +} + +module.exports = insertWrapDetails; diff --git a/node_modules/lodash/_isFlattenable.js b/node_modules/lodash/_isFlattenable.js new file mode 100644 index 0000000..4cc2c24 --- /dev/null +++ b/node_modules/lodash/_isFlattenable.js @@ -0,0 +1,20 @@ +var Symbol = require('./_Symbol'), + isArguments = require('./isArguments'), + isArray = require('./isArray'); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; diff --git a/node_modules/lodash/_isIndex.js b/node_modules/lodash/_isIndex.js new file mode 100644 index 0000000..061cd39 --- /dev/null +++ b/node_modules/lodash/_isIndex.js @@ -0,0 +1,25 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; diff --git a/node_modules/lodash/_isIterateeCall.js b/node_modules/lodash/_isIterateeCall.js new file mode 100644 index 0000000..a0bb5a9 --- /dev/null +++ b/node_modules/lodash/_isIterateeCall.js @@ -0,0 +1,30 @@ +var eq = require('./eq'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; diff --git a/node_modules/lodash/_isKey.js b/node_modules/lodash/_isKey.js new file mode 100644 index 0000000..ff08b06 --- /dev/null +++ b/node_modules/lodash/_isKey.js @@ -0,0 +1,29 @@ +var isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; diff --git a/node_modules/lodash/_isKeyable.js b/node_modules/lodash/_isKeyable.js new file mode 100644 index 0000000..39f1828 --- /dev/null +++ b/node_modules/lodash/_isKeyable.js @@ -0,0 +1,15 @@ +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; diff --git a/node_modules/lodash/_isLaziable.js b/node_modules/lodash/_isLaziable.js new file mode 100644 index 0000000..a57c4f2 --- /dev/null +++ b/node_modules/lodash/_isLaziable.js @@ -0,0 +1,28 @@ +var LazyWrapper = require('./_LazyWrapper'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + lodash = require('./wrapperLodash'); + +/** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; +} + +module.exports = isLaziable; diff --git a/node_modules/lodash/_isMaskable.js b/node_modules/lodash/_isMaskable.js new file mode 100644 index 0000000..eb98d09 --- /dev/null +++ b/node_modules/lodash/_isMaskable.js @@ -0,0 +1,14 @@ +var coreJsData = require('./_coreJsData'), + isFunction = require('./isFunction'), + stubFalse = require('./stubFalse'); + +/** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ +var isMaskable = coreJsData ? isFunction : stubFalse; + +module.exports = isMaskable; diff --git a/node_modules/lodash/_isMasked.js b/node_modules/lodash/_isMasked.js new file mode 100644 index 0000000..4b0f21b --- /dev/null +++ b/node_modules/lodash/_isMasked.js @@ -0,0 +1,20 @@ +var coreJsData = require('./_coreJsData'); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; diff --git a/node_modules/lodash/_isPrototype.js b/node_modules/lodash/_isPrototype.js new file mode 100644 index 0000000..0f29498 --- /dev/null +++ b/node_modules/lodash/_isPrototype.js @@ -0,0 +1,18 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; diff --git a/node_modules/lodash/_isStrictComparable.js b/node_modules/lodash/_isStrictComparable.js new file mode 100644 index 0000000..b59f40b --- /dev/null +++ b/node_modules/lodash/_isStrictComparable.js @@ -0,0 +1,15 @@ +var isObject = require('./isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; diff --git a/node_modules/lodash/_iteratorToArray.js b/node_modules/lodash/_iteratorToArray.js new file mode 100644 index 0000000..4768566 --- /dev/null +++ b/node_modules/lodash/_iteratorToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ +function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; +} + +module.exports = iteratorToArray; diff --git a/node_modules/lodash/_lazyClone.js b/node_modules/lodash/_lazyClone.js new file mode 100644 index 0000000..d8a51f8 --- /dev/null +++ b/node_modules/lodash/_lazyClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ +function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; +} + +module.exports = lazyClone; diff --git a/node_modules/lodash/_lazyReverse.js b/node_modules/lodash/_lazyReverse.js new file mode 100644 index 0000000..c5b5219 --- /dev/null +++ b/node_modules/lodash/_lazyReverse.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'); + +/** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ +function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; +} + +module.exports = lazyReverse; diff --git a/node_modules/lodash/_lazyValue.js b/node_modules/lodash/_lazyValue.js new file mode 100644 index 0000000..371ca8d --- /dev/null +++ b/node_modules/lodash/_lazyValue.js @@ -0,0 +1,69 @@ +var baseWrapperValue = require('./_baseWrapperValue'), + getView = require('./_getView'), + isArray = require('./isArray'); + +/** Used to indicate the type of lazy iteratees. */ +var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ +function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; +} + +module.exports = lazyValue; diff --git a/node_modules/lodash/_listCacheClear.js b/node_modules/lodash/_listCacheClear.js new file mode 100644 index 0000000..acbe39a --- /dev/null +++ b/node_modules/lodash/_listCacheClear.js @@ -0,0 +1,13 @@ +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; diff --git a/node_modules/lodash/_listCacheDelete.js b/node_modules/lodash/_listCacheDelete.js new file mode 100644 index 0000000..b1384ad --- /dev/null +++ b/node_modules/lodash/_listCacheDelete.js @@ -0,0 +1,35 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; diff --git a/node_modules/lodash/_listCacheGet.js b/node_modules/lodash/_listCacheGet.js new file mode 100644 index 0000000..f8192fc --- /dev/null +++ b/node_modules/lodash/_listCacheGet.js @@ -0,0 +1,19 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; diff --git a/node_modules/lodash/_listCacheHas.js b/node_modules/lodash/_listCacheHas.js new file mode 100644 index 0000000..2adf671 --- /dev/null +++ b/node_modules/lodash/_listCacheHas.js @@ -0,0 +1,16 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; diff --git a/node_modules/lodash/_listCacheSet.js b/node_modules/lodash/_listCacheSet.js new file mode 100644 index 0000000..5855c95 --- /dev/null +++ b/node_modules/lodash/_listCacheSet.js @@ -0,0 +1,26 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; diff --git a/node_modules/lodash/_mapCacheClear.js b/node_modules/lodash/_mapCacheClear.js new file mode 100644 index 0000000..bc9ca20 --- /dev/null +++ b/node_modules/lodash/_mapCacheClear.js @@ -0,0 +1,21 @@ +var Hash = require('./_Hash'), + ListCache = require('./_ListCache'), + Map = require('./_Map'); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; diff --git a/node_modules/lodash/_mapCacheDelete.js b/node_modules/lodash/_mapCacheDelete.js new file mode 100644 index 0000000..946ca3c --- /dev/null +++ b/node_modules/lodash/_mapCacheDelete.js @@ -0,0 +1,18 @@ +var getMapData = require('./_getMapData'); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; diff --git a/node_modules/lodash/_mapCacheGet.js b/node_modules/lodash/_mapCacheGet.js new file mode 100644 index 0000000..f29f55c --- /dev/null +++ b/node_modules/lodash/_mapCacheGet.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; diff --git a/node_modules/lodash/_mapCacheHas.js b/node_modules/lodash/_mapCacheHas.js new file mode 100644 index 0000000..a1214c0 --- /dev/null +++ b/node_modules/lodash/_mapCacheHas.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; diff --git a/node_modules/lodash/_mapCacheSet.js b/node_modules/lodash/_mapCacheSet.js new file mode 100644 index 0000000..7346849 --- /dev/null +++ b/node_modules/lodash/_mapCacheSet.js @@ -0,0 +1,22 @@ +var getMapData = require('./_getMapData'); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; diff --git a/node_modules/lodash/_mapToArray.js b/node_modules/lodash/_mapToArray.js new file mode 100644 index 0000000..fe3dd53 --- /dev/null +++ b/node_modules/lodash/_mapToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; diff --git a/node_modules/lodash/_matchesStrictComparable.js b/node_modules/lodash/_matchesStrictComparable.js new file mode 100644 index 0000000..f608af9 --- /dev/null +++ b/node_modules/lodash/_matchesStrictComparable.js @@ -0,0 +1,20 @@ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; diff --git a/node_modules/lodash/_memoizeCapped.js b/node_modules/lodash/_memoizeCapped.js new file mode 100644 index 0000000..7f71c8f --- /dev/null +++ b/node_modules/lodash/_memoizeCapped.js @@ -0,0 +1,26 @@ +var memoize = require('./memoize'); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; diff --git a/node_modules/lodash/_mergeData.js b/node_modules/lodash/_mergeData.js new file mode 100644 index 0000000..cb570f9 --- /dev/null +++ b/node_modules/lodash/_mergeData.js @@ -0,0 +1,90 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + replaceHolders = require('./_replaceHolders'); + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ +function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; +} + +module.exports = mergeData; diff --git a/node_modules/lodash/_metaMap.js b/node_modules/lodash/_metaMap.js new file mode 100644 index 0000000..0157a0b --- /dev/null +++ b/node_modules/lodash/_metaMap.js @@ -0,0 +1,6 @@ +var WeakMap = require('./_WeakMap'); + +/** Used to store function metadata. */ +var metaMap = WeakMap && new WeakMap; + +module.exports = metaMap; diff --git a/node_modules/lodash/_nativeCreate.js b/node_modules/lodash/_nativeCreate.js new file mode 100644 index 0000000..c7aede8 --- /dev/null +++ b/node_modules/lodash/_nativeCreate.js @@ -0,0 +1,6 @@ +var getNative = require('./_getNative'); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; diff --git a/node_modules/lodash/_nativeKeys.js b/node_modules/lodash/_nativeKeys.js new file mode 100644 index 0000000..479a104 --- /dev/null +++ b/node_modules/lodash/_nativeKeys.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; diff --git a/node_modules/lodash/_nativeKeysIn.js b/node_modules/lodash/_nativeKeysIn.js new file mode 100644 index 0000000..00ee505 --- /dev/null +++ b/node_modules/lodash/_nativeKeysIn.js @@ -0,0 +1,20 @@ +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; diff --git a/node_modules/lodash/_nodeUtil.js b/node_modules/lodash/_nodeUtil.js new file mode 100644 index 0000000..983d78f --- /dev/null +++ b/node_modules/lodash/_nodeUtil.js @@ -0,0 +1,30 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; diff --git a/node_modules/lodash/_objectToString.js b/node_modules/lodash/_objectToString.js new file mode 100644 index 0000000..c614ec0 --- /dev/null +++ b/node_modules/lodash/_objectToString.js @@ -0,0 +1,22 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; diff --git a/node_modules/lodash/_overArg.js b/node_modules/lodash/_overArg.js new file mode 100644 index 0000000..651c5c5 --- /dev/null +++ b/node_modules/lodash/_overArg.js @@ -0,0 +1,15 @@ +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; diff --git a/node_modules/lodash/_overRest.js b/node_modules/lodash/_overRest.js new file mode 100644 index 0000000..c7cdef3 --- /dev/null +++ b/node_modules/lodash/_overRest.js @@ -0,0 +1,36 @@ +var apply = require('./_apply'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; diff --git a/node_modules/lodash/_parent.js b/node_modules/lodash/_parent.js new file mode 100644 index 0000000..f174328 --- /dev/null +++ b/node_modules/lodash/_parent.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'), + baseSlice = require('./_baseSlice'); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; diff --git a/node_modules/lodash/_reEscape.js b/node_modules/lodash/_reEscape.js new file mode 100644 index 0000000..7f47eda --- /dev/null +++ b/node_modules/lodash/_reEscape.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEscape = /<%-([\s\S]+?)%>/g; + +module.exports = reEscape; diff --git a/node_modules/lodash/_reEvaluate.js b/node_modules/lodash/_reEvaluate.js new file mode 100644 index 0000000..6adfc31 --- /dev/null +++ b/node_modules/lodash/_reEvaluate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEvaluate = /<%([\s\S]+?)%>/g; + +module.exports = reEvaluate; diff --git a/node_modules/lodash/_reInterpolate.js b/node_modules/lodash/_reInterpolate.js new file mode 100644 index 0000000..d02ff0b --- /dev/null +++ b/node_modules/lodash/_reInterpolate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/node_modules/lodash/_realNames.js b/node_modules/lodash/_realNames.js new file mode 100644 index 0000000..aa0d529 --- /dev/null +++ b/node_modules/lodash/_realNames.js @@ -0,0 +1,4 @@ +/** Used to lookup unminified function names. */ +var realNames = {}; + +module.exports = realNames; diff --git a/node_modules/lodash/_reorder.js b/node_modules/lodash/_reorder.js new file mode 100644 index 0000000..a3502b0 --- /dev/null +++ b/node_modules/lodash/_reorder.js @@ -0,0 +1,29 @@ +var copyArray = require('./_copyArray'), + isIndex = require('./_isIndex'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ +function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; +} + +module.exports = reorder; diff --git a/node_modules/lodash/_replaceHolders.js b/node_modules/lodash/_replaceHolders.js new file mode 100644 index 0000000..74360ec --- /dev/null +++ b/node_modules/lodash/_replaceHolders.js @@ -0,0 +1,29 @@ +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; +} + +module.exports = replaceHolders; diff --git a/node_modules/lodash/_root.js b/node_modules/lodash/_root.js new file mode 100644 index 0000000..d2852be --- /dev/null +++ b/node_modules/lodash/_root.js @@ -0,0 +1,9 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; diff --git a/node_modules/lodash/_safeGet.js b/node_modules/lodash/_safeGet.js new file mode 100644 index 0000000..b070897 --- /dev/null +++ b/node_modules/lodash/_safeGet.js @@ -0,0 +1,21 @@ +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +module.exports = safeGet; diff --git a/node_modules/lodash/_setCacheAdd.js b/node_modules/lodash/_setCacheAdd.js new file mode 100644 index 0000000..1081a74 --- /dev/null +++ b/node_modules/lodash/_setCacheAdd.js @@ -0,0 +1,19 @@ +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; diff --git a/node_modules/lodash/_setCacheHas.js b/node_modules/lodash/_setCacheHas.js new file mode 100644 index 0000000..9a49255 --- /dev/null +++ b/node_modules/lodash/_setCacheHas.js @@ -0,0 +1,14 @@ +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; diff --git a/node_modules/lodash/_setData.js b/node_modules/lodash/_setData.js new file mode 100644 index 0000000..e5cf3eb --- /dev/null +++ b/node_modules/lodash/_setData.js @@ -0,0 +1,20 @@ +var baseSetData = require('./_baseSetData'), + shortOut = require('./_shortOut'); + +/** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var setData = shortOut(baseSetData); + +module.exports = setData; diff --git a/node_modules/lodash/_setToArray.js b/node_modules/lodash/_setToArray.js new file mode 100644 index 0000000..b87f074 --- /dev/null +++ b/node_modules/lodash/_setToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; diff --git a/node_modules/lodash/_setToPairs.js b/node_modules/lodash/_setToPairs.js new file mode 100644 index 0000000..36ad37a --- /dev/null +++ b/node_modules/lodash/_setToPairs.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; diff --git a/node_modules/lodash/_setToString.js b/node_modules/lodash/_setToString.js new file mode 100644 index 0000000..6ca8419 --- /dev/null +++ b/node_modules/lodash/_setToString.js @@ -0,0 +1,14 @@ +var baseSetToString = require('./_baseSetToString'), + shortOut = require('./_shortOut'); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; diff --git a/node_modules/lodash/_setWrapToString.js b/node_modules/lodash/_setWrapToString.js new file mode 100644 index 0000000..decdc44 --- /dev/null +++ b/node_modules/lodash/_setWrapToString.js @@ -0,0 +1,21 @@ +var getWrapDetails = require('./_getWrapDetails'), + insertWrapDetails = require('./_insertWrapDetails'), + setToString = require('./_setToString'), + updateWrapDetails = require('./_updateWrapDetails'); + +/** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ +function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); +} + +module.exports = setWrapToString; diff --git a/node_modules/lodash/_shortOut.js b/node_modules/lodash/_shortOut.js new file mode 100644 index 0000000..3300a07 --- /dev/null +++ b/node_modules/lodash/_shortOut.js @@ -0,0 +1,37 @@ +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; diff --git a/node_modules/lodash/_shuffleSelf.js b/node_modules/lodash/_shuffleSelf.js new file mode 100644 index 0000000..8bcc4f5 --- /dev/null +++ b/node_modules/lodash/_shuffleSelf.js @@ -0,0 +1,28 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ +function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; +} + +module.exports = shuffleSelf; diff --git a/node_modules/lodash/_stackClear.js b/node_modules/lodash/_stackClear.js new file mode 100644 index 0000000..ce8e5a9 --- /dev/null +++ b/node_modules/lodash/_stackClear.js @@ -0,0 +1,15 @@ +var ListCache = require('./_ListCache'); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; diff --git a/node_modules/lodash/_stackDelete.js b/node_modules/lodash/_stackDelete.js new file mode 100644 index 0000000..ff9887a --- /dev/null +++ b/node_modules/lodash/_stackDelete.js @@ -0,0 +1,18 @@ +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; diff --git a/node_modules/lodash/_stackGet.js b/node_modules/lodash/_stackGet.js new file mode 100644 index 0000000..1cdf004 --- /dev/null +++ b/node_modules/lodash/_stackGet.js @@ -0,0 +1,14 @@ +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; diff --git a/node_modules/lodash/_stackHas.js b/node_modules/lodash/_stackHas.js new file mode 100644 index 0000000..16a3ad1 --- /dev/null +++ b/node_modules/lodash/_stackHas.js @@ -0,0 +1,14 @@ +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; diff --git a/node_modules/lodash/_stackSet.js b/node_modules/lodash/_stackSet.js new file mode 100644 index 0000000..b790ac5 --- /dev/null +++ b/node_modules/lodash/_stackSet.js @@ -0,0 +1,34 @@ +var ListCache = require('./_ListCache'), + Map = require('./_Map'), + MapCache = require('./_MapCache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; diff --git a/node_modules/lodash/_strictIndexOf.js b/node_modules/lodash/_strictIndexOf.js new file mode 100644 index 0000000..0486a49 --- /dev/null +++ b/node_modules/lodash/_strictIndexOf.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; diff --git a/node_modules/lodash/_strictLastIndexOf.js b/node_modules/lodash/_strictLastIndexOf.js new file mode 100644 index 0000000..d7310dc --- /dev/null +++ b/node_modules/lodash/_strictLastIndexOf.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; +} + +module.exports = strictLastIndexOf; diff --git a/node_modules/lodash/_stringSize.js b/node_modules/lodash/_stringSize.js new file mode 100644 index 0000000..17ef462 --- /dev/null +++ b/node_modules/lodash/_stringSize.js @@ -0,0 +1,18 @@ +var asciiSize = require('./_asciiSize'), + hasUnicode = require('./_hasUnicode'), + unicodeSize = require('./_unicodeSize'); + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); +} + +module.exports = stringSize; diff --git a/node_modules/lodash/_stringToArray.js b/node_modules/lodash/_stringToArray.js new file mode 100644 index 0000000..d161158 --- /dev/null +++ b/node_modules/lodash/_stringToArray.js @@ -0,0 +1,18 @@ +var asciiToArray = require('./_asciiToArray'), + hasUnicode = require('./_hasUnicode'), + unicodeToArray = require('./_unicodeToArray'); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +module.exports = stringToArray; diff --git a/node_modules/lodash/_stringToPath.js b/node_modules/lodash/_stringToPath.js new file mode 100644 index 0000000..8f39f8a --- /dev/null +++ b/node_modules/lodash/_stringToPath.js @@ -0,0 +1,27 @@ +var memoizeCapped = require('./_memoizeCapped'); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; diff --git a/node_modules/lodash/_toKey.js b/node_modules/lodash/_toKey.js new file mode 100644 index 0000000..c6d645c --- /dev/null +++ b/node_modules/lodash/_toKey.js @@ -0,0 +1,21 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; diff --git a/node_modules/lodash/_toSource.js b/node_modules/lodash/_toSource.js new file mode 100644 index 0000000..a020b38 --- /dev/null +++ b/node_modules/lodash/_toSource.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; diff --git a/node_modules/lodash/_unescapeHtmlChar.js b/node_modules/lodash/_unescapeHtmlChar.js new file mode 100644 index 0000000..a71fecb --- /dev/null +++ b/node_modules/lodash/_unescapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map HTML entities to characters. */ +var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; + +/** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ +var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + +module.exports = unescapeHtmlChar; diff --git a/node_modules/lodash/_unicodeSize.js b/node_modules/lodash/_unicodeSize.js new file mode 100644 index 0000000..68137ec --- /dev/null +++ b/node_modules/lodash/_unicodeSize.js @@ -0,0 +1,44 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; +} + +module.exports = unicodeSize; diff --git a/node_modules/lodash/_unicodeToArray.js b/node_modules/lodash/_unicodeToArray.js new file mode 100644 index 0000000..2a725c0 --- /dev/null +++ b/node_modules/lodash/_unicodeToArray.js @@ -0,0 +1,40 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +module.exports = unicodeToArray; diff --git a/node_modules/lodash/_unicodeWords.js b/node_modules/lodash/_unicodeWords.js new file mode 100644 index 0000000..e72e6e0 --- /dev/null +++ b/node_modules/lodash/_unicodeWords.js @@ -0,0 +1,69 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\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', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]", + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + +/** Used to match complex or compound words. */ +var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji +].join('|'), 'g'); + +/** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function unicodeWords(string) { + return string.match(reUnicodeWord) || []; +} + +module.exports = unicodeWords; diff --git a/node_modules/lodash/_updateWrapDetails.js b/node_modules/lodash/_updateWrapDetails.js new file mode 100644 index 0000000..8759fbd --- /dev/null +++ b/node_modules/lodash/_updateWrapDetails.js @@ -0,0 +1,46 @@ +var arrayEach = require('./_arrayEach'), + arrayIncludes = require('./_arrayIncludes'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + +/** Used to associate wrap methods with their bit flags. */ +var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] +]; + +/** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ +function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); +} + +module.exports = updateWrapDetails; diff --git a/node_modules/lodash/_wrapperClone.js b/node_modules/lodash/_wrapperClone.js new file mode 100644 index 0000000..7bb58a2 --- /dev/null +++ b/node_modules/lodash/_wrapperClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + LodashWrapper = require('./_LodashWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; +} + +module.exports = wrapperClone; diff --git a/node_modules/lodash/add.js b/node_modules/lodash/add.js new file mode 100644 index 0000000..f069515 --- /dev/null +++ b/node_modules/lodash/add.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Adds two numbers. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ +var add = createMathOperation(function(augend, addend) { + return augend + addend; +}, 0); + +module.exports = add; diff --git a/node_modules/lodash/after.js b/node_modules/lodash/after.js new file mode 100644 index 0000000..3900c97 --- /dev/null +++ b/node_modules/lodash/after.js @@ -0,0 +1,42 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ +function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; +} + +module.exports = after; diff --git a/node_modules/lodash/array.js b/node_modules/lodash/array.js new file mode 100644 index 0000000..af688d3 --- /dev/null +++ b/node_modules/lodash/array.js @@ -0,0 +1,67 @@ +module.exports = { + 'chunk': require('./chunk'), + 'compact': require('./compact'), + 'concat': require('./concat'), + 'difference': require('./difference'), + 'differenceBy': require('./differenceBy'), + 'differenceWith': require('./differenceWith'), + 'drop': require('./drop'), + 'dropRight': require('./dropRight'), + 'dropRightWhile': require('./dropRightWhile'), + 'dropWhile': require('./dropWhile'), + 'fill': require('./fill'), + 'findIndex': require('./findIndex'), + 'findLastIndex': require('./findLastIndex'), + 'first': require('./first'), + 'flatten': require('./flatten'), + 'flattenDeep': require('./flattenDeep'), + 'flattenDepth': require('./flattenDepth'), + 'fromPairs': require('./fromPairs'), + 'head': require('./head'), + 'indexOf': require('./indexOf'), + 'initial': require('./initial'), + 'intersection': require('./intersection'), + 'intersectionBy': require('./intersectionBy'), + 'intersectionWith': require('./intersectionWith'), + 'join': require('./join'), + 'last': require('./last'), + 'lastIndexOf': require('./lastIndexOf'), + 'nth': require('./nth'), + 'pull': require('./pull'), + 'pullAll': require('./pullAll'), + 'pullAllBy': require('./pullAllBy'), + 'pullAllWith': require('./pullAllWith'), + 'pullAt': require('./pullAt'), + 'remove': require('./remove'), + 'reverse': require('./reverse'), + 'slice': require('./slice'), + 'sortedIndex': require('./sortedIndex'), + 'sortedIndexBy': require('./sortedIndexBy'), + 'sortedIndexOf': require('./sortedIndexOf'), + 'sortedLastIndex': require('./sortedLastIndex'), + 'sortedLastIndexBy': require('./sortedLastIndexBy'), + 'sortedLastIndexOf': require('./sortedLastIndexOf'), + 'sortedUniq': require('./sortedUniq'), + 'sortedUniqBy': require('./sortedUniqBy'), + 'tail': require('./tail'), + 'take': require('./take'), + 'takeRight': require('./takeRight'), + 'takeRightWhile': require('./takeRightWhile'), + 'takeWhile': require('./takeWhile'), + 'union': require('./union'), + 'unionBy': require('./unionBy'), + 'unionWith': require('./unionWith'), + 'uniq': require('./uniq'), + 'uniqBy': require('./uniqBy'), + 'uniqWith': require('./uniqWith'), + 'unzip': require('./unzip'), + 'unzipWith': require('./unzipWith'), + 'without': require('./without'), + 'xor': require('./xor'), + 'xorBy': require('./xorBy'), + 'xorWith': require('./xorWith'), + 'zip': require('./zip'), + 'zipObject': require('./zipObject'), + 'zipObjectDeep': require('./zipObjectDeep'), + 'zipWith': require('./zipWith') +}; diff --git a/node_modules/lodash/ary.js b/node_modules/lodash/ary.js new file mode 100644 index 0000000..70c87d0 --- /dev/null +++ b/node_modules/lodash/ary.js @@ -0,0 +1,29 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_ARY_FLAG = 128; + +/** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ +function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); +} + +module.exports = ary; diff --git a/node_modules/lodash/assign.js b/node_modules/lodash/assign.js new file mode 100644 index 0000000..909db26 --- /dev/null +++ b/node_modules/lodash/assign.js @@ -0,0 +1,58 @@ +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), + keys = require('./keys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; diff --git a/node_modules/lodash/assignIn.js b/node_modules/lodash/assignIn.js new file mode 100644 index 0000000..e663473 --- /dev/null +++ b/node_modules/lodash/assignIn.js @@ -0,0 +1,40 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ +var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); +}); + +module.exports = assignIn; diff --git a/node_modules/lodash/assignInWith.js b/node_modules/lodash/assignInWith.js new file mode 100644 index 0000000..68fcc0b --- /dev/null +++ b/node_modules/lodash/assignInWith.js @@ -0,0 +1,38 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); + +module.exports = assignInWith; diff --git a/node_modules/lodash/assignWith.js b/node_modules/lodash/assignWith.js new file mode 100644 index 0000000..7dc6c76 --- /dev/null +++ b/node_modules/lodash/assignWith.js @@ -0,0 +1,37 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keys = require('./keys'); + +/** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); +}); + +module.exports = assignWith; diff --git a/node_modules/lodash/at.js b/node_modules/lodash/at.js new file mode 100644 index 0000000..781ee9e --- /dev/null +++ b/node_modules/lodash/at.js @@ -0,0 +1,23 @@ +var baseAt = require('./_baseAt'), + flatRest = require('./_flatRest'); + +/** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ +var at = flatRest(baseAt); + +module.exports = at; diff --git a/node_modules/lodash/attempt.js b/node_modules/lodash/attempt.js new file mode 100644 index 0000000..624d015 --- /dev/null +++ b/node_modules/lodash/attempt.js @@ -0,0 +1,35 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + isError = require('./isError'); + +/** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ +var attempt = baseRest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } +}); + +module.exports = attempt; diff --git a/node_modules/lodash/before.js b/node_modules/lodash/before.js new file mode 100644 index 0000000..a3e0a16 --- /dev/null +++ b/node_modules/lodash/before.js @@ -0,0 +1,40 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ +function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; +} + +module.exports = before; diff --git a/node_modules/lodash/bind.js b/node_modules/lodash/bind.js new file mode 100644 index 0000000..b1076e9 --- /dev/null +++ b/node_modules/lodash/bind.js @@ -0,0 +1,57 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ +var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); +}); + +// Assign default placeholders. +bind.placeholder = {}; + +module.exports = bind; diff --git a/node_modules/lodash/bindAll.js b/node_modules/lodash/bindAll.js new file mode 100644 index 0000000..a35706d --- /dev/null +++ b/node_modules/lodash/bindAll.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseAssignValue = require('./_baseAssignValue'), + bind = require('./bind'), + flatRest = require('./_flatRest'), + toKey = require('./_toKey'); + +/** + * Binds methods of an object to the object itself, overwriting the existing + * method. + * + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'click': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); + * // => Logs 'clicked docs' when clicked. + */ +var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; +}); + +module.exports = bindAll; diff --git a/node_modules/lodash/bindKey.js b/node_modules/lodash/bindKey.js new file mode 100644 index 0000000..f7fd64c --- /dev/null +++ b/node_modules/lodash/bindKey.js @@ -0,0 +1,68 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ +var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); +}); + +// Assign default placeholders. +bindKey.placeholder = {}; + +module.exports = bindKey; diff --git a/node_modules/lodash/camelCase.js b/node_modules/lodash/camelCase.js new file mode 100644 index 0000000..d7390de --- /dev/null +++ b/node_modules/lodash/camelCase.js @@ -0,0 +1,29 @@ +var capitalize = require('./capitalize'), + createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ +var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); +}); + +module.exports = camelCase; diff --git a/node_modules/lodash/capitalize.js b/node_modules/lodash/capitalize.js new file mode 100644 index 0000000..3e1600e --- /dev/null +++ b/node_modules/lodash/capitalize.js @@ -0,0 +1,23 @@ +var toString = require('./toString'), + upperFirst = require('./upperFirst'); + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ +function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); +} + +module.exports = capitalize; diff --git a/node_modules/lodash/castArray.js b/node_modules/lodash/castArray.js new file mode 100644 index 0000000..e470bdb --- /dev/null +++ b/node_modules/lodash/castArray.js @@ -0,0 +1,44 @@ +var isArray = require('./isArray'); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; diff --git a/node_modules/lodash/ceil.js b/node_modules/lodash/ceil.js new file mode 100644 index 0000000..56c8722 --- /dev/null +++ b/node_modules/lodash/ceil.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded up to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ +var ceil = createRound('ceil'); + +module.exports = ceil; diff --git a/node_modules/lodash/chain.js b/node_modules/lodash/chain.js new file mode 100644 index 0000000..f6cd647 --- /dev/null +++ b/node_modules/lodash/chain.js @@ -0,0 +1,38 @@ +var lodash = require('./wrapperLodash'); + +/** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ +function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; +} + +module.exports = chain; diff --git a/node_modules/lodash/chunk.js b/node_modules/lodash/chunk.js new file mode 100644 index 0000000..5b562fe --- /dev/null +++ b/node_modules/lodash/chunk.js @@ -0,0 +1,50 @@ +var baseSlice = require('./_baseSlice'), + isIterateeCall = require('./_isIterateeCall'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ +function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; +} + +module.exports = chunk; diff --git a/node_modules/lodash/clamp.js b/node_modules/lodash/clamp.js new file mode 100644 index 0000000..91a72c9 --- /dev/null +++ b/node_modules/lodash/clamp.js @@ -0,0 +1,39 @@ +var baseClamp = require('./_baseClamp'), + toNumber = require('./toNumber'); + +/** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); +} + +module.exports = clamp; diff --git a/node_modules/lodash/clone.js b/node_modules/lodash/clone.js new file mode 100644 index 0000000..dd439d6 --- /dev/null +++ b/node_modules/lodash/clone.js @@ -0,0 +1,36 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); +} + +module.exports = clone; diff --git a/node_modules/lodash/cloneDeep.js b/node_modules/lodash/cloneDeep.js new file mode 100644 index 0000000..4425fbe --- /dev/null +++ b/node_modules/lodash/cloneDeep.js @@ -0,0 +1,29 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); +} + +module.exports = cloneDeep; diff --git a/node_modules/lodash/cloneDeepWith.js b/node_modules/lodash/cloneDeepWith.js new file mode 100644 index 0000000..fd9c6c0 --- /dev/null +++ b/node_modules/lodash/cloneDeepWith.js @@ -0,0 +1,40 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ +function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneDeepWith; diff --git a/node_modules/lodash/cloneWith.js b/node_modules/lodash/cloneWith.js new file mode 100644 index 0000000..d2f4e75 --- /dev/null +++ b/node_modules/lodash/cloneWith.js @@ -0,0 +1,42 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ +function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneWith; diff --git a/node_modules/lodash/collection.js b/node_modules/lodash/collection.js new file mode 100644 index 0000000..77fe837 --- /dev/null +++ b/node_modules/lodash/collection.js @@ -0,0 +1,30 @@ +module.exports = { + 'countBy': require('./countBy'), + 'each': require('./each'), + 'eachRight': require('./eachRight'), + 'every': require('./every'), + 'filter': require('./filter'), + 'find': require('./find'), + 'findLast': require('./findLast'), + 'flatMap': require('./flatMap'), + 'flatMapDeep': require('./flatMapDeep'), + 'flatMapDepth': require('./flatMapDepth'), + 'forEach': require('./forEach'), + 'forEachRight': require('./forEachRight'), + 'groupBy': require('./groupBy'), + 'includes': require('./includes'), + 'invokeMap': require('./invokeMap'), + 'keyBy': require('./keyBy'), + 'map': require('./map'), + 'orderBy': require('./orderBy'), + 'partition': require('./partition'), + 'reduce': require('./reduce'), + 'reduceRight': require('./reduceRight'), + 'reject': require('./reject'), + 'sample': require('./sample'), + 'sampleSize': require('./sampleSize'), + 'shuffle': require('./shuffle'), + 'size': require('./size'), + 'some': require('./some'), + 'sortBy': require('./sortBy') +}; diff --git a/node_modules/lodash/commit.js b/node_modules/lodash/commit.js new file mode 100644 index 0000000..fe4db71 --- /dev/null +++ b/node_modules/lodash/commit.js @@ -0,0 +1,33 @@ +var LodashWrapper = require('./_LodashWrapper'); + +/** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ +function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); +} + +module.exports = wrapperCommit; diff --git a/node_modules/lodash/compact.js b/node_modules/lodash/compact.js new file mode 100644 index 0000000..031fab4 --- /dev/null +++ b/node_modules/lodash/compact.js @@ -0,0 +1,31 @@ +/** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ +function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = compact; diff --git a/node_modules/lodash/concat.js b/node_modules/lodash/concat.js new file mode 100644 index 0000000..1da48a4 --- /dev/null +++ b/node_modules/lodash/concat.js @@ -0,0 +1,43 @@ +var arrayPush = require('./_arrayPush'), + baseFlatten = require('./_baseFlatten'), + copyArray = require('./_copyArray'), + isArray = require('./isArray'); + +/** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ +function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); +} + +module.exports = concat; diff --git a/node_modules/lodash/cond.js b/node_modules/lodash/cond.js new file mode 100644 index 0000000..6455598 --- /dev/null +++ b/node_modules/lodash/cond.js @@ -0,0 +1,60 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ +function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = baseIteratee; + + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return baseRest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); +} + +module.exports = cond; diff --git a/node_modules/lodash/conforms.js b/node_modules/lodash/conforms.js new file mode 100644 index 0000000..5501a94 --- /dev/null +++ b/node_modules/lodash/conforms.js @@ -0,0 +1,35 @@ +var baseClone = require('./_baseClone'), + baseConforms = require('./_baseConforms'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. + * + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } + * ]; + * + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] + */ +function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); +} + +module.exports = conforms; diff --git a/node_modules/lodash/conformsTo.js b/node_modules/lodash/conformsTo.js new file mode 100644 index 0000000..b8a93eb --- /dev/null +++ b/node_modules/lodash/conformsTo.js @@ -0,0 +1,32 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ +function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); +} + +module.exports = conformsTo; diff --git a/node_modules/lodash/constant.js b/node_modules/lodash/constant.js new file mode 100644 index 0000000..655ece3 --- /dev/null +++ b/node_modules/lodash/constant.js @@ -0,0 +1,26 @@ +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; diff --git a/node_modules/lodash/core.js b/node_modules/lodash/core.js new file mode 100644 index 0000000..6d70dca --- /dev/null +++ b/node_modules/lodash/core.js @@ -0,0 +1,3877 @@ +/** + * @license + * Lodash (Custom Build) + * Build: `lodash core -o ./dist/lodash.core.js` + * 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() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.20'; + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + numberTag = '[object Number]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /*--------------------------------------------------------------------------*/ + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + array.push.apply(array, values); + return array; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Built-in value references. */ + var objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsFinite = root.isFinite, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + object[key] = value; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !false) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return baseFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + var baseIsArguments = noop; + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : baseGetTag(object), + othTag = othIsArr ? arrayTag : baseGetTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + stack || (stack = []); + var objStack = find(stack, function(entry) { + return entry[0] == object; + }); + var othStack = find(stack, function(entry) { + return entry[0] == other; + }); + if (objStack && othStack) { + return objStack[1] == other; + } + stack.push([object, other]); + stack.push([other, object]); + if (isSameTag && !objIsObj) { + var result = (objIsArr) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + stack.pop(); + return result; + } + } + if (!isSameTag) { + return false; + } + var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(func) { + if (typeof func == 'function') { + return func; + } + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var props = nativeKeys(source); + return function(object) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length]; + if (!(key in object && + baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) + )) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return reduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source) { + return baseSlice(source, 0, source.length); + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + return reduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = false; + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = false; + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + 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; + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + var compared; + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!baseSome(other, function(othValue, othIndex) { + if (!indexOf(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + 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; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + var compared; + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return func.apply(this, otherArgs); + }; + } + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = identity; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + return baseFilter(array, Boolean); + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else { + fromIndex = 0; + } + var index = (fromIndex || 0) - 1, + isReflexive = value === value; + + while (++index < length) { + var other = array[index]; + if ((isReflexive ? other === value : other !== other)) { + return index; + } + } + return -1; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; + return length ? baseSlice(array, start, end) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseEvery(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // 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)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return baseEach(collection, baseIteratee(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + return baseMap(collection, baseIteratee(iteratee)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + collection = isArrayLike(collection) ? collection : nativeKeys(collection); + return collection.length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseSome(collection, baseIteratee(predicate)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + function sortBy(collection, iteratee) { + var index = 0; + iteratee = baseIteratee(iteratee); + + return baseMap(baseMap(collection, function(value, key, collection) { + return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; + }).sort(function(object, other) { + return compareAscending(object.criteria, other.criteria) || (object.index - other.index); + }), baseProperty('value')); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); + }); + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + if (!isObject(value)) { + return value; + } + return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = baseIsDate; + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + return !nativeKeys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = baseIsRegExp; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!isArrayLike(value)) { + return values(value); + } + return value.length ? copyArray(value) : []; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + var toInteger = Number; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + var toNumber = Number; + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + copyObject(source, nativeKeys(source), object); + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, nativeKeysIn(source), object); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : assign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasOwnProperty.call(object, path); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = nativeKeys; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + var keysIn = nativeKeysIn; + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var value = object == null ? undefined : object[path]; + if (value === undefined) { + value = defaultValue; + } + return isFunction(value) ? value.call(object) : value; + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + var iteratee = baseIteratee; + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * 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 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.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)); + } + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + baseEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseLt) + : undefined; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.assignIn = assignIn; + lodash.before = before; + lodash.bind = bind; + lodash.chain = chain; + lodash.compact = compact; + lodash.concat = concat; + lodash.create = create; + lodash.defaults = defaults; + lodash.defer = defer; + lodash.delay = delay; + lodash.filter = filter; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.matches = matches; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.once = once; + lodash.pick = pick; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.tap = tap; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.values = values; + + // Add aliases. + lodash.extend = assignIn; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.clone = clone; + lodash.escape = escape; + lodash.every = every; + lodash.find = find; + lodash.forEach = forEach; + lodash.has = has; + lodash.head = head; + lodash.identity = identity; + lodash.indexOf = indexOf; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isBoolean = isBoolean; + lodash.isDate = isDate; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isNaN = isNaN; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isRegExp = isRegExp; + lodash.isString = isString; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.max = max; + lodash.min = min; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.reduce = reduce; + lodash.result = result; + lodash.size = size; + lodash.some = some; + lodash.uniqueId = uniqueId; + + // Add aliases. + lodash.each = forEach; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Add `Array` methods to `lodash.prototype`. + baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + /*--------------------------------------------------------------------------*/ + + // Some AMD build optimizers, like r.js, check for condition patterns like: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = lodash; + + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + define(function() { + return lodash; + }); + } + // Check for `exports` after `define` in case a build optimizer adds it. + else if (freeModule) { + // Export for Node.js. + (freeModule.exports = lodash)._ = lodash; + // Export for CommonJS support. + freeExports._ = lodash; + } + else { + // Export to the global object. + root._ = lodash; + } +}.call(this)); diff --git a/node_modules/lodash/core.min.js b/node_modules/lodash/core.min.js new file mode 100644 index 0000000..f409525 --- /dev/null +++ b/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 { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ +var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } +}); + +module.exports = countBy; diff --git a/node_modules/lodash/create.js b/node_modules/lodash/create.js new file mode 100644 index 0000000..919edb8 --- /dev/null +++ b/node_modules/lodash/create.js @@ -0,0 +1,43 @@ +var baseAssign = require('./_baseAssign'), + baseCreate = require('./_baseCreate'); + +/** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); +} + +module.exports = create; diff --git a/node_modules/lodash/curry.js b/node_modules/lodash/curry.js new file mode 100644 index 0000000..918db1a --- /dev/null +++ b/node_modules/lodash/curry.js @@ -0,0 +1,57 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8; + +/** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} + +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; diff --git a/node_modules/lodash/curryRight.js b/node_modules/lodash/curryRight.js new file mode 100644 index 0000000..c85b6f3 --- /dev/null +++ b/node_modules/lodash/curryRight.js @@ -0,0 +1,54 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_RIGHT_FLAG = 16; + +/** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; +} + +// Assign default placeholders. +curryRight.placeholder = {}; + +module.exports = curryRight; diff --git a/node_modules/lodash/date.js b/node_modules/lodash/date.js new file mode 100644 index 0000000..cbf5b41 --- /dev/null +++ b/node_modules/lodash/date.js @@ -0,0 +1,3 @@ +module.exports = { + 'now': require('./now') +}; diff --git a/node_modules/lodash/debounce.js b/node_modules/lodash/debounce.js new file mode 100644 index 0000000..8f751d5 --- /dev/null +++ b/node_modules/lodash/debounce.js @@ -0,0 +1,191 @@ +var isObject = require('./isObject'), + now = require('./now'), + toNumber = require('./toNumber'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; diff --git a/node_modules/lodash/deburr.js b/node_modules/lodash/deburr.js new file mode 100644 index 0000000..f85e314 --- /dev/null +++ b/node_modules/lodash/deburr.js @@ -0,0 +1,45 @@ +var deburrLetter = require('./_deburrLetter'), + toString = require('./toString'); + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; diff --git a/node_modules/lodash/defaultTo.js b/node_modules/lodash/defaultTo.js new file mode 100644 index 0000000..5b33359 --- /dev/null +++ b/node_modules/lodash/defaultTo.js @@ -0,0 +1,25 @@ +/** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ +function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; +} + +module.exports = defaultTo; diff --git a/node_modules/lodash/defaults.js b/node_modules/lodash/defaults.js new file mode 100644 index 0000000..c74df04 --- /dev/null +++ b/node_modules/lodash/defaults.js @@ -0,0 +1,64 @@ +var baseRest = require('./_baseRest'), + eq = require('./eq'), + isIterateeCall = require('./_isIterateeCall'), + keysIn = require('./keysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; diff --git a/node_modules/lodash/defaultsDeep.js b/node_modules/lodash/defaultsDeep.js new file mode 100644 index 0000000..9b5fa3e --- /dev/null +++ b/node_modules/lodash/defaultsDeep.js @@ -0,0 +1,30 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + customDefaultsMerge = require('./_customDefaultsMerge'), + mergeWith = require('./mergeWith'); + +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ +var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); +}); + +module.exports = defaultsDeep; diff --git a/node_modules/lodash/defer.js b/node_modules/lodash/defer.js new file mode 100644 index 0000000..f6d6c6f --- /dev/null +++ b/node_modules/lodash/defer.js @@ -0,0 +1,26 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; diff --git a/node_modules/lodash/delay.js b/node_modules/lodash/delay.js new file mode 100644 index 0000000..bd55479 --- /dev/null +++ b/node_modules/lodash/delay.js @@ -0,0 +1,28 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'), + toNumber = require('./toNumber'); + +/** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ +var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); +}); + +module.exports = delay; diff --git a/node_modules/lodash/difference.js b/node_modules/lodash/difference.js new file mode 100644 index 0000000..fa28bb3 --- /dev/null +++ b/node_modules/lodash/difference.js @@ -0,0 +1,33 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; diff --git a/node_modules/lodash/differenceBy.js b/node_modules/lodash/differenceBy.js new file mode 100644 index 0000000..2cd63e7 --- /dev/null +++ b/node_modules/lodash/differenceBy.js @@ -0,0 +1,44 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ +var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = differenceBy; diff --git a/node_modules/lodash/differenceWith.js b/node_modules/lodash/differenceWith.js new file mode 100644 index 0000000..c0233f4 --- /dev/null +++ b/node_modules/lodash/differenceWith.js @@ -0,0 +1,40 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ +var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; +}); + +module.exports = differenceWith; diff --git a/node_modules/lodash/divide.js b/node_modules/lodash/divide.js new file mode 100644 index 0000000..8cae0cd --- /dev/null +++ b/node_modules/lodash/divide.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ +var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; +}, 1); + +module.exports = divide; diff --git a/node_modules/lodash/drop.js b/node_modules/lodash/drop.js new file mode 100644 index 0000000..d5c3cba --- /dev/null +++ b/node_modules/lodash/drop.js @@ -0,0 +1,38 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; diff --git a/node_modules/lodash/dropRight.js b/node_modules/lodash/dropRight.js new file mode 100644 index 0000000..441fe99 --- /dev/null +++ b/node_modules/lodash/dropRight.js @@ -0,0 +1,39 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; diff --git a/node_modules/lodash/dropRightWhile.js b/node_modules/lodash/dropRightWhile.js new file mode 100644 index 0000000..9ad36a0 --- /dev/null +++ b/node_modules/lodash/dropRightWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true, true) + : []; +} + +module.exports = dropRightWhile; diff --git a/node_modules/lodash/dropWhile.js b/node_modules/lodash/dropWhile.js new file mode 100644 index 0000000..903ef56 --- /dev/null +++ b/node_modules/lodash/dropWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true) + : []; +} + +module.exports = dropWhile; diff --git a/node_modules/lodash/each.js b/node_modules/lodash/each.js new file mode 100644 index 0000000..8800f42 --- /dev/null +++ b/node_modules/lodash/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/node_modules/lodash/eachRight.js b/node_modules/lodash/eachRight.js new file mode 100644 index 0000000..3252b2a --- /dev/null +++ b/node_modules/lodash/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/node_modules/lodash/endsWith.js b/node_modules/lodash/endsWith.js new file mode 100644 index 0000000..76fc866 --- /dev/null +++ b/node_modules/lodash/endsWith.js @@ -0,0 +1,43 @@ +var baseClamp = require('./_baseClamp'), + baseToString = require('./_baseToString'), + toInteger = require('./toInteger'), + toString = require('./toString'); + +/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ +function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; +} + +module.exports = endsWith; diff --git a/node_modules/lodash/entries.js b/node_modules/lodash/entries.js new file mode 100644 index 0000000..7a88df2 --- /dev/null +++ b/node_modules/lodash/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/node_modules/lodash/entriesIn.js b/node_modules/lodash/entriesIn.js new file mode 100644 index 0000000..f6c6331 --- /dev/null +++ b/node_modules/lodash/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/node_modules/lodash/eq.js b/node_modules/lodash/eq.js new file mode 100644 index 0000000..a940688 --- /dev/null +++ b/node_modules/lodash/eq.js @@ -0,0 +1,37 @@ +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; diff --git a/node_modules/lodash/escape.js b/node_modules/lodash/escape.js new file mode 100644 index 0000000..9247e00 --- /dev/null +++ b/node_modules/lodash/escape.js @@ -0,0 +1,43 @@ +var escapeHtmlChar = require('./_escapeHtmlChar'), + toString = require('./toString'); + +/** Used to match HTML entities and HTML characters. */ +var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + +/** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ +function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; +} + +module.exports = escape; diff --git a/node_modules/lodash/escapeRegExp.js b/node_modules/lodash/escapeRegExp.js new file mode 100644 index 0000000..0a58c69 --- /dev/null +++ b/node_modules/lodash/escapeRegExp.js @@ -0,0 +1,32 @@ +var toString = require('./toString'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +module.exports = escapeRegExp; diff --git a/node_modules/lodash/every.js b/node_modules/lodash/every.js new file mode 100644 index 0000000..25080da --- /dev/null +++ b/node_modules/lodash/every.js @@ -0,0 +1,56 @@ +var arrayEvery = require('./_arrayEvery'), + baseEvery = require('./_baseEvery'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = every; diff --git a/node_modules/lodash/extend.js b/node_modules/lodash/extend.js new file mode 100644 index 0000000..e00166c --- /dev/null +++ b/node_modules/lodash/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/node_modules/lodash/extendWith.js b/node_modules/lodash/extendWith.js new file mode 100644 index 0000000..dbdcb3b --- /dev/null +++ b/node_modules/lodash/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/node_modules/lodash/fill.js b/node_modules/lodash/fill.js new file mode 100644 index 0000000..ae13aa1 --- /dev/null +++ b/node_modules/lodash/fill.js @@ -0,0 +1,45 @@ +var baseFill = require('./_baseFill'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ +function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); +} + +module.exports = fill; diff --git a/node_modules/lodash/filter.js b/node_modules/lodash/filter.js new file mode 100644 index 0000000..89e0c8c --- /dev/null +++ b/node_modules/lodash/filter.js @@ -0,0 +1,52 @@ +var arrayFilter = require('./_arrayFilter'), + baseFilter = require('./_baseFilter'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // 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; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; diff --git a/node_modules/lodash/find.js b/node_modules/lodash/find.js new file mode 100644 index 0000000..de732cc --- /dev/null +++ b/node_modules/lodash/find.js @@ -0,0 +1,42 @@ +var createFind = require('./_createFind'), + findIndex = require('./findIndex'); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; diff --git a/node_modules/lodash/findIndex.js b/node_modules/lodash/findIndex.js new file mode 100644 index 0000000..4689069 --- /dev/null +++ b/node_modules/lodash/findIndex.js @@ -0,0 +1,55 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; diff --git a/node_modules/lodash/findKey.js b/node_modules/lodash/findKey.js new file mode 100644 index 0000000..cac0248 --- /dev/null +++ b/node_modules/lodash/findKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwn = require('./_baseForOwn'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ +function findKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); +} + +module.exports = findKey; diff --git a/node_modules/lodash/findLast.js b/node_modules/lodash/findLast.js new file mode 100644 index 0000000..70b4271 --- /dev/null +++ b/node_modules/lodash/findLast.js @@ -0,0 +1,25 @@ +var createFind = require('./_createFind'), + findLastIndex = require('./findLastIndex'); + +/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ +var findLast = createFind(findLastIndex); + +module.exports = findLast; diff --git a/node_modules/lodash/findLastIndex.js b/node_modules/lodash/findLastIndex.js new file mode 100644 index 0000000..7da3431 --- /dev/null +++ b/node_modules/lodash/findLastIndex.js @@ -0,0 +1,59 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ +function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); +} + +module.exports = findLastIndex; diff --git a/node_modules/lodash/findLastKey.js b/node_modules/lodash/findLastKey.js new file mode 100644 index 0000000..66fb9fb --- /dev/null +++ b/node_modules/lodash/findLastKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwnRight = require('./_baseForOwnRight'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ +function findLastKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); +} + +module.exports = findLastKey; diff --git a/node_modules/lodash/first.js b/node_modules/lodash/first.js new file mode 100644 index 0000000..53f4ad1 --- /dev/null +++ b/node_modules/lodash/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/node_modules/lodash/flatMap.js b/node_modules/lodash/flatMap.js new file mode 100644 index 0000000..e668506 --- /dev/null +++ b/node_modules/lodash/flatMap.js @@ -0,0 +1,29 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); +} + +module.exports = flatMap; diff --git a/node_modules/lodash/flatMapDeep.js b/node_modules/lodash/flatMapDeep.js new file mode 100644 index 0000000..4653d60 --- /dev/null +++ b/node_modules/lodash/flatMapDeep.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); +} + +module.exports = flatMapDeep; diff --git a/node_modules/lodash/flatMapDepth.js b/node_modules/lodash/flatMapDepth.js new file mode 100644 index 0000000..6d72005 --- /dev/null +++ b/node_modules/lodash/flatMapDepth.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'), + toInteger = require('./toInteger'); + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} + +module.exports = flatMapDepth; diff --git a/node_modules/lodash/flatten.js b/node_modules/lodash/flatten.js new file mode 100644 index 0000000..3f09f7f --- /dev/null +++ b/node_modules/lodash/flatten.js @@ -0,0 +1,22 @@ +var baseFlatten = require('./_baseFlatten'); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; diff --git a/node_modules/lodash/flattenDeep.js b/node_modules/lodash/flattenDeep.js new file mode 100644 index 0000000..8ad585c --- /dev/null +++ b/node_modules/lodash/flattenDeep.js @@ -0,0 +1,25 @@ +var baseFlatten = require('./_baseFlatten'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; +} + +module.exports = flattenDeep; diff --git a/node_modules/lodash/flattenDepth.js b/node_modules/lodash/flattenDepth.js new file mode 100644 index 0000000..441fdcc --- /dev/null +++ b/node_modules/lodash/flattenDepth.js @@ -0,0 +1,33 @@ +var baseFlatten = require('./_baseFlatten'), + toInteger = require('./toInteger'); + +/** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); +} + +module.exports = flattenDepth; diff --git a/node_modules/lodash/flip.js b/node_modules/lodash/flip.js new file mode 100644 index 0000000..c28dd78 --- /dev/null +++ b/node_modules/lodash/flip.js @@ -0,0 +1,28 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ +function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); +} + +module.exports = flip; diff --git a/node_modules/lodash/floor.js b/node_modules/lodash/floor.js new file mode 100644 index 0000000..ab6dfa2 --- /dev/null +++ b/node_modules/lodash/floor.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded down to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ +var floor = createRound('floor'); + +module.exports = floor; diff --git a/node_modules/lodash/flow.js b/node_modules/lodash/flow.js new file mode 100644 index 0000000..74b6b62 --- /dev/null +++ b/node_modules/lodash/flow.js @@ -0,0 +1,27 @@ +var createFlow = require('./_createFlow'); + +/** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ +var flow = createFlow(); + +module.exports = flow; diff --git a/node_modules/lodash/flowRight.js b/node_modules/lodash/flowRight.js new file mode 100644 index 0000000..1146141 --- /dev/null +++ b/node_modules/lodash/flowRight.js @@ -0,0 +1,26 @@ +var createFlow = require('./_createFlow'); + +/** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. + * + * @static + * @since 3.0.0 + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flow + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight([square, _.add]); + * addSquare(1, 2); + * // => 9 + */ +var flowRight = createFlow(true); + +module.exports = flowRight; diff --git a/node_modules/lodash/forEach.js b/node_modules/lodash/forEach.js new file mode 100644 index 0000000..c64eaa7 --- /dev/null +++ b/node_modules/lodash/forEach.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseEach = require('./_baseEach'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; diff --git a/node_modules/lodash/forEachRight.js b/node_modules/lodash/forEachRight.js new file mode 100644 index 0000000..7390eba --- /dev/null +++ b/node_modules/lodash/forEachRight.js @@ -0,0 +1,31 @@ +var arrayEachRight = require('./_arrayEachRight'), + baseEachRight = require('./_baseEachRight'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ +function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEachRight; diff --git a/node_modules/lodash/forIn.js b/node_modules/lodash/forIn.js new file mode 100644 index 0000000..583a596 --- /dev/null +++ b/node_modules/lodash/forIn.js @@ -0,0 +1,39 @@ +var baseFor = require('./_baseFor'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ +function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, castFunction(iteratee), keysIn); +} + +module.exports = forIn; diff --git a/node_modules/lodash/forInRight.js b/node_modules/lodash/forInRight.js new file mode 100644 index 0000000..4aedf58 --- /dev/null +++ b/node_modules/lodash/forInRight.js @@ -0,0 +1,37 @@ +var baseForRight = require('./_baseForRight'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ +function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, castFunction(iteratee), keysIn); +} + +module.exports = forInRight; diff --git a/node_modules/lodash/forOwn.js b/node_modules/lodash/forOwn.js new file mode 100644 index 0000000..94eed84 --- /dev/null +++ b/node_modules/lodash/forOwn.js @@ -0,0 +1,36 @@ +var baseForOwn = require('./_baseForOwn'), + castFunction = require('./_castFunction'); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; diff --git a/node_modules/lodash/forOwnRight.js b/node_modules/lodash/forOwnRight.js new file mode 100644 index 0000000..86f338f --- /dev/null +++ b/node_modules/lodash/forOwnRight.js @@ -0,0 +1,34 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + castFunction = require('./_castFunction'); + +/** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ +function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, castFunction(iteratee)); +} + +module.exports = forOwnRight; diff --git a/node_modules/lodash/fp.js b/node_modules/lodash/fp.js new file mode 100644 index 0000000..e372dbb --- /dev/null +++ b/node_modules/lodash/fp.js @@ -0,0 +1,2 @@ +var _ = require('./lodash.min').runInContext(); +module.exports = require('./fp/_baseConvert')(_, _); diff --git a/node_modules/lodash/fp/F.js b/node_modules/lodash/fp/F.js new file mode 100644 index 0000000..a05a63a --- /dev/null +++ b/node_modules/lodash/fp/F.js @@ -0,0 +1 @@ +module.exports = require('./stubFalse'); diff --git a/node_modules/lodash/fp/T.js b/node_modules/lodash/fp/T.js new file mode 100644 index 0000000..e2ba8ea --- /dev/null +++ b/node_modules/lodash/fp/T.js @@ -0,0 +1 @@ +module.exports = require('./stubTrue'); diff --git a/node_modules/lodash/fp/__.js b/node_modules/lodash/fp/__.js new file mode 100644 index 0000000..4af98de --- /dev/null +++ b/node_modules/lodash/fp/__.js @@ -0,0 +1 @@ +module.exports = require('./placeholder'); diff --git a/node_modules/lodash/fp/_baseConvert.js b/node_modules/lodash/fp/_baseConvert.js new file mode 100644 index 0000000..9baf8e1 --- /dev/null +++ b/node_modules/lodash/fp/_baseConvert.js @@ -0,0 +1,569 @@ +var mapping = require('./_mapping'), + fallbackHolder = require('./placeholder'); + +/** Built-in value reference. */ +var push = Array.prototype.push; + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * A specialized version of `_.spread` which flattens the spread array into + * the arguments of the invoked `func`. + * + * @private + * @param {Function} func The function to spread arguments over. + * @param {number} start The start position of the spread. + * @returns {Function} Returns the new function. + */ +function flatSpread(func, start) { + return function() { + var length = arguments.length, + lastIndex = length - 1, + args = Array(length); + + while (length--) { + args[length] = arguments[length]; + } + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + push.apply(otherArgs, array); + } + if (start != lastIndex) { + push.apply(otherArgs, args.slice(start + 1)); + } + return func.apply(this, otherArgs); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function wrapImmutable(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} + +/** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ +function baseConvert(util, name, func, options) { + var isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var defaultHolder = isLib ? func : fallbackHolder, + forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isError': util.isError, + 'isFunction': util.isFunction, + 'isWeakMap': util.isWeakMap, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'toInteger': util.toInteger, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isError = helpers.isError, + isFunction = helpers.isFunction, + isWeakMap = helpers.isWeakMap, + keys = helpers.keys, + rearg = helpers.rearg, + toInteger = helpers.toInteger, + toPath = helpers.toPath; + + var aryMethodKeys = keys(mapping.aryMethod); + + var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function(iteratee) { + return function() { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function(mixin) { + return function(source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var pairs = []; + each(keys(source), function(key) { + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); + } + }); + + mixin(func, Object(source)); + + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; + } else { + delete func.prototype[pair[0]]; + } + }); + return func; + }; + }, + 'nthArg': function(nthArg) { + return function(n) { + var arity = n < 0 ? 1 : (toInteger(n) + 1); + return curry(nthArg(n), arity); + }; + }, + 'rearg': function(rearg) { + return function(func, indexes) { + var arity = indexes ? indexes.length : 0; + return curry(rearg(func, indexes), arity); + }; + }, + 'runInContext': function(runInContext) { + return function(context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Casts `func` to a function with an arity capped iteratee if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @returns {Function} Returns the cast function. + */ + function castCap(name, func) { + if (config.cap) { + var indexes = mapping.iterateeRearg[name]; + if (indexes) { + return iterateeRearg(func, indexes); + } + var n = !isLib && mapping.iterateeAry[name]; + if (n) { + return iterateeAry(func, n); + } + } + return func; + } + + /** + * Casts `func` to a curried function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castCurry(name, func, n) { + return (forceCurry || (config.curry && n > 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + var data = mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : flatSpread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) + ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) + : func; + } + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null && + !(isFunction(value) || isError(value) || isWeakMap(value))) { + nested[key] = clone(index == lastIndex ? value : Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var realName = mapping.aliasToReal[name] || name, + methodName = mapping.remap[realName] || realName, + oldOptions = options; + + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[methodName] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, realName, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func, placeholder) { + var result, + realName = mapping.aliasToReal[name] || name, + wrapped = func, + wrapper = wrappers[realName]; + + if (wrapper) { + wrapped = wrapper(func); + } + else if (config.immutable) { + if (mapping.mutate.array[realName]) { + wrapped = wrapImmutable(func, cloneArray); + } + else if (mapping.mutate.object[realName]) { + wrapped = wrapImmutable(func, createCloner(func)); + } + else if (mapping.mutate.set[realName]) { + wrapped = wrapImmutable(func, cloneByPath); + } + } + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { + if (realName == otherName) { + var data = mapping.methodSpread[realName], + afterRearg = data && data.afterRearg; + + result = afterRearg + ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) + : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); + + result = castCap(realName, result); + result = castCurry(realName, result, aryKey); + return false; + } + }); + return !result; + }); + + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(realName, func); + result.placeholder = func.placeholder = placeholder; + + return result; + } + + /*--------------------------------------------------------------------------*/ + + if (!isObj) { + return wrap(name, func, defaultHolder); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func, _)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function(pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + _.placeholder = _; + + // Assign aliases. + each(keys(_), function(key) { + each(mapping.realToAlias[key] || [], function(alias) { + _[alias] = _[key]; + }); + }); + + return _; +} + +module.exports = baseConvert; diff --git a/node_modules/lodash/fp/_convertBrowser.js b/node_modules/lodash/fp/_convertBrowser.js new file mode 100644 index 0000000..bde030d --- /dev/null +++ b/node_modules/lodash/fp/_convertBrowser.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'); + +/** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Function} lodash The lodash function to convert. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ +function browserConvert(lodash, options) { + return baseConvert(lodash, lodash, options); +} + +if (typeof _ == 'function' && typeof _.runInContext == 'function') { + _ = browserConvert(_.runInContext()); +} +module.exports = browserConvert; diff --git a/node_modules/lodash/fp/_falseOptions.js b/node_modules/lodash/fp/_falseOptions.js new file mode 100644 index 0000000..773235e --- /dev/null +++ b/node_modules/lodash/fp/_falseOptions.js @@ -0,0 +1,7 @@ +module.exports = { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false +}; diff --git a/node_modules/lodash/fp/_mapping.js b/node_modules/lodash/fp/_mapping.js new file mode 100644 index 0000000..a642ec0 --- /dev/null +++ b/node_modules/lodash/fp/_mapping.js @@ -0,0 +1,358 @@ +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + + // Ramda aliases. + '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', + 'all': 'every', + 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', + 'apply': 'spread', + 'assoc': 'set', + 'assocPath': 'set', + 'complement': 'negate', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'unset', + 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', + 'equals': 'isEqual', + 'identical': 'eq', + 'indexBy': 'keyBy', + 'init': 'initial', + 'invertObj': 'invert', + 'juxt': 'over', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'paths': 'at', + 'pickAll': 'pick', + 'pipe': 'flow', + 'pluck': 'map', + 'prop': 'get', + 'propEq': 'matchesProperty', + 'propOr': 'getOr', + 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'where': 'conformsTo', + 'whereEq': 'isMatch', + 'zipObj': 'zipObject' +}; + +/** Used to map ary to method names. */ +exports.aryMethod = { + '1': [ + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', + 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words', 'zipAll' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', + 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', + 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', + 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', + 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', + 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', + 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', + 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', + 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', + 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', + 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] +}; + +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] +}; + +/** Used to map method names to their iteratee ary. */ +exports.iterateeAry = { + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findFrom': 1, + 'findIndex': 1, + 'findIndexFrom': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastFrom': 1, + 'findLastIndex': 1, + 'findLastIndexFrom': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; + +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'mapKeys': [1], + 'reduceRight': [1, 0] +}; + +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInAllWith': [1, 0], + 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 0], + 'assignWith': [1, 2, 0], + 'differenceBy': [1, 2, 0], + 'differenceWith': [1, 2, 0], + 'getOr': [2, 1, 0], + 'intersectionBy': [1, 2, 0], + 'intersectionWith': [1, 2, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 0], + 'mergeWith': [1, 2, 0], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], + 'rangeStep': [1, 2, 0], + 'rangeStepRight': [1, 2, 0], + 'setWith': [3, 1, 2, 0], + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'unionBy': [1, 2, 0], + 'unionWith': [1, 2, 0], + 'updateWith': [3, 1, 2, 0], + 'xorBy': [1, 2, 0], + 'xorWith': [1, 2, 0], + 'zipWith': [1, 2, 0] +}; + +/** Used to map method names to spread configs. */ +exports.methodSpread = { + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'start': 0 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'start': 0 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'start': 0 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } +}; + +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAllWith': true, + 'pullAt': true, + 'remove': true, + 'reverse': true + }, + 'object': { + 'assign': true, + 'assignAll': true, + 'assignAllWith': true, + 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, + 'assignInWith': true, + 'assignWith': true, + 'defaults': true, + 'defaultsAll': true, + 'defaultsDeep': true, + 'defaultsDeepAll': true, + 'merge': true, + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, + }, + 'set': { + 'set': true, + 'setWith': true, + 'unset': true, + 'update': true, + 'updateWith': true + } +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + return result; +}()); + +/** Used to map method names to other names. */ +exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', + 'findFrom': 'find', + 'findIndexFrom': 'findIndex', + 'findLastFrom': 'findLast', + 'findLastIndexFrom': 'findLastIndex', + 'getOr': 'get', + 'includesFrom': 'includes', + 'indexOfFrom': 'indexOf', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'propertyOf': 'get', + 'rangeStep': 'range', + 'rangeStepRight': 'rangeRight', + 'restFrom': 'rest', + 'spreadFrom': 'spread', + 'trimChars': 'trim', + 'trimCharsEnd': 'trimEnd', + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' +}; + +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'rearg': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ +exports.skipRearg = { + 'add': true, + 'assign': true, + 'assignIn': true, + 'bind': true, + 'bindKey': true, + 'concat': true, + 'difference': true, + 'divide': true, + 'eq': true, + 'gt': true, + 'gte': true, + 'isEqual': true, + 'lt': true, + 'lte': true, + 'matchesProperty': true, + 'merge': true, + 'multiply': true, + 'overArgs': true, + 'partial': true, + 'partialRight': true, + 'propertyOf': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'subtract': true, + 'zip': true, + 'zipObject': true, + 'zipObjectDeep': true +}; diff --git a/node_modules/lodash/fp/_util.js b/node_modules/lodash/fp/_util.js new file mode 100644 index 0000000..1dbf36f --- /dev/null +++ b/node_modules/lodash/fp/_util.js @@ -0,0 +1,16 @@ +module.exports = { + 'ary': require('../ary'), + 'assign': require('../_baseAssign'), + 'clone': require('../clone'), + 'curry': require('../curry'), + 'forEach': require('../_arrayEach'), + 'isArray': require('../isArray'), + 'isError': require('../isError'), + 'isFunction': require('../isFunction'), + 'isWeakMap': require('../isWeakMap'), + 'iteratee': require('../iteratee'), + 'keys': require('../_baseKeys'), + 'rearg': require('../rearg'), + 'toInteger': require('../toInteger'), + 'toPath': require('../toPath') +}; diff --git a/node_modules/lodash/fp/add.js b/node_modules/lodash/fp/add.js new file mode 100644 index 0000000..816eeec --- /dev/null +++ b/node_modules/lodash/fp/add.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('add', require('../add')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/after.js b/node_modules/lodash/fp/after.js new file mode 100644 index 0000000..21a0167 --- /dev/null +++ b/node_modules/lodash/fp/after.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('after', require('../after')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/all.js b/node_modules/lodash/fp/all.js new file mode 100644 index 0000000..d0839f7 --- /dev/null +++ b/node_modules/lodash/fp/all.js @@ -0,0 +1 @@ +module.exports = require('./every'); diff --git a/node_modules/lodash/fp/allPass.js b/node_modules/lodash/fp/allPass.js new file mode 100644 index 0000000..79b73ef --- /dev/null +++ b/node_modules/lodash/fp/allPass.js @@ -0,0 +1 @@ +module.exports = require('./overEvery'); diff --git a/node_modules/lodash/fp/always.js b/node_modules/lodash/fp/always.js new file mode 100644 index 0000000..9887703 --- /dev/null +++ b/node_modules/lodash/fp/always.js @@ -0,0 +1 @@ +module.exports = require('./constant'); diff --git a/node_modules/lodash/fp/any.js b/node_modules/lodash/fp/any.js new file mode 100644 index 0000000..900ac25 --- /dev/null +++ b/node_modules/lodash/fp/any.js @@ -0,0 +1 @@ +module.exports = require('./some'); diff --git a/node_modules/lodash/fp/anyPass.js b/node_modules/lodash/fp/anyPass.js new file mode 100644 index 0000000..2774ab3 --- /dev/null +++ b/node_modules/lodash/fp/anyPass.js @@ -0,0 +1 @@ +module.exports = require('./overSome'); diff --git a/node_modules/lodash/fp/apply.js b/node_modules/lodash/fp/apply.js new file mode 100644 index 0000000..2b75712 --- /dev/null +++ b/node_modules/lodash/fp/apply.js @@ -0,0 +1 @@ +module.exports = require('./spread'); diff --git a/node_modules/lodash/fp/array.js b/node_modules/lodash/fp/array.js new file mode 100644 index 0000000..fe939c2 --- /dev/null +++ b/node_modules/lodash/fp/array.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../array')); diff --git a/node_modules/lodash/fp/ary.js b/node_modules/lodash/fp/ary.js new file mode 100644 index 0000000..8edf187 --- /dev/null +++ b/node_modules/lodash/fp/ary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ary', require('../ary')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assign.js b/node_modules/lodash/fp/assign.js new file mode 100644 index 0000000..23f47af --- /dev/null +++ b/node_modules/lodash/fp/assign.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assign', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignAll.js b/node_modules/lodash/fp/assignAll.js new file mode 100644 index 0000000..b1d36c7 --- /dev/null +++ b/node_modules/lodash/fp/assignAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAll', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignAllWith.js b/node_modules/lodash/fp/assignAllWith.js new file mode 100644 index 0000000..21e836e --- /dev/null +++ b/node_modules/lodash/fp/assignAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAllWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignIn.js b/node_modules/lodash/fp/assignIn.js new file mode 100644 index 0000000..6e7c65f --- /dev/null +++ b/node_modules/lodash/fp/assignIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignIn', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInAll.js b/node_modules/lodash/fp/assignInAll.js new file mode 100644 index 0000000..7ba75db --- /dev/null +++ b/node_modules/lodash/fp/assignInAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAll', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInAllWith.js b/node_modules/lodash/fp/assignInAllWith.js new file mode 100644 index 0000000..e766903 --- /dev/null +++ b/node_modules/lodash/fp/assignInAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAllWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInWith.js b/node_modules/lodash/fp/assignInWith.js new file mode 100644 index 0000000..acb5923 --- /dev/null +++ b/node_modules/lodash/fp/assignInWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignWith.js b/node_modules/lodash/fp/assignWith.js new file mode 100644 index 0000000..eb92521 --- /dev/null +++ b/node_modules/lodash/fp/assignWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assoc.js b/node_modules/lodash/fp/assoc.js new file mode 100644 index 0000000..7648820 --- /dev/null +++ b/node_modules/lodash/fp/assoc.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/node_modules/lodash/fp/assocPath.js b/node_modules/lodash/fp/assocPath.js new file mode 100644 index 0000000..7648820 --- /dev/null +++ b/node_modules/lodash/fp/assocPath.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/node_modules/lodash/fp/at.js b/node_modules/lodash/fp/at.js new file mode 100644 index 0000000..cc39d25 --- /dev/null +++ b/node_modules/lodash/fp/at.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('at', require('../at')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/attempt.js b/node_modules/lodash/fp/attempt.js new file mode 100644 index 0000000..26ca42e --- /dev/null +++ b/node_modules/lodash/fp/attempt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('attempt', require('../attempt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/before.js b/node_modules/lodash/fp/before.js new file mode 100644 index 0000000..7a2de65 --- /dev/null +++ b/node_modules/lodash/fp/before.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('before', require('../before')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bind.js b/node_modules/lodash/fp/bind.js new file mode 100644 index 0000000..5cbe4f3 --- /dev/null +++ b/node_modules/lodash/fp/bind.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bind', require('../bind')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bindAll.js b/node_modules/lodash/fp/bindAll.js new file mode 100644 index 0000000..6b4a4a0 --- /dev/null +++ b/node_modules/lodash/fp/bindAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindAll', require('../bindAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bindKey.js b/node_modules/lodash/fp/bindKey.js new file mode 100644 index 0000000..6a46c6b --- /dev/null +++ b/node_modules/lodash/fp/bindKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindKey', require('../bindKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/camelCase.js b/node_modules/lodash/fp/camelCase.js new file mode 100644 index 0000000..87b77b4 --- /dev/null +++ b/node_modules/lodash/fp/camelCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/capitalize.js b/node_modules/lodash/fp/capitalize.js new file mode 100644 index 0000000..cac74e1 --- /dev/null +++ b/node_modules/lodash/fp/capitalize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/castArray.js b/node_modules/lodash/fp/castArray.js new file mode 100644 index 0000000..8681c09 --- /dev/null +++ b/node_modules/lodash/fp/castArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('castArray', require('../castArray')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/ceil.js b/node_modules/lodash/fp/ceil.js new file mode 100644 index 0000000..f416b72 --- /dev/null +++ b/node_modules/lodash/fp/ceil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ceil', require('../ceil')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/chain.js b/node_modules/lodash/fp/chain.js new file mode 100644 index 0000000..604fe39 --- /dev/null +++ b/node_modules/lodash/fp/chain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chain', require('../chain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/chunk.js b/node_modules/lodash/fp/chunk.js new file mode 100644 index 0000000..871ab08 --- /dev/null +++ b/node_modules/lodash/fp/chunk.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chunk', require('../chunk')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/clamp.js b/node_modules/lodash/fp/clamp.js new file mode 100644 index 0000000..3b06c01 --- /dev/null +++ b/node_modules/lodash/fp/clamp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clamp', require('../clamp')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/clone.js b/node_modules/lodash/fp/clone.js new file mode 100644 index 0000000..cadb59c --- /dev/null +++ b/node_modules/lodash/fp/clone.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clone', require('../clone'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneDeep.js b/node_modules/lodash/fp/cloneDeep.js new file mode 100644 index 0000000..a6107aa --- /dev/null +++ b/node_modules/lodash/fp/cloneDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneDeepWith.js b/node_modules/lodash/fp/cloneDeepWith.js new file mode 100644 index 0000000..6f01e44 --- /dev/null +++ b/node_modules/lodash/fp/cloneDeepWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeepWith', require('../cloneDeepWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneWith.js b/node_modules/lodash/fp/cloneWith.js new file mode 100644 index 0000000..aa88578 --- /dev/null +++ b/node_modules/lodash/fp/cloneWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneWith', require('../cloneWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/collection.js b/node_modules/lodash/fp/collection.js new file mode 100644 index 0000000..fc8b328 --- /dev/null +++ b/node_modules/lodash/fp/collection.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../collection')); diff --git a/node_modules/lodash/fp/commit.js b/node_modules/lodash/fp/commit.js new file mode 100644 index 0000000..130a894 --- /dev/null +++ b/node_modules/lodash/fp/commit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('commit', require('../commit'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/compact.js b/node_modules/lodash/fp/compact.js new file mode 100644 index 0000000..ce8f7a1 --- /dev/null +++ b/node_modules/lodash/fp/compact.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('compact', require('../compact'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/complement.js b/node_modules/lodash/fp/complement.js new file mode 100644 index 0000000..93eb462 --- /dev/null +++ b/node_modules/lodash/fp/complement.js @@ -0,0 +1 @@ +module.exports = require('./negate'); diff --git a/node_modules/lodash/fp/compose.js b/node_modules/lodash/fp/compose.js new file mode 100644 index 0000000..1954e94 --- /dev/null +++ b/node_modules/lodash/fp/compose.js @@ -0,0 +1 @@ +module.exports = require('./flowRight'); diff --git a/node_modules/lodash/fp/concat.js b/node_modules/lodash/fp/concat.js new file mode 100644 index 0000000..e59346a --- /dev/null +++ b/node_modules/lodash/fp/concat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('concat', require('../concat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cond.js b/node_modules/lodash/fp/cond.js new file mode 100644 index 0000000..6a0120e --- /dev/null +++ b/node_modules/lodash/fp/cond.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cond', require('../cond'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/conforms.js b/node_modules/lodash/fp/conforms.js new file mode 100644 index 0000000..3247f64 --- /dev/null +++ b/node_modules/lodash/fp/conforms.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/node_modules/lodash/fp/conformsTo.js b/node_modules/lodash/fp/conformsTo.js new file mode 100644 index 0000000..aa7f41e --- /dev/null +++ b/node_modules/lodash/fp/conformsTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('conformsTo', require('../conformsTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/constant.js b/node_modules/lodash/fp/constant.js new file mode 100644 index 0000000..9e406fc --- /dev/null +++ b/node_modules/lodash/fp/constant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('constant', require('../constant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/contains.js b/node_modules/lodash/fp/contains.js new file mode 100644 index 0000000..594722a --- /dev/null +++ b/node_modules/lodash/fp/contains.js @@ -0,0 +1 @@ +module.exports = require('./includes'); diff --git a/node_modules/lodash/fp/convert.js b/node_modules/lodash/fp/convert.js new file mode 100644 index 0000000..4795dc4 --- /dev/null +++ b/node_modules/lodash/fp/convert.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'), + util = require('./_util'); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func, options) { + return baseConvert(util, name, func, options); +} + +module.exports = convert; diff --git a/node_modules/lodash/fp/countBy.js b/node_modules/lodash/fp/countBy.js new file mode 100644 index 0000000..dfa4643 --- /dev/null +++ b/node_modules/lodash/fp/countBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('countBy', require('../countBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/create.js b/node_modules/lodash/fp/create.js new file mode 100644 index 0000000..752025f --- /dev/null +++ b/node_modules/lodash/fp/create.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('create', require('../create')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curry.js b/node_modules/lodash/fp/curry.js new file mode 100644 index 0000000..b0b4168 --- /dev/null +++ b/node_modules/lodash/fp/curry.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curry', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryN.js b/node_modules/lodash/fp/curryN.js new file mode 100644 index 0000000..2ae7d00 --- /dev/null +++ b/node_modules/lodash/fp/curryN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryN', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryRight.js b/node_modules/lodash/fp/curryRight.js new file mode 100644 index 0000000..cb619eb --- /dev/null +++ b/node_modules/lodash/fp/curryRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRight', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryRightN.js b/node_modules/lodash/fp/curryRightN.js new file mode 100644 index 0000000..2495afc --- /dev/null +++ b/node_modules/lodash/fp/curryRightN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRightN', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/date.js b/node_modules/lodash/fp/date.js new file mode 100644 index 0000000..82cb952 --- /dev/null +++ b/node_modules/lodash/fp/date.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../date')); diff --git a/node_modules/lodash/fp/debounce.js b/node_modules/lodash/fp/debounce.js new file mode 100644 index 0000000..2612229 --- /dev/null +++ b/node_modules/lodash/fp/debounce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('debounce', require('../debounce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/deburr.js b/node_modules/lodash/fp/deburr.js new file mode 100644 index 0000000..96463ab --- /dev/null +++ b/node_modules/lodash/fp/deburr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('deburr', require('../deburr'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultTo.js b/node_modules/lodash/fp/defaultTo.js new file mode 100644 index 0000000..d6b52a4 --- /dev/null +++ b/node_modules/lodash/fp/defaultTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultTo', require('../defaultTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaults.js b/node_modules/lodash/fp/defaults.js new file mode 100644 index 0000000..e1a8e6e --- /dev/null +++ b/node_modules/lodash/fp/defaults.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaults', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsAll.js b/node_modules/lodash/fp/defaultsAll.js new file mode 100644 index 0000000..238fcc3 --- /dev/null +++ b/node_modules/lodash/fp/defaultsAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsAll', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsDeep.js b/node_modules/lodash/fp/defaultsDeep.js new file mode 100644 index 0000000..1f172ff --- /dev/null +++ b/node_modules/lodash/fp/defaultsDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeep', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsDeepAll.js b/node_modules/lodash/fp/defaultsDeepAll.js new file mode 100644 index 0000000..6835f2f --- /dev/null +++ b/node_modules/lodash/fp/defaultsDeepAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeepAll', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defer.js b/node_modules/lodash/fp/defer.js new file mode 100644 index 0000000..ec7990f --- /dev/null +++ b/node_modules/lodash/fp/defer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defer', require('../defer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/delay.js b/node_modules/lodash/fp/delay.js new file mode 100644 index 0000000..556dbd5 --- /dev/null +++ b/node_modules/lodash/fp/delay.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('delay', require('../delay')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/difference.js b/node_modules/lodash/fp/difference.js new file mode 100644 index 0000000..2d03765 --- /dev/null +++ b/node_modules/lodash/fp/difference.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('difference', require('../difference')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/differenceBy.js b/node_modules/lodash/fp/differenceBy.js new file mode 100644 index 0000000..2f91491 --- /dev/null +++ b/node_modules/lodash/fp/differenceBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceBy', require('../differenceBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/differenceWith.js b/node_modules/lodash/fp/differenceWith.js new file mode 100644 index 0000000..bcf5ad2 --- /dev/null +++ b/node_modules/lodash/fp/differenceWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceWith', require('../differenceWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dissoc.js b/node_modules/lodash/fp/dissoc.js new file mode 100644 index 0000000..7ec7be1 --- /dev/null +++ b/node_modules/lodash/fp/dissoc.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/node_modules/lodash/fp/dissocPath.js b/node_modules/lodash/fp/dissocPath.js new file mode 100644 index 0000000..7ec7be1 --- /dev/null +++ b/node_modules/lodash/fp/dissocPath.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/node_modules/lodash/fp/divide.js b/node_modules/lodash/fp/divide.js new file mode 100644 index 0000000..82048c5 --- /dev/null +++ b/node_modules/lodash/fp/divide.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('divide', require('../divide')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/drop.js b/node_modules/lodash/fp/drop.js new file mode 100644 index 0000000..2fa9b4f --- /dev/null +++ b/node_modules/lodash/fp/drop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('drop', require('../drop')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropLast.js b/node_modules/lodash/fp/dropLast.js new file mode 100644 index 0000000..174e525 --- /dev/null +++ b/node_modules/lodash/fp/dropLast.js @@ -0,0 +1 @@ +module.exports = require('./dropRight'); diff --git a/node_modules/lodash/fp/dropLastWhile.js b/node_modules/lodash/fp/dropLastWhile.js new file mode 100644 index 0000000..be2a9d2 --- /dev/null +++ b/node_modules/lodash/fp/dropLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./dropRightWhile'); diff --git a/node_modules/lodash/fp/dropRight.js b/node_modules/lodash/fp/dropRight.js new file mode 100644 index 0000000..e98881f --- /dev/null +++ b/node_modules/lodash/fp/dropRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRight', require('../dropRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropRightWhile.js b/node_modules/lodash/fp/dropRightWhile.js new file mode 100644 index 0000000..cacaa70 --- /dev/null +++ b/node_modules/lodash/fp/dropRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRightWhile', require('../dropRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropWhile.js b/node_modules/lodash/fp/dropWhile.js new file mode 100644 index 0000000..285f864 --- /dev/null +++ b/node_modules/lodash/fp/dropWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropWhile', require('../dropWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/each.js b/node_modules/lodash/fp/each.js new file mode 100644 index 0000000..8800f42 --- /dev/null +++ b/node_modules/lodash/fp/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/node_modules/lodash/fp/eachRight.js b/node_modules/lodash/fp/eachRight.js new file mode 100644 index 0000000..3252b2a --- /dev/null +++ b/node_modules/lodash/fp/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/node_modules/lodash/fp/endsWith.js b/node_modules/lodash/fp/endsWith.js new file mode 100644 index 0000000..17dc2a4 --- /dev/null +++ b/node_modules/lodash/fp/endsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('endsWith', require('../endsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/entries.js b/node_modules/lodash/fp/entries.js new file mode 100644 index 0000000..7a88df2 --- /dev/null +++ b/node_modules/lodash/fp/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/node_modules/lodash/fp/entriesIn.js b/node_modules/lodash/fp/entriesIn.js new file mode 100644 index 0000000..f6c6331 --- /dev/null +++ b/node_modules/lodash/fp/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/node_modules/lodash/fp/eq.js b/node_modules/lodash/fp/eq.js new file mode 100644 index 0000000..9a3d21b --- /dev/null +++ b/node_modules/lodash/fp/eq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('eq', require('../eq')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/equals.js b/node_modules/lodash/fp/equals.js new file mode 100644 index 0000000..e6a5ce0 --- /dev/null +++ b/node_modules/lodash/fp/equals.js @@ -0,0 +1 @@ +module.exports = require('./isEqual'); diff --git a/node_modules/lodash/fp/escape.js b/node_modules/lodash/fp/escape.js new file mode 100644 index 0000000..52c1fbb --- /dev/null +++ b/node_modules/lodash/fp/escape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escape', require('../escape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/escapeRegExp.js b/node_modules/lodash/fp/escapeRegExp.js new file mode 100644 index 0000000..369b2ef --- /dev/null +++ b/node_modules/lodash/fp/escapeRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/every.js b/node_modules/lodash/fp/every.js new file mode 100644 index 0000000..95c2776 --- /dev/null +++ b/node_modules/lodash/fp/every.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('every', require('../every')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/extend.js b/node_modules/lodash/fp/extend.js new file mode 100644 index 0000000..e00166c --- /dev/null +++ b/node_modules/lodash/fp/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/node_modules/lodash/fp/extendAll.js b/node_modules/lodash/fp/extendAll.js new file mode 100644 index 0000000..cc55b64 --- /dev/null +++ b/node_modules/lodash/fp/extendAll.js @@ -0,0 +1 @@ +module.exports = require('./assignInAll'); diff --git a/node_modules/lodash/fp/extendAllWith.js b/node_modules/lodash/fp/extendAllWith.js new file mode 100644 index 0000000..6679d20 --- /dev/null +++ b/node_modules/lodash/fp/extendAllWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInAllWith'); diff --git a/node_modules/lodash/fp/extendWith.js b/node_modules/lodash/fp/extendWith.js new file mode 100644 index 0000000..dbdcb3b --- /dev/null +++ b/node_modules/lodash/fp/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/node_modules/lodash/fp/fill.js b/node_modules/lodash/fp/fill.js new file mode 100644 index 0000000..b2d47e8 --- /dev/null +++ b/node_modules/lodash/fp/fill.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fill', require('../fill')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/filter.js b/node_modules/lodash/fp/filter.js new file mode 100644 index 0000000..796d501 --- /dev/null +++ b/node_modules/lodash/fp/filter.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('filter', require('../filter')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/find.js b/node_modules/lodash/fp/find.js new file mode 100644 index 0000000..f805d33 --- /dev/null +++ b/node_modules/lodash/fp/find.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('find', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findFrom.js b/node_modules/lodash/fp/findFrom.js new file mode 100644 index 0000000..da8275e --- /dev/null +++ b/node_modules/lodash/fp/findFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findFrom', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findIndex.js b/node_modules/lodash/fp/findIndex.js new file mode 100644 index 0000000..8c15fd1 --- /dev/null +++ b/node_modules/lodash/fp/findIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndex', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findIndexFrom.js b/node_modules/lodash/fp/findIndexFrom.js new file mode 100644 index 0000000..32e98cb --- /dev/null +++ b/node_modules/lodash/fp/findIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndexFrom', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findKey.js b/node_modules/lodash/fp/findKey.js new file mode 100644 index 0000000..475bcfa --- /dev/null +++ b/node_modules/lodash/fp/findKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findKey', require('../findKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLast.js b/node_modules/lodash/fp/findLast.js new file mode 100644 index 0000000..093fe94 --- /dev/null +++ b/node_modules/lodash/fp/findLast.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLast', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastFrom.js b/node_modules/lodash/fp/findLastFrom.js new file mode 100644 index 0000000..76c38fb --- /dev/null +++ b/node_modules/lodash/fp/findLastFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastFrom', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastIndex.js b/node_modules/lodash/fp/findLastIndex.js new file mode 100644 index 0000000..36986df --- /dev/null +++ b/node_modules/lodash/fp/findLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndex', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastIndexFrom.js b/node_modules/lodash/fp/findLastIndexFrom.js new file mode 100644 index 0000000..34c8176 --- /dev/null +++ b/node_modules/lodash/fp/findLastIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndexFrom', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastKey.js b/node_modules/lodash/fp/findLastKey.js new file mode 100644 index 0000000..5f81b60 --- /dev/null +++ b/node_modules/lodash/fp/findLastKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastKey', require('../findLastKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/first.js b/node_modules/lodash/fp/first.js new file mode 100644 index 0000000..53f4ad1 --- /dev/null +++ b/node_modules/lodash/fp/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/node_modules/lodash/fp/flatMap.js b/node_modules/lodash/fp/flatMap.js new file mode 100644 index 0000000..d01dc4d --- /dev/null +++ b/node_modules/lodash/fp/flatMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMap', require('../flatMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatMapDeep.js b/node_modules/lodash/fp/flatMapDeep.js new file mode 100644 index 0000000..569c42e --- /dev/null +++ b/node_modules/lodash/fp/flatMapDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDeep', require('../flatMapDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatMapDepth.js b/node_modules/lodash/fp/flatMapDepth.js new file mode 100644 index 0000000..6eb68fd --- /dev/null +++ b/node_modules/lodash/fp/flatMapDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDepth', require('../flatMapDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatten.js b/node_modules/lodash/fp/flatten.js new file mode 100644 index 0000000..30425d8 --- /dev/null +++ b/node_modules/lodash/fp/flatten.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatten', require('../flatten'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flattenDeep.js b/node_modules/lodash/fp/flattenDeep.js new file mode 100644 index 0000000..aed5db2 --- /dev/null +++ b/node_modules/lodash/fp/flattenDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flattenDepth.js b/node_modules/lodash/fp/flattenDepth.js new file mode 100644 index 0000000..ad65e37 --- /dev/null +++ b/node_modules/lodash/fp/flattenDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDepth', require('../flattenDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flip.js b/node_modules/lodash/fp/flip.js new file mode 100644 index 0000000..0547e7b --- /dev/null +++ b/node_modules/lodash/fp/flip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flip', require('../flip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/floor.js b/node_modules/lodash/fp/floor.js new file mode 100644 index 0000000..a6cf335 --- /dev/null +++ b/node_modules/lodash/fp/floor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('floor', require('../floor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flow.js b/node_modules/lodash/fp/flow.js new file mode 100644 index 0000000..cd83677 --- /dev/null +++ b/node_modules/lodash/fp/flow.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flow', require('../flow')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flowRight.js b/node_modules/lodash/fp/flowRight.js new file mode 100644 index 0000000..972a5b9 --- /dev/null +++ b/node_modules/lodash/fp/flowRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flowRight', require('../flowRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forEach.js b/node_modules/lodash/fp/forEach.js new file mode 100644 index 0000000..2f49452 --- /dev/null +++ b/node_modules/lodash/fp/forEach.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEach', require('../forEach')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forEachRight.js b/node_modules/lodash/fp/forEachRight.js new file mode 100644 index 0000000..3ff9733 --- /dev/null +++ b/node_modules/lodash/fp/forEachRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEachRight', require('../forEachRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forIn.js b/node_modules/lodash/fp/forIn.js new file mode 100644 index 0000000..9341749 --- /dev/null +++ b/node_modules/lodash/fp/forIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forIn', require('../forIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forInRight.js b/node_modules/lodash/fp/forInRight.js new file mode 100644 index 0000000..cecf8bb --- /dev/null +++ b/node_modules/lodash/fp/forInRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forInRight', require('../forInRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forOwn.js b/node_modules/lodash/fp/forOwn.js new file mode 100644 index 0000000..246449e --- /dev/null +++ b/node_modules/lodash/fp/forOwn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwn', require('../forOwn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forOwnRight.js b/node_modules/lodash/fp/forOwnRight.js new file mode 100644 index 0000000..c5e826e --- /dev/null +++ b/node_modules/lodash/fp/forOwnRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwnRight', require('../forOwnRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/fromPairs.js b/node_modules/lodash/fp/fromPairs.js new file mode 100644 index 0000000..f8cc596 --- /dev/null +++ b/node_modules/lodash/fp/fromPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fromPairs', require('../fromPairs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/function.js b/node_modules/lodash/fp/function.js new file mode 100644 index 0000000..dfe69b1 --- /dev/null +++ b/node_modules/lodash/fp/function.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../function')); diff --git a/node_modules/lodash/fp/functions.js b/node_modules/lodash/fp/functions.js new file mode 100644 index 0000000..09d1bb1 --- /dev/null +++ b/node_modules/lodash/fp/functions.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functions', require('../functions'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/functionsIn.js b/node_modules/lodash/fp/functionsIn.js new file mode 100644 index 0000000..2cfeb83 --- /dev/null +++ b/node_modules/lodash/fp/functionsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/get.js b/node_modules/lodash/fp/get.js new file mode 100644 index 0000000..6d3a328 --- /dev/null +++ b/node_modules/lodash/fp/get.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('get', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/getOr.js b/node_modules/lodash/fp/getOr.js new file mode 100644 index 0000000..7dbf771 --- /dev/null +++ b/node_modules/lodash/fp/getOr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('getOr', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/groupBy.js b/node_modules/lodash/fp/groupBy.js new file mode 100644 index 0000000..fc0bc78 --- /dev/null +++ b/node_modules/lodash/fp/groupBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('groupBy', require('../groupBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/gt.js b/node_modules/lodash/fp/gt.js new file mode 100644 index 0000000..9e57c80 --- /dev/null +++ b/node_modules/lodash/fp/gt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gt', require('../gt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/gte.js b/node_modules/lodash/fp/gte.js new file mode 100644 index 0000000..4584786 --- /dev/null +++ b/node_modules/lodash/fp/gte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gte', require('../gte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/has.js b/node_modules/lodash/fp/has.js new file mode 100644 index 0000000..b901298 --- /dev/null +++ b/node_modules/lodash/fp/has.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('has', require('../has')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/hasIn.js b/node_modules/lodash/fp/hasIn.js new file mode 100644 index 0000000..b3c3d1a --- /dev/null +++ b/node_modules/lodash/fp/hasIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('hasIn', require('../hasIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/head.js b/node_modules/lodash/fp/head.js new file mode 100644 index 0000000..2694f0a --- /dev/null +++ b/node_modules/lodash/fp/head.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('head', require('../head'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/identical.js b/node_modules/lodash/fp/identical.js new file mode 100644 index 0000000..85563f4 --- /dev/null +++ b/node_modules/lodash/fp/identical.js @@ -0,0 +1 @@ +module.exports = require('./eq'); diff --git a/node_modules/lodash/fp/identity.js b/node_modules/lodash/fp/identity.js new file mode 100644 index 0000000..096415a --- /dev/null +++ b/node_modules/lodash/fp/identity.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('identity', require('../identity'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/inRange.js b/node_modules/lodash/fp/inRange.js new file mode 100644 index 0000000..202d940 --- /dev/null +++ b/node_modules/lodash/fp/inRange.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('inRange', require('../inRange')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/includes.js b/node_modules/lodash/fp/includes.js new file mode 100644 index 0000000..1146780 --- /dev/null +++ b/node_modules/lodash/fp/includes.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includes', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/includesFrom.js b/node_modules/lodash/fp/includesFrom.js new file mode 100644 index 0000000..683afdb --- /dev/null +++ b/node_modules/lodash/fp/includesFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includesFrom', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/indexBy.js b/node_modules/lodash/fp/indexBy.js new file mode 100644 index 0000000..7e64bc0 --- /dev/null +++ b/node_modules/lodash/fp/indexBy.js @@ -0,0 +1 @@ +module.exports = require('./keyBy'); diff --git a/node_modules/lodash/fp/indexOf.js b/node_modules/lodash/fp/indexOf.js new file mode 100644 index 0000000..524658e --- /dev/null +++ b/node_modules/lodash/fp/indexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOf', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/indexOfFrom.js b/node_modules/lodash/fp/indexOfFrom.js new file mode 100644 index 0000000..d99c822 --- /dev/null +++ b/node_modules/lodash/fp/indexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOfFrom', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/init.js b/node_modules/lodash/fp/init.js new file mode 100644 index 0000000..2f88d8b --- /dev/null +++ b/node_modules/lodash/fp/init.js @@ -0,0 +1 @@ +module.exports = require('./initial'); diff --git a/node_modules/lodash/fp/initial.js b/node_modules/lodash/fp/initial.js new file mode 100644 index 0000000..b732ba0 --- /dev/null +++ b/node_modules/lodash/fp/initial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('initial', require('../initial'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersection.js b/node_modules/lodash/fp/intersection.js new file mode 100644 index 0000000..52936d5 --- /dev/null +++ b/node_modules/lodash/fp/intersection.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersection', require('../intersection')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersectionBy.js b/node_modules/lodash/fp/intersectionBy.js new file mode 100644 index 0000000..72629f2 --- /dev/null +++ b/node_modules/lodash/fp/intersectionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionBy', require('../intersectionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersectionWith.js b/node_modules/lodash/fp/intersectionWith.js new file mode 100644 index 0000000..e064f40 --- /dev/null +++ b/node_modules/lodash/fp/intersectionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionWith', require('../intersectionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invert.js b/node_modules/lodash/fp/invert.js new file mode 100644 index 0000000..2d5d1f0 --- /dev/null +++ b/node_modules/lodash/fp/invert.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invert', require('../invert')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invertBy.js b/node_modules/lodash/fp/invertBy.js new file mode 100644 index 0000000..63ca97e --- /dev/null +++ b/node_modules/lodash/fp/invertBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invertBy', require('../invertBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invertObj.js b/node_modules/lodash/fp/invertObj.js new file mode 100644 index 0000000..f1d842e --- /dev/null +++ b/node_modules/lodash/fp/invertObj.js @@ -0,0 +1 @@ +module.exports = require('./invert'); diff --git a/node_modules/lodash/fp/invoke.js b/node_modules/lodash/fp/invoke.js new file mode 100644 index 0000000..fcf17f0 --- /dev/null +++ b/node_modules/lodash/fp/invoke.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invoke', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeArgs.js b/node_modules/lodash/fp/invokeArgs.js new file mode 100644 index 0000000..d3f2953 --- /dev/null +++ b/node_modules/lodash/fp/invokeArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgs', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeArgsMap.js b/node_modules/lodash/fp/invokeArgsMap.js new file mode 100644 index 0000000..eaa9f84 --- /dev/null +++ b/node_modules/lodash/fp/invokeArgsMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgsMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeMap.js b/node_modules/lodash/fp/invokeMap.js new file mode 100644 index 0000000..6515fd7 --- /dev/null +++ b/node_modules/lodash/fp/invokeMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArguments.js b/node_modules/lodash/fp/isArguments.js new file mode 100644 index 0000000..1d93c9e --- /dev/null +++ b/node_modules/lodash/fp/isArguments.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArray.js b/node_modules/lodash/fp/isArray.js new file mode 100644 index 0000000..ba7ade8 --- /dev/null +++ b/node_modules/lodash/fp/isArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArray', require('../isArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayBuffer.js b/node_modules/lodash/fp/isArrayBuffer.js new file mode 100644 index 0000000..5088513 --- /dev/null +++ b/node_modules/lodash/fp/isArrayBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayLike.js b/node_modules/lodash/fp/isArrayLike.js new file mode 100644 index 0000000..8f1856b --- /dev/null +++ b/node_modules/lodash/fp/isArrayLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayLikeObject.js b/node_modules/lodash/fp/isArrayLikeObject.js new file mode 100644 index 0000000..2108498 --- /dev/null +++ b/node_modules/lodash/fp/isArrayLikeObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isBoolean.js b/node_modules/lodash/fp/isBoolean.js new file mode 100644 index 0000000..9339f75 --- /dev/null +++ b/node_modules/lodash/fp/isBoolean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isBuffer.js b/node_modules/lodash/fp/isBuffer.js new file mode 100644 index 0000000..e60b123 --- /dev/null +++ b/node_modules/lodash/fp/isBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isDate.js b/node_modules/lodash/fp/isDate.js new file mode 100644 index 0000000..dc41d08 --- /dev/null +++ b/node_modules/lodash/fp/isDate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isDate', require('../isDate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isElement.js b/node_modules/lodash/fp/isElement.js new file mode 100644 index 0000000..18ee039 --- /dev/null +++ b/node_modules/lodash/fp/isElement.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isElement', require('../isElement'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEmpty.js b/node_modules/lodash/fp/isEmpty.js new file mode 100644 index 0000000..0f4ae84 --- /dev/null +++ b/node_modules/lodash/fp/isEmpty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEqual.js b/node_modules/lodash/fp/isEqual.js new file mode 100644 index 0000000..4138386 --- /dev/null +++ b/node_modules/lodash/fp/isEqual.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqual', require('../isEqual')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEqualWith.js b/node_modules/lodash/fp/isEqualWith.js new file mode 100644 index 0000000..029ff5c --- /dev/null +++ b/node_modules/lodash/fp/isEqualWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqualWith', require('../isEqualWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isError.js b/node_modules/lodash/fp/isError.js new file mode 100644 index 0000000..3dfd81c --- /dev/null +++ b/node_modules/lodash/fp/isError.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isError', require('../isError'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isFinite.js b/node_modules/lodash/fp/isFinite.js new file mode 100644 index 0000000..0b647b8 --- /dev/null +++ b/node_modules/lodash/fp/isFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isFunction.js b/node_modules/lodash/fp/isFunction.js new file mode 100644 index 0000000..ff8e5c4 --- /dev/null +++ b/node_modules/lodash/fp/isFunction.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isInteger.js b/node_modules/lodash/fp/isInteger.js new file mode 100644 index 0000000..67af4ff --- /dev/null +++ b/node_modules/lodash/fp/isInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isLength.js b/node_modules/lodash/fp/isLength.js new file mode 100644 index 0000000..fc101c5 --- /dev/null +++ b/node_modules/lodash/fp/isLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isLength', require('../isLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMap.js b/node_modules/lodash/fp/isMap.js new file mode 100644 index 0000000..a209aa6 --- /dev/null +++ b/node_modules/lodash/fp/isMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMap', require('../isMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMatch.js b/node_modules/lodash/fp/isMatch.js new file mode 100644 index 0000000..6264ca1 --- /dev/null +++ b/node_modules/lodash/fp/isMatch.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatch', require('../isMatch')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMatchWith.js b/node_modules/lodash/fp/isMatchWith.js new file mode 100644 index 0000000..d95f319 --- /dev/null +++ b/node_modules/lodash/fp/isMatchWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatchWith', require('../isMatchWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNaN.js b/node_modules/lodash/fp/isNaN.js new file mode 100644 index 0000000..66a978f --- /dev/null +++ b/node_modules/lodash/fp/isNaN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNative.js b/node_modules/lodash/fp/isNative.js new file mode 100644 index 0000000..3d775ba --- /dev/null +++ b/node_modules/lodash/fp/isNative.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNative', require('../isNative'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNil.js b/node_modules/lodash/fp/isNil.js new file mode 100644 index 0000000..5952c02 --- /dev/null +++ b/node_modules/lodash/fp/isNil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNil', require('../isNil'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNull.js b/node_modules/lodash/fp/isNull.js new file mode 100644 index 0000000..f201a35 --- /dev/null +++ b/node_modules/lodash/fp/isNull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNull', require('../isNull'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNumber.js b/node_modules/lodash/fp/isNumber.js new file mode 100644 index 0000000..a2b5fa0 --- /dev/null +++ b/node_modules/lodash/fp/isNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isObject.js b/node_modules/lodash/fp/isObject.js new file mode 100644 index 0000000..231ace0 --- /dev/null +++ b/node_modules/lodash/fp/isObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObject', require('../isObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isObjectLike.js b/node_modules/lodash/fp/isObjectLike.js new file mode 100644 index 0000000..f16082e --- /dev/null +++ b/node_modules/lodash/fp/isObjectLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isPlainObject.js b/node_modules/lodash/fp/isPlainObject.js new file mode 100644 index 0000000..b5bea90 --- /dev/null +++ b/node_modules/lodash/fp/isPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isRegExp.js b/node_modules/lodash/fp/isRegExp.js new file mode 100644 index 0000000..12a1a3d --- /dev/null +++ b/node_modules/lodash/fp/isRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSafeInteger.js b/node_modules/lodash/fp/isSafeInteger.js new file mode 100644 index 0000000..7230f55 --- /dev/null +++ b/node_modules/lodash/fp/isSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSet.js b/node_modules/lodash/fp/isSet.js new file mode 100644 index 0000000..35c01f6 --- /dev/null +++ b/node_modules/lodash/fp/isSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSet', require('../isSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isString.js b/node_modules/lodash/fp/isString.js new file mode 100644 index 0000000..1fd0679 --- /dev/null +++ b/node_modules/lodash/fp/isString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isString', require('../isString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSymbol.js b/node_modules/lodash/fp/isSymbol.js new file mode 100644 index 0000000..3867695 --- /dev/null +++ b/node_modules/lodash/fp/isSymbol.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isTypedArray.js b/node_modules/lodash/fp/isTypedArray.js new file mode 100644 index 0000000..8567953 --- /dev/null +++ b/node_modules/lodash/fp/isTypedArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isUndefined.js b/node_modules/lodash/fp/isUndefined.js new file mode 100644 index 0000000..ddbca31 --- /dev/null +++ b/node_modules/lodash/fp/isUndefined.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isWeakMap.js b/node_modules/lodash/fp/isWeakMap.js new file mode 100644 index 0000000..ef60c61 --- /dev/null +++ b/node_modules/lodash/fp/isWeakMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isWeakSet.js b/node_modules/lodash/fp/isWeakSet.js new file mode 100644 index 0000000..c99bfaa --- /dev/null +++ b/node_modules/lodash/fp/isWeakSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/iteratee.js b/node_modules/lodash/fp/iteratee.js new file mode 100644 index 0000000..9f0f717 --- /dev/null +++ b/node_modules/lodash/fp/iteratee.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('iteratee', require('../iteratee')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/join.js b/node_modules/lodash/fp/join.js new file mode 100644 index 0000000..a220e00 --- /dev/null +++ b/node_modules/lodash/fp/join.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('join', require('../join')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/juxt.js b/node_modules/lodash/fp/juxt.js new file mode 100644 index 0000000..f71e04e --- /dev/null +++ b/node_modules/lodash/fp/juxt.js @@ -0,0 +1 @@ +module.exports = require('./over'); diff --git a/node_modules/lodash/fp/kebabCase.js b/node_modules/lodash/fp/kebabCase.js new file mode 100644 index 0000000..60737f1 --- /dev/null +++ b/node_modules/lodash/fp/kebabCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keyBy.js b/node_modules/lodash/fp/keyBy.js new file mode 100644 index 0000000..9a6a85d --- /dev/null +++ b/node_modules/lodash/fp/keyBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keyBy', require('../keyBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keys.js b/node_modules/lodash/fp/keys.js new file mode 100644 index 0000000..e12bb07 --- /dev/null +++ b/node_modules/lodash/fp/keys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keys', require('../keys'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keysIn.js b/node_modules/lodash/fp/keysIn.js new file mode 100644 index 0000000..f3eb36a --- /dev/null +++ b/node_modules/lodash/fp/keysIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lang.js b/node_modules/lodash/fp/lang.js new file mode 100644 index 0000000..08cc9c1 --- /dev/null +++ b/node_modules/lodash/fp/lang.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../lang')); diff --git a/node_modules/lodash/fp/last.js b/node_modules/lodash/fp/last.js new file mode 100644 index 0000000..0f71699 --- /dev/null +++ b/node_modules/lodash/fp/last.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('last', require('../last'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lastIndexOf.js b/node_modules/lodash/fp/lastIndexOf.js new file mode 100644 index 0000000..ddf39c3 --- /dev/null +++ b/node_modules/lodash/fp/lastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOf', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lastIndexOfFrom.js b/node_modules/lodash/fp/lastIndexOfFrom.js new file mode 100644 index 0000000..1ff6a0b --- /dev/null +++ b/node_modules/lodash/fp/lastIndexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOfFrom', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lowerCase.js b/node_modules/lodash/fp/lowerCase.js new file mode 100644 index 0000000..ea64bc1 --- /dev/null +++ b/node_modules/lodash/fp/lowerCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lowerFirst.js b/node_modules/lodash/fp/lowerFirst.js new file mode 100644 index 0000000..539720a --- /dev/null +++ b/node_modules/lodash/fp/lowerFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lt.js b/node_modules/lodash/fp/lt.js new file mode 100644 index 0000000..a31d21e --- /dev/null +++ b/node_modules/lodash/fp/lt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lt', require('../lt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lte.js b/node_modules/lodash/fp/lte.js new file mode 100644 index 0000000..d795d10 --- /dev/null +++ b/node_modules/lodash/fp/lte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lte', require('../lte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/map.js b/node_modules/lodash/fp/map.js new file mode 100644 index 0000000..cf98794 --- /dev/null +++ b/node_modules/lodash/fp/map.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('map', require('../map')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mapKeys.js b/node_modules/lodash/fp/mapKeys.js new file mode 100644 index 0000000..1684587 --- /dev/null +++ b/node_modules/lodash/fp/mapKeys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapKeys', require('../mapKeys')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mapValues.js b/node_modules/lodash/fp/mapValues.js new file mode 100644 index 0000000..4004972 --- /dev/null +++ b/node_modules/lodash/fp/mapValues.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapValues', require('../mapValues')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/matches.js b/node_modules/lodash/fp/matches.js new file mode 100644 index 0000000..29d1e1e --- /dev/null +++ b/node_modules/lodash/fp/matches.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/node_modules/lodash/fp/matchesProperty.js b/node_modules/lodash/fp/matchesProperty.js new file mode 100644 index 0000000..4575bd2 --- /dev/null +++ b/node_modules/lodash/fp/matchesProperty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('matchesProperty', require('../matchesProperty')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/math.js b/node_modules/lodash/fp/math.js new file mode 100644 index 0000000..e8f50f7 --- /dev/null +++ b/node_modules/lodash/fp/math.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../math')); diff --git a/node_modules/lodash/fp/max.js b/node_modules/lodash/fp/max.js new file mode 100644 index 0000000..a66acac --- /dev/null +++ b/node_modules/lodash/fp/max.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('max', require('../max'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/maxBy.js b/node_modules/lodash/fp/maxBy.js new file mode 100644 index 0000000..d083fd6 --- /dev/null +++ b/node_modules/lodash/fp/maxBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('maxBy', require('../maxBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mean.js b/node_modules/lodash/fp/mean.js new file mode 100644 index 0000000..3117246 --- /dev/null +++ b/node_modules/lodash/fp/mean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mean', require('../mean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/meanBy.js b/node_modules/lodash/fp/meanBy.js new file mode 100644 index 0000000..556f25e --- /dev/null +++ b/node_modules/lodash/fp/meanBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('meanBy', require('../meanBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/memoize.js b/node_modules/lodash/fp/memoize.js new file mode 100644 index 0000000..638eec6 --- /dev/null +++ b/node_modules/lodash/fp/memoize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('memoize', require('../memoize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/merge.js b/node_modules/lodash/fp/merge.js new file mode 100644 index 0000000..ac66add --- /dev/null +++ b/node_modules/lodash/fp/merge.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('merge', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeAll.js b/node_modules/lodash/fp/mergeAll.js new file mode 100644 index 0000000..a3674d6 --- /dev/null +++ b/node_modules/lodash/fp/mergeAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAll', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeAllWith.js b/node_modules/lodash/fp/mergeAllWith.js new file mode 100644 index 0000000..4bd4206 --- /dev/null +++ b/node_modules/lodash/fp/mergeAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAllWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeWith.js b/node_modules/lodash/fp/mergeWith.js new file mode 100644 index 0000000..00d44d5 --- /dev/null +++ b/node_modules/lodash/fp/mergeWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/method.js b/node_modules/lodash/fp/method.js new file mode 100644 index 0000000..f4060c6 --- /dev/null +++ b/node_modules/lodash/fp/method.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('method', require('../method')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/methodOf.js b/node_modules/lodash/fp/methodOf.js new file mode 100644 index 0000000..6139905 --- /dev/null +++ b/node_modules/lodash/fp/methodOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('methodOf', require('../methodOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/min.js b/node_modules/lodash/fp/min.js new file mode 100644 index 0000000..d12c6b4 --- /dev/null +++ b/node_modules/lodash/fp/min.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('min', require('../min'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/minBy.js b/node_modules/lodash/fp/minBy.js new file mode 100644 index 0000000..fdb9e24 --- /dev/null +++ b/node_modules/lodash/fp/minBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('minBy', require('../minBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mixin.js b/node_modules/lodash/fp/mixin.js new file mode 100644 index 0000000..332e6fb --- /dev/null +++ b/node_modules/lodash/fp/mixin.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mixin', require('../mixin')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/multiply.js b/node_modules/lodash/fp/multiply.js new file mode 100644 index 0000000..4dcf0b0 --- /dev/null +++ b/node_modules/lodash/fp/multiply.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('multiply', require('../multiply')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nAry.js b/node_modules/lodash/fp/nAry.js new file mode 100644 index 0000000..f262a76 --- /dev/null +++ b/node_modules/lodash/fp/nAry.js @@ -0,0 +1 @@ +module.exports = require('./ary'); diff --git a/node_modules/lodash/fp/negate.js b/node_modules/lodash/fp/negate.js new file mode 100644 index 0000000..8b6dc7c --- /dev/null +++ b/node_modules/lodash/fp/negate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('negate', require('../negate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/next.js b/node_modules/lodash/fp/next.js new file mode 100644 index 0000000..140155e --- /dev/null +++ b/node_modules/lodash/fp/next.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('next', require('../next'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/noop.js b/node_modules/lodash/fp/noop.js new file mode 100644 index 0000000..b9e32cc --- /dev/null +++ b/node_modules/lodash/fp/noop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('noop', require('../noop'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/now.js b/node_modules/lodash/fp/now.js new file mode 100644 index 0000000..6de2068 --- /dev/null +++ b/node_modules/lodash/fp/now.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('now', require('../now'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nth.js b/node_modules/lodash/fp/nth.js new file mode 100644 index 0000000..da4fda7 --- /dev/null +++ b/node_modules/lodash/fp/nth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nth', require('../nth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nthArg.js b/node_modules/lodash/fp/nthArg.js new file mode 100644 index 0000000..fce3165 --- /dev/null +++ b/node_modules/lodash/fp/nthArg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nthArg', require('../nthArg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/number.js b/node_modules/lodash/fp/number.js new file mode 100644 index 0000000..5c10b88 --- /dev/null +++ b/node_modules/lodash/fp/number.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../number')); diff --git a/node_modules/lodash/fp/object.js b/node_modules/lodash/fp/object.js new file mode 100644 index 0000000..ae39a13 --- /dev/null +++ b/node_modules/lodash/fp/object.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../object')); diff --git a/node_modules/lodash/fp/omit.js b/node_modules/lodash/fp/omit.js new file mode 100644 index 0000000..fd68529 --- /dev/null +++ b/node_modules/lodash/fp/omit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omit', require('../omit')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/omitAll.js b/node_modules/lodash/fp/omitAll.js new file mode 100644 index 0000000..144cf4b --- /dev/null +++ b/node_modules/lodash/fp/omitAll.js @@ -0,0 +1 @@ +module.exports = require('./omit'); diff --git a/node_modules/lodash/fp/omitBy.js b/node_modules/lodash/fp/omitBy.js new file mode 100644 index 0000000..90df738 --- /dev/null +++ b/node_modules/lodash/fp/omitBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omitBy', require('../omitBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/once.js b/node_modules/lodash/fp/once.js new file mode 100644 index 0000000..f8f0a5c --- /dev/null +++ b/node_modules/lodash/fp/once.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('once', require('../once'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/orderBy.js b/node_modules/lodash/fp/orderBy.js new file mode 100644 index 0000000..848e210 --- /dev/null +++ b/node_modules/lodash/fp/orderBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('orderBy', require('../orderBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/over.js b/node_modules/lodash/fp/over.js new file mode 100644 index 0000000..01eba7b --- /dev/null +++ b/node_modules/lodash/fp/over.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('over', require('../over')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overArgs.js b/node_modules/lodash/fp/overArgs.js new file mode 100644 index 0000000..738556f --- /dev/null +++ b/node_modules/lodash/fp/overArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overArgs', require('../overArgs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overEvery.js b/node_modules/lodash/fp/overEvery.js new file mode 100644 index 0000000..9f5a032 --- /dev/null +++ b/node_modules/lodash/fp/overEvery.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overEvery', require('../overEvery')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overSome.js b/node_modules/lodash/fp/overSome.js new file mode 100644 index 0000000..15939d5 --- /dev/null +++ b/node_modules/lodash/fp/overSome.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overSome', require('../overSome')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pad.js b/node_modules/lodash/fp/pad.js new file mode 100644 index 0000000..f1dea4a --- /dev/null +++ b/node_modules/lodash/fp/pad.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pad', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padChars.js b/node_modules/lodash/fp/padChars.js new file mode 100644 index 0000000..d6e0804 --- /dev/null +++ b/node_modules/lodash/fp/padChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padChars', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padCharsEnd.js b/node_modules/lodash/fp/padCharsEnd.js new file mode 100644 index 0000000..d4ab79a --- /dev/null +++ b/node_modules/lodash/fp/padCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padCharsStart.js b/node_modules/lodash/fp/padCharsStart.js new file mode 100644 index 0000000..a08a300 --- /dev/null +++ b/node_modules/lodash/fp/padCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padEnd.js b/node_modules/lodash/fp/padEnd.js new file mode 100644 index 0000000..a8522ec --- /dev/null +++ b/node_modules/lodash/fp/padEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padStart.js b/node_modules/lodash/fp/padStart.js new file mode 100644 index 0000000..f4ca79d --- /dev/null +++ b/node_modules/lodash/fp/padStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/parseInt.js b/node_modules/lodash/fp/parseInt.js new file mode 100644 index 0000000..27314cc --- /dev/null +++ b/node_modules/lodash/fp/parseInt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('parseInt', require('../parseInt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partial.js b/node_modules/lodash/fp/partial.js new file mode 100644 index 0000000..5d46015 --- /dev/null +++ b/node_modules/lodash/fp/partial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partial', require('../partial')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partialRight.js b/node_modules/lodash/fp/partialRight.js new file mode 100644 index 0000000..7f05fed --- /dev/null +++ b/node_modules/lodash/fp/partialRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partialRight', require('../partialRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partition.js b/node_modules/lodash/fp/partition.js new file mode 100644 index 0000000..2ebcacc --- /dev/null +++ b/node_modules/lodash/fp/partition.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partition', require('../partition')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/path.js b/node_modules/lodash/fp/path.js new file mode 100644 index 0000000..b29cfb2 --- /dev/null +++ b/node_modules/lodash/fp/path.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/pathEq.js b/node_modules/lodash/fp/pathEq.js new file mode 100644 index 0000000..36c027a --- /dev/null +++ b/node_modules/lodash/fp/pathEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/node_modules/lodash/fp/pathOr.js b/node_modules/lodash/fp/pathOr.js new file mode 100644 index 0000000..4ab5820 --- /dev/null +++ b/node_modules/lodash/fp/pathOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/node_modules/lodash/fp/paths.js b/node_modules/lodash/fp/paths.js new file mode 100644 index 0000000..1eb7950 --- /dev/null +++ b/node_modules/lodash/fp/paths.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/node_modules/lodash/fp/pick.js b/node_modules/lodash/fp/pick.js new file mode 100644 index 0000000..197393d --- /dev/null +++ b/node_modules/lodash/fp/pick.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pick', require('../pick')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pickAll.js b/node_modules/lodash/fp/pickAll.js new file mode 100644 index 0000000..a8ecd46 --- /dev/null +++ b/node_modules/lodash/fp/pickAll.js @@ -0,0 +1 @@ +module.exports = require('./pick'); diff --git a/node_modules/lodash/fp/pickBy.js b/node_modules/lodash/fp/pickBy.js new file mode 100644 index 0000000..d832d16 --- /dev/null +++ b/node_modules/lodash/fp/pickBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pickBy', require('../pickBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pipe.js b/node_modules/lodash/fp/pipe.js new file mode 100644 index 0000000..b2e1e2c --- /dev/null +++ b/node_modules/lodash/fp/pipe.js @@ -0,0 +1 @@ +module.exports = require('./flow'); diff --git a/node_modules/lodash/fp/placeholder.js b/node_modules/lodash/fp/placeholder.js new file mode 100644 index 0000000..1ce1739 --- /dev/null +++ b/node_modules/lodash/fp/placeholder.js @@ -0,0 +1,6 @@ +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; diff --git a/node_modules/lodash/fp/plant.js b/node_modules/lodash/fp/plant.js new file mode 100644 index 0000000..eca8f32 --- /dev/null +++ b/node_modules/lodash/fp/plant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('plant', require('../plant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pluck.js b/node_modules/lodash/fp/pluck.js new file mode 100644 index 0000000..0d1e1ab --- /dev/null +++ b/node_modules/lodash/fp/pluck.js @@ -0,0 +1 @@ +module.exports = require('./map'); diff --git a/node_modules/lodash/fp/prop.js b/node_modules/lodash/fp/prop.js new file mode 100644 index 0000000..b29cfb2 --- /dev/null +++ b/node_modules/lodash/fp/prop.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/propEq.js b/node_modules/lodash/fp/propEq.js new file mode 100644 index 0000000..36c027a --- /dev/null +++ b/node_modules/lodash/fp/propEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/node_modules/lodash/fp/propOr.js b/node_modules/lodash/fp/propOr.js new file mode 100644 index 0000000..4ab5820 --- /dev/null +++ b/node_modules/lodash/fp/propOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/node_modules/lodash/fp/property.js b/node_modules/lodash/fp/property.js new file mode 100644 index 0000000..b29cfb2 --- /dev/null +++ b/node_modules/lodash/fp/property.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/propertyOf.js b/node_modules/lodash/fp/propertyOf.js new file mode 100644 index 0000000..f6273ee --- /dev/null +++ b/node_modules/lodash/fp/propertyOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('propertyOf', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/props.js b/node_modules/lodash/fp/props.js new file mode 100644 index 0000000..1eb7950 --- /dev/null +++ b/node_modules/lodash/fp/props.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/node_modules/lodash/fp/pull.js b/node_modules/lodash/fp/pull.js new file mode 100644 index 0000000..8d7084f --- /dev/null +++ b/node_modules/lodash/fp/pull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pull', require('../pull')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAll.js b/node_modules/lodash/fp/pullAll.js new file mode 100644 index 0000000..98d5c9a --- /dev/null +++ b/node_modules/lodash/fp/pullAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAll', require('../pullAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAllBy.js b/node_modules/lodash/fp/pullAllBy.js new file mode 100644 index 0000000..876bc3b --- /dev/null +++ b/node_modules/lodash/fp/pullAllBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllBy', require('../pullAllBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAllWith.js b/node_modules/lodash/fp/pullAllWith.js new file mode 100644 index 0000000..f71ba4d --- /dev/null +++ b/node_modules/lodash/fp/pullAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllWith', require('../pullAllWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAt.js b/node_modules/lodash/fp/pullAt.js new file mode 100644 index 0000000..e8b3bb6 --- /dev/null +++ b/node_modules/lodash/fp/pullAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAt', require('../pullAt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/random.js b/node_modules/lodash/fp/random.js new file mode 100644 index 0000000..99d852e --- /dev/null +++ b/node_modules/lodash/fp/random.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('random', require('../random')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/range.js b/node_modules/lodash/fp/range.js new file mode 100644 index 0000000..a6bb591 --- /dev/null +++ b/node_modules/lodash/fp/range.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('range', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeRight.js b/node_modules/lodash/fp/rangeRight.js new file mode 100644 index 0000000..fdb712f --- /dev/null +++ b/node_modules/lodash/fp/rangeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeStep.js b/node_modules/lodash/fp/rangeStep.js new file mode 100644 index 0000000..d72dfc2 --- /dev/null +++ b/node_modules/lodash/fp/rangeStep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStep', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeStepRight.js b/node_modules/lodash/fp/rangeStepRight.js new file mode 100644 index 0000000..8b2a67b --- /dev/null +++ b/node_modules/lodash/fp/rangeStepRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStepRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rearg.js b/node_modules/lodash/fp/rearg.js new file mode 100644 index 0000000..678e02a --- /dev/null +++ b/node_modules/lodash/fp/rearg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rearg', require('../rearg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reduce.js b/node_modules/lodash/fp/reduce.js new file mode 100644 index 0000000..4cef0a0 --- /dev/null +++ b/node_modules/lodash/fp/reduce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduce', require('../reduce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reduceRight.js b/node_modules/lodash/fp/reduceRight.js new file mode 100644 index 0000000..caf5bb5 --- /dev/null +++ b/node_modules/lodash/fp/reduceRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduceRight', require('../reduceRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reject.js b/node_modules/lodash/fp/reject.js new file mode 100644 index 0000000..c163273 --- /dev/null +++ b/node_modules/lodash/fp/reject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reject', require('../reject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/remove.js b/node_modules/lodash/fp/remove.js new file mode 100644 index 0000000..e9d1327 --- /dev/null +++ b/node_modules/lodash/fp/remove.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('remove', require('../remove')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/repeat.js b/node_modules/lodash/fp/repeat.js new file mode 100644 index 0000000..08470f2 --- /dev/null +++ b/node_modules/lodash/fp/repeat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('repeat', require('../repeat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/replace.js b/node_modules/lodash/fp/replace.js new file mode 100644 index 0000000..2227db6 --- /dev/null +++ b/node_modules/lodash/fp/replace.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('replace', require('../replace')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rest.js b/node_modules/lodash/fp/rest.js new file mode 100644 index 0000000..c1f3d64 --- /dev/null +++ b/node_modules/lodash/fp/rest.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rest', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/restFrom.js b/node_modules/lodash/fp/restFrom.js new file mode 100644 index 0000000..714e42b --- /dev/null +++ b/node_modules/lodash/fp/restFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('restFrom', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/result.js b/node_modules/lodash/fp/result.js new file mode 100644 index 0000000..f86ce07 --- /dev/null +++ b/node_modules/lodash/fp/result.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('result', require('../result')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reverse.js b/node_modules/lodash/fp/reverse.js new file mode 100644 index 0000000..07c9f5e --- /dev/null +++ b/node_modules/lodash/fp/reverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reverse', require('../reverse')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/round.js b/node_modules/lodash/fp/round.js new file mode 100644 index 0000000..4c0e5c8 --- /dev/null +++ b/node_modules/lodash/fp/round.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('round', require('../round')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sample.js b/node_modules/lodash/fp/sample.js new file mode 100644 index 0000000..6bea125 --- /dev/null +++ b/node_modules/lodash/fp/sample.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sample', require('../sample'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sampleSize.js b/node_modules/lodash/fp/sampleSize.js new file mode 100644 index 0000000..359ed6f --- /dev/null +++ b/node_modules/lodash/fp/sampleSize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sampleSize', require('../sampleSize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/seq.js b/node_modules/lodash/fp/seq.js new file mode 100644 index 0000000..d8f42b0 --- /dev/null +++ b/node_modules/lodash/fp/seq.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../seq')); diff --git a/node_modules/lodash/fp/set.js b/node_modules/lodash/fp/set.js new file mode 100644 index 0000000..0b56a56 --- /dev/null +++ b/node_modules/lodash/fp/set.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('set', require('../set')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/setWith.js b/node_modules/lodash/fp/setWith.js new file mode 100644 index 0000000..0b58495 --- /dev/null +++ b/node_modules/lodash/fp/setWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('setWith', require('../setWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/shuffle.js b/node_modules/lodash/fp/shuffle.js new file mode 100644 index 0000000..aa3a1ca --- /dev/null +++ b/node_modules/lodash/fp/shuffle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/size.js b/node_modules/lodash/fp/size.js new file mode 100644 index 0000000..7490136 --- /dev/null +++ b/node_modules/lodash/fp/size.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('size', require('../size'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/slice.js b/node_modules/lodash/fp/slice.js new file mode 100644 index 0000000..15945d3 --- /dev/null +++ b/node_modules/lodash/fp/slice.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('slice', require('../slice')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/snakeCase.js b/node_modules/lodash/fp/snakeCase.js new file mode 100644 index 0000000..a0ff780 --- /dev/null +++ b/node_modules/lodash/fp/snakeCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/some.js b/node_modules/lodash/fp/some.js new file mode 100644 index 0000000..a4fa2d0 --- /dev/null +++ b/node_modules/lodash/fp/some.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('some', require('../some')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortBy.js b/node_modules/lodash/fp/sortBy.js new file mode 100644 index 0000000..e0790ad --- /dev/null +++ b/node_modules/lodash/fp/sortBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortBy', require('../sortBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndex.js b/node_modules/lodash/fp/sortedIndex.js new file mode 100644 index 0000000..364a054 --- /dev/null +++ b/node_modules/lodash/fp/sortedIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndex', require('../sortedIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndexBy.js b/node_modules/lodash/fp/sortedIndexBy.js new file mode 100644 index 0000000..9593dbd --- /dev/null +++ b/node_modules/lodash/fp/sortedIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexBy', require('../sortedIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndexOf.js b/node_modules/lodash/fp/sortedIndexOf.js new file mode 100644 index 0000000..c9084ca --- /dev/null +++ b/node_modules/lodash/fp/sortedIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexOf', require('../sortedIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndex.js b/node_modules/lodash/fp/sortedLastIndex.js new file mode 100644 index 0000000..47fe241 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndex', require('../sortedLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndexBy.js b/node_modules/lodash/fp/sortedLastIndexBy.js new file mode 100644 index 0000000..0f9a347 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndexOf.js b/node_modules/lodash/fp/sortedLastIndexOf.js new file mode 100644 index 0000000..0d4d932 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedUniq.js b/node_modules/lodash/fp/sortedUniq.js new file mode 100644 index 0000000..882d283 --- /dev/null +++ b/node_modules/lodash/fp/sortedUniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedUniqBy.js b/node_modules/lodash/fp/sortedUniqBy.js new file mode 100644 index 0000000..033db91 --- /dev/null +++ b/node_modules/lodash/fp/sortedUniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniqBy', require('../sortedUniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/split.js b/node_modules/lodash/fp/split.js new file mode 100644 index 0000000..14de1a7 --- /dev/null +++ b/node_modules/lodash/fp/split.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('split', require('../split')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/spread.js b/node_modules/lodash/fp/spread.js new file mode 100644 index 0000000..2d11b70 --- /dev/null +++ b/node_modules/lodash/fp/spread.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spread', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/spreadFrom.js b/node_modules/lodash/fp/spreadFrom.js new file mode 100644 index 0000000..0b630df --- /dev/null +++ b/node_modules/lodash/fp/spreadFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spreadFrom', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/startCase.js b/node_modules/lodash/fp/startCase.js new file mode 100644 index 0000000..ada98c9 --- /dev/null +++ b/node_modules/lodash/fp/startCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startCase', require('../startCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/startsWith.js b/node_modules/lodash/fp/startsWith.js new file mode 100644 index 0000000..985e2f2 --- /dev/null +++ b/node_modules/lodash/fp/startsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startsWith', require('../startsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/string.js b/node_modules/lodash/fp/string.js new file mode 100644 index 0000000..773b037 --- /dev/null +++ b/node_modules/lodash/fp/string.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../string')); diff --git a/node_modules/lodash/fp/stubArray.js b/node_modules/lodash/fp/stubArray.js new file mode 100644 index 0000000..cd604cb --- /dev/null +++ b/node_modules/lodash/fp/stubArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubArray', require('../stubArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubFalse.js b/node_modules/lodash/fp/stubFalse.js new file mode 100644 index 0000000..3296664 --- /dev/null +++ b/node_modules/lodash/fp/stubFalse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubFalse', require('../stubFalse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubObject.js b/node_modules/lodash/fp/stubObject.js new file mode 100644 index 0000000..c6c8ec4 --- /dev/null +++ b/node_modules/lodash/fp/stubObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubObject', require('../stubObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubString.js b/node_modules/lodash/fp/stubString.js new file mode 100644 index 0000000..701051e --- /dev/null +++ b/node_modules/lodash/fp/stubString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubString', require('../stubString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubTrue.js b/node_modules/lodash/fp/stubTrue.js new file mode 100644 index 0000000..9249082 --- /dev/null +++ b/node_modules/lodash/fp/stubTrue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/subtract.js b/node_modules/lodash/fp/subtract.js new file mode 100644 index 0000000..d32b16d --- /dev/null +++ b/node_modules/lodash/fp/subtract.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('subtract', require('../subtract')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sum.js b/node_modules/lodash/fp/sum.js new file mode 100644 index 0000000..5cce12b --- /dev/null +++ b/node_modules/lodash/fp/sum.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sum', require('../sum'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sumBy.js b/node_modules/lodash/fp/sumBy.js new file mode 100644 index 0000000..c882656 --- /dev/null +++ b/node_modules/lodash/fp/sumBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sumBy', require('../sumBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/symmetricDifference.js b/node_modules/lodash/fp/symmetricDifference.js new file mode 100644 index 0000000..78c16ad --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifference.js @@ -0,0 +1 @@ +module.exports = require('./xor'); diff --git a/node_modules/lodash/fp/symmetricDifferenceBy.js b/node_modules/lodash/fp/symmetricDifferenceBy.js new file mode 100644 index 0000000..298fc7f --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifferenceBy.js @@ -0,0 +1 @@ +module.exports = require('./xorBy'); diff --git a/node_modules/lodash/fp/symmetricDifferenceWith.js b/node_modules/lodash/fp/symmetricDifferenceWith.js new file mode 100644 index 0000000..70bc6fa --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifferenceWith.js @@ -0,0 +1 @@ +module.exports = require('./xorWith'); diff --git a/node_modules/lodash/fp/tail.js b/node_modules/lodash/fp/tail.js new file mode 100644 index 0000000..f122f0a --- /dev/null +++ b/node_modules/lodash/fp/tail.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tail', require('../tail'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/take.js b/node_modules/lodash/fp/take.js new file mode 100644 index 0000000..9af98a7 --- /dev/null +++ b/node_modules/lodash/fp/take.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('take', require('../take')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeLast.js b/node_modules/lodash/fp/takeLast.js new file mode 100644 index 0000000..e98c84a --- /dev/null +++ b/node_modules/lodash/fp/takeLast.js @@ -0,0 +1 @@ +module.exports = require('./takeRight'); diff --git a/node_modules/lodash/fp/takeLastWhile.js b/node_modules/lodash/fp/takeLastWhile.js new file mode 100644 index 0000000..5367968 --- /dev/null +++ b/node_modules/lodash/fp/takeLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./takeRightWhile'); diff --git a/node_modules/lodash/fp/takeRight.js b/node_modules/lodash/fp/takeRight.js new file mode 100644 index 0000000..b82950a --- /dev/null +++ b/node_modules/lodash/fp/takeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRight', require('../takeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeRightWhile.js b/node_modules/lodash/fp/takeRightWhile.js new file mode 100644 index 0000000..8ffb0a2 --- /dev/null +++ b/node_modules/lodash/fp/takeRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRightWhile', require('../takeRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeWhile.js b/node_modules/lodash/fp/takeWhile.js new file mode 100644 index 0000000..2813664 --- /dev/null +++ b/node_modules/lodash/fp/takeWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeWhile', require('../takeWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/tap.js b/node_modules/lodash/fp/tap.js new file mode 100644 index 0000000..d33ad6e --- /dev/null +++ b/node_modules/lodash/fp/tap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tap', require('../tap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/template.js b/node_modules/lodash/fp/template.js new file mode 100644 index 0000000..74857e1 --- /dev/null +++ b/node_modules/lodash/fp/template.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('template', require('../template')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/templateSettings.js b/node_modules/lodash/fp/templateSettings.js new file mode 100644 index 0000000..7bcc0a8 --- /dev/null +++ b/node_modules/lodash/fp/templateSettings.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/throttle.js b/node_modules/lodash/fp/throttle.js new file mode 100644 index 0000000..77fff14 --- /dev/null +++ b/node_modules/lodash/fp/throttle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('throttle', require('../throttle')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/thru.js b/node_modules/lodash/fp/thru.js new file mode 100644 index 0000000..d42b3b1 --- /dev/null +++ b/node_modules/lodash/fp/thru.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('thru', require('../thru')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/times.js b/node_modules/lodash/fp/times.js new file mode 100644 index 0000000..0dab06d --- /dev/null +++ b/node_modules/lodash/fp/times.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('times', require('../times')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toArray.js b/node_modules/lodash/fp/toArray.js new file mode 100644 index 0000000..f0c360a --- /dev/null +++ b/node_modules/lodash/fp/toArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toArray', require('../toArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toFinite.js b/node_modules/lodash/fp/toFinite.js new file mode 100644 index 0000000..3a47687 --- /dev/null +++ b/node_modules/lodash/fp/toFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toFinite', require('../toFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toInteger.js b/node_modules/lodash/fp/toInteger.js new file mode 100644 index 0000000..e0af6a7 --- /dev/null +++ b/node_modules/lodash/fp/toInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toIterator.js b/node_modules/lodash/fp/toIterator.js new file mode 100644 index 0000000..65e6baa --- /dev/null +++ b/node_modules/lodash/fp/toIterator.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toJSON.js b/node_modules/lodash/fp/toJSON.js new file mode 100644 index 0000000..2d718d0 --- /dev/null +++ b/node_modules/lodash/fp/toJSON.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toLength.js b/node_modules/lodash/fp/toLength.js new file mode 100644 index 0000000..b97cdd9 --- /dev/null +++ b/node_modules/lodash/fp/toLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLength', require('../toLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toLower.js b/node_modules/lodash/fp/toLower.js new file mode 100644 index 0000000..616ef36 --- /dev/null +++ b/node_modules/lodash/fp/toLower.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLower', require('../toLower'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toNumber.js b/node_modules/lodash/fp/toNumber.js new file mode 100644 index 0000000..d0c6f4d --- /dev/null +++ b/node_modules/lodash/fp/toNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPairs.js b/node_modules/lodash/fp/toPairs.js new file mode 100644 index 0000000..af78378 --- /dev/null +++ b/node_modules/lodash/fp/toPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPairsIn.js b/node_modules/lodash/fp/toPairsIn.js new file mode 100644 index 0000000..66504ab --- /dev/null +++ b/node_modules/lodash/fp/toPairsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPath.js b/node_modules/lodash/fp/toPath.js new file mode 100644 index 0000000..b4d5e50 --- /dev/null +++ b/node_modules/lodash/fp/toPath.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPath', require('../toPath'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPlainObject.js b/node_modules/lodash/fp/toPlainObject.js new file mode 100644 index 0000000..278bb86 --- /dev/null +++ b/node_modules/lodash/fp/toPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toSafeInteger.js b/node_modules/lodash/fp/toSafeInteger.js new file mode 100644 index 0000000..367a26f --- /dev/null +++ b/node_modules/lodash/fp/toSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toString.js b/node_modules/lodash/fp/toString.js new file mode 100644 index 0000000..cec4f8e --- /dev/null +++ b/node_modules/lodash/fp/toString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toString', require('../toString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toUpper.js b/node_modules/lodash/fp/toUpper.js new file mode 100644 index 0000000..54f9a56 --- /dev/null +++ b/node_modules/lodash/fp/toUpper.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/transform.js b/node_modules/lodash/fp/transform.js new file mode 100644 index 0000000..759d088 --- /dev/null +++ b/node_modules/lodash/fp/transform.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('transform', require('../transform')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trim.js b/node_modules/lodash/fp/trim.js new file mode 100644 index 0000000..e6319a7 --- /dev/null +++ b/node_modules/lodash/fp/trim.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trim', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimChars.js b/node_modules/lodash/fp/trimChars.js new file mode 100644 index 0000000..c9294de --- /dev/null +++ b/node_modules/lodash/fp/trimChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimChars', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimCharsEnd.js b/node_modules/lodash/fp/trimCharsEnd.js new file mode 100644 index 0000000..284bc2f --- /dev/null +++ b/node_modules/lodash/fp/trimCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimCharsStart.js b/node_modules/lodash/fp/trimCharsStart.js new file mode 100644 index 0000000..ff0ee65 --- /dev/null +++ b/node_modules/lodash/fp/trimCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimEnd.js b/node_modules/lodash/fp/trimEnd.js new file mode 100644 index 0000000..7190880 --- /dev/null +++ b/node_modules/lodash/fp/trimEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimStart.js b/node_modules/lodash/fp/trimStart.js new file mode 100644 index 0000000..fda902c --- /dev/null +++ b/node_modules/lodash/fp/trimStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/truncate.js b/node_modules/lodash/fp/truncate.js new file mode 100644 index 0000000..d265c1d --- /dev/null +++ b/node_modules/lodash/fp/truncate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('truncate', require('../truncate')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unapply.js b/node_modules/lodash/fp/unapply.js new file mode 100644 index 0000000..c5dfe77 --- /dev/null +++ b/node_modules/lodash/fp/unapply.js @@ -0,0 +1 @@ +module.exports = require('./rest'); diff --git a/node_modules/lodash/fp/unary.js b/node_modules/lodash/fp/unary.js new file mode 100644 index 0000000..286c945 --- /dev/null +++ b/node_modules/lodash/fp/unary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unary', require('../unary'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unescape.js b/node_modules/lodash/fp/unescape.js new file mode 100644 index 0000000..fddcb46 --- /dev/null +++ b/node_modules/lodash/fp/unescape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unescape', require('../unescape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/union.js b/node_modules/lodash/fp/union.js new file mode 100644 index 0000000..ef8228d --- /dev/null +++ b/node_modules/lodash/fp/union.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('union', require('../union')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unionBy.js b/node_modules/lodash/fp/unionBy.js new file mode 100644 index 0000000..603687a --- /dev/null +++ b/node_modules/lodash/fp/unionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionBy', require('../unionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unionWith.js b/node_modules/lodash/fp/unionWith.js new file mode 100644 index 0000000..65bb3a7 --- /dev/null +++ b/node_modules/lodash/fp/unionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionWith', require('../unionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniq.js b/node_modules/lodash/fp/uniq.js new file mode 100644 index 0000000..bc18524 --- /dev/null +++ b/node_modules/lodash/fp/uniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniq', require('../uniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqBy.js b/node_modules/lodash/fp/uniqBy.js new file mode 100644 index 0000000..634c6a8 --- /dev/null +++ b/node_modules/lodash/fp/uniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqBy', require('../uniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqWith.js b/node_modules/lodash/fp/uniqWith.js new file mode 100644 index 0000000..0ec601a --- /dev/null +++ b/node_modules/lodash/fp/uniqWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqWith', require('../uniqWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqueId.js b/node_modules/lodash/fp/uniqueId.js new file mode 100644 index 0000000..aa8fc2f --- /dev/null +++ b/node_modules/lodash/fp/uniqueId.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqueId', require('../uniqueId')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unnest.js b/node_modules/lodash/fp/unnest.js new file mode 100644 index 0000000..5d34060 --- /dev/null +++ b/node_modules/lodash/fp/unnest.js @@ -0,0 +1 @@ +module.exports = require('./flatten'); diff --git a/node_modules/lodash/fp/unset.js b/node_modules/lodash/fp/unset.js new file mode 100644 index 0000000..ea203a0 --- /dev/null +++ b/node_modules/lodash/fp/unset.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unset', require('../unset')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unzip.js b/node_modules/lodash/fp/unzip.js new file mode 100644 index 0000000..cc364b3 --- /dev/null +++ b/node_modules/lodash/fp/unzip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzip', require('../unzip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unzipWith.js b/node_modules/lodash/fp/unzipWith.js new file mode 100644 index 0000000..182eaa1 --- /dev/null +++ b/node_modules/lodash/fp/unzipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzipWith', require('../unzipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/update.js b/node_modules/lodash/fp/update.js new file mode 100644 index 0000000..b8ce2cc --- /dev/null +++ b/node_modules/lodash/fp/update.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('update', require('../update')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/updateWith.js b/node_modules/lodash/fp/updateWith.js new file mode 100644 index 0000000..d5e8282 --- /dev/null +++ b/node_modules/lodash/fp/updateWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('updateWith', require('../updateWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/upperCase.js b/node_modules/lodash/fp/upperCase.js new file mode 100644 index 0000000..c886f20 --- /dev/null +++ b/node_modules/lodash/fp/upperCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/upperFirst.js b/node_modules/lodash/fp/upperFirst.js new file mode 100644 index 0000000..d8c04df --- /dev/null +++ b/node_modules/lodash/fp/upperFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/useWith.js b/node_modules/lodash/fp/useWith.js new file mode 100644 index 0000000..d8b3df5 --- /dev/null +++ b/node_modules/lodash/fp/useWith.js @@ -0,0 +1 @@ +module.exports = require('./overArgs'); diff --git a/node_modules/lodash/fp/util.js b/node_modules/lodash/fp/util.js new file mode 100644 index 0000000..18c00ba --- /dev/null +++ b/node_modules/lodash/fp/util.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../util')); diff --git a/node_modules/lodash/fp/value.js b/node_modules/lodash/fp/value.js new file mode 100644 index 0000000..555eec7 --- /dev/null +++ b/node_modules/lodash/fp/value.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('value', require('../value'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/valueOf.js b/node_modules/lodash/fp/valueOf.js new file mode 100644 index 0000000..f968807 --- /dev/null +++ b/node_modules/lodash/fp/valueOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/values.js b/node_modules/lodash/fp/values.js new file mode 100644 index 0000000..2dfc561 --- /dev/null +++ b/node_modules/lodash/fp/values.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('values', require('../values'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/valuesIn.js b/node_modules/lodash/fp/valuesIn.js new file mode 100644 index 0000000..a1b2bb8 --- /dev/null +++ b/node_modules/lodash/fp/valuesIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/where.js b/node_modules/lodash/fp/where.js new file mode 100644 index 0000000..3247f64 --- /dev/null +++ b/node_modules/lodash/fp/where.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/node_modules/lodash/fp/whereEq.js b/node_modules/lodash/fp/whereEq.js new file mode 100644 index 0000000..29d1e1e --- /dev/null +++ b/node_modules/lodash/fp/whereEq.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/node_modules/lodash/fp/without.js b/node_modules/lodash/fp/without.js new file mode 100644 index 0000000..bad9e12 --- /dev/null +++ b/node_modules/lodash/fp/without.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('without', require('../without')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/words.js b/node_modules/lodash/fp/words.js new file mode 100644 index 0000000..4a90141 --- /dev/null +++ b/node_modules/lodash/fp/words.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('words', require('../words')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrap.js b/node_modules/lodash/fp/wrap.js new file mode 100644 index 0000000..e93bd8a --- /dev/null +++ b/node_modules/lodash/fp/wrap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrap', require('../wrap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperAt.js b/node_modules/lodash/fp/wrapperAt.js new file mode 100644 index 0000000..8f0a310 --- /dev/null +++ b/node_modules/lodash/fp/wrapperAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperChain.js b/node_modules/lodash/fp/wrapperChain.js new file mode 100644 index 0000000..2a48ea2 --- /dev/null +++ b/node_modules/lodash/fp/wrapperChain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperLodash.js b/node_modules/lodash/fp/wrapperLodash.js new file mode 100644 index 0000000..a7162d0 --- /dev/null +++ b/node_modules/lodash/fp/wrapperLodash.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperReverse.js b/node_modules/lodash/fp/wrapperReverse.js new file mode 100644 index 0000000..e1481aa --- /dev/null +++ b/node_modules/lodash/fp/wrapperReverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperValue.js b/node_modules/lodash/fp/wrapperValue.js new file mode 100644 index 0000000..8eb9112 --- /dev/null +++ b/node_modules/lodash/fp/wrapperValue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xor.js b/node_modules/lodash/fp/xor.js new file mode 100644 index 0000000..29e2819 --- /dev/null +++ b/node_modules/lodash/fp/xor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xor', require('../xor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xorBy.js b/node_modules/lodash/fp/xorBy.js new file mode 100644 index 0000000..b355686 --- /dev/null +++ b/node_modules/lodash/fp/xorBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorBy', require('../xorBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xorWith.js b/node_modules/lodash/fp/xorWith.js new file mode 100644 index 0000000..8e05739 --- /dev/null +++ b/node_modules/lodash/fp/xorWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorWith', require('../xorWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zip.js b/node_modules/lodash/fp/zip.js new file mode 100644 index 0000000..69e147a --- /dev/null +++ b/node_modules/lodash/fp/zip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zip', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipAll.js b/node_modules/lodash/fp/zipAll.js new file mode 100644 index 0000000..efa8ccb --- /dev/null +++ b/node_modules/lodash/fp/zipAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipAll', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipObj.js b/node_modules/lodash/fp/zipObj.js new file mode 100644 index 0000000..f4a3453 --- /dev/null +++ b/node_modules/lodash/fp/zipObj.js @@ -0,0 +1 @@ +module.exports = require('./zipObject'); diff --git a/node_modules/lodash/fp/zipObject.js b/node_modules/lodash/fp/zipObject.js new file mode 100644 index 0000000..462dbb6 --- /dev/null +++ b/node_modules/lodash/fp/zipObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObject', require('../zipObject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipObjectDeep.js b/node_modules/lodash/fp/zipObjectDeep.js new file mode 100644 index 0000000..53a5d33 --- /dev/null +++ b/node_modules/lodash/fp/zipObjectDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObjectDeep', require('../zipObjectDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipWith.js b/node_modules/lodash/fp/zipWith.js new file mode 100644 index 0000000..c5cf9e2 --- /dev/null +++ b/node_modules/lodash/fp/zipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipWith', require('../zipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fromPairs.js b/node_modules/lodash/fromPairs.js new file mode 100644 index 0000000..ee7940d --- /dev/null +++ b/node_modules/lodash/fromPairs.js @@ -0,0 +1,28 @@ +/** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ +function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; +} + +module.exports = fromPairs; diff --git a/node_modules/lodash/function.js b/node_modules/lodash/function.js new file mode 100644 index 0000000..b0fc6d9 --- /dev/null +++ b/node_modules/lodash/function.js @@ -0,0 +1,25 @@ +module.exports = { + 'after': require('./after'), + 'ary': require('./ary'), + 'before': require('./before'), + 'bind': require('./bind'), + 'bindKey': require('./bindKey'), + 'curry': require('./curry'), + 'curryRight': require('./curryRight'), + 'debounce': require('./debounce'), + 'defer': require('./defer'), + 'delay': require('./delay'), + 'flip': require('./flip'), + 'memoize': require('./memoize'), + 'negate': require('./negate'), + 'once': require('./once'), + 'overArgs': require('./overArgs'), + 'partial': require('./partial'), + 'partialRight': require('./partialRight'), + 'rearg': require('./rearg'), + 'rest': require('./rest'), + 'spread': require('./spread'), + 'throttle': require('./throttle'), + 'unary': require('./unary'), + 'wrap': require('./wrap') +}; diff --git a/node_modules/lodash/functions.js b/node_modules/lodash/functions.js new file mode 100644 index 0000000..9722928 --- /dev/null +++ b/node_modules/lodash/functions.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keys = require('./keys'); + +/** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ +function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); +} + +module.exports = functions; diff --git a/node_modules/lodash/functionsIn.js b/node_modules/lodash/functionsIn.js new file mode 100644 index 0000000..f00345d --- /dev/null +++ b/node_modules/lodash/functionsIn.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keysIn = require('./keysIn'); + +/** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ +function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); +} + +module.exports = functionsIn; diff --git a/node_modules/lodash/get.js b/node_modules/lodash/get.js new file mode 100644 index 0000000..8805ff9 --- /dev/null +++ b/node_modules/lodash/get.js @@ -0,0 +1,33 @@ +var baseGet = require('./_baseGet'); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; diff --git a/node_modules/lodash/groupBy.js b/node_modules/lodash/groupBy.js new file mode 100644 index 0000000..babf4f6 --- /dev/null +++ b/node_modules/lodash/groupBy.js @@ -0,0 +1,41 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } +}); + +module.exports = groupBy; diff --git a/node_modules/lodash/gt.js b/node_modules/lodash/gt.js new file mode 100644 index 0000000..3a66282 --- /dev/null +++ b/node_modules/lodash/gt.js @@ -0,0 +1,29 @@ +var baseGt = require('./_baseGt'), + createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ +var gt = createRelationalOperation(baseGt); + +module.exports = gt; diff --git a/node_modules/lodash/gte.js b/node_modules/lodash/gte.js new file mode 100644 index 0000000..4180a68 --- /dev/null +++ b/node_modules/lodash/gte.js @@ -0,0 +1,30 @@ +var createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ +var gte = createRelationalOperation(function(value, other) { + return value >= other; +}); + +module.exports = gte; diff --git a/node_modules/lodash/has.js b/node_modules/lodash/has.js new file mode 100644 index 0000000..34df55e --- /dev/null +++ b/node_modules/lodash/has.js @@ -0,0 +1,35 @@ +var baseHas = require('./_baseHas'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ +function has(object, path) { + return object != null && hasPath(object, path, baseHas); +} + +module.exports = has; diff --git a/node_modules/lodash/hasIn.js b/node_modules/lodash/hasIn.js new file mode 100644 index 0000000..06a3686 --- /dev/null +++ b/node_modules/lodash/hasIn.js @@ -0,0 +1,34 @@ +var baseHasIn = require('./_baseHasIn'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; diff --git a/node_modules/lodash/head.js b/node_modules/lodash/head.js new file mode 100644 index 0000000..dee9d1f --- /dev/null +++ b/node_modules/lodash/head.js @@ -0,0 +1,23 @@ +/** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ +function head(array) { + return (array && array.length) ? array[0] : undefined; +} + +module.exports = head; diff --git a/node_modules/lodash/identity.js b/node_modules/lodash/identity.js new file mode 100644 index 0000000..2d5d963 --- /dev/null +++ b/node_modules/lodash/identity.js @@ -0,0 +1,21 @@ +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; diff --git a/node_modules/lodash/inRange.js b/node_modules/lodash/inRange.js new file mode 100644 index 0000000..f20728d --- /dev/null +++ b/node_modules/lodash/inRange.js @@ -0,0 +1,55 @@ +var baseInRange = require('./_baseInRange'), + toFinite = require('./toFinite'), + toNumber = require('./toNumber'); + +/** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ +function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); +} + +module.exports = inRange; diff --git a/node_modules/lodash/includes.js b/node_modules/lodash/includes.js new file mode 100644 index 0000000..ae0deed --- /dev/null +++ b/node_modules/lodash/includes.js @@ -0,0 +1,53 @@ +var baseIndexOf = require('./_baseIndexOf'), + isArrayLike = require('./isArrayLike'), + isString = require('./isString'), + toInteger = require('./toInteger'), + values = require('./values'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; diff --git a/node_modules/lodash/index.js b/node_modules/lodash/index.js new file mode 100644 index 0000000..5d063e2 --- /dev/null +++ b/node_modules/lodash/index.js @@ -0,0 +1 @@ +module.exports = require('./lodash'); \ No newline at end of file diff --git a/node_modules/lodash/indexOf.js b/node_modules/lodash/indexOf.js new file mode 100644 index 0000000..3c644af --- /dev/null +++ b/node_modules/lodash/indexOf.js @@ -0,0 +1,42 @@ +var baseIndexOf = require('./_baseIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ +function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); +} + +module.exports = indexOf; diff --git a/node_modules/lodash/initial.js b/node_modules/lodash/initial.js new file mode 100644 index 0000000..f47fc50 --- /dev/null +++ b/node_modules/lodash/initial.js @@ -0,0 +1,22 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; diff --git a/node_modules/lodash/intersection.js b/node_modules/lodash/intersection.js new file mode 100644 index 0000000..a94c135 --- /dev/null +++ b/node_modules/lodash/intersection.js @@ -0,0 +1,30 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; diff --git a/node_modules/lodash/intersectionBy.js b/node_modules/lodash/intersectionBy.js new file mode 100644 index 0000000..31461aa --- /dev/null +++ b/node_modules/lodash/intersectionBy.js @@ -0,0 +1,45 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ +var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = intersectionBy; diff --git a/node_modules/lodash/intersectionWith.js b/node_modules/lodash/intersectionWith.js new file mode 100644 index 0000000..63cabfa --- /dev/null +++ b/node_modules/lodash/intersectionWith.js @@ -0,0 +1,41 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ +var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; +}); + +module.exports = intersectionWith; diff --git a/node_modules/lodash/invert.js b/node_modules/lodash/invert.js new file mode 100644 index 0000000..8c47950 --- /dev/null +++ b/node_modules/lodash/invert.js @@ -0,0 +1,42 @@ +var constant = require('./constant'), + createInverter = require('./_createInverter'), + identity = require('./identity'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ +var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; +}, constant(identity)); + +module.exports = invert; diff --git a/node_modules/lodash/invertBy.js b/node_modules/lodash/invertBy.js new file mode 100644 index 0000000..3f4f7e5 --- /dev/null +++ b/node_modules/lodash/invertBy.js @@ -0,0 +1,56 @@ +var baseIteratee = require('./_baseIteratee'), + createInverter = require('./_createInverter'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ +var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } +}, baseIteratee); + +module.exports = invertBy; diff --git a/node_modules/lodash/invoke.js b/node_modules/lodash/invoke.js new file mode 100644 index 0000000..97d51eb --- /dev/null +++ b/node_modules/lodash/invoke.js @@ -0,0 +1,24 @@ +var baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'); + +/** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ +var invoke = baseRest(baseInvoke); + +module.exports = invoke; diff --git a/node_modules/lodash/invokeMap.js b/node_modules/lodash/invokeMap.js new file mode 100644 index 0000000..8da5126 --- /dev/null +++ b/node_modules/lodash/invokeMap.js @@ -0,0 +1,41 @@ +var apply = require('./_apply'), + baseEach = require('./_baseEach'), + baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'), + isArrayLike = require('./isArrayLike'); + +/** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ +var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; +}); + +module.exports = invokeMap; diff --git a/node_modules/lodash/isArguments.js b/node_modules/lodash/isArguments.js new file mode 100644 index 0000000..8b9ed66 --- /dev/null +++ b/node_modules/lodash/isArguments.js @@ -0,0 +1,36 @@ +var baseIsArguments = require('./_baseIsArguments'), + isObjectLike = require('./isObjectLike'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; diff --git a/node_modules/lodash/isArray.js b/node_modules/lodash/isArray.js new file mode 100644 index 0000000..88ab55f --- /dev/null +++ b/node_modules/lodash/isArray.js @@ -0,0 +1,26 @@ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; diff --git a/node_modules/lodash/isArrayBuffer.js b/node_modules/lodash/isArrayBuffer.js new file mode 100644 index 0000000..12904a6 --- /dev/null +++ b/node_modules/lodash/isArrayBuffer.js @@ -0,0 +1,27 @@ +var baseIsArrayBuffer = require('./_baseIsArrayBuffer'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; + +/** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ +var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + +module.exports = isArrayBuffer; diff --git a/node_modules/lodash/isArrayLike.js b/node_modules/lodash/isArrayLike.js new file mode 100644 index 0000000..0f96680 --- /dev/null +++ b/node_modules/lodash/isArrayLike.js @@ -0,0 +1,33 @@ +var isFunction = require('./isFunction'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; diff --git a/node_modules/lodash/isArrayLikeObject.js b/node_modules/lodash/isArrayLikeObject.js new file mode 100644 index 0000000..6c4812a --- /dev/null +++ b/node_modules/lodash/isArrayLikeObject.js @@ -0,0 +1,33 @@ +var isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; diff --git a/node_modules/lodash/isBoolean.js b/node_modules/lodash/isBoolean.js new file mode 100644 index 0000000..a43ed4b --- /dev/null +++ b/node_modules/lodash/isBoolean.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]'; + +/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ +function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); +} + +module.exports = isBoolean; diff --git a/node_modules/lodash/isBuffer.js b/node_modules/lodash/isBuffer.js new file mode 100644 index 0000000..c103cc7 --- /dev/null +++ b/node_modules/lodash/isBuffer.js @@ -0,0 +1,38 @@ +var root = require('./_root'), + stubFalse = require('./stubFalse'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; diff --git a/node_modules/lodash/isDate.js b/node_modules/lodash/isDate.js new file mode 100644 index 0000000..7f0209f --- /dev/null +++ b/node_modules/lodash/isDate.js @@ -0,0 +1,27 @@ +var baseIsDate = require('./_baseIsDate'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsDate = nodeUtil && nodeUtil.isDate; + +/** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ +var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + +module.exports = isDate; diff --git a/node_modules/lodash/isElement.js b/node_modules/lodash/isElement.js new file mode 100644 index 0000000..76ae29c --- /dev/null +++ b/node_modules/lodash/isElement.js @@ -0,0 +1,25 @@ +var isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ +function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); +} + +module.exports = isElement; diff --git a/node_modules/lodash/isEmpty.js b/node_modules/lodash/isEmpty.js new file mode 100644 index 0000000..3597294 --- /dev/null +++ b/node_modules/lodash/isEmpty.js @@ -0,0 +1,77 @@ +var baseKeys = require('./_baseKeys'), + getTag = require('./_getTag'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('./isArrayLike'), + isBuffer = require('./isBuffer'), + isPrototype = require('./_isPrototype'), + isTypedArray = require('./isTypedArray'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; diff --git a/node_modules/lodash/isEqual.js b/node_modules/lodash/isEqual.js new file mode 100644 index 0000000..5e23e76 --- /dev/null +++ b/node_modules/lodash/isEqual.js @@ -0,0 +1,35 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; diff --git a/node_modules/lodash/isEqualWith.js b/node_modules/lodash/isEqualWith.js new file mode 100644 index 0000000..21bdc7f --- /dev/null +++ b/node_modules/lodash/isEqualWith.js @@ -0,0 +1,41 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ +function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; +} + +module.exports = isEqualWith; diff --git a/node_modules/lodash/isError.js b/node_modules/lodash/isError.js new file mode 100644 index 0000000..b4f41e0 --- /dev/null +++ b/node_modules/lodash/isError.js @@ -0,0 +1,36 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** `Object#toString` result references. */ +var domExcTag = '[object DOMException]', + errorTag = '[object Error]'; + +/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); +} + +module.exports = isError; diff --git a/node_modules/lodash/isFinite.js b/node_modules/lodash/isFinite.js new file mode 100644 index 0000000..601842b --- /dev/null +++ b/node_modules/lodash/isFinite.js @@ -0,0 +1,36 @@ +var root = require('./_root'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; diff --git a/node_modules/lodash/isFunction.js b/node_modules/lodash/isFunction.js new file mode 100644 index 0000000..907a8cd --- /dev/null +++ b/node_modules/lodash/isFunction.js @@ -0,0 +1,37 @@ +var baseGetTag = require('./_baseGetTag'), + isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; diff --git a/node_modules/lodash/isInteger.js b/node_modules/lodash/isInteger.js new file mode 100644 index 0000000..66aa87d --- /dev/null +++ b/node_modules/lodash/isInteger.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'); + +/** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ +function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); +} + +module.exports = isInteger; diff --git a/node_modules/lodash/isLength.js b/node_modules/lodash/isLength.js new file mode 100644 index 0000000..3a95caa --- /dev/null +++ b/node_modules/lodash/isLength.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; diff --git a/node_modules/lodash/isMap.js b/node_modules/lodash/isMap.js new file mode 100644 index 0000000..44f8517 --- /dev/null +++ b/node_modules/lodash/isMap.js @@ -0,0 +1,27 @@ +var baseIsMap = require('./_baseIsMap'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; diff --git a/node_modules/lodash/isMatch.js b/node_modules/lodash/isMatch.js new file mode 100644 index 0000000..9773a18 --- /dev/null +++ b/node_modules/lodash/isMatch.js @@ -0,0 +1,36 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ +function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); +} + +module.exports = isMatch; diff --git a/node_modules/lodash/isMatchWith.js b/node_modules/lodash/isMatchWith.js new file mode 100644 index 0000000..187b6a6 --- /dev/null +++ b/node_modules/lodash/isMatchWith.js @@ -0,0 +1,41 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ +function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); +} + +module.exports = isMatchWith; diff --git a/node_modules/lodash/isNaN.js b/node_modules/lodash/isNaN.js new file mode 100644 index 0000000..7d0d783 --- /dev/null +++ b/node_modules/lodash/isNaN.js @@ -0,0 +1,38 @@ +var isNumber = require('./isNumber'); + +/** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ +function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; +} + +module.exports = isNaN; diff --git a/node_modules/lodash/isNative.js b/node_modules/lodash/isNative.js new file mode 100644 index 0000000..f0cb8d5 --- /dev/null +++ b/node_modules/lodash/isNative.js @@ -0,0 +1,40 @@ +var baseIsNative = require('./_baseIsNative'), + isMaskable = require('./_isMaskable'); + +/** Error message constants. */ +var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.'; + +/** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); +} + +module.exports = isNative; diff --git a/node_modules/lodash/isNil.js b/node_modules/lodash/isNil.js new file mode 100644 index 0000000..79f0505 --- /dev/null +++ b/node_modules/lodash/isNil.js @@ -0,0 +1,25 @@ +/** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ +function isNil(value) { + return value == null; +} + +module.exports = isNil; diff --git a/node_modules/lodash/isNull.js b/node_modules/lodash/isNull.js new file mode 100644 index 0000000..c0a374d --- /dev/null +++ b/node_modules/lodash/isNull.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; diff --git a/node_modules/lodash/isNumber.js b/node_modules/lodash/isNumber.js new file mode 100644 index 0000000..cd34ee4 --- /dev/null +++ b/node_modules/lodash/isNumber.js @@ -0,0 +1,38 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); +} + +module.exports = isNumber; diff --git a/node_modules/lodash/isObject.js b/node_modules/lodash/isObject.js new file mode 100644 index 0000000..1dc8939 --- /dev/null +++ b/node_modules/lodash/isObject.js @@ -0,0 +1,31 @@ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; diff --git a/node_modules/lodash/isObjectLike.js b/node_modules/lodash/isObjectLike.js new file mode 100644 index 0000000..301716b --- /dev/null +++ b/node_modules/lodash/isObjectLike.js @@ -0,0 +1,29 @@ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; diff --git a/node_modules/lodash/isPlainObject.js b/node_modules/lodash/isPlainObject.js new file mode 100644 index 0000000..2387373 --- /dev/null +++ b/node_modules/lodash/isPlainObject.js @@ -0,0 +1,62 @@ +var baseGetTag = require('./_baseGetTag'), + getPrototype = require('./_getPrototype'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; diff --git a/node_modules/lodash/isRegExp.js b/node_modules/lodash/isRegExp.js new file mode 100644 index 0000000..76c9b6e --- /dev/null +++ b/node_modules/lodash/isRegExp.js @@ -0,0 +1,27 @@ +var baseIsRegExp = require('./_baseIsRegExp'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; + +/** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ +var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + +module.exports = isRegExp; diff --git a/node_modules/lodash/isSafeInteger.js b/node_modules/lodash/isSafeInteger.js new file mode 100644 index 0000000..2a48526 --- /dev/null +++ b/node_modules/lodash/isSafeInteger.js @@ -0,0 +1,37 @@ +var isInteger = require('./isInteger'); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ +function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; +} + +module.exports = isSafeInteger; diff --git a/node_modules/lodash/isSet.js b/node_modules/lodash/isSet.js new file mode 100644 index 0000000..ab88bdf --- /dev/null +++ b/node_modules/lodash/isSet.js @@ -0,0 +1,27 @@ +var baseIsSet = require('./_baseIsSet'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; diff --git a/node_modules/lodash/isString.js b/node_modules/lodash/isString.js new file mode 100644 index 0000000..627eb9c --- /dev/null +++ b/node_modules/lodash/isString.js @@ -0,0 +1,30 @@ +var baseGetTag = require('./_baseGetTag'), + isArray = require('./isArray'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; diff --git a/node_modules/lodash/isSymbol.js b/node_modules/lodash/isSymbol.js new file mode 100644 index 0000000..dfb60b9 --- /dev/null +++ b/node_modules/lodash/isSymbol.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; diff --git a/node_modules/lodash/isTypedArray.js b/node_modules/lodash/isTypedArray.js new file mode 100644 index 0000000..da3f8dd --- /dev/null +++ b/node_modules/lodash/isTypedArray.js @@ -0,0 +1,27 @@ +var baseIsTypedArray = require('./_baseIsTypedArray'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; diff --git a/node_modules/lodash/isUndefined.js b/node_modules/lodash/isUndefined.js new file mode 100644 index 0000000..377d121 --- /dev/null +++ b/node_modules/lodash/isUndefined.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; diff --git a/node_modules/lodash/isWeakMap.js b/node_modules/lodash/isWeakMap.js new file mode 100644 index 0000000..8d36f66 --- /dev/null +++ b/node_modules/lodash/isWeakMap.js @@ -0,0 +1,28 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakMapTag = '[object WeakMap]'; + +/** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ +function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; +} + +module.exports = isWeakMap; diff --git a/node_modules/lodash/isWeakSet.js b/node_modules/lodash/isWeakSet.js new file mode 100644 index 0000000..e628b26 --- /dev/null +++ b/node_modules/lodash/isWeakSet.js @@ -0,0 +1,28 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakSetTag = '[object WeakSet]'; + +/** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ +function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; +} + +module.exports = isWeakSet; diff --git a/node_modules/lodash/iteratee.js b/node_modules/lodash/iteratee.js new file mode 100644 index 0000000..61b73a8 --- /dev/null +++ b/node_modules/lodash/iteratee.js @@ -0,0 +1,53 @@ +var baseClone = require('./_baseClone'), + baseIteratee = require('./_baseIteratee'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); +} + +module.exports = iteratee; diff --git a/node_modules/lodash/join.js b/node_modules/lodash/join.js new file mode 100644 index 0000000..45de079 --- /dev/null +++ b/node_modules/lodash/join.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeJoin = arrayProto.join; + +/** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ +function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); +} + +module.exports = join; diff --git a/node_modules/lodash/kebabCase.js b/node_modules/lodash/kebabCase.js new file mode 100644 index 0000000..8a52be6 --- /dev/null +++ b/node_modules/lodash/kebabCase.js @@ -0,0 +1,28 @@ +var createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ +var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); +}); + +module.exports = kebabCase; diff --git a/node_modules/lodash/keyBy.js b/node_modules/lodash/keyBy.js new file mode 100644 index 0000000..acc007a --- /dev/null +++ b/node_modules/lodash/keyBy.js @@ -0,0 +1,36 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ +var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); +}); + +module.exports = keyBy; diff --git a/node_modules/lodash/keys.js b/node_modules/lodash/keys.js new file mode 100644 index 0000000..d143c71 --- /dev/null +++ b/node_modules/lodash/keys.js @@ -0,0 +1,37 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeys = require('./_baseKeys'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; diff --git a/node_modules/lodash/keysIn.js b/node_modules/lodash/keysIn.js new file mode 100644 index 0000000..a62308f --- /dev/null +++ b/node_modules/lodash/keysIn.js @@ -0,0 +1,32 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeysIn = require('./_baseKeysIn'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; diff --git a/node_modules/lodash/lang.js b/node_modules/lodash/lang.js new file mode 100644 index 0000000..a396216 --- /dev/null +++ b/node_modules/lodash/lang.js @@ -0,0 +1,58 @@ +module.exports = { + 'castArray': require('./castArray'), + 'clone': require('./clone'), + 'cloneDeep': require('./cloneDeep'), + 'cloneDeepWith': require('./cloneDeepWith'), + 'cloneWith': require('./cloneWith'), + 'conformsTo': require('./conformsTo'), + 'eq': require('./eq'), + 'gt': require('./gt'), + 'gte': require('./gte'), + 'isArguments': require('./isArguments'), + 'isArray': require('./isArray'), + 'isArrayBuffer': require('./isArrayBuffer'), + 'isArrayLike': require('./isArrayLike'), + 'isArrayLikeObject': require('./isArrayLikeObject'), + 'isBoolean': require('./isBoolean'), + 'isBuffer': require('./isBuffer'), + 'isDate': require('./isDate'), + 'isElement': require('./isElement'), + 'isEmpty': require('./isEmpty'), + 'isEqual': require('./isEqual'), + 'isEqualWith': require('./isEqualWith'), + 'isError': require('./isError'), + 'isFinite': require('./isFinite'), + 'isFunction': require('./isFunction'), + 'isInteger': require('./isInteger'), + 'isLength': require('./isLength'), + 'isMap': require('./isMap'), + 'isMatch': require('./isMatch'), + 'isMatchWith': require('./isMatchWith'), + 'isNaN': require('./isNaN'), + 'isNative': require('./isNative'), + 'isNil': require('./isNil'), + 'isNull': require('./isNull'), + 'isNumber': require('./isNumber'), + 'isObject': require('./isObject'), + 'isObjectLike': require('./isObjectLike'), + 'isPlainObject': require('./isPlainObject'), + 'isRegExp': require('./isRegExp'), + 'isSafeInteger': require('./isSafeInteger'), + 'isSet': require('./isSet'), + 'isString': require('./isString'), + 'isSymbol': require('./isSymbol'), + 'isTypedArray': require('./isTypedArray'), + 'isUndefined': require('./isUndefined'), + 'isWeakMap': require('./isWeakMap'), + 'isWeakSet': require('./isWeakSet'), + 'lt': require('./lt'), + 'lte': require('./lte'), + 'toArray': require('./toArray'), + 'toFinite': require('./toFinite'), + 'toInteger': require('./toInteger'), + 'toLength': require('./toLength'), + 'toNumber': require('./toNumber'), + 'toPlainObject': require('./toPlainObject'), + 'toSafeInteger': require('./toSafeInteger'), + 'toString': require('./toString') +}; diff --git a/node_modules/lodash/last.js b/node_modules/lodash/last.js new file mode 100644 index 0000000..cad1eaf --- /dev/null +++ b/node_modules/lodash/last.js @@ -0,0 +1,20 @@ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; diff --git a/node_modules/lodash/lastIndexOf.js b/node_modules/lodash/lastIndexOf.js new file mode 100644 index 0000000..dabfb61 --- /dev/null +++ b/node_modules/lodash/lastIndexOf.js @@ -0,0 +1,46 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictLastIndexOf = require('./_strictLastIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ +function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); +} + +module.exports = lastIndexOf; diff --git a/node_modules/lodash/lodash.js b/node_modules/lodash/lodash.js new file mode 100644 index 0000000..1fd7116 --- /dev/null +++ b/node_modules/lodash/lodash.js @@ -0,0 +1,17161 @@ +/** + * @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() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.20'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\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', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + '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' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\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', + // Latin Extended-A block. + '\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' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @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, baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + 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; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + 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; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + 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) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + 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; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // 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; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' +``` + +- In node.js: `npm install natural-compare-lite` + +```javascript +require("natural-compare-lite") +``` + +### Usage + +```javascript +// Simple case sensitive example +var a = ["z1.doc", "z10.doc", "z17.doc", "z2.doc", "z23.doc", "z3.doc"]; +a.sort(String.naturalCompare); +// ["z1.doc", "z2.doc", "z3.doc", "z10.doc", "z17.doc", "z23.doc"] + +// Use wrapper function for case insensitivity +a.sort(function(a, b){ + return String.naturalCompare(a.toLowerCase(), b.toLowerCase()); +}) + +// In most cases we want to sort an array of objects +var a = [ {"street":"350 5th Ave", "room":"A-1021"} + , {"street":"350 5th Ave", "room":"A-21046-b"} ]; + +// sort by street, then by room +a.sort(function(a, b){ + return String.naturalCompare(a.street, b.street) || String.naturalCompare(a.room, b.room); +}) + +// When text transformation is needed (eg toLowerCase()), +// it is best for performance to keep +// transformed key in that object. +// There are no need to do text transformation +// on each comparision when sorting. +var a = [ {"make":"Audi", "model":"A6"} + , {"make":"Kia", "model":"Rio"} ]; + +// sort by make, then by model +a.map(function(car){ + car.sort_key = (car.make + " " + car.model).toLowerCase(); +}) +a.sort(function(a, b){ + return String.naturalCompare(a.sort_key, b.sort_key); +}) +``` + +- Works well with dates in ISO format eg "Rev 2012-07-26.doc". + + +### Custom alphabet + +It is possible to configure a custom alphabet +to achieve a desired order. + +```javascript +// Estonian alphabet +String.alphabet = "ABDEFGHIJKLMNOPRSŠZŽTUVÕÄÖÜXYabdefghijklmnoprsšzžtuvõäöüxy" +["t", "z", "x", "õ"].sort(String.naturalCompare) +// ["z", "t", "õ", "x"] + +// Russian alphabet +String.alphabet = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя" +["Ё", "А", "Б"].sort(String.naturalCompare) +// ["А", "Б", "Ё"] +``` + + +External links +-------------- + +- [GitHub repo][https://github.com/litejs/natural-compare-lite] +- [jsperf test](http://jsperf.com/natural-sort-2/12) + + +Licence +------- + +Copyright (c) 2012-2015 Lauri Rooden <lauri@rooden.ee> +[The MIT License](http://lauri.rooden.ee/mit-license.txt) + + diff --git a/node_modules/natural-compare/index.js b/node_modules/natural-compare/index.js new file mode 100644 index 0000000..e705d49 --- /dev/null +++ b/node_modules/natural-compare/index.js @@ -0,0 +1,57 @@ + + + +/* + * @version 1.4.0 + * @date 2015-10-26 + * @stability 3 - Stable + * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite) + * @license MIT License + */ + + +var naturalCompare = function(a, b) { + var i, codeA + , codeB = 1 + , posA = 0 + , posB = 0 + , alphabet = String.alphabet + + function getCode(str, pos, code) { + if (code) { + for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i; + return +str.slice(pos - 1, i) + } + code = alphabet && alphabet.indexOf(str.charAt(pos)) + return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code + : code < 46 ? 65 // - + : code < 48 ? code - 1 + : code < 58 ? code + 18 // 0-9 + : code < 65 ? code - 11 + : code < 91 ? code + 11 // A-Z + : code < 97 ? code - 37 + : code < 123 ? code + 5 // a-z + : code - 63 + } + + + if ((a+="") != (b+="")) for (;codeB;) { + codeA = getCode(a, posA++) + codeB = getCode(b, posB++) + + if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) { + codeA = getCode(a, posA, posA) + codeB = getCode(b, posB, posA = i) + posB = i + } + + if (codeA != codeB) return (codeA < codeB) ? -1 : 1 + } + return 0 +} + +try { + module.exports = naturalCompare; +} catch (e) { + String.naturalCompare = naturalCompare; +} diff --git a/node_modules/natural-compare/package.json b/node_modules/natural-compare/package.json new file mode 100644 index 0000000..a7d7e2c --- /dev/null +++ b/node_modules/natural-compare/package.json @@ -0,0 +1,73 @@ +{ + "_from": "natural-compare@^1.4.0", + "_id": "natural-compare@1.4.0", + "_inBundle": false, + "_integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "_location": "/natural-compare", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "natural-compare@^1.4.0", + "name": "natural-compare", + "escapedName": "natural-compare", + "rawSpec": "^1.4.0", + "saveSpec": null, + "fetchSpec": "^1.4.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "_shasum": "4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7", + "_spec": "natural-compare@^1.4.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Lauri Rooden", + "url": "https://github.com/litejs/natural-compare-lite" + }, + "bugs": { + "url": "https://github.com/litejs/natural-compare-lite/issues" + }, + "buildman": { + "dist/index-min.js": { + "banner": "/*! litejs.com/MIT-LICENSE.txt */", + "input": "index.js" + } + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Compare strings containing a mix of letters and numbers in the way a human being would in sort order.", + "devDependencies": { + "buildman": "*", + "testman": "*" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/litejs/natural-compare-lite#readme", + "keywords": [ + "string", + "natural", + "order", + "sort", + "natsort", + "natcmp", + "compare", + "alphanum", + "litejs" + ], + "license": "MIT", + "main": "index.js", + "name": "natural-compare", + "repository": { + "type": "git", + "url": "git://github.com/litejs/natural-compare-lite.git" + }, + "scripts": { + "build": "node node_modules/buildman/index.js --all", + "test": "node tests/index.js" + }, + "stability": 3, + "version": "1.4.0" +} diff --git a/node_modules/normalize-package-data/AUTHORS b/node_modules/normalize-package-data/AUTHORS new file mode 100644 index 0000000..66282ba --- /dev/null +++ b/node_modules/normalize-package-data/AUTHORS @@ -0,0 +1,4 @@ +# Names sorted by how much code was originally theirs. +Isaac Z. Schlueter +Meryn Stol +Robert Kowalski diff --git a/node_modules/normalize-package-data/LICENSE b/node_modules/normalize-package-data/LICENSE new file mode 100644 index 0000000..6ed662c --- /dev/null +++ b/node_modules/normalize-package-data/LICENSE @@ -0,0 +1,30 @@ +This package contains code originally written by Isaac Z. Schlueter. +Used with permission. + +Copyright (c) Meryn Stol ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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 AUTHOR 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 THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/normalize-package-data/README.md b/node_modules/normalize-package-data/README.md new file mode 100644 index 0000000..d2bd7bc --- /dev/null +++ b/node_modules/normalize-package-data/README.md @@ -0,0 +1,106 @@ +# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data) + +normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. + +normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools. + +## Installation + +``` +npm install normalize-package-data +``` + +## Usage + +Basic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`. + +```javascript +normalizeData = require('normalize-package-data') +packageData = require("./package.json") +normalizeData(packageData) +// packageData is now normalized +``` + +#### Strict mode + +You may activate strict validation by passing true as the second argument. + +```javascript +normalizeData = require('normalize-package-data') +packageData = require("./package.json") +normalizeData(packageData, true) +// packageData is now normalized +``` + +If strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace. + +#### Warnings + +Optionally, you may pass a "warning" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data. + +```javascript +normalizeData = require('normalize-package-data') +packageData = require("./package.json") +warnFn = function(msg) { console.error(msg) } +normalizeData(packageData, warnFn) +// packageData is now normalized. Any number of warnings may have been logged. +``` + +You may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third. + +When `private` field is set to `true`, warnings will be suppressed. + +### Potential exceptions + +If the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback. + +## What normalization (currently) entails + +* The value of `name` field gets trimmed (unless in strict mode). +* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver). +* If `name` and/or `version` fields are missing, they are set to empty strings. +* If `files` field is not an array, it will be removed. +* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value. +* If `man` field is a string, it will become an array with the original string as its sole member. +* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\s+`. +* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties. +* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`. +* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs. +* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched. +* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved. +* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL. +* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`. +* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`. +* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to git+https://github.com/[owner-name]/[repo-name].git +* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value. +* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. +* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. +* If `homepage` field is not a string, it will be removed. +* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. +* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]#readme . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. + +### Rules for name field + +If `name` field is given, the value of the name field must be a string. The string may not: + +* start with a period. +* contain the following characters: `/@\s+%` +* contain any characters that would need to be encoded for use in urls. +* resemble the word `node_modules` or `favicon.ico` (case doesn't matter). + +### Rules for version field + +If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver). + +### Rules for license field + +The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/package/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license). + +## Credits + +This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson. + +## License + +normalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). +Copyright (c) 2013 Meryn Stol diff --git a/node_modules/normalize-package-data/lib/extract_description.js b/node_modules/normalize-package-data/lib/extract_description.js new file mode 100644 index 0000000..83f10aa --- /dev/null +++ b/node_modules/normalize-package-data/lib/extract_description.js @@ -0,0 +1,14 @@ +module.exports = extractDescription + +// Extracts description from contents of a readme file in markdown format +function extractDescription (d) { + if (!d) return; + if (d === "ERROR: No README data found!") return; + // the first block of text before the first heading + // that isn't the first line heading + d = d.trim().split('\n') + for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); + var l = d.length + for (var e = s + 1; e < l && d[e].trim(); e ++); + return d.slice(s, e).join(' ').trim() +} diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js new file mode 100644 index 0000000..27682e9 --- /dev/null +++ b/node_modules/normalize-package-data/lib/fixer.js @@ -0,0 +1,418 @@ +var semver = require("semver") +var validateLicense = require('validate-npm-package-license'); +var hostedGitInfo = require("hosted-git-info") +var isBuiltinModule = require("resolve").isCore +var depTypes = ["dependencies","devDependencies","optionalDependencies"] +var extractDescription = require("./extract_description") +var url = require("url") +var typos = require("./typos.json") + +var fixer = module.exports = { + // default warning function + warn: function() {}, + + fixRepositoryField: function(data) { + if (data.repositories) { + this.warn("repositories"); + data.repository = data.repositories[0] + } + if (!data.repository) return this.warn("missingRepository") + if (typeof data.repository === "string") { + data.repository = { + type: "git", + url: data.repository + } + } + var r = data.repository.url || "" + if (r) { + var hosted = hostedGitInfo.fromUrl(r) + if (hosted) { + r = data.repository.url + = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString() + } + } + + if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { + this.warn("brokenGitUrl", r) + } + } + +, fixTypos: function(data) { + Object.keys(typos.topLevel).forEach(function (d) { + if (data.hasOwnProperty(d)) { + this.warn("typo", d, typos.topLevel[d]) + } + }, this) + } + +, fixScriptsField: function(data) { + if (!data.scripts) return + if (typeof data.scripts !== "object") { + this.warn("nonObjectScripts") + delete data.scripts + return + } + Object.keys(data.scripts).forEach(function (k) { + if (typeof data.scripts[k] !== "string") { + this.warn("nonStringScript") + delete data.scripts[k] + } else if (typos.script[k] && !data.scripts[typos.script[k]]) { + this.warn("typo", k, typos.script[k], "scripts") + } + }, this) + } + +, fixFilesField: function(data) { + var files = data.files + if (files && !Array.isArray(files)) { + this.warn("nonArrayFiles") + delete data.files + } else if (data.files) { + data.files = data.files.filter(function(file) { + if (!file || typeof file !== "string") { + this.warn("invalidFilename", file) + return false + } else { + return true + } + }, this) + } + } + +, fixBinField: function(data) { + if (!data.bin) return; + if (typeof data.bin === "string") { + var b = {} + var match + if (match = data.name.match(/^@[^/]+[/](.*)$/)) { + b[match[1]] = data.bin + } else { + b[data.name] = data.bin + } + data.bin = b + } + } + +, fixManField: function(data) { + if (!data.man) return; + if (typeof data.man === "string") { + data.man = [ data.man ] + } + } +, fixBundleDependenciesField: function(data) { + var bdd = "bundledDependencies" + var bd = "bundleDependencies" + if (data[bdd] && !data[bd]) { + data[bd] = data[bdd] + delete data[bdd] + } + if (data[bd] && !Array.isArray(data[bd])) { + this.warn("nonArrayBundleDependencies") + delete data[bd] + } else if (data[bd]) { + data[bd] = data[bd].filter(function(bd) { + if (!bd || typeof bd !== 'string') { + this.warn("nonStringBundleDependency", bd) + return false + } else { + if (!data.dependencies) { + data.dependencies = {} + } + if (!data.dependencies.hasOwnProperty(bd)) { + this.warn("nonDependencyBundleDependency", bd) + data.dependencies[bd] = "*" + } + return true + } + }, this) + } + } + +, fixDependencies: function(data, strict) { + var loose = !strict + objectifyDeps(data, this.warn) + addOptionalDepsToDeps(data, this.warn) + this.fixBundleDependenciesField(data) + + ;['dependencies','devDependencies'].forEach(function(deps) { + if (!(deps in data)) return + if (!data[deps] || typeof data[deps] !== "object") { + this.warn("nonObjectDependencies", deps) + delete data[deps] + return + } + Object.keys(data[deps]).forEach(function (d) { + var r = data[deps][d] + if (typeof r !== 'string') { + this.warn("nonStringDependency", d, JSON.stringify(r)) + delete data[deps][d] + } + var hosted = hostedGitInfo.fromUrl(data[deps][d]) + if (hosted) data[deps][d] = hosted.toString() + }, this) + }, this) + } + +, fixModulesField: function (data) { + if (data.modules) { + this.warn("deprecatedModules") + delete data.modules + } + } + +, fixKeywordsField: function (data) { + if (typeof data.keywords === "string") { + data.keywords = data.keywords.split(/,\s+/) + } + if (data.keywords && !Array.isArray(data.keywords)) { + delete data.keywords + this.warn("nonArrayKeywords") + } else if (data.keywords) { + data.keywords = data.keywords.filter(function(kw) { + if (typeof kw !== "string" || !kw) { + this.warn("nonStringKeyword"); + return false + } else { + return true + } + }, this) + } + } + +, fixVersionField: function(data, strict) { + // allow "loose" semver 1.0 versions in non-strict mode + // enforce strict semver 2.0 compliance in strict mode + var loose = !strict + if (!data.version) { + data.version = "" + return true + } + if (!semver.valid(data.version, loose)) { + throw new Error('Invalid version: "'+ data.version + '"') + } + data.version = semver.clean(data.version, loose) + return true + } + +, fixPeople: function(data) { + modifyPeople(data, unParsePerson) + modifyPeople(data, parsePerson) + } + +, fixNameField: function(data, options) { + if (typeof options === "boolean") options = {strict: options} + else if (typeof options === "undefined") options = {} + var strict = options.strict + if (!data.name && !strict) { + data.name = "" + return + } + if (typeof data.name !== "string") { + throw new Error("name field must be a string.") + } + if (!strict) + data.name = data.name.trim() + ensureValidName(data.name, strict, options.allowLegacyCase) + if (isBuiltinModule(data.name)) + this.warn("conflictingName", data.name) + } + + +, fixDescriptionField: function (data) { + if (data.description && typeof data.description !== 'string') { + this.warn("nonStringDescription") + delete data.description + } + if (data.readme && !data.description) + data.description = extractDescription(data.readme) + if(data.description === undefined) delete data.description; + if (!data.description) this.warn("missingDescription") + } + +, fixReadmeField: function (data) { + if (!data.readme) { + this.warn("missingReadme") + data.readme = "ERROR: No README data found!" + } + } + +, fixBugsField: function(data) { + if (!data.bugs && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if(hosted && hosted.bugs()) { + data.bugs = {url: hosted.bugs()} + } + } + else if(data.bugs) { + var emailRe = /^.+@.*\..+$/ + if(typeof data.bugs == "string") { + if(emailRe.test(data.bugs)) + data.bugs = {email:data.bugs} + else if(url.parse(data.bugs).protocol) + data.bugs = {url: data.bugs} + else + this.warn("nonEmailUrlBugsString") + } + else { + bugsTypos(data.bugs, this.warn) + var oldBugs = data.bugs + data.bugs = {} + if(oldBugs.url) { + if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) + data.bugs.url = oldBugs.url + else + this.warn("nonUrlBugsUrlField") + } + if(oldBugs.email) { + if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) + data.bugs.email = oldBugs.email + else + this.warn("nonEmailBugsEmailField") + } + } + if(!data.bugs.email && !data.bugs.url) { + delete data.bugs + this.warn("emptyNormalizedBugs") + } + } + } + +, fixHomepageField: function(data) { + if (!data.homepage && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted && hosted.docs()) data.homepage = hosted.docs() + } + if (!data.homepage) return + + if(typeof data.homepage !== "string") { + this.warn("nonUrlHomepage") + return delete data.homepage + } + if(!url.parse(data.homepage).protocol) { + data.homepage = "http://" + data.homepage + } + } + +, fixLicenseField: function(data) { + if (!data.license) { + return this.warn("missingLicense") + } else{ + if ( + typeof(data.license) !== 'string' || + data.license.length < 1 || + data.license.trim() === '' + ) { + this.warn("invalidLicense") + } else { + if (!validateLicense(data.license).validForNewPackages) + this.warn("invalidLicense") + } + } + } +} + +function isValidScopedPackageName(spec) { + if (spec.charAt(0) !== '@') return false + + var rest = spec.slice(1).split('/') + if (rest.length !== 2) return false + + return rest[0] && rest[1] && + rest[0] === encodeURIComponent(rest[0]) && + rest[1] === encodeURIComponent(rest[1]) +} + +function isCorrectlyEncodedName(spec) { + return !spec.match(/[\/@\s\+%:]/) && + spec === encodeURIComponent(spec) +} + +function ensureValidName (name, strict, allowLegacyCase) { + if (name.charAt(0) === "." || + !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || + (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || + name.toLowerCase() === "node_modules" || + name.toLowerCase() === "favicon.ico") { + throw new Error("Invalid name: " + JSON.stringify(name)) + } +} + +function modifyPeople (data, fn) { + if (data.author) data.author = fn(data.author) + ;["maintainers", "contributors"].forEach(function (set) { + if (!Array.isArray(data[set])) return; + data[set] = data[set].map(fn) + }) + return data +} + +function unParsePerson (person) { + if (typeof person === "string") return person + var name = person.name || "" + var u = person.url || person.web + var url = u ? (" ("+u+")") : "" + var e = person.email || person.mail + var email = e ? (" <"+e+">") : "" + return name+email+url +} + +function parsePerson (person) { + if (typeof person !== "string") return person + var name = person.match(/^([^\(<]+)/) + var url = person.match(/\(([^\)]+)\)/) + var email = person.match(/<([^>]+)>/) + var obj = {} + if (name && name[0].trim()) obj.name = name[0].trim() + if (email) obj.email = email[1]; + if (url) obj.url = url[1]; + return obj +} + +function addOptionalDepsToDeps (data, warn) { + var o = data.optionalDependencies + if (!o) return; + var d = data.dependencies || {} + Object.keys(o).forEach(function (k) { + d[k] = o[k] + }) + data.dependencies = d +} + +function depObjectify (deps, type, warn) { + if (!deps) return {} + if (typeof deps === "string") { + deps = deps.trim().split(/[\n\r\s\t ,]+/) + } + if (!Array.isArray(deps)) return deps + warn("deprecatedArrayDependencies", type) + var o = {} + deps.filter(function (d) { + return typeof d === "string" + }).forEach(function(d) { + d = d.trim().split(/(:?[@\s><=])/) + var dn = d.shift() + var dv = d.join("") + dv = dv.trim() + dv = dv.replace(/^@/, "") + o[dn] = dv + }) + return o +} + +function objectifyDeps (data, warn) { + depTypes.forEach(function (type) { + if (!data[type]) return; + data[type] = depObjectify(data[type], type, warn) + }) +} + +function bugsTypos(bugs, warn) { + if (!bugs) return + Object.keys(bugs).forEach(function (k) { + if (typos.bugs[k]) { + warn("typo", k, typos.bugs[k], "bugs") + bugs[typos.bugs[k]] = bugs[k] + delete bugs[k] + } + }) +} diff --git a/node_modules/normalize-package-data/lib/make_warning.js b/node_modules/normalize-package-data/lib/make_warning.js new file mode 100644 index 0000000..4ac74ad --- /dev/null +++ b/node_modules/normalize-package-data/lib/make_warning.js @@ -0,0 +1,23 @@ +var util = require("util") +var messages = require("./warning_messages.json") + +module.exports = function() { + var args = Array.prototype.slice.call(arguments, 0) + var warningName = args.shift() + if (warningName == "typo") { + return makeTypoWarning.apply(null,args) + } + else { + var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" + args.unshift(msgTemplate) + return util.format.apply(null, args) + } +} + +function makeTypoWarning (providedName, probableName, field) { + if (field) { + providedName = field + "['" + providedName + "']" + probableName = field + "['" + probableName + "']" + } + return util.format(messages.typo, providedName, probableName) +} diff --git a/node_modules/normalize-package-data/lib/normalize.js b/node_modules/normalize-package-data/lib/normalize.js new file mode 100644 index 0000000..bd1bfef --- /dev/null +++ b/node_modules/normalize-package-data/lib/normalize.js @@ -0,0 +1,39 @@ +module.exports = normalize + +var fixer = require("./fixer") +normalize.fixer = fixer + +var makeWarning = require("./make_warning") + +var fieldsToFix = ['name','version','description','repository','modules','scripts' + ,'files','bin','man','bugs','keywords','readme','homepage','license'] +var otherThingsToFix = ['dependencies','people', 'typos'] + +var thingsToFix = fieldsToFix.map(function(fieldName) { + return ucFirst(fieldName) + "Field" +}) +// two ways to do this in CoffeeScript on only one line, sub-70 chars: +// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" +// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) +thingsToFix = thingsToFix.concat(otherThingsToFix) + +function normalize (data, warn, strict) { + if(warn === true) warn = null, strict = true + if(!strict) strict = false + if(!warn || data.private) warn = function(msg) { /* noop */ } + + if (data.scripts && + data.scripts.install === "node-gyp rebuild" && + !data.scripts.preinstall) { + data.gypfile = true + } + fixer.warn = function() { warn(makeWarning.apply(null, arguments)) } + thingsToFix.forEach(function(thingName) { + fixer["fix" + ucFirst(thingName)](data, strict) + }) + data._id = data.name + "@" + data.version +} + +function ucFirst (string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} diff --git a/node_modules/normalize-package-data/lib/safe_format.js b/node_modules/normalize-package-data/lib/safe_format.js new file mode 100644 index 0000000..b07f100 --- /dev/null +++ b/node_modules/normalize-package-data/lib/safe_format.js @@ -0,0 +1,9 @@ +var util = require('util') + +module.exports = function() { + var args = Array.prototype.slice.call(arguments, 0) + args.forEach(function(arg) { + if (!arg) throw new TypeError('Bad arguments.') + }) + return util.format.apply(null, arguments) +} diff --git a/node_modules/normalize-package-data/lib/typos.json b/node_modules/normalize-package-data/lib/typos.json new file mode 100644 index 0000000..7f9dd28 --- /dev/null +++ b/node_modules/normalize-package-data/lib/typos.json @@ -0,0 +1,25 @@ +{ + "topLevel": { + "dependancies": "dependencies" + ,"dependecies": "dependencies" + ,"depdenencies": "dependencies" + ,"devEependencies": "devDependencies" + ,"depends": "dependencies" + ,"dev-dependencies": "devDependencies" + ,"devDependences": "devDependencies" + ,"devDepenencies": "devDependencies" + ,"devdependencies": "devDependencies" + ,"repostitory": "repository" + ,"repo": "repository" + ,"prefereGlobal": "preferGlobal" + ,"hompage": "homepage" + ,"hampage": "homepage" + ,"autohr": "author" + ,"autor": "author" + ,"contributers": "contributors" + ,"publicationConfig": "publishConfig" + ,"script": "scripts" + }, + "bugs": { "web": "url", "name": "url" }, + "script": { "server": "start", "tests": "test" } +} diff --git a/node_modules/normalize-package-data/lib/warning_messages.json b/node_modules/normalize-package-data/lib/warning_messages.json new file mode 100644 index 0000000..4890f50 --- /dev/null +++ b/node_modules/normalize-package-data/lib/warning_messages.json @@ -0,0 +1,30 @@ +{ + "repositories": "'repositories' (plural) Not supported. Please pick one as the 'repository' field" + ,"missingRepository": "No repository field." + ,"brokenGitUrl": "Probably broken git url: %s" + ,"nonObjectScripts": "scripts must be an object" + ,"nonStringScript": "script values must be string commands" + ,"nonArrayFiles": "Invalid 'files' member" + ,"invalidFilename": "Invalid filename in 'files' list: %s" + ,"nonArrayBundleDependencies": "Invalid 'bundleDependencies' list. Must be array of package names" + ,"nonStringBundleDependency": "Invalid bundleDependencies member: %s" + ,"nonDependencyBundleDependency": "Non-dependency in bundleDependencies: %s" + ,"nonObjectDependencies": "%s field must be an object" + ,"nonStringDependency": "Invalid dependency: %s %s" + ,"deprecatedArrayDependencies": "specifying %s as array is deprecated" + ,"deprecatedModules": "modules field is deprecated" + ,"nonArrayKeywords": "keywords should be an array of strings" + ,"nonStringKeyword": "keywords should be an array of strings" + ,"conflictingName": "%s is also the name of a node core module." + ,"nonStringDescription": "'description' field should be a string" + ,"missingDescription": "No description" + ,"missingReadme": "No README data" + ,"missingLicense": "No license field." + ,"nonEmailUrlBugsString": "Bug string field must be url, email, or {email,url}" + ,"nonUrlBugsUrlField": "bugs.url field must be a string url. Deleted." + ,"nonEmailBugsEmailField": "bugs.email field must be a string email. Deleted." + ,"emptyNormalizedBugs": "Normalized value of bugs field is an empty object. Deleted." + ,"nonUrlHomepage": "homepage field must be a string url. Deleted." + ,"invalidLicense": "license should be a valid SPDX license expression" + ,"typo": "%s should probably be %s." +} diff --git a/node_modules/normalize-package-data/node_modules/.bin/semver b/node_modules/normalize-package-data/node_modules/.bin/semver new file mode 120000 index 0000000..317eb29 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md b/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md new file mode 100644 index 0000000..66304fd --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md @@ -0,0 +1,39 @@ +# changes log + +## 5.7 + +* Add `minVersion` method + +## 5.6 + +* Move boolean `loose` param to an options object, with + backwards-compatibility protection. +* Add ability to opt out of special prerelease version handling with + the `includePrerelease` option flag. + +## 5.5 + +* Add version coercion capabilities + +## 5.4 + +* Add intersection checking + +## 5.3 + +* Add `minSatisfying` method + +## 5.2 + +* Add `prerelease(v)` that returns prerelease components + +## 5.1 + +* Add Backus-Naur for ranges +* Remove excessively cute inspection methods + +## 5.0 + +* Remove AMD/Browserified build artifacts +* Fix ltr and gtr when using the `*` range +* Fix for range `*` with a prerelease identifier diff --git a/node_modules/normalize-package-data/node_modules/semver/LICENSE b/node_modules/normalize-package-data/node_modules/semver/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/normalize-package-data/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/node_modules/normalize-package-data/node_modules/semver/README.md b/node_modules/normalize-package-data/node_modules/semver/README.md new file mode 100644 index 0000000..f8dfa5a --- /dev/null +++ b/node_modules/normalize-package-data/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/node_modules/normalize-package-data/node_modules/semver/bin/semver b/node_modules/normalize-package-data/node_modules/semver/bin/semver new file mode 100755 index 0000000..801e77f --- /dev/null +++ b/node_modules/normalize-package-data/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/node_modules/normalize-package-data/node_modules/semver/package.json b/node_modules/normalize-package-data/node_modules/semver/package.json new file mode 100644 index 0000000..80025ec --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/semver/package.json @@ -0,0 +1,60 @@ +{ + "_from": "semver@2 || 3 || 4 || 5", + "_id": "semver@5.7.1", + "_inBundle": false, + "_integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "_location": "/normalize-package-data/semver", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "semver@2 || 3 || 4 || 5", + "name": "semver", + "escapedName": "semver", + "rawSpec": "2 || 3 || 4 || 5", + "saveSpec": null, + "fetchSpec": "2 || 3 || 4 || 5" + }, + "_requiredBy": [ + "/normalize-package-data" + ], + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "_shasum": "a954f931aeba508d307bbf069eff0c01c96116f7", + "_spec": "semver@2 || 3 || 4 || 5", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/normalize-package-data", + "bin": { + "semver": "bin/semver" + }, + "bugs": { + "url": "https://github.com/npm/node-semver/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The semantic version parser used by npm.", + "devDependencies": { + "tap": "^13.0.0-rc.18" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "homepage": "https://github.com/npm/node-semver#readme", + "license": "ISC", + "main": "semver.js", + "name": "semver", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap" + }, + "tap": { + "check-coverage": true + }, + "version": "5.7.1" +} diff --git a/node_modules/normalize-package-data/node_modules/semver/range.bnf b/node_modules/normalize-package-data/node_modules/semver/range.bnf new file mode 100644 index 0000000..d4c6ae0 --- /dev/null +++ b/node_modules/normalize-package-data/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/node_modules/normalize-package-data/node_modules/semver/semver.js b/node_modules/normalize-package-data/node_modules/semver/semver.js new file mode 100644 index 0000000..d315d5d --- /dev/null +++ b/node_modules/normalize-package-data/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/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json new file mode 100644 index 0000000..272c772 --- /dev/null +++ b/node_modules/normalize-package-data/package.json @@ -0,0 +1,77 @@ +{ + "_from": "normalize-package-data@^2.3.2", + "_id": "normalize-package-data@2.5.0", + "_inBundle": false, + "_integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "_location": "/normalize-package-data", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "normalize-package-data@^2.3.2", + "name": "normalize-package-data", + "escapedName": "normalize-package-data", + "rawSpec": "^2.3.2", + "saveSpec": null, + "fetchSpec": "^2.3.2" + }, + "_requiredBy": [ + "/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "_shasum": "e66db1838b200c1dfc233225d12cb36520e234a8", + "_spec": "normalize-package-data@^2.3.2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/read-pkg", + "author": { + "name": "Meryn Stol", + "email": "merynstol@gmail.com" + }, + "bugs": { + "url": "https://github.com/npm/normalize-package-data/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + { + "name": "Meryn Stol", + "email": "merynstol@gmail.com" + }, + { + "name": "Robert Kowalski", + "email": "rok@kowalski.gd" + } + ], + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "deprecated": false, + "description": "Normalizes data that can be found in package.json files.", + "devDependencies": { + "async": "^2.6.1", + "tap": "^12.4.0", + "underscore": "^1.8.3" + }, + "files": [ + "lib/*.js", + "lib/*.json", + "AUTHORS" + ], + "homepage": "https://github.com/npm/normalize-package-data#readme", + "license": "BSD-2-Clause", + "main": "lib/normalize.js", + "name": "normalize-package-data", + "repository": { + "type": "git", + "url": "git://github.com/npm/normalize-package-data.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.5.0" +} diff --git a/node_modules/object-inspect/.eslintignore b/node_modules/object-inspect/.eslintignore new file mode 100644 index 0000000..404abb2 --- /dev/null +++ b/node_modules/object-inspect/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/node_modules/object-inspect/.eslintrc b/node_modules/object-inspect/.eslintrc new file mode 100644 index 0000000..6ba656a --- /dev/null +++ b/node_modules/object-inspect/.eslintrc @@ -0,0 +1,64 @@ +{ + "root": true, + "extends": "@ljharb", + "rules": { + "complexity": 0, + "func-style": [2, "declaration"], + "indent": [2, 4], + "max-lines": 1, + "max-lines-per-function": 1, + "max-params": [2, 4], + "max-statements": [2, 100], + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "no-param-reassign": 1, + "operator-linebreak": [2, "before"], + "strict": 0, // TODO + }, + "globals": { + "BigInt": false, + "WeakSet": false, + "WeakMap": false, + }, + "overrides": [ + { + "files": ["test/**", "test-*", "example/**"], + "rules": { + "array-bracket-newline": 0, + "id-length": 0, + "max-params": 0, + "max-statements": 0, + "max-statements-per-line": 0, + "object-curly-newline": 0, + "sort-keys": 0, + }, + }, + { + "files": ["example/**"], + "rules": { + "no-console": 0, + }, + }, + { + "files": ["test/browser/**"], + "env": { + "browser": true, + }, + }, + { + "files": ["test/bigint*"], + "rules": { + "new-cap": [2, { "capIsNewExceptions": ["BigInt"] }], + }, + }, + { + "files": "index.js", + "globals": { + "HTMLElement": false, + }, + "rules": { + "no-use-before-define": 1, + }, + }, + ], +} diff --git a/node_modules/object-inspect/.github/workflows/rebase.yml b/node_modules/object-inspect/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/object-inspect/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object-inspect/.nycrc b/node_modules/object-inspect/.nycrc new file mode 100644 index 0000000..84c1894 --- /dev/null +++ b/node_modules/object-inspect/.nycrc @@ -0,0 +1,17 @@ +{ + "all": true, + "check-coverage": false, + "instrumentation": false, + "sourceMap": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 93, + "statements": 93, + "functions": 96, + "branches": 89, + "exclude": [ + "coverage", + "example", + "test", + "test-core-js.js" + ] +} diff --git a/node_modules/object-inspect/.travis.yml b/node_modules/object-inspect/.travis.yml new file mode 100644 index 0000000..79ccccc --- /dev/null +++ b/node_modules/object-inspect/.travis.yml @@ -0,0 +1,53 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml +script: + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi' +matrix: + include: + - node_js: "13.7" + env: COVERAGE=true + - node_js: "12.14" + env: COVERAGE=true + - node_js: "10.18" + env: COVERAGE=true + - node_js: "8.17" + env: COVERAGE=true + - node_js: "6.17" + env: COVERAGE=true + - node_js: "4.9" + env: COVERAGE=true + - node_js: "iojs-v1.8" + env: COVERAGE=true + - node_js: "0.12" + env: COVERAGE=true + - node_js: "0.10" + env: COVERAGE=true + - node_js: "0.8" + env: COVERAGE=true + exclude: + - node_js: "13.7" + env: TEST=true + - node_js: "12.14" + env: TEST=true + - node_js: "10.18" + env: TEST=true + - node_js: "8.17" + env: TEST=true + - node_js: "6.17" + env: TEST=true + - node_js: "4.9" + env: TEST=true + - node_js: "iojs-v1.8" + env: TEST=true + - node_js: "0.12" + env: TEST=true + - node_js: "0.10" + env: TEST=true + - node_js: "0.8" + env: TEST=true diff --git a/node_modules/object-inspect/LICENSE b/node_modules/object-inspect/LICENSE new file mode 100644 index 0000000..ca64cc1 --- /dev/null +++ b/node_modules/object-inspect/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/object-inspect/example/all.js b/node_modules/object-inspect/example/all.js new file mode 100644 index 0000000..2f3355c --- /dev/null +++ b/node_modules/object-inspect/example/all.js @@ -0,0 +1,23 @@ +'use strict'; + +var inspect = require('../'); +var Buffer = require('safer-buffer').Buffer; + +var holes = ['a', 'b']; +holes[4] = 'e'; +holes[6] = 'g'; + +var obj = { + a: 1, + b: [3, 4, undefined, null], + c: undefined, + d: null, + e: { + regex: /^x/i, + buf: Buffer.from('abc'), + holes: holes + }, + now: new Date() +}; +obj.self = obj; +console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/circular.js b/node_modules/object-inspect/example/circular.js new file mode 100644 index 0000000..487a7c1 --- /dev/null +++ b/node_modules/object-inspect/example/circular.js @@ -0,0 +1,6 @@ +'use strict'; + +var inspect = require('../'); +var obj = { a: 1, b: [3, 4] }; +obj.c = obj; +console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/fn.js b/node_modules/object-inspect/example/fn.js new file mode 100644 index 0000000..9b5db8d --- /dev/null +++ b/node_modules/object-inspect/example/fn.js @@ -0,0 +1,5 @@ +'use strict'; + +var inspect = require('../'); +var obj = [1, 2, function f(n) { return n + 5; }, 4]; +console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/inspect.js b/node_modules/object-inspect/example/inspect.js new file mode 100644 index 0000000..e2df7c9 --- /dev/null +++ b/node_modules/object-inspect/example/inspect.js @@ -0,0 +1,10 @@ +'use strict'; + +/* eslint-env browser */ +var inspect = require('../'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/node_modules/object-inspect/index.js b/node_modules/object-inspect/index.js new file mode 100644 index 0000000..61176bb --- /dev/null +++ b/node_modules/object-inspect/index.js @@ -0,0 +1,383 @@ +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var match = String.prototype.match; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + +var inspectCustom = require('./util.inspect').custom; +var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if ( + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity + : opts.maxStringLength !== null + ) + ) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean') { + throw new TypeError('option "customInspect", if provided, must be `true` or `false`'); + } + + if ( + has(opts, 'indent') + && opts.indent !== null + && opts.indent !== '\t' + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) + ) { + throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { // eslint-disable-line valid-typeof + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + + var indent = getIndent(opts, depth); + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from, noIndent) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']'; + } + if (isSymbol(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + xs.join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + if (ys.length === 0) { return '{}'; } + if (indent) { + return '{' + indentedJoin(ys, indent) + '}'; + } + return '{ ' + ys.join(', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote(s) { + return String(s).replace(/"/g, '"'); +} + +function isArray(obj) { return toStr(obj) === '[object Array]'; } +function isDate(obj) { return toStr(obj) === '[object Date]'; } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]'; } +function isError(obj) { return toStr(obj) === '[object Error]'; } +function isSymbol(obj) { return toStr(obj) === '[object Symbol]'; } +function isString(obj) { return toStr(obj) === '[object String]'; } +function isNumber(obj) { return toStr(obj) === '[object Number]'; } +function isBigInt(obj) { return toStr(obj) === '[object BigInt]'; } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]'; } + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { return f.name; } + var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; + } + // eslint-disable-next-line no-control-regex + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} + +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} + +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = Array(opts.indent + 1).join(' '); + } else { + return null; + } + return { + base: baseIndent, + prev: Array(depth + 1).join(baseIndent) + }; +} + +function indentedJoin(xs, indent) { + if (xs.length === 0) { return ''; } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if ((/[^\w$]/).test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; +} diff --git a/node_modules/object-inspect/package.json b/node_modules/object-inspect/package.json new file mode 100644 index 0000000..9e7526d --- /dev/null +++ b/node_modules/object-inspect/package.json @@ -0,0 +1,107 @@ +{ + "_from": "object-inspect@^1.8.0", + "_id": "object-inspect@1.8.0", + "_inBundle": false, + "_integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "_location": "/object-inspect", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-inspect@^1.8.0", + "name": "object-inspect", + "escapedName": "object-inspect", + "rawSpec": "^1.8.0", + "saveSpec": null, + "fetchSpec": "^1.8.0" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "_shasum": "df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0", + "_spec": "object-inspect@^1.8.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "browser": { + "./util.inspect.js": false + }, + "bugs": { + "url": "https://github.com/inspect-js/object-inspect/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "string representations of objects in node and the browser", + "devDependencies": { + "@ljharb/eslint-config": "^17.1.0", + "aud": "^1.1.2", + "core-js": "^2.6.11", + "eslint": "^7.1.0", + "for-each": "^0.3.3", + "nyc": "^10.3.2", + "safe-publish-latest": "^1.1.4", + "string.prototype.repeat": "^1.0.0", + "tape": "^5.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "greenkeeper": { + "ignore": [ + "nyc", + "core-js" + ] + }, + "homepage": "https://github.com/inspect-js/object-inspect", + "keywords": [ + "inspect", + "util.inspect", + "object", + "stringify", + "pretty" + ], + "license": "MIT", + "main": "index.js", + "name": "object-inspect", + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/object-inspect.git" + }, + "scripts": { + "coverage": "nyc npm run tests-only", + "lint": "eslint .", + "posttest": "npx aud --production", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "pretests-only": "node test-core-js", + "test": "npm run tests-only", + "tests-only": "tape test/*.js" + }, + "testling": { + "files": [ + "test/*.js", + "test/browser/*.js" + ], + "browsers": [ + "ie/6..latest", + "chrome/latest", + "firefox/latest", + "safari/latest", + "opera/latest", + "iphone/latest", + "ipad/latest", + "android/latest" + ] + }, + "version": "1.8.0" +} diff --git a/node_modules/object-inspect/readme.markdown b/node_modules/object-inspect/readme.markdown new file mode 100644 index 0000000..61ec8e0 --- /dev/null +++ b/node_modules/object-inspect/readme.markdown @@ -0,0 +1,62 @@ +# object-inspect + +string representations of objects in node and the browser + +[![build status](https://secure.travis-ci.com/inspect-js/object-inspect.png)](https://travis-ci.com/inspect-js/object-inspect) + +# example + +## circular + +``` js +var inspect = require('object-inspect'); +var obj = { a: 1, b: [3,4] }; +obj.c = obj; +console.log(inspect(obj)); +``` + +## dom element + +``` js +var inspect = require('object-inspect'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); +``` + +output: + +``` +[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] +``` + +# methods + +``` js +var inspect = require('object-inspect') +``` + +## var s = inspect(obj, opts={}) + +Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`. + +Additional options: + - `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements. + - `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`. + - `customInspect`: When `true`, a custom inspect method function will be invoked. Default `true`. + - `indent`: must be "\t", `null`, or a positive integer. Default `null`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install object-inspect +``` + +# license + +MIT diff --git a/node_modules/object-inspect/test-core-js.js b/node_modules/object-inspect/test-core-js.js new file mode 100644 index 0000000..e53c400 --- /dev/null +++ b/node_modules/object-inspect/test-core-js.js @@ -0,0 +1,26 @@ +'use strict'; + +require('core-js'); + +var inspect = require('./'); +var test = require('tape'); + +test('Maps', function (t) { + t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); + t.end(); +}); + +test('WeakMaps', function (t) { + t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); + t.end(); +}); + +test('Sets', function (t) { + t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); + t.end(); +}); + +test('WeakSets', function (t) { + t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); + t.end(); +}); diff --git a/node_modules/object-inspect/test/bigint.js b/node_modules/object-inspect/test/bigint.js new file mode 100644 index 0000000..3259143 --- /dev/null +++ b/node_modules/object-inspect/test/bigint.js @@ -0,0 +1,31 @@ +var inspect = require('../'); +var test = require('tape'); + +test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) { + t.test('primitives', function (st) { + st.plan(3); + + st.equal(inspect(BigInt(-256)), '-256n'); + st.equal(inspect(BigInt(0)), '0n'); + st.equal(inspect(BigInt(256)), '256n'); + }); + + t.test('objects', function (st) { + st.plan(3); + + st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)'); + st.equal(inspect(Object(BigInt(0))), 'Object(0n)'); + st.equal(inspect(Object(BigInt(256))), 'Object(256n)'); + }); + + t.test('syntactic primitives', function (st) { + st.plan(3); + + /* eslint-disable no-new-func */ + st.equal(inspect(Function('return -256n')()), '-256n'); + st.equal(inspect(Function('return 0n')()), '0n'); + st.equal(inspect(Function('return 256n')()), '256n'); + }); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/browser/dom.js b/node_modules/object-inspect/test/browser/dom.js new file mode 100644 index 0000000..210c0b2 --- /dev/null +++ b/node_modules/object-inspect/test/browser/dom.js @@ -0,0 +1,15 @@ +var inspect = require('../../'); +var test = require('tape'); + +test('dom element', function (t) { + t.plan(1); + + var d = document.createElement('div'); + d.setAttribute('id', 'beep'); + d.innerHTML = 'woooiiiii'; + + t.equal( + inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), + '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' + ); +}); diff --git a/node_modules/object-inspect/test/circular.js b/node_modules/object-inspect/test/circular.js new file mode 100644 index 0000000..e864cfe --- /dev/null +++ b/node_modules/object-inspect/test/circular.js @@ -0,0 +1,9 @@ +var inspect = require('../'); +var test = require('tape'); + +test('circular', function (t) { + t.plan(1); + var obj = { a: 1, b: [3, 4] }; + obj.c = obj; + t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); +}); diff --git a/node_modules/object-inspect/test/deep.js b/node_modules/object-inspect/test/deep.js new file mode 100644 index 0000000..ff1c7ea --- /dev/null +++ b/node_modules/object-inspect/test/deep.js @@ -0,0 +1,9 @@ +var inspect = require('../'); +var test = require('tape'); + +test('deep', function (t) { + t.plan(2); + var obj = [[[[[[500]]]]]]; + t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); + t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); +}); diff --git a/node_modules/object-inspect/test/element.js b/node_modules/object-inspect/test/element.js new file mode 100644 index 0000000..47fa9e2 --- /dev/null +++ b/node_modules/object-inspect/test/element.js @@ -0,0 +1,53 @@ +var inspect = require('../'); +var test = require('tape'); + +test('element', function (t) { + t.plan(3); + var elem = { + nodeName: 'div', + attributes: [{ name: 'class', value: 'row' }], + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1,
, 3 ]"); + t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1,
, 3 ]'); +}); + +test('element no attr', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); +}); + +test('element with contents', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [{ nodeName: 'b' }] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
...
, 3 ]'); +}); + +test('element instance', function (t) { + t.plan(1); + var h = global.HTMLElement; + global.HTMLElement = function (name, attr) { + this.nodeName = name; + this.attributes = attr; + }; + global.HTMLElement.prototype.getAttribute = function () {}; + + var elem = new global.HTMLElement('div', []); + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + global.HTMLElement = h; +}); diff --git a/node_modules/object-inspect/test/err.js b/node_modules/object-inspect/test/err.js new file mode 100644 index 0000000..db96338 --- /dev/null +++ b/node_modules/object-inspect/test/err.js @@ -0,0 +1,31 @@ +var inspect = require('../'); +var test = require('tape'); + +test('type error', function (t) { + t.plan(1); + var aerr = new TypeError(); + aerr.foo = 555; + aerr.bar = [1, 2, 3]; + + var berr = new TypeError('tuv'); + berr.baz = 555; + + var cerr = new SyntaxError(); + cerr.message = 'whoa'; + cerr['a-b'] = 5; + + var obj = [ + new TypeError(), + new TypeError('xxx'), + aerr, + berr, + cerr + ]; + t.equal(inspect(obj), '[ ' + [ + '[TypeError]', + '[TypeError: xxx]', + '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', + '{ [TypeError: tuv] baz: 555 }', + '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }' + ].join(', ') + ' ]'); +}); diff --git a/node_modules/object-inspect/test/fn.js b/node_modules/object-inspect/test/fn.js new file mode 100644 index 0000000..c69ef8e --- /dev/null +++ b/node_modules/object-inspect/test/fn.js @@ -0,0 +1,28 @@ +var inspect = require('../'); +var test = require('tape'); + +test('function', function (t) { + t.plan(1); + var obj = [1, 2, function f(n) { return n; }, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); +}); + +test('function name', function (t) { + t.plan(1); + var f = (function () { + return function () {}; + }()); + f.toString = function () { return 'function xxx () {}'; }; + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); +}); + +test('anon function', function (t) { + var f = (function () { + return function () {}; + }()); + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/has.js b/node_modules/object-inspect/test/has.js new file mode 100644 index 0000000..026d6d5 --- /dev/null +++ b/node_modules/object-inspect/test/has.js @@ -0,0 +1,34 @@ +var inspect = require('../'); +var test = require('tape'); + +function withoutProperty(object, property, fn) { + var original; + if (Object.getOwnPropertyDescriptor) { + original = Object.getOwnPropertyDescriptor(object, property); + } else { + original = object[property]; + } + delete object[property]; + try { + fn(); + } finally { + if (Object.getOwnPropertyDescriptor) { + Object.defineProperty(object, property, original); + } else { + object[property] = original; + } + } +} + +test('when Object#hasOwnProperty is deleted', function (t) { + t.plan(1); + var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays + + // eslint-disable-next-line no-extend-native + Array.prototype[1] = 2; // this is needed to account for "in" vs "hasOwnProperty" + + withoutProperty(Object.prototype, 'hasOwnProperty', function () { + t.equal(inspect(arr), '[ 1, , 3 ]'); + }); + delete Array.prototype[1]; +}); diff --git a/node_modules/object-inspect/test/holes.js b/node_modules/object-inspect/test/holes.js new file mode 100644 index 0000000..87fc8c8 --- /dev/null +++ b/node_modules/object-inspect/test/holes.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var inspect = require('../'); + +var xs = ['a', 'b']; +xs[5] = 'f'; +xs[7] = 'j'; +xs[8] = 'k'; + +test('holes', function (t) { + t.plan(1); + t.equal( + inspect(xs), + "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" + ); +}); diff --git a/node_modules/object-inspect/test/indent-option.js b/node_modules/object-inspect/test/indent-option.js new file mode 100644 index 0000000..89d8fce --- /dev/null +++ b/node_modules/object-inspect/test/indent-option.js @@ -0,0 +1,271 @@ +var test = require('tape'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('bad indent options', function (t) { + forEach([ + undefined, + true, + false, + -1, + 1.2, + Infinity, + -Infinity, + NaN + ], function (indent) { + t['throws']( + function () { inspect('', { indent: indent }); }, + TypeError, + inspect(indent) + ' is invalid' + ); + }); + + t.end(); +}); + +test('simple object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: 2 }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('two deep object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: { c: 3, d: 4 } }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('simple array with all single line elements', function (t) { + t.plan(2); + + var obj = [1, 2, 3, 'asdf\nsdf']; + + var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; + + t.equal(inspect(obj, { indent: 2 }), expected, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); +}); + +test('array with complex elements', function (t) { + t.plan(2); + + var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; + + var expectedSpaces = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('values', function (t) { + t.plan(2); + var obj = [{}, [], { 'a-b': 5 }]; + + var expectedSpaces = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + + var expectedStringSpaces = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabsDoubleQuotes = [ + 'Map (2) {', + ' { a: 1 } => [ "b" ],', + ' 3 => NaN', + '}' + ].join('\n'); + + t.equal( + inspect(map, { indent: 2 }), + expectedStringSpaces, + 'Map keys are not indented (two)' + ); + t.equal( + inspect(map, { indent: '\t' }), + expectedStringTabs, + 'Map keys are not indented (tabs)' + ); + t.equal( + inspect(map, { indent: '\t', quoteStyle: 'double' }), + expectedStringTabsDoubleQuotes, + 'Map keys are not indented (tabs + double quotes)' + ); + + t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); + t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + var expectedNestedSpaces = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); + t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedStringSpaces = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); + t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); + + t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); + t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + var expectedNestedSpaces = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); + t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/inspect.js b/node_modules/object-inspect/test/inspect.js new file mode 100644 index 0000000..2277e4c --- /dev/null +++ b/node_modules/object-inspect/test/inspect.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var hasSymbols = require('has-symbols')(); +var utilInspect = require('../util.inspect'); +var repeat = require('string.prototype.repeat'); + +var inspect = require('..'); + +test('inspect', function (t) { + t.plan(3); + var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []]; + t.equal(inspect(obj), '[ !XYZ¡, [] ]'); + t.equal(inspect(obj, { customInspect: true }), '[ !XYZ¡, [] ]'); + t.equal(inspect(obj, { customInspect: false }), '[ { inspect: [Function: xyzInspect] }, [] ]'); +}); + +test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) { + t.plan(3); + + var obj = { inspect: function stringInspect() { return 'string'; } }; + obj[utilInspect.custom] = function custom() { return 'symbol'; }; + + t.equal(inspect([obj, []]), '[ ' + (utilInspect.custom ? 'symbol' : 'string') + ', [] ]'); + t.equal(inspect([obj, []], { customInspect: true }), '[ ' + (utilInspect.custom ? 'symbol' : 'string') + ', [] ]'); + t.equal(inspect([obj, []], { customInspect: false }), '[ { inspect: [Function: stringInspect] }, [] ]'); +}); + +test('maxStringLength', function (t) { + t.equal( + inspect([repeat('a', 1e8)], { maxStringLength: 10 }), + '[ \'aaaaaaaaaa\'... 99999990 more characters ]', + 'maxStringLength option limits output' + ); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/lowbyte.js b/node_modules/object-inspect/test/lowbyte.js new file mode 100644 index 0000000..d234242 --- /dev/null +++ b/node_modules/object-inspect/test/lowbyte.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; + +test('interpolate low bytes', function (t) { + t.plan(1); + t.equal( + inspect(obj), + "{ x: 'a\\r\\nb', y: '\\x05! \\x1f \\x12' }" + ); +}); diff --git a/node_modules/object-inspect/test/number.js b/node_modules/object-inspect/test/number.js new file mode 100644 index 0000000..448304e --- /dev/null +++ b/node_modules/object-inspect/test/number.js @@ -0,0 +1,12 @@ +var inspect = require('../'); +var test = require('tape'); + +test('negative zero', function (t) { + t.equal(inspect(0), '0', 'inspect(0) === "0"'); + t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); + + t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); + t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/quoteStyle.js b/node_modules/object-inspect/test/quoteStyle.js new file mode 100644 index 0000000..ae4d734 --- /dev/null +++ b/node_modules/object-inspect/test/quoteStyle.js @@ -0,0 +1,17 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); + +test('quoteStyle option', function (t) { + t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/undef.js b/node_modules/object-inspect/test/undef.js new file mode 100644 index 0000000..e3f4961 --- /dev/null +++ b/node_modules/object-inspect/test/undef.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; + +test('undef and null', function (t) { + t.plan(1); + t.equal( + inspect(obj), + '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' + ); +}); diff --git a/node_modules/object-inspect/test/values.js b/node_modules/object-inspect/test/values.js new file mode 100644 index 0000000..0d40a5f --- /dev/null +++ b/node_modules/object-inspect/test/values.js @@ -0,0 +1,171 @@ +var inspect = require('../'); +var test = require('tape'); + +test('values', function (t) { + t.plan(1); + var obj = [{}, [], { 'a-b': 5 }]; + t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); +}); + +test('arrays with properties', function (t) { + t.plan(1); + var arr = [3]; + arr.foo = 'bar'; + var obj = [1, 2, arr]; + obj.baz = 'quux'; + obj.index = -1; + t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); +}); + +test('has', function (t) { + t.plan(1); + var has = Object.prototype.hasOwnProperty; + delete Object.prototype.hasOwnProperty; + t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); + Object.prototype.hasOwnProperty = has; // eslint-disable-line no-extend-native +}); + +test('indexOf seen', function (t) { + t.plan(1); + var xs = [1, 2, 3, {}]; + xs.push(xs); + + var seen = []; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[ 1, 2, 3, {}, [Circular] ]' + ); +}); + +test('seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('seen seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [5, xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('symbols', { skip: typeof Symbol !== 'function' }, function (t) { + var sym = Symbol('foo'); + t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); + t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); + t.end(); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; + t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); + t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); + + t.end(); +}); + +test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { + var map = new WeakMap(); + map.set({ a: 1 }, ['b']); + var expectedString = 'WeakMap { ? }'; + t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); + t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; + t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); + t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); + + t.end(); +}); + +test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { + var map = new WeakSet(); + map.add({ a: 1 }); + var expectedString = 'WeakSet { ? }'; + t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); + t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); + + t.end(); +}); + +test('Strings', function (t) { + var str = 'abc'; + + t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); + t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); + t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); + t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); + t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); + t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); + + t.end(); +}); + +test('Numbers', function (t) { + var num = 42; + + t.equal(inspect(num), String(num), 'primitive number shows as such'); + t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); + + t.end(); +}); + +test('Booleans', function (t) { + t.equal(inspect(true), String(true), 'primitive true shows as such'); + t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); + + t.equal(inspect(false), String(false), 'primitive false shows as such'); + t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); + + t.end(); +}); + +test('Date', function (t) { + var now = new Date(); + t.equal(inspect(now), String(now), 'Date shows properly'); + t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); + + t.end(); +}); + +test('RegExps', function (t) { + t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); + t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); + + t.end(); +}); diff --git a/node_modules/object-inspect/util.inspect.js b/node_modules/object-inspect/util.inspect.js new file mode 100644 index 0000000..7784fab --- /dev/null +++ b/node_modules/object-inspect/util.inspect.js @@ -0,0 +1 @@ +module.exports = require('util').inspect; diff --git a/node_modules/object-keys/.editorconfig b/node_modules/object-keys/.editorconfig new file mode 100644 index 0000000..eaa2141 --- /dev/null +++ b/node_modules/object-keys/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/object-keys/.eslintrc b/node_modules/object-keys/.eslintrc new file mode 100644 index 0000000..9a8d5b0 --- /dev/null +++ b/node_modules/object-keys/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 23], + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 3], + "max-statements": [2, 23], + "max-statements-per-line": [2, { "max": 2 }], + "no-extra-parens": [1], + "no-invalid-this": [1], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "LabeledStatement", "WithStatement"], + "operator-linebreak": [2, "after"] + } +} diff --git a/node_modules/object-keys/.travis.yml b/node_modules/object-keys/.travis.yml new file mode 100644 index 0000000..94a6ce4 --- /dev/null +++ b/node_modules/object-keys/.travis.yml @@ -0,0 +1,277 @@ +language: node_js +os: + - linux +node_js: + - "11.8" + - "10.15" + - "9.11" + - "8.15" + - "7.10" + - "6.16" + - "5.12" + - "4.9" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + - node_js: "lts/*" + env: POSTTEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "11.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.14" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.14" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.15" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.14" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true + - env: COVERAGE=true + - env: POSTTEST=true diff --git a/node_modules/object-keys/CHANGELOG.md b/node_modules/object-keys/CHANGELOG.md new file mode 100644 index 0000000..b7d92df --- /dev/null +++ b/node_modules/object-keys/CHANGELOG.md @@ -0,0 +1,232 @@ +1.1.1 / 2019-04-06 +================= + * [Fix] exclude deprecated Firefox keys (#53) + +1.1.0 / 2019-02-10 +================= + * [New] [Refactor] move full implementation to `implementation` entry point + * [Refactor] only evaluate the implementation if `Object.keys` is not present + * [Tests] up to `node` `v11.8`, `v10.15`, `v8.15`, `v6.16` + * [Tests] remove jscs + * [Tests] switch to `npm audit` from `nsp` + +1.0.12 / 2018-06-18 +================= + * [Fix] avoid accessing `window.applicationCache`, to avoid issues with latest Chrome on HTTP (#46) + +1.0.11 / 2016-07-05 +================= + * [Fix] exclude keys regarding the style (eg. `pageYOffset`) on `window` to avoid reflow (#32) + +1.0.10 / 2016-07-04 +================= + * [Fix] exclude `height` and `width` keys on `window` to avoid reflow (#31) + * [Fix] In IE 6, `window.external` makes `Object.keys` throw + * [Tests] up to `node` `v6.2`, `v5.10`, `v4.4` + * [Tests] use pretest/posttest for linting/security + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Dev Deps] remove unused eccheck script + dep + +1.0.9 / 2015-10-19 +================= + * [Fix] Blacklist 'frame' property on window (#16, #17) + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` + +1.0.8 / 2015-10-14 +================= + * [Fix] wrap automation equality bug checking in try/catch, per [es5-shim#327](https://github.com/es-shims/es5-shim/issues/327) + * [Fix] Blacklist 'window.frameElement' per [es5-shim#322](https://github.com/es-shims/es5-shim/issues/322) + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] up to `io.js` `v3.3`, `node` `v4.2` + * [Dev Deps] update `eslint`, `tape`, `@ljharb/eslint-config`, `jscs` + +1.0.7 / 2015-07-18 +================= + * [Fix] A proper fix for 176f03335e90d5c8d0d8125a99f27819c9b9cdad / https://github.com/es-shims/es5-shim/issues/275 that doesn't break dontEnum/constructor fixes in IE 8. + * [Fix] Remove deprecation message in Chrome by touching deprecated window properties (#15) + * [Tests] Improve test output for automation equality bugfix + * [Tests] Test on `io.js` `v2.4` + +1.0.6 / 2015-07-09 +================= + * [Fix] Use an object lookup rather than ES5's `indexOf` (#14) + * [Tests] ES3 browsers don't have `Array.isArray` + * [Tests] Fix `no-shadow` rule, as well as an IE 8 bug caused by engine NFE shadowing bugs. + +1.0.5 / 2015-07-03 +================= + * [Fix] Fix a flabbergasting IE 8 bug where `localStorage.constructor.prototype === localStorage` throws + * [Tests] Test up to `io.js` `v2.3` + * [Dev Deps] Update `nsp`, `eslint` + +1.0.4 / 2015-05-23 +================= + * Fix a Safari 5.0 bug with `Object.keys` not working with `arguments` + * Test on latest `node` and `io.js` + * Update `jscs`, `tape`, `eslint`, `nsp`, `is`, `editorconfig-tools`, `covert` + +1.0.3 / 2015-01-06 +================= + * Revert "Make `object-keys` more robust against later environment tampering" to maintain ES3 compliance + +1.0.2 / 2014-12-28 +================= + * Update lots of dev dependencies + * Tweaks to README + * Make `object-keys` more robust against later environment tampering + +1.0.1 / 2014-09-03 +================= + * Update URLs and badges in README + +1.0.0 / 2014-08-26 +================= + * v1.0.0 + +0.6.1 / 2014-08-25 +================= + * v0.6.1 + * Updating dependencies (tape, covert, is) + * Update badges in readme + * Use separate var statements + +0.6.0 / 2014-04-23 +================= + * v0.6.0 + * Updating dependencies (tape, covert) + * Make sure boxed primitives, and arguments objects, work properly in ES3 browsers + * Improve test matrix: test all node versions, but only latest two stables are a failure + * Remove internal foreach shim. + +0.5.1 / 2014-03-09 +================= + * 0.5.1 + * Updating dependencies (tape, covert, is) + * Removing forEach from the module (but keeping it in tests) + +0.5.0 / 2014-01-30 +================= + * 0.5.0 + * Explicitly returning the shim, instead of returning native Object.keys when present + * Adding a changelog. + * Cleaning up IIFE wrapping + * Testing on node 0.4 through 0.11 + +0.4.0 / 2013-08-14 +================== + + * v0.4.0 + * In Chrome 4-10 and Safari 4, typeof (new RegExp) === 'function' + * If it's a string, make sure to use charAt instead of brackets. + * Only use Function#call if necessary. + * Making sure the context tests actually run. + * Better function detection + * Adding the android browser + * Fixing testling files + * Updating tape + * Removing the "is" dependency. + * Making an isArguments shim. + * Adding a local forEach shim and tests. + * Updating paths. + * Moving the shim test. + * v0.3.0 + +0.3.0 / 2013-05-18 +================== + + * README tweak. + * Fixing constructor enum issue. Fixes [#5](https://github.com/ljharb/object-keys/issues/5). + * Adding a test for [#5](https://github.com/ljharb/object-keys/issues/5) + * Updating readme. + * Updating dependencies. + * Giving credit to lodash. + * Make sure that a prototype's constructor property is not enumerable. Fixes [#3](https://github.com/ljharb/object-keys/issues/3). + * Adding additional tests to handle arguments objects, and to skip "prototype" in functions. Fixes [#2](https://github.com/ljharb/object-keys/issues/2). + * Fixing a typo on this test for [#3](https://github.com/ljharb/object-keys/issues/3). + * Adding node 0.10 to travis. + * Adding an IE < 9 test per [#3](https://github.com/ljharb/object-keys/issues/3) + * Adding an iOS 5 mobile Safari test per [#2](https://github.com/ljharb/object-keys/issues/2) + * Moving "indexof" and "is" to be dev dependencies. + * Making sure the shim works with functions. + * Flattening the tests. + +0.2.0 / 2013-05-10 +================== + + * v0.2.0 + * Object.keys should work with arrays. + +0.1.8 / 2013-05-10 +================== + + * v0.1.8 + * Upgrading dependencies. + * Using a simpler check. + * Fixing a bug in hasDontEnumBug browsers. + * Using the newest tape! + * Fixing this error test. + * "undefined" is probably a reserved word in ES3. + * Better test message. + +0.1.7 / 2013-04-17 +================== + + * Upgrading "is" once more. + * The key "null" is breaking some browsers. + +0.1.6 / 2013-04-17 +================== + + * v0.1.6 + * Upgrading "is" + +0.1.5 / 2013-04-14 +================== + + * Bumping version. + * Adding more testling browsers. + * Updating "is" + +0.1.4 / 2013-04-08 +================== + + * Using "is" instead of "is-extended". + +0.1.3 / 2013-04-07 +================== + + * Using "foreach" instead of my own shim. + * Removing "tap"; I'll just wait for "tape" to fix its node 0.10 bug. + +0.1.2 / 2013-04-03 +================== + + * Adding dependency status; moving links to an index at the bottom. + * Upgrading is-extended; version 0.1.2 + * Adding an npm version badge. + +0.1.1 / 2013-04-01 +================== + + * Adding Travis CI. + * Bumping the version. + * Adding indexOf since IE sucks. + * Adding a forEach shim since older browsers don't have Array#forEach. + * Upgrading tape - 0.3.2 uses Array#map + * Using explicit end instead of plan. + * Can't test with Array.isArray in older browsers. + * Using is-extended. + * Fixing testling files. + * JSHint/JSLint-ing. + * Removing an unused object. + * Using strict mode. + +0.1.0 / 2013-03-30 +================== + + * Changing the exports should have meant a higher version bump. + * Oops, fixing the repo URL. + * Adding more tests. + * 0.0.2 + * Merge branch 'export_one_thing'; closes [#1](https://github.com/ljharb/object-keys/issues/1) + * Move shim export to a separate file. diff --git a/node_modules/object-keys/LICENSE b/node_modules/object-keys/LICENSE new file mode 100644 index 0000000..28553fd --- /dev/null +++ b/node_modules/object-keys/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2013 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/object-keys/README.md b/node_modules/object-keys/README.md new file mode 100644 index 0000000..ed4c277 --- /dev/null +++ b/node_modules/object-keys/README.md @@ -0,0 +1,76 @@ +#object-keys [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +An Object.keys shim. Invoke its "shim" method to shim Object.keys if it is unavailable. + +Most common usage: +```js +var keys = Object.keys || require('object-keys'); +``` + +## Example + +```js +var keys = require('object-keys'); +var assert = require('assert'); +var obj = { + a: true, + b: true, + c: true +}; + +assert.deepEqual(keys(obj), ['a', 'b', 'c']); +``` + +```js +var keys = require('object-keys'); +var assert = require('assert'); +/* when Object.keys is not present */ +delete Object.keys; +var shimmedKeys = keys.shim(); +assert.equal(shimmedKeys, keys); +assert.deepEqual(Object.keys(obj), keys(obj)); +``` + +```js +var keys = require('object-keys'); +var assert = require('assert'); +/* when Object.keys is present */ +var shimmedKeys = keys.shim(); +assert.equal(shimmedKeys, Object.keys); +assert.deepEqual(Object.keys(obj), keys(obj)); +``` + +## Source +Implementation taken directly from [es5-shim][es5-shim-url], with modifications, including from [lodash][lodash-url]. + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/object-keys +[npm-version-svg]: http://versionbadg.es/ljharb/object-keys.svg +[travis-svg]: https://travis-ci.org/ljharb/object-keys.svg +[travis-url]: https://travis-ci.org/ljharb/object-keys +[deps-svg]: https://david-dm.org/ljharb/object-keys.svg +[deps-url]: https://david-dm.org/ljharb/object-keys +[dev-deps-svg]: https://david-dm.org/ljharb/object-keys/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/object-keys#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/object-keys.png +[testling-url]: https://ci.testling.com/ljharb/object-keys +[es5-shim-url]: https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L542-589 +[lodash-url]: https://github.com/lodash/lodash +[npm-badge-png]: https://nodei.co/npm/object-keys.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/object-keys.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/object-keys.svg +[downloads-url]: http://npm-stat.com/charts.html?package=object-keys + diff --git a/node_modules/object-keys/implementation.js b/node_modules/object-keys/implementation.js new file mode 100644 index 0000000..5b32986 --- /dev/null +++ b/node_modules/object-keys/implementation.js @@ -0,0 +1,122 @@ +'use strict'; + +var keysShim; +if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = require('./isArguments'); // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } + }; + + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; + + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); + } + + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } + } + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } + } + return theKeys; + }; +} +module.exports = keysShim; diff --git a/node_modules/object-keys/index.js b/node_modules/object-keys/index.js new file mode 100644 index 0000000..a43807d --- /dev/null +++ b/node_modules/object-keys/index.js @@ -0,0 +1,32 @@ +'use strict'; + +var slice = Array.prototype.slice; +var isArgs = require('./isArguments'); + +var origKeys = Object.keys; +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation'); + +var originalKeys = Object.keys; + +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; +}; + +module.exports = keysShim; diff --git a/node_modules/object-keys/isArguments.js b/node_modules/object-keys/isArguments.js new file mode 100644 index 0000000..f2a2a90 --- /dev/null +++ b/node_modules/object-keys/isArguments.js @@ -0,0 +1,17 @@ +'use strict'; + +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; diff --git a/node_modules/object-keys/package.json b/node_modules/object-keys/package.json new file mode 100644 index 0000000..51eee9d --- /dev/null +++ b/node_modules/object-keys/package.json @@ -0,0 +1,125 @@ +{ + "_from": "object-keys@^1.1.1", + "_id": "object-keys@1.1.1", + "_inBundle": false, + "_integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "_location": "/object-keys", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-keys@^1.1.1", + "name": "object-keys", + "escapedName": "object-keys", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/define-properties", + "/es-abstract", + "/object.assign", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "_shasum": "1c47f272df277f3b1daf061677d9c82e2322c60e", + "_spec": "object-keys@^1.1.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/object.assign", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "bugs": { + "url": "https://github.com/ljharb/object-keys/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net" + }, + { + "name": "Ivan Starkov", + "email": "istarkov@gmail.com" + }, + { + "name": "Gary Katsevman", + "email": "git@gkatsev.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim", + "devDependencies": { + "@ljharb/eslint-config": "^13.1.1", + "covert": "^1.1.1", + "eslint": "^5.13.0", + "foreach": "^2.0.5", + "indexof": "^0.0.1", + "is": "^3.3.0", + "tape": "^4.9.2" + }, + "engines": { + "node": ">= 0.4" + }, + "homepage": "https://github.com/ljharb/object-keys#readme", + "keywords": [ + "Object.keys", + "keys", + "ES5", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "object-keys", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/object-keys.git" + }, + "scripts": { + "audit": "npm audit", + "coverage": "covert test/*.js", + "coverage-quiet": "covert test/*.js --quiet", + "lint": "eslint .", + "postaudit": "rm package-lock.json", + "posttest": "npm run --silent audit", + "preaudit": "npm install --package-lock --package-lock-only", + "pretest": "npm run --silent lint", + "test": "npm run --silent tests-only", + "tests-only": "node test/index.js" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.1.1" +} diff --git a/node_modules/object-keys/test/index.js b/node_modules/object-keys/test/index.js new file mode 100644 index 0000000..5402465 --- /dev/null +++ b/node_modules/object-keys/test/index.js @@ -0,0 +1,5 @@ +'use strict'; + +require('./isArguments'); + +require('./shim'); diff --git a/node_modules/object.assign/.editorconfig b/node_modules/object.assign/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/object.assign/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/object.assign/.eslintignore b/node_modules/object.assign/.eslintignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/node_modules/object.assign/.eslintignore @@ -0,0 +1 @@ +dist/ diff --git a/node_modules/object.assign/.eslintrc b/node_modules/object.assign/.eslintrc new file mode 100644 index 0000000..6d4cafd --- /dev/null +++ b/node_modules/object.assign/.eslintrc @@ -0,0 +1,26 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 19], + "id-length": [2, { "min": 1, "max": 30 }], + "max-statements": [2, 33], + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": [1, { "ignore": [0] }], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "no-invalid-this": 1, + "max-lines-per-function": 0, + "max-statements-per-line": [2, { "max": 3 }], + "no-magic-numbers": 0, + }, + }, + ], +} diff --git a/node_modules/object.assign/.github/FUNDING.yml b/node_modules/object.assign/.github/FUNDING.yml new file mode 100644 index 0000000..ef7fdbf --- /dev/null +++ b/node_modules/object.assign/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/object.assign +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/object.assign/.github/workflows/rebase.yml b/node_modules/object.assign/.github/workflows/rebase.yml new file mode 100644 index 0000000..0c2ad39 --- /dev/null +++ b/node_modules/object.assign/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request_target] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object.assign/.github/workflows/require-allow-edits.yml b/node_modules/object.assign/.github/workflows/require-allow-edits.yml new file mode 100644 index 0000000..aac42d3 --- /dev/null +++ b/node_modules/object.assign/.github/workflows/require-allow-edits.yml @@ -0,0 +1,14 @@ +name: Require “Allow Edits” + +on: [pull_request_target] + +jobs: + _: + name: "Require “Allow Edits”" + + runs-on: ubuntu-latest + + steps: + - uses: ljharb/require-allow-edits@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object.assign/CHANGELOG.md b/node_modules/object.assign/CHANGELOG.md new file mode 100644 index 0000000..87cc66b --- /dev/null +++ b/node_modules/object.assign/CHANGELOG.md @@ -0,0 +1,194 @@ +4.1.1 / 2020-09-11 +================== + * [Fix] avoid mutating `Object.assign` in modern engines + * [Refactor] use `callBind` from `es-abstract` instead of `function-bind` + * [Deps] update `has-symbols`, `object-keys`, `define-properties` + * [meta] add `funding` field, FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `browserify`, `covert`, `for-each`, `is`, `tape`, `functions-have-names`; add `aud`, `safe-publish-latest`; remove `jscs` + * [actions] add Require Allow Edits workflow + * [actions] add automatic rebasing / merge commit blocking + * [Tests] ses-compat - add test to ensure package initializes correctly after ses lockdown (#77) + * [Tests] Add passing test for a source of `window.location` (#68) + * [Tests] use shared travis-ci config + * [Tests] use `npx aud` instead of `npm audit` with hoops or `nsp` + * [Tests] use `functions-have-names` + +4.1.0 / 2017-12-21 +================== + * [New] add `auto` entry point (#52) + * [Refactor] Use `has-symbols` module + * [Deps] update `function-bind`, `object-keys` + * [Dev Deps] update `@es-shims/api`, `browserify`, `nsp`, `eslint`, `@ljharb/eslint-config`, `is` + * [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS + +4.0.4 / 2016-07-04 +================== + * [Fix] Cache original `getOwnPropertySymbols`, and use that when `Object.getOwnPropertySymbols` is unavailable + * [Deps] update `object-keys` + * [Dev Deps] update `eslint`, `get-own-property-symbols`, `core-js`, `jscs`, `nsp`, `browserify`, `@ljharb/eslint-config`, `tape`, `@es-shims/api` + * [Tests] up to `node` `v6.2`, `v5.10`, `v4.4` + * [Tests] run sham tests on node 0.10 + * [Tests] use pretest/posttest for linting/security + +4.0.3 / 2015-10-21 +================== + * [Fix] Support core-js's Symbol sham (#17) + * [Fix] Ensure that properties removed or made non-enumerable during enumeration are not assigned (#16) + * [Fix] Avoid looking up keys and values more than once + * [Tests] Avoid using `reduce` so `npm run test:shams:corejs` passes in `node` `v0.8` ([core-js#122](https://github.com/zloirock/core-js/issues/122)) + * [Tests] Refactor to use my conventional structure that separates shimmed, implementation, and common tests + * [Tests] Create `npm run test:shams` and better organize tests for symbol shams + * [Tests] Remove `nsp` in favor of `requiresafe` + +4.0.2 / 2015-10-20 +================== + * [Fix] Ensure correct property enumeration order, particularly in v8 (#15) + * [Deps] update `object-keys`, `define-properties` + * [Dev Deps] update `browserify`, `is`, `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` + * [Tests] up to `io.js` `v3.3`, `node` `v4.2` + +4.0.1 / 2015-08-16 +================== + * [Docs] Add `Symbol` note to readme + +4.0.0 / 2015-08-15 +================== + * [Breaking] Implement the [es-shim API](es-shims/api). + * [Robustness] Make implementation robust against later modification of environment methods. + * [Refactor] Move implementation to `implementation.js` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Deps] update `object-keys`, `define-properties` + * [Dev Deps] update `browserify`, `tape`, `eslint`, `jscs`, `browserify` + * [Tests] Add `npm run tests-only` + * [Tests] use my personal shared `eslint` config. + * [Tests] up to `io.js` `v3.0` + +3.0.1 / 2015-06-28 +================== + * Cache `Object` and `Array#push` to make the shim more robust. + * [Fix] Remove use of `Array#filter`, which isn't in ES3. + * [Deps] Update `object-keys`, `define-properties` + * [Dev Deps] Update `get-own-property-symbols`, `browserify`, `eslint`, `nsp` + * [Tests] Test up to `io.js` `v2.3` + * [Tests] Adding `Object.assign` tests for non-object targets, per https://github.com/paulmillr/es6-shim/issues/348 + +3.0.0 / 2015-05-20 +================== + * Attempt to feature-detect Symbols, even if `typeof Symbol() !== 'symbol'` (#12) + * Make a separate `hasSymbols` internal module + * Update `browserify`, `eslint` + +2.0.3 / 2015-06-28 +================== + * Cache `Object` and `Array#push` to make the shim more robust. + * [Fix] Remove use of `Array#filter`, which isn't in ES3 + * [Deps] Update `object-keys`, `define-properties` + * [Dev Deps] Update `browserify`, `nsp`, `eslint` + * [Tests] Test up to `io.js` `v2.3` + +2.0.2 / 2015-05-20 +================== + * Make sure `.shim` is non-enumerable. + * Refactor `.shim` implementation to use `define-properties` predicates, rather than `delete`ing the original. + * Update docs to match spec/implementation. (#11) + * Add `npm run eslint` + * Test up to `io.js` `v2.0` + * Update `jscs`, `browserify`, `covert` + +2.0.1 / 2015-04-12 +================== + * Make sure non-enumerable Symbols are excluded. + +2.0.0 / 2015-04-12 +================== + * Make sure the shim function overwrites a broken implementation with pending exceptions. + * Ensure shim is not enumerable using `define-properties` + * Ensure `Object.assign` includes symbols. + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. + * Add `npm run security` via `nsp` + * Update `browserify`, `jscs`, `tape`, `object-keys`, `is` + +1.1.1 / 2014-12-14 +================== + * Actually include the browser build in `npm` + +1.1.0 / 2014-12-14 +================== + * Add `npm run build`, and build an automatic-shimming browser distribution as part of the npm publish process. + * Update `is`, `jscs` + +1.0.3 / 2014-11-29 +================== + * Revert "optimize --production installs" + +1.0.2 / 2014-11-27 +================== + * Update `jscs`, `is`, `object-keys`, `tape` + * Add badges to README + * Name URLs in README + * Lock `covert` to `v1.0.0` + * Optimize --production installs + +1.0.1 / 2014-08-26 +================== + * Update `is`, `covert` + +1.0.0 / 2014-08-07 +================== + * Update `object-keys`, `tape` + +0.5.0 / 2014-07-31 +================== + * Object.assign no longer throws on null or undefined sources, per https://bugs.ecmascript.org/show_bug.cgi?id=3096 + +0.4.3 / 2014-07-30 +================== + * Don’t modify vars in the function signature, since it deoptimizes v8 + +0.4.2 / 2014-07-30 +================== + * Fixing the version number: v0.4.2 + +0.4.1 / 2014-07-19 +================== + * Revert "Use the native Object.keys if it’s available." + +0.4.0 / 2014-07-19 +================== + * Use the native Object.keys if it’s available. + * Fixes [#2](https://github.com/ljharb/object.assign/issues/2). + * Adding failing tests for [#2](https://github.com/ljharb/object.assign/issues/2). + * Fix indentation. + * Adding `npm run lint` + * Update `tape`, `covert` + * README: Use SVG badge for Travis [#1](https://github.com/ljharb/object.assign/issues/1) from mathiasbynens/patch-1 + +0.3.1 / 2014-04-10 +================== + * Object.assign does partially modify objects if it throws, per https://twitter.com/awbjs/status/454320863093862400 + +0.3.0 / 2014-04-10 +================== + * Update with newest ES6 behavior - Object.assign now takes a variable number of source objects. + * Update `tape` + * Make sure old and unstable nodes don’t fail Travis + +0.2.1 / 2014-03-16 +================== + * Let object-keys handle the fallback + * Update dependency badges + * Adding bower.json + +0.2.0 / 2014-03-16 +================== + * Use a for loop, because ES3 browsers don’t have "reduce" + +0.1.1 / 2014-03-14 +================== + * Updating readme + +0.1.0 / 2014-03-14 +================== + * Initial release. + diff --git a/node_modules/object.assign/LICENSE b/node_modules/object.assign/LICENSE new file mode 100644 index 0000000..ab29cbd --- /dev/null +++ b/node_modules/object.assign/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/object.assign/README.md b/node_modules/object.assign/README.md new file mode 100644 index 0000000..70b6ac4 --- /dev/null +++ b/node_modules/object.assign/README.md @@ -0,0 +1,135 @@ +#object.assign [![Version Badge][npm-version-svg]][npm-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][npm-url] + +[![browser support][testling-png]][testling-url] + +An Object.assign shim. Invoke its "shim" method to shim Object.assign if it is unavailable. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s. + +Takes a minimum of 2 arguments: `target` and `source`. +Takes a variable sized list of source arguments - at least 1, as many as you want. +Throws a TypeError if the `target` argument is `null` or `undefined`. + +Most common usage: +```js +var assign = require('object.assign').getPolyfill(); // returns native method if compliant + /* or */ +var assign = require('object.assign/polyfill')(); // returns native method if compliant +``` + +## Example + +```js +var assert = require('assert'); + +// Multiple sources! +var target = { a: true }; +var source1 = { b: true }; +var source2 = { c: true }; +var sourceN = { n: true }; + +var expected = { + a: true, + b: true, + c: true, + n: true +}; + +assign(target, source1, source2, sourceN); +assert.deepEqual(target, expected); // AWESOME! +``` + +```js +var target = { + a: true, + b: true, + c: true +}; +var source1 = { + c: false, + d: false +}; +var sourceN = { + e: false +}; + +var assigned = assign(target, source1, sourceN); +assert.equal(target, assigned); // returns the target object +assert.deepEqual(assigned, { + a: true, + b: true, + c: false, + d: false, + e: false +}); +``` + +```js +/* when Object.assign is not present */ +delete Object.assign; +var shimmedAssign = require('object.assign').shim(); + /* or */ +var shimmedAssign = require('object.assign/shim')(); + +assert.equal(shimmedAssign, assign); + +var target = { + a: true, + b: true, + c: true +}; +var source = { + c: false, + d: false, + e: false +}; + +var assigned = assign(target, source); +assert.deepEqual(Object.assign(target, source), assign(target, source)); +``` + +```js +/* when Object.assign is present */ +var shimmedAssign = require('object.assign').shim(); +assert.equal(shimmedAssign, Object.assign); + +var target = { + a: true, + b: true, + c: true +}; +var source = { + c: false, + d: false, + e: false +}; + +assert.deepEqual(Object.assign(target, source), assign(target, source)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[npm-url]: https://npmjs.org/package/object.assign +[npm-version-svg]: http://versionbadg.es/ljharb/object.assign.svg +[travis-svg]: https://travis-ci.org/ljharb/object.assign.svg +[travis-url]: https://travis-ci.org/ljharb/object.assign +[deps-svg]: https://david-dm.org/ljharb/object.assign.svg?theme=shields.io +[deps-url]: https://david-dm.org/ljharb/object.assign +[dev-deps-svg]: https://david-dm.org/ljharb/object.assign/dev-status.svg?theme=shields.io +[dev-deps-url]: https://david-dm.org/ljharb/object.assign#info=devDependencies +[testling-png]: https://ci.testling.com/ljharb/object.assign.png +[testling-url]: https://ci.testling.com/ljharb/object.assign +[npm-badge-png]: https://nodei.co/npm/object.assign.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/object.assign.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/object.assign.svg +[downloads-url]: http://npm-stat.com/charts.html?package=object.assign diff --git a/node_modules/object.assign/auto.js b/node_modules/object.assign/auto.js new file mode 100644 index 0000000..8ebf606 --- /dev/null +++ b/node_modules/object.assign/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/object.assign/dist/browser.js b/node_modules/object.assign/dist/browser.js new file mode 100644 index 0000000..4df0860 --- /dev/null +++ b/node_modules/object.assign/dist/browser.js @@ -0,0 +1,840 @@ +(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 2 ? arguments[2] : {}; + var props = keys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } +}; + +defineProperties.supportsDescriptors = !!supportsDescriptors; + +module.exports = defineProperties; + +},{"object-keys":16}],5:[function(require,module,exports){ +'use strict'; + +/* globals + AggregateError, + Atomics, + FinalizationRegistry, + SharedArrayBuffer, + WeakRef, +*/ + +var undefined; + +var $SyntaxError = SyntaxError; +var $Function = Function; +var $TypeError = TypeError; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + // eslint-disable-next-line no-new-func + return Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var asyncGenFunction = getEvalledConstructor('async function* () {}'); +var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined; +var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': getEvalledConstructor('async function () {}'), + '%AsyncGenerator%': asyncGenFunctionPrototype, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': getEvalledConstructor('function* () {}'), + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': Object, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%ReferenceError%': ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet +}; + +var LEGACY_ALIASES = { + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = require('function-bind'); +var hasOwn = require('has'); +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + if (!allowMissing && !(part in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + value = isOwn ? desc.get || desc.value : value[part]; + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; + +},{"function-bind":9,"has":14,"has-symbols":10}],6:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +module.exports = function callBind() { + return $reflectApply(bind, $call, arguments); +}; + +module.exports.apply = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +},{"../GetIntrinsic":5,"function-bind":9}],7:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; + +},{"../GetIntrinsic":5,"./callBind":6}],8:[function(require,module,exports){ +'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; +}; + +},{}],9:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; + +},{"./implementation":8}],10:[function(require,module,exports){ +(function (global){ +'use strict'; + +var origSymbol = global.Symbol; +var hasSymbolSham = require('./shams'); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./shams":11}],11:[function(require,module,exports){ +'use strict'; + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + +},{}],12:[function(require,module,exports){ +arguments[4][8][0].apply(exports,arguments) +},{"dup":8}],13:[function(require,module,exports){ +arguments[4][9][0].apply(exports,arguments) +},{"./implementation":12,"dup":9}],14:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); + +},{"function-bind":13}],15:[function(require,module,exports){ +'use strict'; + +var keysShim; +if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = require('./isArguments'); // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } + }; + + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; + + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); + } + + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } + } + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } + } + return theKeys; + }; +} +module.exports = keysShim; + +},{"./isArguments":17}],16:[function(require,module,exports){ +'use strict'; + +var slice = Array.prototype.slice; +var isArgs = require('./isArguments'); + +var origKeys = Object.keys; +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation'); + +var originalKeys = Object.keys; + +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; +}; + +module.exports = keysShim; + +},{"./implementation":15,"./isArguments":17}],17:[function(require,module,exports){ +'use strict'; + +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; + +},{}],18:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); + +var lacksProperEnumerationOrder = function () { + if (!Object.assign) { + return false; + } + /* + * v8, specifically in node 4.x, has a bug with incorrect property enumeration order + * note: this does not detect the bug unless there's 20 characters + */ + var str = 'abcdefghijklmnopqrst'; + var letters = str.split(''); + var map = {}; + for (var i = 0; i < letters.length; ++i) { + map[letters[i]] = letters[i]; + } + var obj = Object.assign({}, map); + var actual = ''; + for (var k in obj) { + actual += k; + } + return str !== actual; +}; + +var assignHasPendingExceptions = function () { + if (!Object.assign || !Object.preventExtensions) { + return false; + } + /* + * Firefox 37 still has "pending exception" logic in its Object.assign implementation, + * which is 72% slower than our shim, and Firefox 40's native implementation. + */ + var thrower = Object.preventExtensions({ 1: 2 }); + try { + Object.assign(thrower, 'xy'); + } catch (e) { + return thrower[1] === 'y'; + } + return false; +}; + +module.exports = function getPolyfill() { + if (!Object.assign) { + return implementation; + } + if (lacksProperEnumerationOrder()) { + return implementation; + } + if (assignHasPendingExceptions()) { + return implementation; + } + return Object.assign; +}; + +},{"./implementation":2}],19:[function(require,module,exports){ +'use strict'; + +var define = require('define-properties'); +var getPolyfill = require('./polyfill'); + +module.exports = function shimAssign() { + var polyfill = getPolyfill(); + define( + Object, + { assign: polyfill }, + { assign: function () { return Object.assign !== polyfill; } } + ); + return polyfill; +}; + +},{"./polyfill":18,"define-properties":4}]},{},[1]); diff --git a/node_modules/object.assign/hasSymbols.js b/node_modules/object.assign/hasSymbols.js new file mode 100644 index 0000000..34841e0 --- /dev/null +++ b/node_modules/object.assign/hasSymbols.js @@ -0,0 +1,43 @@ +'use strict'; + +var keys = require('object-keys'); + +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + /* + * temp disabled per https://github.com/ljharb/object.assign/issues/17 + * if (sym instanceof Symbol) { return false; } + * temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + * if (!(symObj instanceof Symbol)) { return false; } + */ + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-unreachable-loop + if (keys(obj).length !== 0) { return false; } + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; diff --git a/node_modules/object.assign/implementation.js b/node_modules/object.assign/implementation.js new file mode 100644 index 0000000..a1f46a6 --- /dev/null +++ b/node_modules/object.assign/implementation.js @@ -0,0 +1,42 @@ +'use strict'; + +// modified from https://github.com/es-shims/es6-shim +var keys = require('object-keys'); +var canBeObject = function (obj) { + return typeof obj !== 'undefined' && obj !== null; +}; +var hasSymbols = require('has-symbols/shams')(); +var callBound = require('es-abstract/helpers/callBound'); +var toObject = Object; +var $push = callBound('Array.prototype.push'); +var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; + +// eslint-disable-next-line no-unused-vars +module.exports = function assign(target, source1) { + if (!canBeObject(target)) { throw new TypeError('target must be an object'); } + var objTarget = toObject(target); + var s, source, i, props, syms, value, key; + for (s = 1; s < arguments.length; ++s) { + source = toObject(arguments[s]); + props = keys(source); + var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); + if (getSymbols) { + syms = getSymbols(source); + for (i = 0; i < syms.length; ++i) { + key = syms[i]; + if ($propIsEnumerable(source, key)) { + $push(props, key); + } + } + } + for (i = 0; i < props.length; ++i) { + key = props[i]; + value = source[key]; + if ($propIsEnumerable(source, key)) { + objTarget[key] = value; + } + } + } + return objTarget; +}; diff --git a/node_modules/object.assign/index.js b/node_modules/object.assign/index.js new file mode 100644 index 0000000..894f138 --- /dev/null +++ b/node_modules/object.assign/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var defineProperties = require('define-properties'); +var callBind = require('es-abstract/helpers/callBind'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var polyfill = callBind.apply(getPolyfill()); +// eslint-disable-next-line no-unused-vars +var bound = function assign(target, source1) { + return polyfill(Object, arguments); +}; + +defineProperties(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; diff --git a/node_modules/object.assign/package.json b/node_modules/object.assign/package.json new file mode 100644 index 0000000..3f59e4c --- /dev/null +++ b/node_modules/object.assign/package.json @@ -0,0 +1,122 @@ +{ + "_from": "object.assign@^4.1.0", + "_id": "object.assign@4.1.1", + "_inBundle": false, + "_integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "_location": "/object.assign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object.assign@^4.1.0", + "name": "object.assign", + "escapedName": "object.assign", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/eslint-config-airbnb-base", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "_shasum": "303867a666cdd41936ecdedfb1f8f3e32a478cdd", + "_spec": "object.assign@^4.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-config-airbnb-base", + "author": { + "name": "Jordan Harband" + }, + "bugs": { + "url": "https://github.com/ljharb/object.assign/issues" + }, + "bundleDependencies": false, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "deprecated": false, + "description": "ES6 spec-compliant Object.assign shim. From https://github.com/es-shims/es6-shim", + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^17.2.0", + "aud": "^1.1.2", + "browserify": "^16.5.0", + "covert": "^1.1.1", + "eslint": "^7.8.1", + "for-each": "^0.3.3", + "functions-have-names": "^1.2.1", + "has": "^1.0.3", + "is": "^3.3.0", + "safe-publish-latest": "^1.1.4", + "ses": "^0.10.3", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/object.assign#readme", + "keywords": [ + "Object.assign", + "assign", + "ES6", + "extend", + "$.extend", + "jQuery", + "_.extend", + "Underscore", + "es-shim API", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "object.assign", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/object.assign.git" + }, + "scripts": { + "build": "mkdir -p dist && browserify browserShim.js > dist/browser.js", + "coverage": "covert test/*.js", + "lint": "eslint .", + "posttest": "aud --production", + "prepublish": "safe-publish-latest && npm run build", + "pretest": "npm run --silent lint && es-shim-api --bound", + "test": "npm run --silent tests-only && npm run test:ses", + "test:implementation": "node test", + "test:native": "node test/native", + "test:ses": "node test/ses-compat", + "test:shim": "node test/shimmed", + "tests-only": "npm run --silent test:implementation && npm run --silent test:shim" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "4.1.1" +} diff --git a/node_modules/object.assign/polyfill.js b/node_modules/object.assign/polyfill.js new file mode 100644 index 0000000..ca94aea --- /dev/null +++ b/node_modules/object.assign/polyfill.js @@ -0,0 +1,55 @@ +'use strict'; + +var implementation = require('./implementation'); + +var lacksProperEnumerationOrder = function () { + if (!Object.assign) { + return false; + } + /* + * v8, specifically in node 4.x, has a bug with incorrect property enumeration order + * note: this does not detect the bug unless there's 20 characters + */ + var str = 'abcdefghijklmnopqrst'; + var letters = str.split(''); + var map = {}; + for (var i = 0; i < letters.length; ++i) { + map[letters[i]] = letters[i]; + } + var obj = Object.assign({}, map); + var actual = ''; + for (var k in obj) { + actual += k; + } + return str !== actual; +}; + +var assignHasPendingExceptions = function () { + if (!Object.assign || !Object.preventExtensions) { + return false; + } + /* + * Firefox 37 still has "pending exception" logic in its Object.assign implementation, + * which is 72% slower than our shim, and Firefox 40's native implementation. + */ + var thrower = Object.preventExtensions({ 1: 2 }); + try { + Object.assign(thrower, 'xy'); + } catch (e) { + return thrower[1] === 'y'; + } + return false; +}; + +module.exports = function getPolyfill() { + if (!Object.assign) { + return implementation; + } + if (lacksProperEnumerationOrder()) { + return implementation; + } + if (assignHasPendingExceptions()) { + return implementation; + } + return Object.assign; +}; diff --git a/node_modules/object.assign/shim.js b/node_modules/object.assign/shim.js new file mode 100644 index 0000000..9f896ae --- /dev/null +++ b/node_modules/object.assign/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var define = require('define-properties'); +var getPolyfill = require('./polyfill'); + +module.exports = function shimAssign() { + var polyfill = getPolyfill(); + define( + Object, + { assign: polyfill }, + { assign: function () { return Object.assign !== polyfill; } } + ); + return polyfill; +}; diff --git a/node_modules/object.assign/test/index.js b/node_modules/object.assign/test/index.js new file mode 100644 index 0000000..776b2b3 --- /dev/null +++ b/node_modules/object.assign/test/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var assign = require('../'); +var test = require('tape'); +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('bad array/this value', function (st) { + st['throws'](function () { assign(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { assign(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(assign, t); + + t.end(); +}); diff --git a/node_modules/object.assign/test/native.js b/node_modules/object.assign/test/native.js new file mode 100644 index 0000000..49a70f7 --- /dev/null +++ b/node_modules/object.assign/test/native.js @@ -0,0 +1,49 @@ +'use strict'; + +var test = require('tape'); +var defineProperties = require('define-properties'); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names')(); + +var runTests = require('./tests'); + +test('native', function (t) { + t.equal(Object.assign.length, 2, 'Object.assign has a length of 2'); + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Object.assign.name, 'assign', 'Object.assign has name "assign"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Object, 'assign'), 'Object.assign is not enumerable'); + et.end(); + }); + + var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); + + t.test('bad object value', { skip: !supportsStrictMode }, function (st) { + st['throws'](function () { return Object.assign(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Object.assign(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + // v8 in node 0.8 and 0.10 have non-enumerable string properties + var stringCharsAreEnumerable = isEnumerable.call('xy', 0); + t.test('when Object.assign is present and has pending exceptions', { skip: !stringCharsAreEnumerable || !Object.preventExtensions }, function (st) { + /* + * Firefox 37 still has "pending exception" logic in its Object.assign implementation, + * which is 72% slower than our shim, and Firefox 40's native implementation. + */ + var thrower = Object.preventExtensions({ 1: '2' }); + var error; + try { Object.assign(thrower, 'xy'); } catch (e) { error = e; } + st.equal(error instanceof TypeError, true, 'error is TypeError'); + st.equal(thrower[1], '2', 'thrower[1] === "2"'); + + st.end(); + }); + + runTests(Object.assign, t); + + t.end(); +}); diff --git a/node_modules/object.assign/test/ses-compat.js b/node_modules/object.assign/test/ses-compat.js new file mode 100644 index 0000000..5b14cba --- /dev/null +++ b/node_modules/object.assign/test/ses-compat.js @@ -0,0 +1,15 @@ +'use strict'; + +// requiring ses exposes "lockdown" on the global +require('ses'); + +/* + * lockdown freezes the primordials + * disabling the error taming makes debugging much easier + * lockdown({ errorTaming: 'unsafe' }); + */ +// eslint-disable-next-line no-undef +lockdown(); + +// initialize the module +require('..'); diff --git a/node_modules/object.assign/test/shimmed.js b/node_modules/object.assign/test/shimmed.js new file mode 100644 index 0000000..ee57758 --- /dev/null +++ b/node_modules/object.assign/test/shimmed.js @@ -0,0 +1,52 @@ +'use strict'; + +var assign = require('../'); +assign.shim(); + +var test = require('tape'); +var defineProperties = require('define-properties'); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names')(); + +var runTests = require('./tests'); + +test('shimmed', function (t) { + t.equal(Object.assign.length, 2, 'Object.assign has a length of 2'); + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Object.assign.name, 'assign', 'Object.assign has name "assign"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Object, 'assign'), 'Object.assign is not enumerable'); + et.end(); + }); + + var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); + + t.test('bad object value', { skip: !supportsStrictMode }, function (st) { + st['throws'](function () { return Object.assign(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Object.assign(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + // v8 in node 0.8 and 0.10 have non-enumerable string properties + var stringCharsAreEnumerable = isEnumerable.call('xy', 0); + t.test('when Object.assign is present and has pending exceptions', { skip: !stringCharsAreEnumerable || !Object.preventExtensions }, function (st) { + /* + * Firefox 37 still has "pending exception" logic in its Object.assign implementation, + * which is 72% slower than our shim, and Firefox 40's native implementation. + */ + var thrower = Object.preventExtensions({ 1: '2' }); + var error; + try { Object.assign(thrower, 'xy'); } catch (e) { error = e; } + st.equal(error instanceof TypeError, true, 'error is TypeError'); + st.equal(thrower[1], '2', 'thrower[1] === "2"'); + + st.end(); + }); + + runTests(Object.assign, t); + + t.end(); +}); diff --git a/node_modules/object.assign/test/tests.js b/node_modules/object.assign/test/tests.js new file mode 100644 index 0000000..994a8de --- /dev/null +++ b/node_modules/object.assign/test/tests.js @@ -0,0 +1,237 @@ +'use strict'; + +var hasSymbols = require('has-symbols/shams')(); +var forEach = require('for-each'); +var has = require('has'); + +module.exports = function (assign, t) { + t.test('error cases', function (st) { + st['throws'](function () { assign(null); }, TypeError, 'target must be an object'); + st['throws'](function () { assign(undefined); }, TypeError, 'target must be an object'); + st['throws'](function () { assign(null, {}); }, TypeError, 'target must be an object'); + st['throws'](function () { assign(undefined, {}); }, TypeError, 'target must be an object'); + st.end(); + }); + + t.test('non-object target, no sources', function (st) { + var bool = assign(true); + st.equal(typeof bool, 'object', 'bool is object'); + st.equal(Boolean.prototype.valueOf.call(bool), true, 'bool coerces to `true`'); + + var number = assign(1); + st.equal(typeof number, 'object', 'number is object'); + st.equal(Number.prototype.valueOf.call(number), 1, 'number coerces to `1`'); + + var string = assign('1'); + st.equal(typeof string, 'object', 'number is object'); + st.equal(String.prototype.valueOf.call(string), '1', 'number coerces to `"1"`'); + + st.end(); + }); + + t.test('non-object target, with sources', function (st) { + var signal = {}; + + st.test('boolean', function (st2) { + var bool = assign(true, { a: signal }); + st2.equal(typeof bool, 'object', 'bool is object'); + st2.equal(Boolean.prototype.valueOf.call(bool), true, 'bool coerces to `true`'); + st2.equal(bool.a, signal, 'source properties copied'); + st2.end(); + }); + + st.test('number', function (st2) { + var number = assign(1, { a: signal }); + st2.equal(typeof number, 'object', 'number is object'); + st2.equal(Number.prototype.valueOf.call(number), 1, 'number coerces to `1`'); + st2.equal(number.a, signal, 'source properties copied'); + st2.end(); + }); + + st.test('string', function (st2) { + var string = assign('1', { a: signal }); + st2.equal(typeof string, 'object', 'number is object'); + st2.equal(String.prototype.valueOf.call(string), '1', 'number coerces to `"1"`'); + st2.equal(string.a, signal, 'source properties copied'); + st2.end(); + }); + + st.end(); + }); + + t.test('non-object sources', function (st) { + st.deepEqual(assign({ a: 1 }, null, { b: 2 }), { a: 1, b: 2 }, 'ignores null source'); + st.deepEqual(assign({ a: 1 }, { b: 2 }, undefined), { a: 1, b: 2 }, 'ignores undefined source'); + st.end(); + }); + + t.test('returns the modified target object', function (st) { + var target = {}; + var returned = assign(target, { a: 1 }); + st.equal(returned, target, 'returned object is the same reference as the target object'); + st.end(); + }); + + t.test('has the right length', function (st) { + st.equal(assign.length, 2, 'length is 2 => 2 required arguments'); + st.end(); + }); + + t.test('merge two objects', function (st) { + var target = { a: 1 }; + var returned = assign(target, { b: 2 }); + st.deepEqual(returned, { a: 1, b: 2 }, 'returned object has properties from both'); + st.end(); + }); + + t.test('works with functions', function (st) { + var target = function () {}; + target.a = 1; + var returned = assign(target, { b: 2 }); + st.equal(target, returned, 'returned object is target'); + st.equal(returned.a, 1); + st.equal(returned.b, 2); + st.end(); + }); + + t.test('works with primitives', function (st) { + var target = 2; + var source = { b: 42 }; + var returned = assign(target, source); + st.equal(Object.prototype.toString.call(returned), '[object Number]', 'returned is object form of number primitive'); + st.equal(Number(returned), target, 'returned and target have same valueOf'); + st.equal(returned.b, source.b); + st.end(); + }); + + /* globals window */ + t.test('works with window.location', { skip: typeof window === 'undefined' }, function (st) { + var target = {}; + assign(target, window.location); + for (var prop in window.location) { + if (has(window.location, prop)) { + st.deepEqual(target[prop], window.location[prop], prop + ' is copied'); + } + } + st.end(); + }); + + t.test('merge N objects', function (st) { + var target = { a: 1 }; + var source1 = { b: 2 }; + var source2 = { c: 3 }; + var returned = assign(target, source1, source2); + st.deepEqual(returned, { a: 1, b: 2, c: 3 }, 'returned object has properties from all sources'); + st.end(); + }); + + t.test('only iterates over own keys', function (st) { + var Foo = function () {}; + Foo.prototype.bar = true; + var foo = new Foo(); + foo.baz = true; + var target = { a: 1 }; + var returned = assign(target, foo); + st.equal(returned, target, 'returned object is the same reference as the target object'); + st.deepEqual(target, { a: 1, baz: true }, 'returned object has only own properties from both'); + st.end(); + }); + + t.test('includes enumerable symbols, after keys', { skip: !hasSymbols }, function (st) { + var visited = []; + var obj = {}; + Object.defineProperty(obj, 'a', { enumerable: true, get: function () { visited.push('a'); return 42; } }); + var symbol = Symbol('enumerable'); + Object.defineProperty(obj, symbol, { + enumerable: true, + get: function () { visited.push(symbol); return Infinity; } + }); + var nonEnumSymbol = Symbol('non-enumerable'); + Object.defineProperty(obj, nonEnumSymbol, { + enumerable: false, + get: function () { visited.push(nonEnumSymbol); return -Infinity; } + }); + var target = assign({}, obj); + st.deepEqual(visited, ['a', symbol], 'key is visited first, then symbol'); + st.equal(target.a, 42, 'target.a is 42'); + st.equal(target[symbol], Infinity, 'target[symbol] is Infinity'); + st.notEqual(target[nonEnumSymbol], -Infinity, 'target[nonEnumSymbol] is not -Infinity'); + st.end(); + }); + + t.test('does not fail when symbols are not present', function (st) { + var getSyms; + if (hasSymbols) { + getSyms = Object.getOwnPropertySymbols; + delete Object.getOwnPropertySymbols; + } + + var visited = []; + var obj = {}; + Object.defineProperty(obj, 'a', { enumerable: true, get: function () { visited.push('a'); return 42; } }); + var keys = ['a']; + if (hasSymbols) { + var symbol = Symbol('sym'); + Object.defineProperty(obj, symbol, { + enumerable: true, + get: function () { visited.push(symbol); return Infinity; } + }); + keys.push(symbol); + } + var target = assign({}, obj); + st.deepEqual(visited, keys, 'assign visits expected keys'); + st.equal(target.a, 42, 'target.a is 42'); + + if (hasSymbols) { + st.equal(target[symbol], Infinity); + + Object.getOwnPropertySymbols = getSyms; + } + st.end(); + }); + + t.test('preserves correct property enumeration order', function (st) { + var str = 'abcdefghijklmnopqrst'; + var letters = {}; + forEach(str.split(''), function (letter) { + letters[letter] = letter; + }); + + var n = 5; + st.comment('run the next test ' + n + ' times'); + var object = assign({}, letters); + var actual = ''; + for (var k in object) { + actual += k; + } + for (var i = 0; i < n; ++i) { + st.equal(actual, str, 'property enumeration order should be followed'); + } + st.end(); + }); + + t.test('checks enumerability and existence, in case of modification during [[Get]]', { skip: !Object.defineProperty }, function (st) { + var targetBvalue = {}; + var targetCvalue = {}; + var target = { b: targetBvalue, c: targetCvalue }; + var source = {}; + Object.defineProperty(source, 'a', { + enumerable: true, + get: function () { + delete this.b; + Object.defineProperty(this, 'c', { enumerable: false }); + return 'a'; + } + }); + var sourceBvalue = {}; + var sourceCvalue = {}; + source.b = sourceBvalue; + source.c = sourceCvalue; + var result = assign(target, source); + st.equal(result, target, 'sanity check: result is === target'); + st.equal(result.b, targetBvalue, 'target key not overwritten by deleted source key'); + st.equal(result.c, targetCvalue, 'target key not overwritten by non-enumerable source key'); + + st.end(); + }); +}; diff --git a/node_modules/object.entries/.editorconfig b/node_modules/object.entries/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/object.entries/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/object.entries/.eslintrc b/node_modules/object.entries/.eslintrc new file mode 100644 index 0000000..15c95c1 --- /dev/null +++ b/node_modules/object.entries/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "new-cap": [2, { "capIsNewExceptions": ["RequireObjectCoercible"] }], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"] + } +} diff --git a/node_modules/object.entries/.github/workflows/rebase.yml b/node_modules/object.entries/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/object.entries/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object.entries/.travis.yml b/node_modules/object.entries/.travis.yml new file mode 100644 index 0000000..5ed0fa5 --- /dev/null +++ b/node_modules/object.entries/.travis.yml @@ -0,0 +1,8 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml diff --git a/node_modules/object.entries/CHANGELOG.md b/node_modules/object.entries/CHANGELOG.md new file mode 100644 index 0000000..6a32b2a --- /dev/null +++ b/node_modules/object.entries/CHANGELOG.md @@ -0,0 +1,124 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.1.2](https://github.com/ljharb/Object.entries/compare/v1.1.1...v1.1.2) - 2020-05-20 + +### Commits + +- [meta] add `auto-changelog` [`29e2771`](https://github.com/ljharb/Object.entries/commit/29e2771f01d3cc14c9372584ca8c966ccd10a294) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `functions-have-names`; add `safe-publish-latest` [`f30dde0`](https://github.com/ljharb/Object.entries/commit/f30dde0d2061c6f17078c45db925d536b3986327) +- [Refactor] use `callBound` instead of `function-bind` [`db94733`](https://github.com/ljharb/Object.entries/commit/db94733a409286914f0b0067ced2a05e0af34064) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`; add `aud` [`124d3bb`](https://github.com/ljharb/Object.entries/commit/124d3bb9f14c7f117aec7310fd0a461e90d7255b) +- [Fix] do not mutate the native function when present [`fffb674`](https://github.com/ljharb/Object.entries/commit/fffb6746635276a921eb6c893d230448d89d8436) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`5552db4`](https://github.com/ljharb/Object.entries/commit/5552db46d67f9d9b2de2952d44b96a883b96007d) +- [Deps] update `es-abstract` [`bcf93d0`](https://github.com/ljharb/Object.entries/commit/bcf93d0dc0a5b1a3cd0620ad75876d09602524bd) +- [meta] only run `aud` on prod deps [`13c35c9`](https://github.com/ljharb/Object.entries/commit/13c35c9d8e0b1e30be0ea9e5307ea552d8b31143) +- [Deps] update `es-abstract` [`9374fed`](https://github.com/ljharb/Object.entries/commit/9374fed15ca58ba6af9494d1bc61634e9a6b9d8b) + +## [v1.1.1](https://github.com/ljharb/Object.entries/compare/v1.1.0...v1.1.1) - 2019-12-12 + +### Commits + +- [Tests] use shared travis-ci configs [`576c8a7`](https://github.com/ljharb/Object.entries/commit/576c8a7db358c79ba8135a0c87c91e6e3f31c91a) +- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17`; use `nvm install-latest-npm` [`26c5a45`](https://github.com/ljharb/Object.entries/commit/26c5a4570bb7c4a535921e5e1a51e1f22f2fbd80) +- [actions] add automatic rebasing / merge commit blocking [`3253bdf`](https://github.com/ljharb/Object.entries/commit/3253bdf6b24d83414db15b4175eaf2fa0fdd1b5f) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names` [`bf480ef`](https://github.com/ljharb/Object.entries/commit/bf480efed7cdd20bd99d2d441bf99472fc061057) +- [Refactor] use split-up `es-abstract` (85% bundle size decrease) [`3fd42b9`](https://github.com/ljharb/Object.entries/commit/3fd42b97b91a2192b20f3b6f04c7e658ba841955) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9bf7f7f`](https://github.com/ljharb/Object.entries/commit/9bf7f7feaab5b4d1ffbd19e63a91db619fc3c15d) +- [meta] clean up scripts [`908f4fd`](https://github.com/ljharb/Object.entries/commit/908f4fdc3c7b7bb4fd595b8136715254e1462d01) +- [Dev Deps] update `eslint`, `tape` [`213436c`](https://github.com/ljharb/Object.entries/commit/213436c385c49dd9f50aacfeb77a85a44c276de6) +- [Tests] use `functions-have-names` [`8cd5de5`](https://github.com/ljharb/Object.entries/commit/8cd5de572695fcf0ffda03714cd0a0754a296edb) +- [Deps] update `es-abstract` [`3a2ca03`](https://github.com/ljharb/Object.entries/commit/3a2ca0383cc511c05f196820a264e81e3dad0a54) + +## [v1.1.0](https://github.com/ljharb/Object.entries/compare/v1.0.4...v1.1.0) - 2019-01-01 + +### Fixed + +- Exclude test.html from the npm package. [`#12`](https://github.com/ljharb/Object.entries/issues/12) + +### Commits + +- [Tests] remove `jscs` [`052aed1`](https://github.com/ljharb/Object.entries/commit/052aed1bba3d9b1fc177d8570110291740ffa3d0) +- [Tests] up to `node` `v11.1`, `v10.13`, `v9.11`, `v8.12`, `v7.10`, `v6.14`, `v4.9`; use `nvm install-latest-npm` [`0015678`](https://github.com/ljharb/Object.entries/commit/001567848e2c81be9df50f3e7e16cdfbe168f815) +- [Tests] up to `node` `v7.4`, `v4.7`; improve test matrix [`6f19e66`](https://github.com/ljharb/Object.entries/commit/6f19e66bbbf6d38628589ad3654fd3cb3299cc47) +- [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` [`89415ba`](https://github.com/ljharb/Object.entries/commit/89415ba61eb7260b7f16ad7df95c40a3f175fa5a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `tape` [`91f9ee6`](https://github.com/ljharb/Object.entries/commit/91f9ee65a28021d42fe53fb3b0341160c691f876) +- [New] add `auto` entry point` [`9799c0d`](https://github.com/ljharb/Object.entries/commit/9799c0d8634cfecb68038a1770fcb35e184ebe94) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`074677d`](https://github.com/ljharb/Object.entries/commit/074677d53f2226fc1f09ed18275ce0963cf60998) +- [Deps] update `define-properties`, `es-abstract`, `function-bind`, `has` [`db5d97e`](https://github.com/ljharb/Object.entries/commit/db5d97ed6ff82757df50bc776afa9aa8260bdb3b) +- [Tests] use `npm audit` instead of `nsp` [`bc3e6a7`](https://github.com/ljharb/Object.entries/commit/bc3e6a74aa961adee9e66bb46c02ca5aa5eba8fd) +- Only apps should have lockfiles [`d192ab7`](https://github.com/ljharb/Object.entries/commit/d192ab7e6bfd9e2c4260e82097ab5d81915cc30f) + +## [v1.0.4](https://github.com/ljharb/Object.entries/compare/v1.0.3...v1.0.4) - 2016-12-04 + +### Commits + +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `@es-shims/api` [`cf4a9cf`](https://github.com/ljharb/Object.entries/commit/cf4a9cf9f0397a5ff385801879df86316b90cc00) +- [Tests] up to `node` `v7.2`, `v6.9`, `v4.6`; improve test matrix. [`281ccbd`](https://github.com/ljharb/Object.entries/commit/281ccbd6fe3b3bf6f214bd628679963bbe34ed7e) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`33fb890`](https://github.com/ljharb/Object.entries/commit/33fb8903265ac8e5ec64bde093c1b2a047e9e709) +- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`7c1ea3f`](https://github.com/ljharb/Object.entries/commit/7c1ea3f748fce028d95b4f4e87104725a3659aaa) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`f9473c7`](https://github.com/ljharb/Object.entries/commit/f9473c7f49d894c5e6de116652aa39420889f549) +- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@es-shims/api` [`1368a76`](https://github.com/ljharb/Object.entries/commit/1368a7680f0bb37063e006d81879623a6a8021cc) +- [Tests] up to `v5.6`, `v4.3` [`7ad9976`](https://github.com/ljharb/Object.entries/commit/7ad9976601f953997142d7a23fd7714345474f52) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`6bf18dc`](https://github.com/ljharb/Object.entries/commit/6bf18dc431fbff454b4a3a0531450250aadbbc49) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`a45c239`](https://github.com/ljharb/Object.entries/commit/a45c239369a29305ea854e5a99ebaef3199e3dfa) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`13f7d10`](https://github.com/ljharb/Object.entries/commit/13f7d10ddf5947d2b3c853edfd2a450498dd3694) +- [Tests] up to `node` `v5.9`, `v4.4` [`261533c`](https://github.com/ljharb/Object.entries/commit/261533c95bde27255ff86f9f20d4de958d48e860) +- [Dev Deps] update `jscs` [`8dd7b5f`](https://github.com/ljharb/Object.entries/commit/8dd7b5f169295af19b363ccccd39eeb8c25bb688) +- [Docs] update to reflect ES2017 inclusion. [`7662206`](https://github.com/ljharb/Object.entries/commit/7662206b05bd30f4851fd94eb6c27051601387eb) +- [Tests] use pretest/posttest for linting/security [`87d62ad`](https://github.com/ljharb/Object.entries/commit/87d62ad0fd1212bbb827a8be9a121906f4498835) +- [Tests] fix npm upgrades on older nodes [`67cabde`](https://github.com/ljharb/Object.entries/commit/67cabdeb4860c94a96c2075581260c5862dd3564) +- [Tests] up to `node` `v6.2` [`c50c154`](https://github.com/ljharb/Object.entries/commit/c50c154edb3acdc4741ef55df9e2d2cdae9a11d3) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`ff17ab8`](https://github.com/ljharb/Object.entries/commit/ff17ab8b5f27535b4f048afe6d7340319bb051cd) +- [Deps] update `es-abstract` [`b8be50a`](https://github.com/ljharb/Object.entries/commit/b8be50ab1beab650243dc4066d2e90ec755f79e9) +- [Deps] update `es-abstract` [`fb3a7e1`](https://github.com/ljharb/Object.entries/commit/fb3a7e192617e8247730818b6d6ff977304184b5) +- [Tests] on `node` `v5.12` [`ba624ca`](https://github.com/ljharb/Object.entries/commit/ba624caff1a2a722d17c495bd35d4b0994f4cc42) +- [Tests] on `node` `v5.10` [`e513ca5`](https://github.com/ljharb/Object.entries/commit/e513ca566d2ca3e39f0638e15cb1f126f82d14ca) +- [Deps] update `function-bind` [`6e25d29`](https://github.com/ljharb/Object.entries/commit/6e25d2992bf73908d6e544e8563997c81053f9e2) +- [Deps] update `es-abstract` [`bf680a4`](https://github.com/ljharb/Object.entries/commit/bf680a49bd7dccd98b58ab35b994306b199c3c94) +- [Deps] update `es-abstract` [`fbb209b`](https://github.com/ljharb/Object.entries/commit/fbb209b786bdd23d169b38c9dda1d2b38fae5e73) +- [Deps] update `define-properties` [`77d4ead`](https://github.com/ljharb/Object.entries/commit/77d4ead3e5f5f2877f5e3cba99cdd0e293089811) +- [Tests] on `node` `v4.2` [`d946594`](https://github.com/ljharb/Object.entries/commit/d946594e73f99a3896f89ce5e517effd7f9c8487) +- [Tests] on `node` `v5.0` [`80d7d16`](https://github.com/ljharb/Object.entries/commit/80d7d16f766d22bd9134d8bc5d796ef2e67d2239) + +## [v1.0.3](https://github.com/ljharb/Object.entries/compare/v1.0.2...v1.0.3) - 2015-10-06 + +### Commits + +- Add test case to cover non-enumerable keys made enumerable by a previous getter. [`5b53808`](https://github.com/ljharb/Object.entries/commit/5b53808de5c7af8070b398a7d23fcfa60713ba70) +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` [`1c3ddff`](https://github.com/ljharb/Object.entries/commit/1c3ddff43a0ad435ebd23cb09ade6ceec3e38f02) +- [Dev Deps] update `jscs`, `eslint` [`0a0f1be`](https://github.com/ljharb/Object.entries/commit/0a0f1be8d4cb060689e5e7e8a16a8de5a358b599) +- [Deps] update `es-abstract` [`8cacfdc`](https://github.com/ljharb/Object.entries/commit/8cacfdc380db1f73f7f4331c934119c8323f39a3) + +## [v1.0.2](https://github.com/ljharb/Object.entries/compare/v1.0.1...v1.0.2) - 2015-09-25 + +### Fixed + +- Not-yet-visited keys deleted on a [[Get]] must not show up in the output [`#1`](https://github.com/ljharb/Object.entries/issues/1) + +## [v1.0.1](https://github.com/ljharb/Object.entries/compare/v1.0.0...v1.0.1) - 2015-09-21 + +### Commits + +- [Tests] on `iojs` `v3.3`, up to `node` `v4.1` [`181f888`](https://github.com/ljharb/Object.entries/commit/181f888a24cc89e2e3fd5cf2b93abbbda204242f) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`e93536e`](https://github.com/ljharb/Object.entries/commit/e93536e3313967445764e27cd146800c18133060) +- Add es-shim API keyword [`51080c2`](https://github.com/ljharb/Object.entries/commit/51080c2c41f19567f1bda40d5dd00e7d8f177d64) +- [Docs] update version badge URL [`398a7e4`](https://github.com/ljharb/Object.entries/commit/398a7e4550eb37adf880013a735875a8986181da) + +## v1.0.0 - 2015-09-02 + +### Commits + +- Dotfiles [`3a59351`](https://github.com/ljharb/Object.entries/commit/3a59351792c3b06ffbb6f515198a35955a0a1124) +- Tests [`bd1ceae`](https://github.com/ljharb/Object.entries/commit/bd1ceae7b6e16381da6065513ce4373e0f15e0ad) +- package.json [`301832d`](https://github.com/ljharb/Object.entries/commit/301832d1fb1a688f879f7d06451062d2fea7671f) +- Read me [`d92e775`](https://github.com/ljharb/Object.entries/commit/d92e7756a80e0e3e2a32a1b6525b8d48ecd73391) +- Initial commit [`212a7ce`](https://github.com/ljharb/Object.entries/commit/212a7ce24ef0edbcc8c84d5d3338fe3a60ffa963) +- Implementation. [`8fd8aae`](https://github.com/ljharb/Object.entries/commit/8fd8aae302b1d25db118e5f127ff887e04f966c7) +- Clarifying tests that only Symbol *properties* are omitted. [`1b5cb92`](https://github.com/ljharb/Object.entries/commit/1b5cb92ae7edde17fb17971f961d157bef714c63) diff --git a/node_modules/object.entries/LICENSE b/node_modules/object.entries/LICENSE new file mode 100644 index 0000000..b43df44 --- /dev/null +++ b/node_modules/object.entries/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/object.entries/README.md b/node_modules/object.entries/README.md new file mode 100644 index 0000000..f0cdbfd --- /dev/null +++ b/node_modules/object.entries/README.md @@ -0,0 +1,59 @@ +# object.entries [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +An ES2017 spec-compliant `Object.entries` shim. Invoke its "shim" method to shim `Object.entries` if it is unavailable or noncompliant. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.github.io/ecma262/#sec-object.entries). + +Most common usage: +```js +var assert = require('assert'); +var entries = require('object.entries'); + +var obj = { a: 1, b: 2, c: 3 }; +var expected = [['a', 1], ['b', 2], ['c', 3]]; + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + // for environments with Symbol support + var sym = Symbol(); + obj[sym] = 4; + obj.d = sym; + expected.push(['d', sym]); +} + +assert.deepEqual(entries(obj), expected); + +if (!Object.entries) { + entries.shim(); +} + +assert.deepEqual(Object.entries(obj), expected); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.com/package/object.entries +[npm-version-svg]: http://versionbadg.es/es-shims/Object.entries.svg +[travis-svg]: https://travis-ci.org/es-shims/Object.entries.svg +[travis-url]: https://travis-ci.org/es-shims/Object.entries +[deps-svg]: https://david-dm.org/es-shims/Object.entries.svg +[deps-url]: https://david-dm.org/es-shims/Object.entries +[dev-deps-svg]: https://david-dm.org/es-shims/Object.entries/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/Object.entries#info=devDependencies +[testling-svg]: https://ci.testling.com/es-shims/Object.entries.png +[testling-url]: https://ci.testling.com/es-shims/Object.entries +[npm-badge-png]: https://nodei.co/npm/object.entries.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/object.entries.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/object.entries.svg +[downloads-url]: http://npm-stat.com/charts.html?package=object.entries diff --git a/node_modules/object.entries/auto.js b/node_modules/object.entries/auto.js new file mode 100644 index 0000000..8ebf606 --- /dev/null +++ b/node_modules/object.entries/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/object.entries/implementation.js b/node_modules/object.entries/implementation.js new file mode 100644 index 0000000..adf5819 --- /dev/null +++ b/node_modules/object.entries/implementation.js @@ -0,0 +1,17 @@ +'use strict'; + +var RequireObjectCoercible = require('es-abstract/2019/RequireObjectCoercible'); +var has = require('has'); +var callBound = require('es-abstract/helpers/callBound'); +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +module.exports = function entries(O) { + var obj = RequireObjectCoercible(O); + var entrys = []; + for (var key in obj) { + if (has(obj, key) && $isEnumerable(obj, key)) { + entrys.push([key, obj[key]]); + } + } + return entrys; +}; diff --git a/node_modules/object.entries/index.js b/node_modules/object.entries/index.js new file mode 100644 index 0000000..6cd38c2 --- /dev/null +++ b/node_modules/object.entries/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var define = require('define-properties'); +var callBind = require('es-abstract/helpers/callBind'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var polyfill = callBind(getPolyfill(), Object); + +define(polyfill, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = polyfill; diff --git a/node_modules/object.entries/node_modules/es-abstract/.editorconfig b/node_modules/object.entries/node_modules/es-abstract/.editorconfig new file mode 100644 index 0000000..eaa2141 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/object.entries/node_modules/es-abstract/.eslintignore b/node_modules/object.entries/node_modules/es-abstract/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/node_modules/object.entries/node_modules/es-abstract/.eslintrc b/node_modules/object.entries/node_modules/es-abstract/.eslintrc new file mode 100644 index 0000000..1bac5b7 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.eslintrc @@ -0,0 +1,66 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + }, + + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 4], + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "new-cap": 0, + "no-extra-parens": 1, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "operations/*", + "rules": { + "max-lines": 0, + }, + }, + { + "files": "operations/*.js", + "parserOptions": { + "ecmaVersion": 2020, + }, + "rules": { + "no-console": 0, + "no-multi-str": 0, + }, + }, + { + "files": "operations/getOps.js", + "rules": { + "no-console": 0, + "no-process-exit": 0, + }, + }, + { + "files": "test/**", + "rules": { + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": 0, + "max-statements-per-line": [2, { "max": 3 }], + "max-statements": 0, + "no-implicit-coercion": 0, + "no-invalid-this": 1, + "object-curly-newline": 0, + "prefer-regex-literals": 0, + }, + }, + ], +} diff --git a/node_modules/object.entries/node_modules/es-abstract/.gitattributes b/node_modules/object.entries/node_modules/es-abstract/.gitattributes new file mode 100644 index 0000000..0b600dc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.gitattributes @@ -0,0 +1,472 @@ +2015/AbstractRelationalComparison.js spackled linguist-generated=true +2015/DateFromTime.js spackled linguist-generated=true +2015/Day.js spackled linguist-generated=true +2015/DayFromYear.js spackled linguist-generated=true +2015/DayWithinYear.js spackled linguist-generated=true +2015/DaysInYear.js spackled linguist-generated=true +2015/HourFromTime.js spackled linguist-generated=true +2015/InLeapYear.js spackled linguist-generated=true +2015/IsCallable.js spackled linguist-generated=true +2015/IsPropertyDescriptor.js spackled linguist-generated=true +2015/MakeDate.js spackled linguist-generated=true +2015/MakeDay.js spackled linguist-generated=true +2015/MakeTime.js spackled linguist-generated=true +2015/MinFromTime.js spackled linguist-generated=true +2015/MonthFromTime.js spackled linguist-generated=true +2015/SameValue.js spackled linguist-generated=true +2015/SecFromTime.js spackled linguist-generated=true +2015/StrictEqualityComparison.js spackled linguist-generated=true +2015/TimeClip.js spackled linguist-generated=true +2015/TimeFromYear.js spackled linguist-generated=true +2015/TimeWithinDay.js spackled linguist-generated=true +2015/ToBoolean.js spackled linguist-generated=true +2015/ToInt32.js spackled linguist-generated=true +2015/ToPropertyDescriptor.js spackled linguist-generated=true +2015/ToUint16.js spackled linguist-generated=true +2015/ToUint32.js spackled linguist-generated=true +2015/WeekDay.js spackled linguist-generated=true +2015/YearFromTime.js spackled linguist-generated=true +2015/modulo.js spackled linguist-generated=true +2015/msFromTime.js spackled linguist-generated=true +2016/AbstractEqualityComparison.js spackled linguist-generated=true +2016/AbstractRelationalComparison.js spackled linguist-generated=true +2016/AdvanceStringIndex.js spackled linguist-generated=true +2016/ArrayCreate.js spackled linguist-generated=true +2016/ArraySetLength.js spackled linguist-generated=true +2016/ArraySpeciesCreate.js spackled linguist-generated=true +2016/Call.js spackled linguist-generated=true +2016/CanonicalNumericIndexString.js spackled linguist-generated=true +2016/CompletePropertyDescriptor.js spackled linguist-generated=true +2016/CreateDataProperty.js spackled linguist-generated=true +2016/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2016/CreateHTML.js spackled linguist-generated=true +2016/CreateIterResultObject.js spackled linguist-generated=true +2016/CreateListFromArrayLike.js spackled linguist-generated=true +2016/CreateMethodProperty.js spackled linguist-generated=true +2016/DateFromTime.js spackled linguist-generated=true +2016/Day.js spackled linguist-generated=true +2016/DayFromYear.js spackled linguist-generated=true +2016/DayWithinYear.js spackled linguist-generated=true +2016/DaysInYear.js spackled linguist-generated=true +2016/DefinePropertyOrThrow.js spackled linguist-generated=true +2016/DeletePropertyOrThrow.js spackled linguist-generated=true +2016/EnumerableOwnNames.js spackled linguist-generated=true +2016/FromPropertyDescriptor.js spackled linguist-generated=true +2016/Get.js spackled linguist-generated=true +2016/GetIterator.js spackled linguist-generated=true +2016/GetMethod.js spackled linguist-generated=true +2016/GetOwnPropertyKeys.js spackled linguist-generated=true +2016/GetPrototypeFromConstructor.js spackled linguist-generated=true +2016/GetSubstitution.js spackled linguist-generated=true +2016/GetV.js spackled linguist-generated=true +2016/HasOwnProperty.js spackled linguist-generated=true +2016/HasProperty.js spackled linguist-generated=true +2016/HourFromTime.js spackled linguist-generated=true +2016/InLeapYear.js spackled linguist-generated=true +2016/InstanceofOperator.js spackled linguist-generated=true +2016/Invoke.js spackled linguist-generated=true +2016/IsAccessorDescriptor.js spackled linguist-generated=true +2016/IsArray.js spackled linguist-generated=true +2016/IsCallable.js spackled linguist-generated=true +2016/IsConcatSpreadable.js spackled linguist-generated=true +2016/IsConstructor.js spackled linguist-generated=true +2016/IsDataDescriptor.js spackled linguist-generated=true +2016/IsExtensible.js spackled linguist-generated=true +2016/IsGenericDescriptor.js spackled linguist-generated=true +2016/IsInteger.js spackled linguist-generated=true +2016/IsPromise.js spackled linguist-generated=true +2016/IsPropertyDescriptor.js spackled linguist-generated=true +2016/IsPropertyKey.js spackled linguist-generated=true +2016/IsRegExp.js spackled linguist-generated=true +2016/IteratorClose.js spackled linguist-generated=true +2016/IteratorComplete.js spackled linguist-generated=true +2016/IteratorNext.js spackled linguist-generated=true +2016/IteratorStep.js spackled linguist-generated=true +2016/IteratorValue.js spackled linguist-generated=true +2016/MakeDate.js spackled linguist-generated=true +2016/MakeDay.js spackled linguist-generated=true +2016/MakeTime.js spackled linguist-generated=true +2016/MinFromTime.js spackled linguist-generated=true +2016/MonthFromTime.js spackled linguist-generated=true +2016/ObjectCreate.js spackled linguist-generated=true +2016/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2016/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2016/OrdinaryHasInstance.js spackled linguist-generated=true +2016/OrdinaryHasProperty.js spackled linguist-generated=true +2016/RegExpExec.js spackled linguist-generated=true +2016/RequireObjectCoercible.js spackled linguist-generated=true +2016/SameValue.js spackled linguist-generated=true +2016/SameValueZero.js spackled linguist-generated=true +2016/SecFromTime.js spackled linguist-generated=true +2016/Set.js spackled linguist-generated=true +2016/SetFunctionName.js spackled linguist-generated=true +2016/SetIntegrityLevel.js spackled linguist-generated=true +2016/SpeciesConstructor.js spackled linguist-generated=true +2016/StrictEqualityComparison.js spackled linguist-generated=true +2016/SymbolDescriptiveString.js spackled linguist-generated=true +2016/TestIntegrityLevel.js spackled linguist-generated=true +2016/TimeClip.js spackled linguist-generated=true +2016/TimeFromYear.js spackled linguist-generated=true +2016/TimeWithinDay.js spackled linguist-generated=true +2016/ToBoolean.js spackled linguist-generated=true +2016/ToDateString.js spackled linguist-generated=true +2016/ToInt16.js spackled linguist-generated=true +2016/ToInt32.js spackled linguist-generated=true +2016/ToInt8.js spackled linguist-generated=true +2016/ToInteger.js spackled linguist-generated=true +2016/ToLength.js spackled linguist-generated=true +2016/ToNumber.js spackled linguist-generated=true +2016/ToObject.js spackled linguist-generated=true +2016/ToPrimitive.js spackled linguist-generated=true +2016/ToPropertyDescriptor.js spackled linguist-generated=true +2016/ToPropertyKey.js spackled linguist-generated=true +2016/ToString.js spackled linguist-generated=true +2016/ToUint16.js spackled linguist-generated=true +2016/ToUint32.js spackled linguist-generated=true +2016/ToUint8.js spackled linguist-generated=true +2016/ToUint8Clamp.js spackled linguist-generated=true +2016/Type.js spackled linguist-generated=true +2016/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2016/WeekDay.js spackled linguist-generated=true +2016/YearFromTime.js spackled linguist-generated=true +2016/modulo.js spackled linguist-generated=true +2016/msFromTime.js spackled linguist-generated=true +2016/thisBooleanValue.js spackled linguist-generated=true +2016/thisNumberValue.js spackled linguist-generated=true +2016/thisStringValue.js spackled linguist-generated=true +2016/thisTimeValue.js spackled linguist-generated=true +2017/AbstractEqualityComparison.js spackled linguist-generated=true +2017/AbstractRelationalComparison.js spackled linguist-generated=true +2017/AdvanceStringIndex.js spackled linguist-generated=true +2017/ArrayCreate.js spackled linguist-generated=true +2017/ArraySetLength.js spackled linguist-generated=true +2017/ArraySpeciesCreate.js spackled linguist-generated=true +2017/Call.js spackled linguist-generated=true +2017/CanonicalNumericIndexString.js spackled linguist-generated=true +2017/CompletePropertyDescriptor.js spackled linguist-generated=true +2017/CreateDataProperty.js spackled linguist-generated=true +2017/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2017/CreateHTML.js spackled linguist-generated=true +2017/CreateIterResultObject.js spackled linguist-generated=true +2017/CreateListFromArrayLike.js spackled linguist-generated=true +2017/CreateMethodProperty.js spackled linguist-generated=true +2017/DateFromTime.js spackled linguist-generated=true +2017/Day.js spackled linguist-generated=true +2017/DayFromYear.js spackled linguist-generated=true +2017/DayWithinYear.js spackled linguist-generated=true +2017/DaysInYear.js spackled linguist-generated=true +2017/DefinePropertyOrThrow.js spackled linguist-generated=true +2017/DeletePropertyOrThrow.js spackled linguist-generated=true +2017/FromPropertyDescriptor.js spackled linguist-generated=true +2017/Get.js spackled linguist-generated=true +2017/GetIterator.js spackled linguist-generated=true +2017/GetMethod.js spackled linguist-generated=true +2017/GetOwnPropertyKeys.js spackled linguist-generated=true +2017/GetPrototypeFromConstructor.js spackled linguist-generated=true +2017/GetSubstitution.js spackled linguist-generated=true +2017/GetV.js spackled linguist-generated=true +2017/HasOwnProperty.js spackled linguist-generated=true +2017/HasProperty.js spackled linguist-generated=true +2017/HourFromTime.js spackled linguist-generated=true +2017/InLeapYear.js spackled linguist-generated=true +2017/InstanceofOperator.js spackled linguist-generated=true +2017/Invoke.js spackled linguist-generated=true +2017/IsAccessorDescriptor.js spackled linguist-generated=true +2017/IsArray.js spackled linguist-generated=true +2017/IsCallable.js spackled linguist-generated=true +2017/IsConcatSpreadable.js spackled linguist-generated=true +2017/IsConstructor.js spackled linguist-generated=true +2017/IsDataDescriptor.js spackled linguist-generated=true +2017/IsExtensible.js spackled linguist-generated=true +2017/IsGenericDescriptor.js spackled linguist-generated=true +2017/IsInteger.js spackled linguist-generated=true +2017/IsPromise.js spackled linguist-generated=true +2017/IsPropertyDescriptor.js spackled linguist-generated=true +2017/IsPropertyKey.js spackled linguist-generated=true +2017/IsRegExp.js spackled linguist-generated=true +2017/IteratorClose.js spackled linguist-generated=true +2017/IteratorComplete.js spackled linguist-generated=true +2017/IteratorNext.js spackled linguist-generated=true +2017/IteratorStep.js spackled linguist-generated=true +2017/IteratorValue.js spackled linguist-generated=true +2017/MakeDate.js spackled linguist-generated=true +2017/MakeDay.js spackled linguist-generated=true +2017/MakeTime.js spackled linguist-generated=true +2017/MinFromTime.js spackled linguist-generated=true +2017/MonthFromTime.js spackled linguist-generated=true +2017/ObjectCreate.js spackled linguist-generated=true +2017/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2017/OrdinaryHasInstance.js spackled linguist-generated=true +2017/OrdinaryHasProperty.js spackled linguist-generated=true +2017/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2017/RegExpExec.js spackled linguist-generated=true +2017/RequireObjectCoercible.js spackled linguist-generated=true +2017/SameValue.js spackled linguist-generated=true +2017/SameValueNonNumber.js spackled linguist-generated=true +2017/SameValueZero.js spackled linguist-generated=true +2017/SecFromTime.js spackled linguist-generated=true +2017/Set.js spackled linguist-generated=true +2017/SetFunctionName.js spackled linguist-generated=true +2017/SetIntegrityLevel.js spackled linguist-generated=true +2017/SpeciesConstructor.js spackled linguist-generated=true +2017/StrictEqualityComparison.js spackled linguist-generated=true +2017/SymbolDescriptiveString.js spackled linguist-generated=true +2017/TestIntegrityLevel.js spackled linguist-generated=true +2017/TimeClip.js spackled linguist-generated=true +2017/TimeFromYear.js spackled linguist-generated=true +2017/TimeWithinDay.js spackled linguist-generated=true +2017/ToBoolean.js spackled linguist-generated=true +2017/ToDateString.js spackled linguist-generated=true +2017/ToInt16.js spackled linguist-generated=true +2017/ToInt32.js spackled linguist-generated=true +2017/ToInt8.js spackled linguist-generated=true +2017/ToInteger.js spackled linguist-generated=true +2017/ToLength.js spackled linguist-generated=true +2017/ToNumber.js spackled linguist-generated=true +2017/ToObject.js spackled linguist-generated=true +2017/ToPrimitive.js spackled linguist-generated=true +2017/ToPropertyDescriptor.js spackled linguist-generated=true +2017/ToPropertyKey.js spackled linguist-generated=true +2017/ToString.js spackled linguist-generated=true +2017/ToUint16.js spackled linguist-generated=true +2017/ToUint32.js spackled linguist-generated=true +2017/ToUint8.js spackled linguist-generated=true +2017/ToUint8Clamp.js spackled linguist-generated=true +2017/Type.js spackled linguist-generated=true +2017/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2017/WeekDay.js spackled linguist-generated=true +2017/YearFromTime.js spackled linguist-generated=true +2017/modulo.js spackled linguist-generated=true +2017/msFromTime.js spackled linguist-generated=true +2017/thisBooleanValue.js spackled linguist-generated=true +2017/thisNumberValue.js spackled linguist-generated=true +2017/thisStringValue.js spackled linguist-generated=true +2017/thisTimeValue.js spackled linguist-generated=true +2018/AbstractEqualityComparison.js spackled linguist-generated=true +2018/AbstractRelationalComparison.js spackled linguist-generated=true +2018/AdvanceStringIndex.js spackled linguist-generated=true +2018/ArrayCreate.js spackled linguist-generated=true +2018/ArraySetLength.js spackled linguist-generated=true +2018/ArraySpeciesCreate.js spackled linguist-generated=true +2018/Call.js spackled linguist-generated=true +2018/CanonicalNumericIndexString.js spackled linguist-generated=true +2018/CompletePropertyDescriptor.js spackled linguist-generated=true +2018/CreateDataProperty.js spackled linguist-generated=true +2018/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2018/CreateHTML.js spackled linguist-generated=true +2018/CreateIterResultObject.js spackled linguist-generated=true +2018/CreateListFromArrayLike.js spackled linguist-generated=true +2018/CreateMethodProperty.js spackled linguist-generated=true +2018/DateFromTime.js spackled linguist-generated=true +2018/Day.js spackled linguist-generated=true +2018/DayFromYear.js spackled linguist-generated=true +2018/DayWithinYear.js spackled linguist-generated=true +2018/DaysInYear.js spackled linguist-generated=true +2018/DefinePropertyOrThrow.js spackled linguist-generated=true +2018/DeletePropertyOrThrow.js spackled linguist-generated=true +2018/FromPropertyDescriptor.js spackled linguist-generated=true +2018/Get.js spackled linguist-generated=true +2018/GetIterator.js spackled linguist-generated=true +2018/GetMethod.js spackled linguist-generated=true +2018/GetOwnPropertyKeys.js spackled linguist-generated=true +2018/GetPrototypeFromConstructor.js spackled linguist-generated=true +2018/GetV.js spackled linguist-generated=true +2018/HasOwnProperty.js spackled linguist-generated=true +2018/HasProperty.js spackled linguist-generated=true +2018/HourFromTime.js spackled linguist-generated=true +2018/InLeapYear.js spackled linguist-generated=true +2018/InstanceofOperator.js spackled linguist-generated=true +2018/Invoke.js spackled linguist-generated=true +2018/IsAccessorDescriptor.js spackled linguist-generated=true +2018/IsArray.js spackled linguist-generated=true +2018/IsCallable.js spackled linguist-generated=true +2018/IsConcatSpreadable.js spackled linguist-generated=true +2018/IsConstructor.js spackled linguist-generated=true +2018/IsDataDescriptor.js spackled linguist-generated=true +2018/IsExtensible.js spackled linguist-generated=true +2018/IsGenericDescriptor.js spackled linguist-generated=true +2018/IsInteger.js spackled linguist-generated=true +2018/IsPromise.js spackled linguist-generated=true +2018/IsPropertyKey.js spackled linguist-generated=true +2018/IsRegExp.js spackled linguist-generated=true +2018/IterableToList.js spackled linguist-generated=true +2018/IteratorClose.js spackled linguist-generated=true +2018/IteratorComplete.js spackled linguist-generated=true +2018/IteratorNext.js spackled linguist-generated=true +2018/IteratorStep.js spackled linguist-generated=true +2018/IteratorValue.js spackled linguist-generated=true +2018/MakeDate.js spackled linguist-generated=true +2018/MakeDay.js spackled linguist-generated=true +2018/MakeTime.js spackled linguist-generated=true +2018/MinFromTime.js spackled linguist-generated=true +2018/MonthFromTime.js spackled linguist-generated=true +2018/ObjectCreate.js spackled linguist-generated=true +2018/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2018/OrdinaryHasInstance.js spackled linguist-generated=true +2018/OrdinaryHasProperty.js spackled linguist-generated=true +2018/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2018/RegExpExec.js spackled linguist-generated=true +2018/RequireObjectCoercible.js spackled linguist-generated=true +2018/SameValue.js spackled linguist-generated=true +2018/SameValueNonNumber.js spackled linguist-generated=true +2018/SameValueZero.js spackled linguist-generated=true +2018/SecFromTime.js spackled linguist-generated=true +2018/Set.js spackled linguist-generated=true +2018/SetFunctionName.js spackled linguist-generated=true +2018/SetIntegrityLevel.js spackled linguist-generated=true +2018/SpeciesConstructor.js spackled linguist-generated=true +2018/StrictEqualityComparison.js spackled linguist-generated=true +2018/SymbolDescriptiveString.js spackled linguist-generated=true +2018/TestIntegrityLevel.js spackled linguist-generated=true +2018/TimeClip.js spackled linguist-generated=true +2018/TimeFromYear.js spackled linguist-generated=true +2018/TimeWithinDay.js spackled linguist-generated=true +2018/ToBoolean.js spackled linguist-generated=true +2018/ToDateString.js spackled linguist-generated=true +2018/ToIndex.js spackled linguist-generated=true +2018/ToInt16.js spackled linguist-generated=true +2018/ToInt32.js spackled linguist-generated=true +2018/ToInt8.js spackled linguist-generated=true +2018/ToInteger.js spackled linguist-generated=true +2018/ToLength.js spackled linguist-generated=true +2018/ToNumber.js spackled linguist-generated=true +2018/ToObject.js spackled linguist-generated=true +2018/ToPrimitive.js spackled linguist-generated=true +2018/ToPropertyDescriptor.js spackled linguist-generated=true +2018/ToPropertyKey.js spackled linguist-generated=true +2018/ToString.js spackled linguist-generated=true +2018/ToUint16.js spackled linguist-generated=true +2018/ToUint32.js spackled linguist-generated=true +2018/ToUint8.js spackled linguist-generated=true +2018/ToUint8Clamp.js spackled linguist-generated=true +2018/Type.js spackled linguist-generated=true +2018/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2018/WeekDay.js spackled linguist-generated=true +2018/YearFromTime.js spackled linguist-generated=true +2018/modulo.js spackled linguist-generated=true +2018/msFromTime.js spackled linguist-generated=true +2018/thisBooleanValue.js spackled linguist-generated=true +2018/thisNumberValue.js spackled linguist-generated=true +2018/thisStringValue.js spackled linguist-generated=true +2018/thisTimeValue.js spackled linguist-generated=true +2019/AbstractEqualityComparison.js spackled linguist-generated=true +2019/AbstractRelationalComparison.js spackled linguist-generated=true +2019/AdvanceStringIndex.js spackled linguist-generated=true +2019/ArrayCreate.js spackled linguist-generated=true +2019/ArraySetLength.js spackled linguist-generated=true +2019/ArraySpeciesCreate.js spackled linguist-generated=true +2019/Call.js spackled linguist-generated=true +2019/CanonicalNumericIndexString.js spackled linguist-generated=true +2019/CompletePropertyDescriptor.js spackled linguist-generated=true +2019/CopyDataProperties.js spackled linguist-generated=true +2019/CreateDataProperty.js spackled linguist-generated=true +2019/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2019/CreateHTML.js spackled linguist-generated=true +2019/CreateIterResultObject.js spackled linguist-generated=true +2019/CreateListFromArrayLike.js spackled linguist-generated=true +2019/CreateMethodProperty.js spackled linguist-generated=true +2019/DateFromTime.js spackled linguist-generated=true +2019/DateString.js spackled linguist-generated=true +2019/Day.js spackled linguist-generated=true +2019/DayFromYear.js spackled linguist-generated=true +2019/DayWithinYear.js spackled linguist-generated=true +2019/DaysInYear.js spackled linguist-generated=true +2019/DefinePropertyOrThrow.js spackled linguist-generated=true +2019/DeletePropertyOrThrow.js spackled linguist-generated=true +2019/EnumerableOwnPropertyNames.js spackled linguist-generated=true +2019/FromPropertyDescriptor.js spackled linguist-generated=true +2019/Get.js spackled linguist-generated=true +2019/GetIterator.js spackled linguist-generated=true +2019/GetMethod.js spackled linguist-generated=true +2019/GetOwnPropertyKeys.js spackled linguist-generated=true +2019/GetPrototypeFromConstructor.js spackled linguist-generated=true +2019/GetSubstitution.js spackled linguist-generated=true +2019/GetV.js spackled linguist-generated=true +2019/HasOwnProperty.js spackled linguist-generated=true +2019/HasProperty.js spackled linguist-generated=true +2019/HourFromTime.js spackled linguist-generated=true +2019/InLeapYear.js spackled linguist-generated=true +2019/InstanceofOperator.js spackled linguist-generated=true +2019/Invoke.js spackled linguist-generated=true +2019/IsAccessorDescriptor.js spackled linguist-generated=true +2019/IsArray.js spackled linguist-generated=true +2019/IsCallable.js spackled linguist-generated=true +2019/IsConcatSpreadable.js spackled linguist-generated=true +2019/IsConstructor.js spackled linguist-generated=true +2019/IsDataDescriptor.js spackled linguist-generated=true +2019/IsExtensible.js spackled linguist-generated=true +2019/IsGenericDescriptor.js spackled linguist-generated=true +2019/IsInteger.js spackled linguist-generated=true +2019/IsPromise.js spackled linguist-generated=true +2019/IsPropertyKey.js spackled linguist-generated=true +2019/IsRegExp.js spackled linguist-generated=true +2019/IsStringPrefix.js spackled linguist-generated=true +2019/IterableToList.js spackled linguist-generated=true +2019/IteratorClose.js spackled linguist-generated=true +2019/IteratorComplete.js spackled linguist-generated=true +2019/IteratorNext.js spackled linguist-generated=true +2019/IteratorStep.js spackled linguist-generated=true +2019/IteratorValue.js spackled linguist-generated=true +2019/MakeDate.js spackled linguist-generated=true +2019/MakeDay.js spackled linguist-generated=true +2019/MakeTime.js spackled linguist-generated=true +2019/MinFromTime.js spackled linguist-generated=true +2019/MonthFromTime.js spackled linguist-generated=true +2019/NumberToString.js spackled linguist-generated=true +2019/ObjectCreate.js spackled linguist-generated=true +2019/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2019/OrdinaryHasInstance.js spackled linguist-generated=true +2019/OrdinaryHasProperty.js spackled linguist-generated=true +2019/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2019/PromiseResolve.js spackled linguist-generated=true +2019/RegExpExec.js spackled linguist-generated=true +2019/RequireObjectCoercible.js spackled linguist-generated=true +2019/SameValue.js spackled linguist-generated=true +2019/SameValueNonNumber.js spackled linguist-generated=true +2019/SameValueZero.js spackled linguist-generated=true +2019/SecFromTime.js spackled linguist-generated=true +2019/Set.js spackled linguist-generated=true +2019/SetFunctionName.js spackled linguist-generated=true +2019/SetIntegrityLevel.js spackled linguist-generated=true +2019/SpeciesConstructor.js spackled linguist-generated=true +2019/StrictEqualityComparison.js spackled linguist-generated=true +2019/SymbolDescriptiveString.js spackled linguist-generated=true +2019/TestIntegrityLevel.js spackled linguist-generated=true +2019/TimeClip.js spackled linguist-generated=true +2019/TimeFromYear.js spackled linguist-generated=true +2019/TimeString.js spackled linguist-generated=true +2019/TimeWithinDay.js spackled linguist-generated=true +2019/ToBoolean.js spackled linguist-generated=true +2019/ToDateString.js spackled linguist-generated=true +2019/ToIndex.js spackled linguist-generated=true +2019/ToInt16.js spackled linguist-generated=true +2019/ToInt32.js spackled linguist-generated=true +2019/ToInt8.js spackled linguist-generated=true +2019/ToInteger.js spackled linguist-generated=true +2019/ToLength.js spackled linguist-generated=true +2019/ToNumber.js spackled linguist-generated=true +2019/ToObject.js spackled linguist-generated=true +2019/ToPrimitive.js spackled linguist-generated=true +2019/ToPropertyDescriptor.js spackled linguist-generated=true +2019/ToPropertyKey.js spackled linguist-generated=true +2019/ToString.js spackled linguist-generated=true +2019/ToUint16.js spackled linguist-generated=true +2019/ToUint32.js spackled linguist-generated=true +2019/ToUint8.js spackled linguist-generated=true +2019/ToUint8Clamp.js spackled linguist-generated=true +2019/Type.js spackled linguist-generated=true +2019/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2019/WeekDay.js spackled linguist-generated=true +2019/YearFromTime.js spackled linguist-generated=true +2019/modulo.js spackled linguist-generated=true +2019/msFromTime.js spackled linguist-generated=true +2019/thisBooleanValue.js spackled linguist-generated=true +2019/thisNumberValue.js spackled linguist-generated=true +2019/thisStringValue.js spackled linguist-generated=true +2019/thisSymbolValue.js spackled linguist-generated=true \ No newline at end of file diff --git a/node_modules/object.entries/node_modules/es-abstract/.github/FUNDING.yml b/node_modules/object.entries/node_modules/es-abstract/.github/FUNDING.yml new file mode 100644 index 0000000..beeb7a2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-abstract +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/object.entries/node_modules/es-abstract/.github/workflows/codeql-analysis.yml b/node_modules/object.entries/node_modules/es-abstract/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..e77ad6a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.github/workflows/codeql-analysis.yml @@ -0,0 +1,52 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 17 * * 4' + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/node_modules/object.entries/node_modules/es-abstract/.github/workflows/rebase.yml b/node_modules/object.entries/node_modules/es-abstract/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object.entries/node_modules/es-abstract/.nycrc b/node_modules/object.entries/node_modules/es-abstract/.nycrc new file mode 100644 index 0000000..d316b4d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.nycrc @@ -0,0 +1,14 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "operations", + "test" + ] +} diff --git a/node_modules/object.entries/node_modules/es-abstract/.travis.yml b/node_modules/object.entries/node_modules/es-abstract/.travis.yml new file mode 100644 index 0000000..5c34024 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/.travis.yml @@ -0,0 +1,32 @@ +version: ~> 1.0 +language: node_js +os: + - linux +cache: + directories: + - "$HOME/.npm" + - "$(nvm cache dir)" + - "$(nvm_version_path $(nvm_version_remote 0.4))" + - "$(nvm_version_path $(nvm_version_remote 0.6))" + - "$(nvm_version_path $(nvm_version_remote 0.10))" +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml +script: + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi' +matrix: + include: + - node_js: "8" + env: COVERAGE=true + - node_js: "4" + env: COVERAGE=true + - node_js: "0.12" + env: COVERAGE=true + - node_js: "0.8" + env: COVERAGE=true + exclude: + - node_js: "0.12" + env: TEST=true + - node_js: "0.8" + env: TEST=true diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/AbstractEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2015/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/AbstractRelationalComparison.js b/node_modules/object.entries/node_modules/es-abstract/2015/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/AdvanceStringIndex.js b/node_modules/object.entries/node_modules/es-abstract/2015/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ArrayCreate.js b/node_modules/object.entries/node_modules/es-abstract/2015/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ArraySetLength.js b/node_modules/object.entries/node_modules/es-abstract/2015/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ArraySpeciesCreate.js b/node_modules/object.entries/node_modules/es-abstract/2015/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/Call.js b/node_modules/object.entries/node_modules/es-abstract/2015/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CanonicalNumericIndexString.js b/node_modules/object.entries/node_modules/es-abstract/2015/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CompletePropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CreateDataProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CreateHTML.js b/node_modules/object.entries/node_modules/es-abstract/2015/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CreateIterResultObject.js b/node_modules/object.entries/node_modules/es-abstract/2015/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CreateListFromArrayLike.js b/node_modules/object.entries/node_modules/es-abstract/2015/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/CreateMethodProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/DateFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/Day.js b/node_modules/object.entries/node_modules/es-abstract/2015/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/DayFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2015/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/DayWithinYear.js b/node_modules/object.entries/node_modules/es-abstract/2015/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/DaysInYear.js b/node_modules/object.entries/node_modules/es-abstract/2015/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/DefinePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2015/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/DeletePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2015/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/EnumerableOwnNames.js b/node_modules/object.entries/node_modules/es-abstract/2015/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/FromPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/Get.js b/node_modules/object.entries/node_modules/es-abstract/2015/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/GetIterator.js b/node_modules/object.entries/node_modules/es-abstract/2015/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/GetMethod.js b/node_modules/object.entries/node_modules/es-abstract/2015/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/GetOwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/2015/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/GetSubstitution.js b/node_modules/object.entries/node_modules/es-abstract/2015/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/GetV.js b/node_modules/object.entries/node_modules/es-abstract/2015/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/HasOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/HasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/HourFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/InLeapYear.js b/node_modules/object.entries/node_modules/es-abstract/2015/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/InstanceofOperator.js b/node_modules/object.entries/node_modules/es-abstract/2015/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/Invoke.js b/node_modules/object.entries/node_modules/es-abstract/2015/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsAccessorDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsArray.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsCallable.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsConcatSpreadable.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsDataDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsExtensible.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsGenericDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsInteger.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsPromise.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IsRegExp.js b/node_modules/object.entries/node_modules/es-abstract/2015/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IteratorClose.js b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IteratorComplete.js b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IteratorNext.js b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IteratorStep.js b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/IteratorValue.js b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/MakeDate.js b/node_modules/object.entries/node_modules/es-abstract/2015/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/MakeDay.js b/node_modules/object.entries/node_modules/es-abstract/2015/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/MakeTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/MinFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/MonthFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ObjectCreate.js b/node_modules/object.entries/node_modules/es-abstract/2015/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasInstance.js b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/RegExpExec.js b/node_modules/object.entries/node_modules/es-abstract/2015/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/RequireObjectCoercible.js b/node_modules/object.entries/node_modules/es-abstract/2015/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SameValue.js b/node_modules/object.entries/node_modules/es-abstract/2015/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SameValueZero.js b/node_modules/object.entries/node_modules/es-abstract/2015/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SecFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/Set.js b/node_modules/object.entries/node_modules/es-abstract/2015/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SetFunctionName.js b/node_modules/object.entries/node_modules/es-abstract/2015/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SetIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2015/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SpeciesConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2015/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/StrictEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2015/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/SymbolDescriptiveString.js b/node_modules/object.entries/node_modules/es-abstract/2015/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/TestIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2015/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/TimeClip.js b/node_modules/object.entries/node_modules/es-abstract/2015/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/TimeFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2015/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/TimeWithinDay.js b/node_modules/object.entries/node_modules/es-abstract/2015/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToBoolean.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToDateString.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToInt16.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToInt32.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToInt8.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToInteger.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToLength.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToNumber.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToObject.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToString.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToUint16.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToUint32.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToUint8.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ToUint8Clamp.js b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/Type.js b/node_modules/object.entries/node_modules/es-abstract/2015/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/WeekDay.js b/node_modules/object.entries/node_modules/es-abstract/2015/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/YearFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/modulo.js b/node_modules/object.entries/node_modules/es-abstract/2015/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/msFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2015/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/thisBooleanValue.js b/node_modules/object.entries/node_modules/es-abstract/2015/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/thisNumberValue.js b/node_modules/object.entries/node_modules/es-abstract/2015/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/thisStringValue.js b/node_modules/object.entries/node_modules/es-abstract/2015/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2015/thisTimeValue.js b/node_modules/object.entries/node_modules/es-abstract/2015/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2015/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/AbstractEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2016/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/AbstractRelationalComparison.js b/node_modules/object.entries/node_modules/es-abstract/2016/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/AdvanceStringIndex.js b/node_modules/object.entries/node_modules/es-abstract/2016/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ArrayCreate.js b/node_modules/object.entries/node_modules/es-abstract/2016/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ArraySetLength.js b/node_modules/object.entries/node_modules/es-abstract/2016/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ArraySpeciesCreate.js b/node_modules/object.entries/node_modules/es-abstract/2016/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/Call.js b/node_modules/object.entries/node_modules/es-abstract/2016/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CanonicalNumericIndexString.js b/node_modules/object.entries/node_modules/es-abstract/2016/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CompletePropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CreateDataProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CreateHTML.js b/node_modules/object.entries/node_modules/es-abstract/2016/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CreateIterResultObject.js b/node_modules/object.entries/node_modules/es-abstract/2016/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CreateListFromArrayLike.js b/node_modules/object.entries/node_modules/es-abstract/2016/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/CreateMethodProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/DateFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/Day.js b/node_modules/object.entries/node_modules/es-abstract/2016/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/DayFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2016/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/DayWithinYear.js b/node_modules/object.entries/node_modules/es-abstract/2016/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/DaysInYear.js b/node_modules/object.entries/node_modules/es-abstract/2016/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/DefinePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2016/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/DeletePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2016/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/EnumerableOwnNames.js b/node_modules/object.entries/node_modules/es-abstract/2016/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/FromPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/Get.js b/node_modules/object.entries/node_modules/es-abstract/2016/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/GetIterator.js b/node_modules/object.entries/node_modules/es-abstract/2016/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/GetMethod.js b/node_modules/object.entries/node_modules/es-abstract/2016/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/GetOwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/2016/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/GetSubstitution.js b/node_modules/object.entries/node_modules/es-abstract/2016/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/GetV.js b/node_modules/object.entries/node_modules/es-abstract/2016/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/HasOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/HasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/HourFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/InLeapYear.js b/node_modules/object.entries/node_modules/es-abstract/2016/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/InstanceofOperator.js b/node_modules/object.entries/node_modules/es-abstract/2016/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/Invoke.js b/node_modules/object.entries/node_modules/es-abstract/2016/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsAccessorDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsArray.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsCallable.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsConcatSpreadable.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsDataDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsExtensible.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsGenericDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsInteger.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsPromise.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IsRegExp.js b/node_modules/object.entries/node_modules/es-abstract/2016/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IterableToArrayLike.js b/node_modules/object.entries/node_modules/es-abstract/2016/IterableToArrayLike.js new file mode 100644 index 0000000..885cade --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IterableToArrayLike.js @@ -0,0 +1,56 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var GetIterator = require('./GetIterator'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); +var ES = { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type +}; + +// https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike +/** + * 1. Let usingIterator be ? GetMethod(items, @@iterator). + * 2. If usingIterator is not undefined, then + * 1. Let iterator be ? GetIterator(items, usingIterator). + * 2. Let values be a new empty List. + * 3. Let next be true. + * 4. Repeat, while next is not false + * 1. Let next be ? IteratorStep(iterator). + * 2. If next is not false, then + * 1. Let nextValue be ? IteratorValue(next). + * 2. Append nextValue to the end of the List values. + * 5. Return CreateArrayFromList(values). + * 3. NOTE: items is not an Iterable so assume it is already an array-like object. + * 4. Return ! ToObject(items). + */ + +module.exports = function IterableToArrayLike(items) { + var usingIterator = getIteratorMethod(ES, items); + if (typeof usingIterator !== 'undefined') { + var iterator = GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return ToObject(items); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IteratorClose.js b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IteratorComplete.js b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IteratorNext.js b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IteratorStep.js b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/IteratorValue.js b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/MakeDate.js b/node_modules/object.entries/node_modules/es-abstract/2016/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/MakeDay.js b/node_modules/object.entries/node_modules/es-abstract/2016/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/MakeTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/MinFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/MonthFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ObjectCreate.js b/node_modules/object.entries/node_modules/es-abstract/2016/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasInstance.js b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/RegExpExec.js b/node_modules/object.entries/node_modules/es-abstract/2016/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/RequireObjectCoercible.js b/node_modules/object.entries/node_modules/es-abstract/2016/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SameValue.js b/node_modules/object.entries/node_modules/es-abstract/2016/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SameValueNonNumber.js b/node_modules/object.entries/node_modules/es-abstract/2016/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SameValueZero.js b/node_modules/object.entries/node_modules/es-abstract/2016/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SecFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/Set.js b/node_modules/object.entries/node_modules/es-abstract/2016/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SetFunctionName.js b/node_modules/object.entries/node_modules/es-abstract/2016/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SetIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2016/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SpeciesConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2016/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/StrictEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2016/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/SymbolDescriptiveString.js b/node_modules/object.entries/node_modules/es-abstract/2016/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/TestIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2016/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/TimeClip.js b/node_modules/object.entries/node_modules/es-abstract/2016/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/TimeFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2016/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/TimeWithinDay.js b/node_modules/object.entries/node_modules/es-abstract/2016/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToBoolean.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToDateString.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToInt16.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToInt32.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToInt8.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToInteger.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToLength.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToNumber.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToObject.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToString.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToUint16.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToUint32.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToUint8.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ToUint8Clamp.js b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/Type.js b/node_modules/object.entries/node_modules/es-abstract/2016/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/WeekDay.js b/node_modules/object.entries/node_modules/es-abstract/2016/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/YearFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/modulo.js b/node_modules/object.entries/node_modules/es-abstract/2016/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/msFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2016/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/thisBooleanValue.js b/node_modules/object.entries/node_modules/es-abstract/2016/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/thisNumberValue.js b/node_modules/object.entries/node_modules/es-abstract/2016/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/thisStringValue.js b/node_modules/object.entries/node_modules/es-abstract/2016/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2016/thisTimeValue.js b/node_modules/object.entries/node_modules/es-abstract/2016/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2016/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/AbstractEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2017/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/AbstractRelationalComparison.js b/node_modules/object.entries/node_modules/es-abstract/2017/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/AdvanceStringIndex.js b/node_modules/object.entries/node_modules/es-abstract/2017/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ArrayCreate.js b/node_modules/object.entries/node_modules/es-abstract/2017/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ArraySetLength.js b/node_modules/object.entries/node_modules/es-abstract/2017/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ArraySpeciesCreate.js b/node_modules/object.entries/node_modules/es-abstract/2017/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/Call.js b/node_modules/object.entries/node_modules/es-abstract/2017/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CanonicalNumericIndexString.js b/node_modules/object.entries/node_modules/es-abstract/2017/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CompletePropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CreateDataProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CreateHTML.js b/node_modules/object.entries/node_modules/es-abstract/2017/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CreateIterResultObject.js b/node_modules/object.entries/node_modules/es-abstract/2017/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CreateListFromArrayLike.js b/node_modules/object.entries/node_modules/es-abstract/2017/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/CreateMethodProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/DateFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/Day.js b/node_modules/object.entries/node_modules/es-abstract/2017/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/DayFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2017/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/DayWithinYear.js b/node_modules/object.entries/node_modules/es-abstract/2017/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/DaysInYear.js b/node_modules/object.entries/node_modules/es-abstract/2017/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/DefinePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2017/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/DeletePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2017/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/EnumerableOwnProperties.js b/node_modules/object.entries/node_modules/es-abstract/2017/EnumerableOwnProperties.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/EnumerableOwnProperties.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/FromPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/Get.js b/node_modules/object.entries/node_modules/es-abstract/2017/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/GetIterator.js b/node_modules/object.entries/node_modules/es-abstract/2017/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/GetMethod.js b/node_modules/object.entries/node_modules/es-abstract/2017/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/GetOwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/2017/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/GetSubstitution.js b/node_modules/object.entries/node_modules/es-abstract/2017/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/GetV.js b/node_modules/object.entries/node_modules/es-abstract/2017/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/HasOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/HasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/HourFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/InLeapYear.js b/node_modules/object.entries/node_modules/es-abstract/2017/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/InstanceofOperator.js b/node_modules/object.entries/node_modules/es-abstract/2017/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/Invoke.js b/node_modules/object.entries/node_modules/es-abstract/2017/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsAccessorDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsArray.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsCallable.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsConcatSpreadable.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsDataDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsExtensible.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsGenericDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsInteger.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsPromise.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IsRegExp.js b/node_modules/object.entries/node_modules/es-abstract/2017/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IterableToList.js b/node_modules/object.entries/node_modules/es-abstract/2017/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IteratorClose.js b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IteratorComplete.js b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IteratorNext.js b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IteratorStep.js b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/IteratorValue.js b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/MakeDate.js b/node_modules/object.entries/node_modules/es-abstract/2017/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/MakeDay.js b/node_modules/object.entries/node_modules/es-abstract/2017/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/MakeTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/MinFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/MonthFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ObjectCreate.js b/node_modules/object.entries/node_modules/es-abstract/2017/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasInstance.js b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/RegExpExec.js b/node_modules/object.entries/node_modules/es-abstract/2017/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/RequireObjectCoercible.js b/node_modules/object.entries/node_modules/es-abstract/2017/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SameValue.js b/node_modules/object.entries/node_modules/es-abstract/2017/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SameValueNonNumber.js b/node_modules/object.entries/node_modules/es-abstract/2017/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SameValueZero.js b/node_modules/object.entries/node_modules/es-abstract/2017/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SecFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/Set.js b/node_modules/object.entries/node_modules/es-abstract/2017/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SetFunctionName.js b/node_modules/object.entries/node_modules/es-abstract/2017/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SetIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2017/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SpeciesConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2017/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/StrictEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2017/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/SymbolDescriptiveString.js b/node_modules/object.entries/node_modules/es-abstract/2017/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/TestIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2017/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/TimeClip.js b/node_modules/object.entries/node_modules/es-abstract/2017/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/TimeFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2017/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/TimeWithinDay.js b/node_modules/object.entries/node_modules/es-abstract/2017/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToBoolean.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToDateString.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToIndex.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToInt16.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToInt32.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToInt8.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToInteger.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToLength.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToNumber.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToObject.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToString.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToUint16.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToUint32.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToUint8.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ToUint8Clamp.js b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/Type.js b/node_modules/object.entries/node_modules/es-abstract/2017/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/WeekDay.js b/node_modules/object.entries/node_modules/es-abstract/2017/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/YearFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/modulo.js b/node_modules/object.entries/node_modules/es-abstract/2017/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/msFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2017/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/thisBooleanValue.js b/node_modules/object.entries/node_modules/es-abstract/2017/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/thisNumberValue.js b/node_modules/object.entries/node_modules/es-abstract/2017/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/thisStringValue.js b/node_modules/object.entries/node_modules/es-abstract/2017/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2017/thisTimeValue.js b/node_modules/object.entries/node_modules/es-abstract/2017/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2017/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/AbstractEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2018/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/AbstractRelationalComparison.js b/node_modules/object.entries/node_modules/es-abstract/2018/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/AdvanceStringIndex.js b/node_modules/object.entries/node_modules/es-abstract/2018/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ArrayCreate.js b/node_modules/object.entries/node_modules/es-abstract/2018/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ArraySetLength.js b/node_modules/object.entries/node_modules/es-abstract/2018/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ArraySpeciesCreate.js b/node_modules/object.entries/node_modules/es-abstract/2018/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/Call.js b/node_modules/object.entries/node_modules/es-abstract/2018/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CanonicalNumericIndexString.js b/node_modules/object.entries/node_modules/es-abstract/2018/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CompletePropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CopyDataProperties.js b/node_modules/object.entries/node_modules/es-abstract/2018/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CreateDataProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CreateHTML.js b/node_modules/object.entries/node_modules/es-abstract/2018/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CreateIterResultObject.js b/node_modules/object.entries/node_modules/es-abstract/2018/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CreateListFromArrayLike.js b/node_modules/object.entries/node_modules/es-abstract/2018/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/CreateMethodProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DateFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DateString.js b/node_modules/object.entries/node_modules/es-abstract/2018/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/Day.js b/node_modules/object.entries/node_modules/es-abstract/2018/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DayFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2018/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DayWithinYear.js b/node_modules/object.entries/node_modules/es-abstract/2018/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DaysInYear.js b/node_modules/object.entries/node_modules/es-abstract/2018/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DefinePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2018/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/DeletePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2018/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js b/node_modules/object.entries/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/FromPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/Get.js b/node_modules/object.entries/node_modules/es-abstract/2018/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/GetIterator.js b/node_modules/object.entries/node_modules/es-abstract/2018/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/GetMethod.js b/node_modules/object.entries/node_modules/es-abstract/2018/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/GetOwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/2018/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/GetSubstitution.js b/node_modules/object.entries/node_modules/es-abstract/2018/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/GetV.js b/node_modules/object.entries/node_modules/es-abstract/2018/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/HasOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/HasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/HourFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/InLeapYear.js b/node_modules/object.entries/node_modules/es-abstract/2018/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/InstanceofOperator.js b/node_modules/object.entries/node_modules/es-abstract/2018/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/Invoke.js b/node_modules/object.entries/node_modules/es-abstract/2018/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsAccessorDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsArray.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsCallable.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsConcatSpreadable.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsDataDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsExtensible.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsGenericDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsInteger.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsPromise.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsRegExp.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IsStringPrefix.js b/node_modules/object.entries/node_modules/es-abstract/2018/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IterableToList.js b/node_modules/object.entries/node_modules/es-abstract/2018/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IteratorClose.js b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IteratorComplete.js b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IteratorNext.js b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IteratorStep.js b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/IteratorValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/MakeDate.js b/node_modules/object.entries/node_modules/es-abstract/2018/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/MakeDay.js b/node_modules/object.entries/node_modules/es-abstract/2018/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/MakeTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/MinFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/MonthFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/NumberToString.js b/node_modules/object.entries/node_modules/es-abstract/2018/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ObjectCreate.js b/node_modules/object.entries/node_modules/es-abstract/2018/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasInstance.js b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/PromiseResolve.js b/node_modules/object.entries/node_modules/es-abstract/2018/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/RegExpExec.js b/node_modules/object.entries/node_modules/es-abstract/2018/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/RequireObjectCoercible.js b/node_modules/object.entries/node_modules/es-abstract/2018/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SameValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SameValueNonNumber.js b/node_modules/object.entries/node_modules/es-abstract/2018/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SameValueZero.js b/node_modules/object.entries/node_modules/es-abstract/2018/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SecFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/Set.js b/node_modules/object.entries/node_modules/es-abstract/2018/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SetFunctionName.js b/node_modules/object.entries/node_modules/es-abstract/2018/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SetIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2018/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SpeciesConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2018/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/StrictEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2018/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/SymbolDescriptiveString.js b/node_modules/object.entries/node_modules/es-abstract/2018/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/TestIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2018/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/TimeClip.js b/node_modules/object.entries/node_modules/es-abstract/2018/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/TimeFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2018/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/TimeString.js b/node_modules/object.entries/node_modules/es-abstract/2018/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/TimeWithinDay.js b/node_modules/object.entries/node_modules/es-abstract/2018/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToBoolean.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToDateString.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToIndex.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToInt16.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToInt32.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToInt8.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToInteger.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToLength.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToNumber.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToObject.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToString.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToUint16.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToUint32.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToUint8.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ToUint8Clamp.js b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/Type.js b/node_modules/object.entries/node_modules/es-abstract/2018/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/WeekDay.js b/node_modules/object.entries/node_modules/es-abstract/2018/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/YearFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/modulo.js b/node_modules/object.entries/node_modules/es-abstract/2018/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/msFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2018/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/thisBooleanValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/thisNumberValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/thisStringValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/thisSymbolValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2018/thisTimeValue.js b/node_modules/object.entries/node_modules/es-abstract/2018/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2018/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/AbstractEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2019/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/AbstractRelationalComparison.js b/node_modules/object.entries/node_modules/es-abstract/2019/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/AddEntriesFromIterable.js b/node_modules/object.entries/node_modules/es-abstract/2019/AddEntriesFromIterable.js new file mode 100644 index 0000000..5aed447 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/AddEntriesFromIterable.js @@ -0,0 +1,52 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var Get = require('./Get'); +var GetIterator = require('./GetIterator'); +var IsCallable = require('./IsCallable'); +var IteratorClose = require('./IteratorClose'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var Type = require('./Type'); + +// https://tc39.es/ecma262/#sec-add-entries-from-iterable + +module.exports = function AddEntriesFromIterable(target, iterable, adder) { + if (!IsCallable(adder)) { + throw new $TypeError('Assertion failed: `adder` is not callable'); + } + if (iterable == null) { + throw new $TypeError('Assertion failed: `iterable` is present, and not nullish'); + } + var iteratorRecord = GetIterator(iterable); + while (true) { // eslint-disable-line no-constant-condition + var next = IteratorStep(iteratorRecord); + if (!next) { + return target; + } + var nextItem = IteratorValue(next); + if (Type(nextItem) !== 'Object') { + var error = new $TypeError('iterator next must return an Object, got ' + inspect(nextItem)); + return IteratorClose( + iteratorRecord, + function () { throw error; } // eslint-disable-line no-loop-func + ); + } + try { + var k = Get(nextItem, '0'); + var v = Get(nextItem, '1'); + Call(adder, target, [k, v]); + } catch (e) { + return IteratorClose( + iteratorRecord, + function () { throw e; } + ); + } + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/AdvanceStringIndex.js b/node_modules/object.entries/node_modules/es-abstract/2019/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ArrayCreate.js b/node_modules/object.entries/node_modules/es-abstract/2019/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ArraySetLength.js b/node_modules/object.entries/node_modules/es-abstract/2019/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ArraySpeciesCreate.js b/node_modules/object.entries/node_modules/es-abstract/2019/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/Call.js b/node_modules/object.entries/node_modules/es-abstract/2019/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CanonicalNumericIndexString.js b/node_modules/object.entries/node_modules/es-abstract/2019/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CompletePropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CopyDataProperties.js b/node_modules/object.entries/node_modules/es-abstract/2019/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CreateDataProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CreateHTML.js b/node_modules/object.entries/node_modules/es-abstract/2019/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CreateIterResultObject.js b/node_modules/object.entries/node_modules/es-abstract/2019/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CreateListFromArrayLike.js b/node_modules/object.entries/node_modules/es-abstract/2019/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/CreateMethodProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DateFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DateString.js b/node_modules/object.entries/node_modules/es-abstract/2019/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/Day.js b/node_modules/object.entries/node_modules/es-abstract/2019/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DayFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2019/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DayWithinYear.js b/node_modules/object.entries/node_modules/es-abstract/2019/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DaysInYear.js b/node_modules/object.entries/node_modules/es-abstract/2019/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DefinePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2019/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/DeletePropertyOrThrow.js b/node_modules/object.entries/node_modules/es-abstract/2019/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js b/node_modules/object.entries/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/FlattenIntoArray.js b/node_modules/object.entries/node_modules/es-abstract/2019/FlattenIntoArray.js new file mode 100644 index 0000000..313a6ed --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/FlattenIntoArray.js @@ -0,0 +1,58 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray + +// eslint-disable-next-line max-params, max-statements +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = ToLength(Get(element, 'length')); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/FromPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/Get.js b/node_modules/object.entries/node_modules/es-abstract/2019/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/GetIterator.js b/node_modules/object.entries/node_modules/es-abstract/2019/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/GetMethod.js b/node_modules/object.entries/node_modules/es-abstract/2019/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/GetOwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/2019/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/GetSubstitution.js b/node_modules/object.entries/node_modules/es-abstract/2019/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/GetV.js b/node_modules/object.entries/node_modules/es-abstract/2019/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/HasOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/HasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/HourFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/InLeapYear.js b/node_modules/object.entries/node_modules/es-abstract/2019/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/InstanceofOperator.js b/node_modules/object.entries/node_modules/es-abstract/2019/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/Invoke.js b/node_modules/object.entries/node_modules/es-abstract/2019/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsAccessorDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsArray.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsCallable.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsConcatSpreadable.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsDataDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsExtensible.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsGenericDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsInteger.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsPromise.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsRegExp.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IsStringPrefix.js b/node_modules/object.entries/node_modules/es-abstract/2019/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IterableToList.js b/node_modules/object.entries/node_modules/es-abstract/2019/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IteratorClose.js b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IteratorComplete.js b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IteratorNext.js b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IteratorStep.js b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/IteratorValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/MakeDate.js b/node_modules/object.entries/node_modules/es-abstract/2019/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/MakeDay.js b/node_modules/object.entries/node_modules/es-abstract/2019/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/MakeTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/MinFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/MonthFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/NumberToString.js b/node_modules/object.entries/node_modules/es-abstract/2019/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ObjectCreate.js b/node_modules/object.entries/node_modules/es-abstract/2019/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasInstance.js b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasProperty.js b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/PromiseResolve.js b/node_modules/object.entries/node_modules/es-abstract/2019/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/RegExpExec.js b/node_modules/object.entries/node_modules/es-abstract/2019/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/RequireObjectCoercible.js b/node_modules/object.entries/node_modules/es-abstract/2019/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SameValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SameValueNonNumber.js b/node_modules/object.entries/node_modules/es-abstract/2019/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SameValueZero.js b/node_modules/object.entries/node_modules/es-abstract/2019/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SecFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/Set.js b/node_modules/object.entries/node_modules/es-abstract/2019/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SetFunctionName.js b/node_modules/object.entries/node_modules/es-abstract/2019/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SetIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2019/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SpeciesConstructor.js b/node_modules/object.entries/node_modules/es-abstract/2019/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/StrictEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/2019/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/SymbolDescriptiveString.js b/node_modules/object.entries/node_modules/es-abstract/2019/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/TestIntegrityLevel.js b/node_modules/object.entries/node_modules/es-abstract/2019/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/TimeClip.js b/node_modules/object.entries/node_modules/es-abstract/2019/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/TimeFromYear.js b/node_modules/object.entries/node_modules/es-abstract/2019/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/TimeString.js b/node_modules/object.entries/node_modules/es-abstract/2019/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/TimeWithinDay.js b/node_modules/object.entries/node_modules/es-abstract/2019/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToBoolean.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToDateString.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToIndex.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToInt16.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToInt32.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToInt8.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToInteger.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToLength.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToNumber.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToObject.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyKey.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToString.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToUint16.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToUint32.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToUint8.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ToUint8Clamp.js b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/TrimString.js b/node_modules/object.entries/node_modules/es-abstract/2019/TrimString.js new file mode 100644 index 0000000..b27112c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/TrimString.js @@ -0,0 +1,29 @@ +'use strict'; + +var trimStart = require('string.prototype.trimstart'); +var trimEnd = require('string.prototype.trimend'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-trimstring + +module.exports = function TrimString(string, where) { + var str = RequireObjectCoercible(string); + var S = ToString(str); + var T; + if (where === 'start') { + T = trimStart(S); + } else if (where === 'end') { + T = trimEnd(S); + } else if (where === 'start+end') { + T = trimStart(trimEnd(S)); + } else { + throw new $TypeError('Assertion failed: invalid `where` value; must be "start", "end", or "start+end"'); + } + return T; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/Type.js b/node_modules/object.entries/node_modules/es-abstract/2019/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/WeekDay.js b/node_modules/object.entries/node_modules/es-abstract/2019/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/YearFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/modulo.js b/node_modules/object.entries/node_modules/es-abstract/2019/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/msFromTime.js b/node_modules/object.entries/node_modules/es-abstract/2019/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/thisBooleanValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/thisNumberValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/thisStringValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/thisSymbolValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/2019/thisTimeValue.js b/node_modules/object.entries/node_modules/es-abstract/2019/thisTimeValue.js new file mode 100644 index 0000000..a9a47ac --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/2019/thisTimeValue.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../2018/thisTimeValue'); diff --git a/node_modules/object.entries/node_modules/es-abstract/5/AbstractEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/5/AbstractEqualityComparison.js new file mode 100644 index 0000000..e55c764 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/AbstractRelationalComparison.js b/node_modules/object.entries/node_modules/es-abstract/5/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/CheckObjectCoercible.js b/node_modules/object.entries/node_modules/es-abstract/5/CheckObjectCoercible.js new file mode 100644 index 0000000..f02b289 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/CheckObjectCoercible.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 + +module.exports = function CheckObjectCoercible(value, optMessage) { + if (value == null) { + throw new $TypeError(optMessage || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/DateFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/Day.js b/node_modules/object.entries/node_modules/es-abstract/5/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/DayFromYear.js b/node_modules/object.entries/node_modules/es-abstract/5/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/5/DayWithinYear.js b/node_modules/object.entries/node_modules/es-abstract/5/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/DaysInYear.js b/node_modules/object.entries/node_modules/es-abstract/5/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/FromPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/5/FromPropertyDescriptor.js new file mode 100644 index 0000000..a3cefbe --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/FromPropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/HourFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/InLeapYear.js b/node_modules/object.entries/node_modules/es-abstract/5/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/IsAccessorDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/5/IsAccessorDescriptor.js new file mode 100644 index 0000000..561382a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/IsCallable.js b/node_modules/object.entries/node_modules/es-abstract/5/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.entries/node_modules/es-abstract/5/IsDataDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/5/IsDataDescriptor.js new file mode 100644 index 0000000..783e2dc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/IsGenericDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/5/IsGenericDescriptor.js new file mode 100644 index 0000000..93340e9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/IsPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/5/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/MakeDate.js b/node_modules/object.entries/node_modules/es-abstract/5/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/MakeDay.js b/node_modules/object.entries/node_modules/es-abstract/5/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/MakeTime.js b/node_modules/object.entries/node_modules/es-abstract/5/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/MinFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/MonthFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/SameValue.js b/node_modules/object.entries/node_modules/es-abstract/5/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/SecFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/StrictEqualityComparison.js b/node_modules/object.entries/node_modules/es-abstract/5/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/TimeClip.js b/node_modules/object.entries/node_modules/es-abstract/5/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/5/TimeFromYear.js b/node_modules/object.entries/node_modules/es-abstract/5/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/TimeWithinDay.js b/node_modules/object.entries/node_modules/es-abstract/5/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToBoolean.js b/node_modules/object.entries/node_modules/es-abstract/5/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToInt32.js b/node_modules/object.entries/node_modules/es-abstract/5/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToInteger.js b/node_modules/object.entries/node_modules/es-abstract/5/ToInteger.js new file mode 100644 index 0000000..a95265b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToInteger.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4 + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return $sign(number) * $floor($abs(number)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToNumber.js b/node_modules/object.entries/node_modules/es-abstract/5/ToNumber.js new file mode 100644 index 0000000..4a7a3b8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToNumber.js @@ -0,0 +1,7 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 + +module.exports = function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToObject.js b/node_modules/object.entries/node_modules/es-abstract/5/ToObject.js new file mode 100644 index 0000000..1d27a13 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var CheckObjectCoercible = require('./CheckObjectCoercible'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.9 + +module.exports = function ToObject(value) { + CheckObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/5/ToPrimitive.js new file mode 100644 index 0000000..071df70 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.1 + +module.exports = require('es-to-primitive/es5'); diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/5/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToString.js b/node_modules/object.entries/node_modules/es-abstract/5/ToString.js new file mode 100644 index 0000000..80ece42 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToString.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.8 + +module.exports = function ToString(value) { + return $String(value); +}; + diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToUint16.js b/node_modules/object.entries/node_modules/es-abstract/5/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/ToUint32.js b/node_modules/object.entries/node_modules/es-abstract/5/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/Type.js b/node_modules/object.entries/node_modules/es-abstract/5/Type.js new file mode 100644 index 0000000..9cc750c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/Type.js @@ -0,0 +1,24 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/5.1/#sec-8 + +module.exports = function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/WeekDay.js b/node_modules/object.entries/node_modules/es-abstract/5/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/YearFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/modulo.js b/node_modules/object.entries/node_modules/es-abstract/5/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/5/msFromTime.js b/node_modules/object.entries/node_modules/es-abstract/5/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/5/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/CHANGELOG.md b/node_modules/object.entries/node_modules/es-abstract/CHANGELOG.md new file mode 100644 index 0000000..584b7cd --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/CHANGELOG.md @@ -0,0 +1,395 @@ +1.18.0-next.1 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [eslint] fix warning + * [Tests] temporarily allow SES tests to fail (#115) + * [Tests] ses-compat - initialize module after ses lockdown (#113) + * [Tests] [Refactor] use defineProperty helper rather than assignment + * [Tests] [Refactor] clean up defineProperty test helper + +1.18.0-next.0 / 2020-08-14 +================= + * [New] add `ES2020` + * [New] `GetIntrinsic`: add `%AggregateError%`, `%FinalizationRegistry%`, and `%WeakRef%` + * [New] `ES5`+: add `abs`, `floor`; use `modulo` consistently + * [New] `GetIntrinsic`: Cache accessed intrinsics (#98) + * [New] `GetIntrinsic`: Add ES201x function intrinsics (#97) + * [New] `ES2015`+: add `QuoteJSONString`, `OrdinaryCreateFromConstructor` + * [New] `ES2017`+: add `StringGetOwnProperty` + * [New] `ES2016`+: add `UTF16Encoding` + * [New] `ES2018`+: add `SetFunctionLength`, `UnicodeEscape` + * [New] add `isLeadingSurrogate`/`isTrailingSurrogate` helpers + * [Fix] `ES5`+: `ToPropertyDescriptor`: use intrinsic TypeError + * [Fix] `ES2018+`: `CopyDataProperties`/`NumberToString`: use intrinsic TypeError + * [Deps] update `is-regex`, `object-inspect` + * [Dev Deps] update `eslint` + +1.17.7 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `is-regex`, `object-inspect`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + +1.17.6 / 2020-06-13 +================= + * [Fix] `helpers/getSymbolDescription`: use the global Symbol registry when available (#92) + * [Fix] `ES2015+`: `IsConstructor`: when `Reflect.construct` is available, be spec-accurate (#93) + * [Fix] `ES2015+`: `Set`: Always return boolean value (#101) + * [Fix] `ES2015+`: `Set`: ensure exceptions are thrown in IE 9 when requested + * [Fix] Use `Reflect.apply(…)` if available (#99) + * [Fix] `helpers/floor`: module-cache `Math.floor` + * [Fix] `helpers/getSymbolDescription`: Prefer bound `description` getter when present + * [Fix] `2016`: Use `getIteratorMethod` in `IterableToArrayLike` (#94) + * [Fix] `helpers/OwnPropertyKeys`: Use `Reflect.ownKeys(…)` if available (#91) + * [Fix] `2018+`: Fix `CopyDataProperties` depending on `this` (#95) + * [meta] mark spackled files as autogenerated + * [meta] `Type`: fix spec URL + * [meta] `ES2015`: complete ops list + * [Deps] update `is‑callable`, `is‑regex` + * [Deps] switch from `string.prototype.trimleft`/`string.prototype.trimright` to `string.prototype.trimstart`/`string.prototype.trimend` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `in-publish`, `object-is`, `tape`; add `aud` + * [eslint] `helpers/isPropertyDescriptor`: fix indentation + * [Tests] `helpers/getSymbolDescription`: add test cases; some envs have `Symbol.for` but can not infer a name (#92) + * [Tests] try out CodeQL analysis + * [Tests] reformat expected missing ops + * [Tests] Run tests with `undefined` this (#96) + +1.17.5 / 2020-03-22 +================= + * [Fix] `CreateDataProperty`: update an existing property + * [Fix] run missing spackle from cd7504701879ddea0f5981e99cbcf93bfea9171d + * [Dev Deps] update `make-arrow-function`, `tape`, `@ljharb/eslint-config` + +1.17.4 / 2020-01-21 +================= + * [Fix] `2015+`: add code to handle IE 8’s problems + * [Tests] fix tests for IE 8 + +1.17.3 / 2020-01-19 +================= + * [Fix] `ObjectCreate` `2015+`: Fall back to `__proto__` and normal `new` in older browsers + * [Fix] `GetIntrinsic`: ensure the `allowMissing` property actually works on dotted intrinsics + +1.17.2 / 2020-01-14 +================= + * [Fix] `helpers/OwnPropertyKeys`: include non-enumerables too + +1.17.1 / 2020-01-14 +================= + * [Refactor] add `OwnPropertyKeys` helper, use it in `CopyDataProperties` + * [Refactor] `IteratorClose`: remove useless assignment + * [Dev Deps] update `eslint`, `tape`, `diff` + +1.17.0 / 2019-12-20 +================= + * [New] Split up each operation into its own file (prereleased) + * [Fix] `GetIntrinsic`: IE 8 has a broken `Object.getOwnPropertyDescriptor` + * [Fix] `object.assign` is a runtime dep (prereleased) + * [Refactor] `GetIntrinsic`: remove the internal property salts, since % already handles that + * [Refactor] `GetIntrinsic`: further simplification + * [Deps] update `is-callable`, `string.prototype.trimleft`, `string.prototype.trimright`, `is-regex` + * [Dev Deps] update `@ljharb/eslint-config`, `object-is`, `object.fromentries`, `tape` + * [Tests] add `.eslintignore` + * [meta] remove unused Makefile and associated utils + * [meta] only run spackle script in publish (#78) (prereleased) + +1.17.0-next.1 / 2019-12-11 +================= + * [Fix] `object.assign` is a runtime dep + * [meta] only run spackle script in publish (#78) + +1.17.0-next.0 / 2019-12-11 +================= + * [New] Split up each operation into its own file + +1.16.3 / 2019-12-04 +================= + * [Fix] `GetIntrinsic`: when given a path to a getter, return the actual getter + * [Dev Deps] update `eslint` + +1.16.2 / 2019-11-24 +================= + * [Fix] IE 6-7 lack JSON + * [Fix] IE 6-8 strings can’t use array slice, they need string slice + * [Dev Deps] update `eslint` + +1.16.1 / 2019-11-24 +================= + * [Fix] `GetIntrinsics`: turns out IE 8 throws when `Object.getOwnPropertyDescriptor(arguments);`, and does not throw on `callee` anyways + * [Deps] update `es-to-primitive`, `has-symbols`, `object-inspect` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + * [meta] re-include year files inside `operations` + * [meta] add `funding` field + * [actions] add Automatic Rebase github action + * [Tests] use shared travis-ci config + * [Tests] disable `check-coverage`, and let codecov do it + +1.16.0 / 2019-10-18 +================= + * [New] `ES2015+`: add `SetFunctionName` + * [New] `ES2015+`: add `GetPrototypeFromConstructor`, with caveats + * [New] `ES2015+`: add `CreateListFromArrayLike` + * [New] `ES2016+`: add `OrdinarySetPrototypeOf` + * [New] `ES2016+`: add `OrdinaryGetPrototypeOf` + * [New] add `getSymbolDescription` and `getInferredName` helpers + * [Fix] `GetIterator`: add fallback for pre-Symbol environments, tests + * [Dev Deps] update `object.fromentries` + * [Tests] add `node` `v12.2` + +1.15.0 / 2019-10-02 +================= + * [New] `ES2018`+: add `DateString`, `TimeString` + * [New] `ES2015`+: add `ToDateString` + * [New] `ES5`+: add `msFromTime`, `SecFromTime`, `MinFromTime`, `HourFromTime`, `TimeWithinDay`, `Day`, `DayFromYear`, `TimeFromYear`, `YearFromTime`, `WeekDay`, `DaysInYear`, `InLeapYear`, `DayWithinYear`, `MonthFromTime`, `DateFromTime`, `MakeDay`, `MakeDate`, `MakeTime`, `TimeClip`, `modulo` + * [New] add `regexTester` helper + * [New] add `callBound` helper + * [New] add ES2020’s intrinsic dot notation + * [New] add `isPrefixOf` helper + * [New] add `maxSafeInteger` helper + * [Deps] update `string.prototype.trimleft`, `string.prototype.trimright` + * [Dev Deps] update `eslint` + * [Tests] on `node` `v12.11` + * [meta] npmignore operations scripts; add "deltas" + +1.14.2 / 2019-09-08 +================= + * [Fix] `ES2016`: `IterableToArrayLike`: add proper fallback for strings, pre-Symbols + * [Tests] on `node` `v12.10` + +1.14.1 / 2019-09-03 +================= + * [meta] republish with some extra files removed + +1.14.0 / 2019-09-02 +================= + * [New] add ES2019 + * [New] `ES2017+`: add `IterableToList` + * [New] `ES2016`: add `IterableToArrayLike` + * [New] `ES2015+`: add `ArrayCreate`, `ArraySetLength`, `OrdinaryDefineOwnProperty`, `OrdinaryGetOwnProperty`, `OrdinaryHasProperty`, `CreateHTML`, `GetOwnPropertyKeys`, `InstanceofOperator`, `SymbolDescriptiveString`, `GetSubstitution`, `ValidateAndApplyPropertyDescriptor`, `IsPromise`, `OrdinaryHasInstance`, `TestIntegrityLevel`, `SetIntegrityLevel` + * [New] add `callBind` helper, and use it + * [New] add helpers: `isPropertyDescriptor`, `every` + * [New] ES5+: add `Abstract Relational Comparison` + * [New] ES5+: add `Abstract Equality Comparison`, `Strict Equality Comparison` + * [Fix] `ES2015+`: `GetIterator`: only require native Symbols when `method` is omitted + * [Fix] `ES2015`: `Call`: error message now properly displays Symbols using `object-inspect` + * [Fix] `ES2015+`: `ValidateAndApplyPropertyDescriptor`: use ES2017 logic to bypass spec bugs + * [Fix] `ES2015+`: `CreateDataProperty`, `DefinePropertyOrThrow`, `ValidateAndApplyPropertyDescriptor`: add fallbacks for ES3 + * [Fix] `ES2015+`: `FromPropertyDescriptor`: no longer requires a fully complete Property Descriptor + * [Fix] `ES5`: `IsPropertyDescriptor`: call into `IsDataDescriptor` and `IsAccessorDescriptor` + * [Refactor] use `has-symbols` for Symbol detection + * [Fix] `helpers/assertRecord`: remove `console.log` + * [Deps] update `object-keys` + * [readme] add security note + * [meta] change http URLs to https + * [meta] linter cleanup + * [meta] fix getOps script + * [meta] add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `replace`, `cheerio`, `tape` + * [Tests] up to `node` `v12.9`, `v11.15`, `v10.16`, `v8.16`, `v6.17` + * [Tests] temporarily allow node 0.6 to fail; segfaulting in travis + * [Tests] use the values helper more in es5 tests + * [Tests] fix linting to apply to all files + * [Tests] run `npx aud` only on prod deps + * [Tests] add v.descriptors helpers + * [Tests] use `npx aud` instead of `npm audit` with hoops + * [Tests] use `eclint` instead of `editorconfig-tools` + * [Tests] some intrinsic cleanup + * [Tests] migrate es5 tests to use values helper + * [Tests] add some missing ES2015 ops + +1.13.0 / 2019-01-02 +================= + * [New] add ES2018 + * [New] add ES2015/ES2016: EnumerableOwnNames; ES2017: EnumerableOwnProperties + * [New] `ES2015+`: add `thisBooleanValue`, `thisNumberValue`, `thisStringValue`, `thisTimeValue` + * [New] `ES2015+`: add `DefinePropertyOrThrow`, `DeletePropertyOrThrow`, `CreateMethodProperty` + * [New] add `assertRecord` helper + * [Deps] update `is-callable`, `has`, `object-keys`, `es-to-primitive` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `semver`, `safe-publish-latest`, `replace` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + * [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` + * [Tests] move descriptor factories to `values` helper + * [Tests] add `getOps` to programmatically fetch abstract operation names + +1.12.0 / 2018-05-31 +================= + * [New] add `GetIntrinsic` entry point + * [New] `ES2015`+: add `ObjectCreate` + * [Robustness]: `ES2015+`: ensure `Math.{abs,floor}` and `Function.call` are cached + +1.11.0 / 2018-03-21 +================= + * [New] `ES2015+`: add iterator abstract ops + * [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape` + * [Tests] up to `node` `v9.8`, `v8.10`, `v6.13` + +1.10.0 / 2017-11-24 +================= + * [New] ES2015+: `AdvanceStringIndex` + * [Dev Deps] update `eslint`, `nsp` + * [Tests] require node 0.6 to pass again + * [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS + +1.9.0 / 2017-09-30 +================= + * [New] `es2015+`: add `ArraySpeciesCreate` + * [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow` + * [Tests] consolidate duplicated tests + * [Tests] increase coverage + * [Dev Deps] update `nsp`, `eslint` + +1.8.2 / 2017-09-03 +================= + * [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27) + * [Dev Deps] update `eslint` + +1.8.1 / 2017-08-30 +================= + * [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26) + * [Deps] update `function-bind` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [Docs] github broke markdown parsing + +1.8.0 / 2017-08-04 +================= + * [New] add ES2017 + * [New] move es6+ to es2015+; leave es6/es7 as aliases + * [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor` + * [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec` + * [Fix] es7/es2016: do not mutate ES6 + * [Fix] assign helper only supports one source + * [Deps] update `is-regex` + * [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` + * [Tests] add tests for missing and excess operations + * [Tests] add codecov for coverage + * [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node + * [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same + * [Tests] ES2015: add ToNumber symbol tests + * [Tests] switch to `nyc` for code coverage + * [Tests] make IsRegExp tests consistent across editions + +1.7.0 / 2017-01-22 +================= + * [New] ES6: Add `GetMethod` (#16) + * [New] ES6: Add `GetV` (#16) + * [New] ES6: Add `Get` (#17) + * [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix + * [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + +1.6.1 / 2016-08-21 +================= + * [Fix] ES6: IsConstructor should return true for `class` constructors. + +1.6.0 / 2016-08-20 +================= + * [New] ES5 / ES6: add `Type` + * [New] ES6: `SpeciesConstructor` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest` + * [Tests] up to `node` `v6.4`, `v5.12`, `v4.5` + +1.5.1 / 2016-05-30 +================= + * [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument + * [Refactor] create `isNaN` helper + * [Deps] update `is-callable`, `function-bind` + * [Deps] update `es-to-primitive`, fix ES5 tests + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp` + * [Tests] up to `node` `v6.2`, `v5.11`, `v4.4` + * [Tests] use pretest/posttest for linting/security + +1.5.0 / 2015-12-27 +================= + * [New] adds `Symbol.toPrimitive` support via `es-to-primitive` + * [Deps] update `is-callable`, `es-to-primitive` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape` + * [Tests] up to `node` `v5.3` + +1.4.3 / 2015-11-04 +================= + * [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4) + * [Refactor] `ES6.ToNumber`: No need to double-trim + * [Refactor] group tests better + * [Tests] should still pass on `node` `v0.8` + +1.4.2 / 2015-11-02 +================= + * [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3) + +1.4.1 / 2015-10-31 +================= + * [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2) + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v5.0` + * [Tests] fix npm upgrades for older node versions + * package.json: use object form of "authors", add "contributors" + +1.4.0 / 2015-09-26 +================= + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v4.2` + * [New] Add `SameValueNonNumber` to ES7 + +1.3.2 / 2015-09-26 +================= + * [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` + +1.3.1 / 2015-08-15 +================= + * [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly + +1.3.0 / 2015-08-15 +================= + * [New] ES6’s ToNumber now supports binary and octal literals. + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] up to `io.js` `v3.0` + +1.2.2 / 2015-07-28 +================= + * [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw. + * [Tests] Test on latest `io.js` versions. + * [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp` + +1.2.1 / 2015-03-20 +================= + * Fix `isFinite` helper. + +1.2.0 / 2015-03-19 +================= + * Use `es-to-primitive` for ToPrimitive methods. + * Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions. + +1.1.2 / 2015-03-20 +================= + * Fix isFinite helper. + +1.1.1 / 2015-03-19 +================= + * Fix isPrimitive check for functions + * Update `eslint`, `editorconfig-tools`, `semver`, `nsp` + +1.1.0 / 2015-02-17 +================= + * Add ES7 export (non-default). + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Test on `iojs-v1.2`. + +1.0.1 / 2015-01-30 +================= + * Use `is-callable` instead of an internal function. + * Update `tape`, `jscs`, `nsp`, `eslint` + +1.0.0 / 2015-01-10 +================= + * v1.0.0 diff --git a/node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js b/node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js new file mode 100644 index 0000000..5d38e1f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js @@ -0,0 +1,225 @@ +'use strict'; + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; + +var $TypeError = TypeError; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayPrototype%': Array.prototype, + '%ArrayProto_entries%': Array.prototype.entries, + '%ArrayProto_forEach%': Array.prototype.forEach, + '%ArrayProto_keys%': Array.prototype.keys, + '%ArrayProto_values%': Array.prototype.values, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': asyncFunction, + '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%Boolean%': Boolean, + '%BooleanPrototype%': Boolean.prototype, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '%Date%': Date, + '%DatePrototype%': Date.prototype, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%ErrorPrototype%': Error.prototype, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%EvalErrorPrototype%': EvalError.prototype, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '%Function%': Function, + '%FunctionPrototype%': Function.prototype, + '%Generator%': generator ? getProto(generator()) : undefined, + '%GeneratorFunction%': generatorFunction, + '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '%Math%': Math, + '%Number%': Number, + '%NumberPrototype%': Number.prototype, + '%Object%': Object, + '%ObjectPrototype%': Object.prototype, + '%ObjProto_toString%': Object.prototype.toString, + '%ObjProto_valueOf%': Object.prototype.valueOf, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%RangeErrorPrototype%': RangeError.prototype, + '%ReferenceError%': ReferenceError, + '%ReferenceErrorPrototype%': ReferenceError.prototype, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%RegExpPrototype%': RegExp.prototype, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringPrototype%': String.prototype, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '%SyntaxError%': SyntaxError, + '%SyntaxErrorPrototype%': SyntaxError.prototype, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '%TypeError%': $TypeError, + '%TypeErrorPrototype%': $TypeError.prototype, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '%URIError%': URIError, + '%URIErrorPrototype%': URIError.prototype, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +var bind = require('function-bind'); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + if (!(name in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[name]; +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, parts[i]); + if (!allowMissing && !(parts[i] in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]]; + } else { + value = value[parts[i]]; + } + } + } + return value; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/LICENSE b/node_modules/object.entries/node_modules/es-abstract/LICENSE new file mode 100644 index 0000000..8c271c1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/object.entries/node_modules/es-abstract/README.md b/node_modules/object.entries/node_modules/es-abstract/README.md new file mode 100644 index 0000000..20342d1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/README.md @@ -0,0 +1,48 @@ +# es-abstract [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +ECMAScript spec abstract operations. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +All abstract operations will also be available under an `es5`/`es2015`/`es2016`/`es2017`/`es2018`/`es2019` entry point, and exported property, if you require a specific version. + +## Example + +```js +var ES = require('es-abstract'); +var assert = require('assert'); + +assert(ES.isCallable(function () {})); +assert(!ES.isCallable(/a/g)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-abstract +[npm-version-svg]: http://versionbadg.es/ljharb/es-abstract.svg +[travis-svg]: https://travis-ci.org/ljharb/es-abstract.svg +[travis-url]: https://travis-ci.org/ljharb/es-abstract +[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg +[deps-url]: https://david-dm.org/ljharb/es-abstract +[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/es-abstract.png +[testling-url]: https://ci.testling.com/ljharb/es-abstract +[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-abstract.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-abstract.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-abstract diff --git a/node_modules/object.entries/node_modules/es-abstract/es2015.js b/node_modules/object.entries/node_modules/es-abstract/es2015.js new file mode 100644 index 0000000..dc02ca4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es2015.js @@ -0,0 +1,115 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-operations +var ES6 = { + 'Abstract Equality Comparison': require('./2015/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2015/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2015/StrictEqualityComparison'), + AdvanceStringIndex: require('./2015/AdvanceStringIndex'), + ArrayCreate: require('./2015/ArrayCreate'), + ArraySetLength: require('./2015/ArraySetLength'), + ArraySpeciesCreate: require('./2015/ArraySpeciesCreate'), + Call: require('./2015/Call'), + CanonicalNumericIndexString: require('./2015/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2015/CompletePropertyDescriptor'), + CreateDataProperty: require('./2015/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2015/CreateDataPropertyOrThrow'), + CreateHTML: require('./2015/CreateHTML'), + CreateIterResultObject: require('./2015/CreateIterResultObject'), + CreateListFromArrayLike: require('./2015/CreateListFromArrayLike'), + CreateMethodProperty: require('./2015/CreateMethodProperty'), + DateFromTime: require('./2015/DateFromTime'), + Day: require('./2015/Day'), + DayFromYear: require('./2015/DayFromYear'), + DaysInYear: require('./2015/DaysInYear'), + DayWithinYear: require('./2015/DayWithinYear'), + DefinePropertyOrThrow: require('./2015/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2015/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2015/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2015/FromPropertyDescriptor'), + Get: require('./2015/Get'), + GetIterator: require('./2015/GetIterator'), + GetMethod: require('./2015/GetMethod'), + GetOwnPropertyKeys: require('./2015/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2015/GetPrototypeFromConstructor'), + GetSubstitution: require('./2015/GetSubstitution'), + GetV: require('./2015/GetV'), + HasOwnProperty: require('./2015/HasOwnProperty'), + HasProperty: require('./2015/HasProperty'), + HourFromTime: require('./2015/HourFromTime'), + InLeapYear: require('./2015/InLeapYear'), + InstanceofOperator: require('./2015/InstanceofOperator'), + Invoke: require('./2015/Invoke'), + IsAccessorDescriptor: require('./2015/IsAccessorDescriptor'), + IsArray: require('./2015/IsArray'), + IsCallable: require('./2015/IsCallable'), + IsConcatSpreadable: require('./2015/IsConcatSpreadable'), + IsConstructor: require('./2015/IsConstructor'), + IsDataDescriptor: require('./2015/IsDataDescriptor'), + IsExtensible: require('./2015/IsExtensible'), + IsGenericDescriptor: require('./2015/IsGenericDescriptor'), + IsInteger: require('./2015/IsInteger'), + IsPromise: require('./2015/IsPromise'), + IsPropertyDescriptor: require('./2015/IsPropertyDescriptor'), + IsPropertyKey: require('./2015/IsPropertyKey'), + IsRegExp: require('./2015/IsRegExp'), + IteratorClose: require('./2015/IteratorClose'), + IteratorComplete: require('./2015/IteratorComplete'), + IteratorNext: require('./2015/IteratorNext'), + IteratorStep: require('./2015/IteratorStep'), + IteratorValue: require('./2015/IteratorValue'), + MakeDate: require('./2015/MakeDate'), + MakeDay: require('./2015/MakeDay'), + MakeTime: require('./2015/MakeTime'), + MinFromTime: require('./2015/MinFromTime'), + modulo: require('./2015/modulo'), + MonthFromTime: require('./2015/MonthFromTime'), + msFromTime: require('./2015/msFromTime'), + ObjectCreate: require('./2015/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2015/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2015/OrdinaryGetOwnProperty'), + OrdinaryHasInstance: require('./2015/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2015/OrdinaryHasProperty'), + RegExpExec: require('./2015/RegExpExec'), + RequireObjectCoercible: require('./2015/RequireObjectCoercible'), + SameValue: require('./2015/SameValue'), + SameValueZero: require('./2015/SameValueZero'), + SecFromTime: require('./2015/SecFromTime'), + Set: require('./2015/Set'), + SetFunctionName: require('./2015/SetFunctionName'), + SetIntegrityLevel: require('./2015/SetIntegrityLevel'), + SpeciesConstructor: require('./2015/SpeciesConstructor'), + SymbolDescriptiveString: require('./2015/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2015/TestIntegrityLevel'), + thisBooleanValue: require('./2015/thisBooleanValue'), + thisNumberValue: require('./2015/thisNumberValue'), + thisStringValue: require('./2015/thisStringValue'), + thisTimeValue: require('./2015/thisTimeValue'), + TimeClip: require('./2015/TimeClip'), + TimeFromYear: require('./2015/TimeFromYear'), + TimeWithinDay: require('./2015/TimeWithinDay'), + ToBoolean: require('./2015/ToBoolean'), + ToDateString: require('./2015/ToDateString'), + ToInt16: require('./2015/ToInt16'), + ToInt32: require('./2015/ToInt32'), + ToInt8: require('./2015/ToInt8'), + ToInteger: require('./2015/ToInteger'), + ToLength: require('./2015/ToLength'), + ToNumber: require('./2015/ToNumber'), + ToObject: require('./2015/ToObject'), + ToPrimitive: require('./2015/ToPrimitive'), + ToPropertyDescriptor: require('./2015/ToPropertyDescriptor'), + ToPropertyKey: require('./2015/ToPropertyKey'), + ToString: require('./2015/ToString'), + ToUint16: require('./2015/ToUint16'), + ToUint32: require('./2015/ToUint32'), + ToUint8: require('./2015/ToUint8'), + ToUint8Clamp: require('./2015/ToUint8Clamp'), + Type: require('./2015/Type'), + ValidateAndApplyPropertyDescriptor: require('./2015/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2015/WeekDay'), + YearFromTime: require('./2015/YearFromTime') +}; + +module.exports = ES6; diff --git a/node_modules/object.entries/node_modules/es-abstract/es2016.js b/node_modules/object.entries/node_modules/es-abstract/es2016.js new file mode 100644 index 0000000..9e72e82 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es2016.js @@ -0,0 +1,119 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/7.0/#sec-abstract-operations +var ES2016 = { + 'Abstract Equality Comparison': require('./2016/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2016/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2016/StrictEqualityComparison'), + AdvanceStringIndex: require('./2016/AdvanceStringIndex'), + ArrayCreate: require('./2016/ArrayCreate'), + ArraySetLength: require('./2016/ArraySetLength'), + ArraySpeciesCreate: require('./2016/ArraySpeciesCreate'), + Call: require('./2016/Call'), + CanonicalNumericIndexString: require('./2016/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2016/CompletePropertyDescriptor'), + CreateDataProperty: require('./2016/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2016/CreateDataPropertyOrThrow'), + CreateHTML: require('./2016/CreateHTML'), + CreateIterResultObject: require('./2016/CreateIterResultObject'), + CreateListFromArrayLike: require('./2016/CreateListFromArrayLike'), + CreateMethodProperty: require('./2016/CreateMethodProperty'), + DateFromTime: require('./2016/DateFromTime'), + Day: require('./2016/Day'), + DayFromYear: require('./2016/DayFromYear'), + DaysInYear: require('./2016/DaysInYear'), + DayWithinYear: require('./2016/DayWithinYear'), + DefinePropertyOrThrow: require('./2016/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2016/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2016/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2016/FromPropertyDescriptor'), + Get: require('./2016/Get'), + GetIterator: require('./2016/GetIterator'), + GetMethod: require('./2016/GetMethod'), + GetOwnPropertyKeys: require('./2016/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2016/GetPrototypeFromConstructor'), + GetSubstitution: require('./2016/GetSubstitution'), + GetV: require('./2016/GetV'), + HasOwnProperty: require('./2016/HasOwnProperty'), + HasProperty: require('./2016/HasProperty'), + HourFromTime: require('./2016/HourFromTime'), + InLeapYear: require('./2016/InLeapYear'), + InstanceofOperator: require('./2016/InstanceofOperator'), + Invoke: require('./2016/Invoke'), + IsAccessorDescriptor: require('./2016/IsAccessorDescriptor'), + IsArray: require('./2016/IsArray'), + IsCallable: require('./2016/IsCallable'), + IsConcatSpreadable: require('./2016/IsConcatSpreadable'), + IsConstructor: require('./2016/IsConstructor'), + IsDataDescriptor: require('./2016/IsDataDescriptor'), + IsExtensible: require('./2016/IsExtensible'), + IsGenericDescriptor: require('./2016/IsGenericDescriptor'), + IsInteger: require('./2016/IsInteger'), + IsPromise: require('./2016/IsPromise'), + IsPropertyDescriptor: require('./2016/IsPropertyDescriptor'), + IsPropertyKey: require('./2016/IsPropertyKey'), + IsRegExp: require('./2016/IsRegExp'), + IterableToArrayLike: require('./2016/IterableToArrayLike'), + IteratorClose: require('./2016/IteratorClose'), + IteratorComplete: require('./2016/IteratorComplete'), + IteratorNext: require('./2016/IteratorNext'), + IteratorStep: require('./2016/IteratorStep'), + IteratorValue: require('./2016/IteratorValue'), + MakeDate: require('./2016/MakeDate'), + MakeDay: require('./2016/MakeDay'), + MakeTime: require('./2016/MakeTime'), + MinFromTime: require('./2016/MinFromTime'), + modulo: require('./2016/modulo'), + MonthFromTime: require('./2016/MonthFromTime'), + msFromTime: require('./2016/msFromTime'), + ObjectCreate: require('./2016/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2016/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2016/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2016/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2016/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2016/OrdinaryHasProperty'), + RegExpExec: require('./2016/RegExpExec'), + RequireObjectCoercible: require('./2016/RequireObjectCoercible'), + SameValue: require('./2016/SameValue'), + SameValueNonNumber: require('./2016/SameValueNonNumber'), + SameValueZero: require('./2016/SameValueZero'), + SecFromTime: require('./2016/SecFromTime'), + Set: require('./2016/Set'), + SetFunctionName: require('./2016/SetFunctionName'), + SetIntegrityLevel: require('./2016/SetIntegrityLevel'), + SpeciesConstructor: require('./2016/SpeciesConstructor'), + SymbolDescriptiveString: require('./2016/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2016/TestIntegrityLevel'), + thisBooleanValue: require('./2016/thisBooleanValue'), + thisNumberValue: require('./2016/thisNumberValue'), + thisStringValue: require('./2016/thisStringValue'), + thisTimeValue: require('./2016/thisTimeValue'), + TimeClip: require('./2016/TimeClip'), + TimeFromYear: require('./2016/TimeFromYear'), + TimeWithinDay: require('./2016/TimeWithinDay'), + ToBoolean: require('./2016/ToBoolean'), + ToDateString: require('./2016/ToDateString'), + ToInt16: require('./2016/ToInt16'), + ToInt32: require('./2016/ToInt32'), + ToInt8: require('./2016/ToInt8'), + ToInteger: require('./2016/ToInteger'), + ToLength: require('./2016/ToLength'), + ToNumber: require('./2016/ToNumber'), + ToObject: require('./2016/ToObject'), + ToPrimitive: require('./2016/ToPrimitive'), + ToPropertyDescriptor: require('./2016/ToPropertyDescriptor'), + ToPropertyKey: require('./2016/ToPropertyKey'), + ToString: require('./2016/ToString'), + ToUint16: require('./2016/ToUint16'), + ToUint32: require('./2016/ToUint32'), + ToUint8: require('./2016/ToUint8'), + ToUint8Clamp: require('./2016/ToUint8Clamp'), + Type: require('./2016/Type'), + ValidateAndApplyPropertyDescriptor: require('./2016/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2016/WeekDay'), + YearFromTime: require('./2016/YearFromTime') +}; + +module.exports = ES2016; diff --git a/node_modules/object.entries/node_modules/es-abstract/es2017.js b/node_modules/object.entries/node_modules/es-abstract/es2017.js new file mode 100644 index 0000000..5f317b7 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es2017.js @@ -0,0 +1,120 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/8.0/#sec-abstract-operations +var ES2017 = { + 'Abstract Equality Comparison': require('./2017/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2017/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2017/StrictEqualityComparison'), + AdvanceStringIndex: require('./2017/AdvanceStringIndex'), + ArrayCreate: require('./2017/ArrayCreate'), + ArraySetLength: require('./2017/ArraySetLength'), + ArraySpeciesCreate: require('./2017/ArraySpeciesCreate'), + Call: require('./2017/Call'), + CanonicalNumericIndexString: require('./2017/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2017/CompletePropertyDescriptor'), + CreateDataProperty: require('./2017/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2017/CreateDataPropertyOrThrow'), + CreateHTML: require('./2017/CreateHTML'), + CreateIterResultObject: require('./2017/CreateIterResultObject'), + CreateListFromArrayLike: require('./2017/CreateListFromArrayLike'), + CreateMethodProperty: require('./2017/CreateMethodProperty'), + DateFromTime: require('./2017/DateFromTime'), + Day: require('./2017/Day'), + DayFromYear: require('./2017/DayFromYear'), + DaysInYear: require('./2017/DaysInYear'), + DayWithinYear: require('./2017/DayWithinYear'), + DefinePropertyOrThrow: require('./2017/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2017/DeletePropertyOrThrow'), + EnumerableOwnProperties: require('./2017/EnumerableOwnProperties'), + FromPropertyDescriptor: require('./2017/FromPropertyDescriptor'), + Get: require('./2017/Get'), + GetIterator: require('./2017/GetIterator'), + GetMethod: require('./2017/GetMethod'), + GetOwnPropertyKeys: require('./2017/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2017/GetPrototypeFromConstructor'), + GetSubstitution: require('./2017/GetSubstitution'), + GetV: require('./2017/GetV'), + HasOwnProperty: require('./2017/HasOwnProperty'), + HasProperty: require('./2017/HasProperty'), + HourFromTime: require('./2017/HourFromTime'), + InLeapYear: require('./2017/InLeapYear'), + InstanceofOperator: require('./2017/InstanceofOperator'), + Invoke: require('./2017/Invoke'), + IsAccessorDescriptor: require('./2017/IsAccessorDescriptor'), + IsArray: require('./2017/IsArray'), + IsCallable: require('./2017/IsCallable'), + IsConcatSpreadable: require('./2017/IsConcatSpreadable'), + IsConstructor: require('./2017/IsConstructor'), + IsDataDescriptor: require('./2017/IsDataDescriptor'), + IsExtensible: require('./2017/IsExtensible'), + IsGenericDescriptor: require('./2017/IsGenericDescriptor'), + IsInteger: require('./2017/IsInteger'), + IsPromise: require('./2017/IsPromise'), + IsPropertyDescriptor: require('./2017/IsPropertyDescriptor'), + IsPropertyKey: require('./2017/IsPropertyKey'), + IsRegExp: require('./2017/IsRegExp'), + IterableToList: require('./2017/IterableToList'), + IteratorClose: require('./2017/IteratorClose'), + IteratorComplete: require('./2017/IteratorComplete'), + IteratorNext: require('./2017/IteratorNext'), + IteratorStep: require('./2017/IteratorStep'), + IteratorValue: require('./2017/IteratorValue'), + MakeDate: require('./2017/MakeDate'), + MakeDay: require('./2017/MakeDay'), + MakeTime: require('./2017/MakeTime'), + MinFromTime: require('./2017/MinFromTime'), + modulo: require('./2017/modulo'), + MonthFromTime: require('./2017/MonthFromTime'), + msFromTime: require('./2017/msFromTime'), + ObjectCreate: require('./2017/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2017/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2017/OrdinaryGetOwnProperty'), + OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), + OrdinaryGetPrototypeOf: require('./2017/OrdinaryGetPrototypeOf'), + OrdinaryHasInstance: require('./2017/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2017/OrdinaryHasProperty'), + RegExpExec: require('./2017/RegExpExec'), + RequireObjectCoercible: require('./2017/RequireObjectCoercible'), + SameValue: require('./2017/SameValue'), + SameValueNonNumber: require('./2017/SameValueNonNumber'), + SameValueZero: require('./2017/SameValueZero'), + SecFromTime: require('./2017/SecFromTime'), + Set: require('./2017/Set'), + SetFunctionName: require('./2017/SetFunctionName'), + SetIntegrityLevel: require('./2017/SetIntegrityLevel'), + SpeciesConstructor: require('./2017/SpeciesConstructor'), + SymbolDescriptiveString: require('./2017/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2017/TestIntegrityLevel'), + thisBooleanValue: require('./2017/thisBooleanValue'), + thisNumberValue: require('./2017/thisNumberValue'), + thisStringValue: require('./2017/thisStringValue'), + thisTimeValue: require('./2017/thisTimeValue'), + TimeClip: require('./2017/TimeClip'), + TimeFromYear: require('./2017/TimeFromYear'), + TimeWithinDay: require('./2017/TimeWithinDay'), + ToBoolean: require('./2017/ToBoolean'), + ToDateString: require('./2017/ToDateString'), + ToIndex: require('./2017/ToIndex'), + ToInt16: require('./2017/ToInt16'), + ToInt32: require('./2017/ToInt32'), + ToInt8: require('./2017/ToInt8'), + ToInteger: require('./2017/ToInteger'), + ToLength: require('./2017/ToLength'), + ToNumber: require('./2017/ToNumber'), + ToObject: require('./2017/ToObject'), + ToPrimitive: require('./2017/ToPrimitive'), + ToPropertyDescriptor: require('./2017/ToPropertyDescriptor'), + ToPropertyKey: require('./2017/ToPropertyKey'), + ToString: require('./2017/ToString'), + ToUint16: require('./2017/ToUint16'), + ToUint32: require('./2017/ToUint32'), + ToUint8: require('./2017/ToUint8'), + ToUint8Clamp: require('./2017/ToUint8Clamp'), + Type: require('./2017/Type'), + ValidateAndApplyPropertyDescriptor: require('./2017/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2017/WeekDay'), + YearFromTime: require('./2017/YearFromTime') +}; + +module.exports = ES2017; diff --git a/node_modules/object.entries/node_modules/es-abstract/es2018.js b/node_modules/object.entries/node_modules/es-abstract/es2018.js new file mode 100644 index 0000000..e68910b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es2018.js @@ -0,0 +1,126 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/9.0/#sec-abstract-operations +var ES2018 = { + 'Abstract Equality Comparison': require('./2018/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2018/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2018/StrictEqualityComparison'), + AdvanceStringIndex: require('./2018/AdvanceStringIndex'), + ArrayCreate: require('./2018/ArrayCreate'), + ArraySetLength: require('./2018/ArraySetLength'), + ArraySpeciesCreate: require('./2018/ArraySpeciesCreate'), + Call: require('./2018/Call'), + CanonicalNumericIndexString: require('./2018/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2018/CompletePropertyDescriptor'), + CopyDataProperties: require('./2018/CopyDataProperties'), + CreateDataProperty: require('./2018/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2018/CreateDataPropertyOrThrow'), + CreateHTML: require('./2018/CreateHTML'), + CreateIterResultObject: require('./2018/CreateIterResultObject'), + CreateListFromArrayLike: require('./2018/CreateListFromArrayLike'), + CreateMethodProperty: require('./2018/CreateMethodProperty'), + DateFromTime: require('./2018/DateFromTime'), + DateString: require('./2018/DateString'), + Day: require('./2018/Day'), + DayFromYear: require('./2018/DayFromYear'), + DaysInYear: require('./2018/DaysInYear'), + DayWithinYear: require('./2018/DayWithinYear'), + DefinePropertyOrThrow: require('./2018/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2018/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'), + FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'), + Get: require('./2018/Get'), + GetIterator: require('./2018/GetIterator'), + GetMethod: require('./2018/GetMethod'), + GetOwnPropertyKeys: require('./2018/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2018/GetPrototypeFromConstructor'), + GetSubstitution: require('./2018/GetSubstitution'), + GetV: require('./2018/GetV'), + HasOwnProperty: require('./2018/HasOwnProperty'), + HasProperty: require('./2018/HasProperty'), + HourFromTime: require('./2018/HourFromTime'), + InLeapYear: require('./2018/InLeapYear'), + InstanceofOperator: require('./2018/InstanceofOperator'), + Invoke: require('./2018/Invoke'), + IsAccessorDescriptor: require('./2018/IsAccessorDescriptor'), + IsArray: require('./2018/IsArray'), + IsCallable: require('./2018/IsCallable'), + IsConcatSpreadable: require('./2018/IsConcatSpreadable'), + IsConstructor: require('./2018/IsConstructor'), + IsDataDescriptor: require('./2018/IsDataDescriptor'), + IsExtensible: require('./2018/IsExtensible'), + IsGenericDescriptor: require('./2018/IsGenericDescriptor'), + IsInteger: require('./2018/IsInteger'), + IsPromise: require('./2018/IsPromise'), + IsPropertyKey: require('./2018/IsPropertyKey'), + IsRegExp: require('./2018/IsRegExp'), + IsStringPrefix: require('./2018/IsStringPrefix'), + IterableToList: require('./2018/IterableToList'), + IteratorClose: require('./2018/IteratorClose'), + IteratorComplete: require('./2018/IteratorComplete'), + IteratorNext: require('./2018/IteratorNext'), + IteratorStep: require('./2018/IteratorStep'), + IteratorValue: require('./2018/IteratorValue'), + MakeDate: require('./2018/MakeDate'), + MakeDay: require('./2018/MakeDay'), + MakeTime: require('./2018/MakeTime'), + MinFromTime: require('./2018/MinFromTime'), + modulo: require('./2018/modulo'), + MonthFromTime: require('./2018/MonthFromTime'), + msFromTime: require('./2018/msFromTime'), + NumberToString: require('./2018/NumberToString'), + ObjectCreate: require('./2018/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'), + PromiseResolve: require('./2018/PromiseResolve'), + RegExpExec: require('./2018/RegExpExec'), + RequireObjectCoercible: require('./2018/RequireObjectCoercible'), + SameValue: require('./2018/SameValue'), + SameValueNonNumber: require('./2018/SameValueNonNumber'), + SameValueZero: require('./2018/SameValueZero'), + SecFromTime: require('./2018/SecFromTime'), + Set: require('./2018/Set'), + SetFunctionName: require('./2018/SetFunctionName'), + SetIntegrityLevel: require('./2018/SetIntegrityLevel'), + SpeciesConstructor: require('./2018/SpeciesConstructor'), + SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2018/TestIntegrityLevel'), + thisBooleanValue: require('./2018/thisBooleanValue'), + thisNumberValue: require('./2018/thisNumberValue'), + thisStringValue: require('./2018/thisStringValue'), + thisSymbolValue: require('./2018/thisSymbolValue'), + thisTimeValue: require('./2018/thisTimeValue'), + TimeClip: require('./2018/TimeClip'), + TimeFromYear: require('./2018/TimeFromYear'), + TimeString: require('./2018/TimeString'), + TimeWithinDay: require('./2018/TimeWithinDay'), + ToBoolean: require('./2018/ToBoolean'), + ToDateString: require('./2018/ToDateString'), + ToIndex: require('./2018/ToIndex'), + ToInt16: require('./2018/ToInt16'), + ToInt32: require('./2018/ToInt32'), + ToInt8: require('./2018/ToInt8'), + ToInteger: require('./2018/ToInteger'), + ToLength: require('./2018/ToLength'), + ToNumber: require('./2018/ToNumber'), + ToObject: require('./2018/ToObject'), + ToPrimitive: require('./2018/ToPrimitive'), + ToPropertyDescriptor: require('./2018/ToPropertyDescriptor'), + ToPropertyKey: require('./2018/ToPropertyKey'), + ToString: require('./2018/ToString'), + ToUint16: require('./2018/ToUint16'), + ToUint32: require('./2018/ToUint32'), + ToUint8: require('./2018/ToUint8'), + ToUint8Clamp: require('./2018/ToUint8Clamp'), + Type: require('./2018/Type'), + ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2018/WeekDay'), + YearFromTime: require('./2018/YearFromTime') +}; + +module.exports = ES2018; diff --git a/node_modules/object.entries/node_modules/es-abstract/es2019.js b/node_modules/object.entries/node_modules/es-abstract/es2019.js new file mode 100644 index 0000000..3bd65e4 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es2019.js @@ -0,0 +1,129 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/10.0/#sec-abstract-operations +var ES2019 = { + 'Abstract Equality Comparison': require('./2019/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2019/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2019/StrictEqualityComparison'), + AddEntriesFromIterable: require('./2019/AddEntriesFromIterable'), + AdvanceStringIndex: require('./2019/AdvanceStringIndex'), + ArrayCreate: require('./2019/ArrayCreate'), + ArraySetLength: require('./2019/ArraySetLength'), + ArraySpeciesCreate: require('./2019/ArraySpeciesCreate'), + Call: require('./2019/Call'), + CanonicalNumericIndexString: require('./2019/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2019/CompletePropertyDescriptor'), + CopyDataProperties: require('./2019/CopyDataProperties'), + CreateDataProperty: require('./2019/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2019/CreateDataPropertyOrThrow'), + CreateHTML: require('./2019/CreateHTML'), + CreateIterResultObject: require('./2019/CreateIterResultObject'), + CreateListFromArrayLike: require('./2019/CreateListFromArrayLike'), + CreateMethodProperty: require('./2019/CreateMethodProperty'), + DateFromTime: require('./2019/DateFromTime'), + DateString: require('./2019/DateString'), + Day: require('./2019/Day'), + DayFromYear: require('./2019/DayFromYear'), + DaysInYear: require('./2019/DaysInYear'), + DayWithinYear: require('./2019/DayWithinYear'), + DefinePropertyOrThrow: require('./2019/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2019/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2019/EnumerableOwnPropertyNames'), + FlattenIntoArray: require('./2019/FlattenIntoArray'), + FromPropertyDescriptor: require('./2019/FromPropertyDescriptor'), + Get: require('./2019/Get'), + GetIterator: require('./2019/GetIterator'), + GetMethod: require('./2019/GetMethod'), + GetOwnPropertyKeys: require('./2019/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2019/GetPrototypeFromConstructor'), + GetSubstitution: require('./2019/GetSubstitution'), + GetV: require('./2019/GetV'), + HasOwnProperty: require('./2019/HasOwnProperty'), + HasProperty: require('./2019/HasProperty'), + HourFromTime: require('./2019/HourFromTime'), + InLeapYear: require('./2019/InLeapYear'), + InstanceofOperator: require('./2019/InstanceofOperator'), + Invoke: require('./2019/Invoke'), + IsAccessorDescriptor: require('./2019/IsAccessorDescriptor'), + IsArray: require('./2019/IsArray'), + IsCallable: require('./2019/IsCallable'), + IsConcatSpreadable: require('./2019/IsConcatSpreadable'), + IsConstructor: require('./2019/IsConstructor'), + IsDataDescriptor: require('./2019/IsDataDescriptor'), + IsExtensible: require('./2019/IsExtensible'), + IsGenericDescriptor: require('./2019/IsGenericDescriptor'), + IsInteger: require('./2019/IsInteger'), + IsPromise: require('./2019/IsPromise'), + IsPropertyKey: require('./2019/IsPropertyKey'), + IsRegExp: require('./2019/IsRegExp'), + IsStringPrefix: require('./2019/IsStringPrefix'), + IterableToList: require('./2019/IterableToList'), + IteratorClose: require('./2019/IteratorClose'), + IteratorComplete: require('./2019/IteratorComplete'), + IteratorNext: require('./2019/IteratorNext'), + IteratorStep: require('./2019/IteratorStep'), + IteratorValue: require('./2019/IteratorValue'), + MakeDate: require('./2019/MakeDate'), + MakeDay: require('./2019/MakeDay'), + MakeTime: require('./2019/MakeTime'), + MinFromTime: require('./2019/MinFromTime'), + modulo: require('./2019/modulo'), + MonthFromTime: require('./2019/MonthFromTime'), + msFromTime: require('./2019/msFromTime'), + NumberToString: require('./2019/NumberToString'), + ObjectCreate: require('./2019/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2019/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2019/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2019/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2019/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2019/OrdinaryHasProperty'), + PromiseResolve: require('./2019/PromiseResolve'), + RegExpExec: require('./2019/RegExpExec'), + RequireObjectCoercible: require('./2019/RequireObjectCoercible'), + SameValue: require('./2019/SameValue'), + SameValueNonNumber: require('./2019/SameValueNonNumber'), + SameValueZero: require('./2019/SameValueZero'), + SecFromTime: require('./2019/SecFromTime'), + Set: require('./2019/Set'), + SetFunctionName: require('./2019/SetFunctionName'), + SetIntegrityLevel: require('./2019/SetIntegrityLevel'), + SpeciesConstructor: require('./2019/SpeciesConstructor'), + SymbolDescriptiveString: require('./2019/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2019/TestIntegrityLevel'), + thisBooleanValue: require('./2019/thisBooleanValue'), + thisNumberValue: require('./2019/thisNumberValue'), + thisStringValue: require('./2019/thisStringValue'), + thisSymbolValue: require('./2019/thisSymbolValue'), + thisTimeValue: require('./2019/thisTimeValue'), + TimeClip: require('./2019/TimeClip'), + TimeFromYear: require('./2019/TimeFromYear'), + TimeString: require('./2019/TimeString'), + TimeWithinDay: require('./2019/TimeWithinDay'), + ToBoolean: require('./2019/ToBoolean'), + ToDateString: require('./2019/ToDateString'), + ToIndex: require('./2019/ToIndex'), + ToInt16: require('./2019/ToInt16'), + ToInt32: require('./2019/ToInt32'), + ToInt8: require('./2019/ToInt8'), + ToInteger: require('./2019/ToInteger'), + ToLength: require('./2019/ToLength'), + ToNumber: require('./2019/ToNumber'), + ToObject: require('./2019/ToObject'), + ToPrimitive: require('./2019/ToPrimitive'), + ToPropertyDescriptor: require('./2019/ToPropertyDescriptor'), + ToPropertyKey: require('./2019/ToPropertyKey'), + ToString: require('./2019/ToString'), + ToUint16: require('./2019/ToUint16'), + ToUint32: require('./2019/ToUint32'), + ToUint8: require('./2019/ToUint8'), + ToUint8Clamp: require('./2019/ToUint8Clamp'), + TrimString: require('./2019/TrimString'), + Type: require('./2019/Type'), + ValidateAndApplyPropertyDescriptor: require('./2019/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2019/WeekDay'), + YearFromTime: require('./2019/YearFromTime') +}; + +module.exports = ES2019; diff --git a/node_modules/object.entries/node_modules/es-abstract/es5.js b/node_modules/object.entries/node_modules/es-abstract/es5.js new file mode 100644 index 0000000..2cc9515 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es5.js @@ -0,0 +1,49 @@ +'use strict'; + +/* eslint global-require: 0 */ + +// https://es5.github.io/#x9 +module.exports = { + 'Abstract Equality Comparison': require('./5/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./5/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./5/StrictEqualityComparison'), + CheckObjectCoercible: require('./5/CheckObjectCoercible'), + DateFromTime: require('./5/DateFromTime'), + Day: require('./5/Day'), + DayFromYear: require('./5/DayFromYear'), + DaysInYear: require('./5/DaysInYear'), + DayWithinYear: require('./5/DayWithinYear'), + FromPropertyDescriptor: require('./5/FromPropertyDescriptor'), + HourFromTime: require('./5/HourFromTime'), + InLeapYear: require('./5/InLeapYear'), + IsAccessorDescriptor: require('./5/IsAccessorDescriptor'), + IsCallable: require('./5/IsCallable'), + IsDataDescriptor: require('./5/IsDataDescriptor'), + IsGenericDescriptor: require('./5/IsGenericDescriptor'), + IsPropertyDescriptor: require('./5/IsPropertyDescriptor'), + MakeDate: require('./5/MakeDate'), + MakeDay: require('./5/MakeDay'), + MakeTime: require('./5/MakeTime'), + MinFromTime: require('./5/MinFromTime'), + modulo: require('./5/modulo'), + MonthFromTime: require('./5/MonthFromTime'), + msFromTime: require('./5/msFromTime'), + SameValue: require('./5/SameValue'), + SecFromTime: require('./5/SecFromTime'), + TimeClip: require('./5/TimeClip'), + TimeFromYear: require('./5/TimeFromYear'), + TimeWithinDay: require('./5/TimeWithinDay'), + ToBoolean: require('./5/ToBoolean'), + ToInt32: require('./5/ToInt32'), + ToInteger: require('./5/ToInteger'), + ToNumber: require('./5/ToNumber'), + ToObject: require('./5/ToObject'), + ToPrimitive: require('./5/ToPrimitive'), + ToPropertyDescriptor: require('./5/ToPropertyDescriptor'), + ToString: require('./5/ToString'), + ToUint16: require('./5/ToUint16'), + ToUint32: require('./5/ToUint32'), + Type: require('./5/Type'), + WeekDay: require('./5/WeekDay'), + YearFromTime: require('./5/YearFromTime') +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/es6.js b/node_modules/object.entries/node_modules/es-abstract/es6.js new file mode 100644 index 0000000..2d1f4dc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es6.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2015'); diff --git a/node_modules/object.entries/node_modules/es-abstract/es7.js b/node_modules/object.entries/node_modules/es-abstract/es7.js new file mode 100644 index 0000000..f2f15c0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/es7.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2016'); diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/DefineOwnProperty.js b/node_modules/object.entries/node_modules/es-abstract/helpers/DefineOwnProperty.js new file mode 100644 index 0000000..99ace10 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/DefineOwnProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +// eslint-disable-next-line max-params +module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { + if (!$defineProperty) { + if (!IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + // eslint-disable-next-line no-param-reassign + O[P] = V; // will use [[Define]] + return SameValue(O[P], V); + } + $defineProperty(O, P, FromPropertyDescriptor(desc)); + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/OwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..4a06ce3 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/OwnPropertyKeys.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); +var callBound = require('./callBound'); + +var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); +var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; + +var keys = require('object-keys'); + +module.exports = $ownKeys || function OwnPropertyKeys(source) { + var ownKeys = ($gOPN || keys)(source); + if ($gOPS) { + $pushApply(ownKeys, $gOPS(source)); + } + return ownKeys; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js b/node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js new file mode 100644 index 0000000..45e115a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js @@ -0,0 +1,48 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = require('has'); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { + if (Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(Type, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(Type, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/assign.js b/node_modules/object.entries/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 0000000..7e6666e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js b/node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js new file mode 100644 index 0000000..3c1a327 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js @@ -0,0 +1,34 @@ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind() { + return $reflectApply(bind, $call, arguments); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/callBound.js b/node_modules/object.entries/node_modules/es-abstract/helpers/callBound.js new file mode 100644 index 0000000..9dc8fc5 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/every.js b/node_modules/object.entries/node_modules/es-abstract/helpers/every.js new file mode 100644 index 0000000..42a4582 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/every.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js b/node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js new file mode 100644 index 0000000..35915a6 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/getInferredName.js b/node_modules/object.entries/node_modules/es-abstract/helpers/getInferredName.js new file mode 100644 index 0000000..2dab6e7 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/getInferredName.js @@ -0,0 +1,10 @@ +'use strict'; + +var getInferredName; +try { + // eslint-disable-next-line no-new-func + getInferredName = Function('s', 'return { [s]() {} }[s].name;'); +} catch (e) {} + +var inferred = function () {}; +module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/getIteratorMethod.js b/node_modules/object.entries/node_modules/es-abstract/helpers/getIteratorMethod.js new file mode 100644 index 0000000..02f932c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/getIteratorMethod.js @@ -0,0 +1,45 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('./callBound'); + +var $iterator = GetIntrinsic('%Symbol.iterator%', true); +var $stringSlice = callBound('String.prototype.slice'); + +module.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (ES.Type(iterable) === 'String') { + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(iterable, i, true); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + }; + } + return usingIterator; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js new file mode 100644 index 0000000..71168e9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/getProto.js b/node_modules/object.entries/node_modules/es-abstract/helpers/getProto.js new file mode 100644 index 0000000..af10fd8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/getProto.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalGetProto || ( + // eslint-disable-next-line no-proto + [].__proto__ === $ArrayProto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/getSymbolDescription.js b/node_modules/object.entries/node_modules/es-abstract/helpers/getSymbolDescription.js new file mode 100644 index 0000000..45d80d2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/getSymbolDescription.js @@ -0,0 +1,41 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('./callBound'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true); +var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true); +var symToStr = callBound('Symbol.prototype.toString', true); + +var getInferredName = require('./getInferredName'); + +/* eslint-disable consistent-return */ +module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) { + if (!thisSymbolValue) { + throw new $SyntaxError('Symbols are not supported in this environment'); + } + + // will throw if not a symbol primitive or wrapper object + var sym = thisSymbolValue(symbol); + + if (getInferredName) { + var name = getInferredName(sym); + if (name === '') { return; } + return name.slice(1, -1); // name.slice('['.length, -']'.length); + } + + var desc; + if (getGlobalSymbolDescription) { + desc = getGlobalSymbolDescription(sym); + if (typeof desc === 'string') { + return desc; + } + } + + desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length); + if (desc) { + return desc; + } +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js b/node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js new file mode 100644 index 0000000..9e7cd4f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js @@ -0,0 +1,5 @@ +'use strict'; + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js b/node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js new file mode 100644 index 0000000..cb8631d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/isPrefixOf.js b/node_modules/object.entries/node_modules/es-abstract/helpers/isPrefixOf.js new file mode 100644 index 0000000..b67d640 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/isPrefixOf.js @@ -0,0 +1,13 @@ +'use strict'; + +var $strSlice = require('../helpers/callBound')('String.prototype.slice'); + +module.exports = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return $strSlice(string, 0, prefix.length) === prefix; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js new file mode 100644 index 0000000..06f0bf0 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js new file mode 100644 index 0000000..3eff7eb --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line no-restricted-syntax + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js b/node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js new file mode 100644 index 0000000..a6162a1 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js @@ -0,0 +1,20 @@ +'use strict'; + +var every = require('./every'); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/maxSafeInteger.js b/node_modules/object.entries/node_modules/es-abstract/helpers/maxSafeInteger.js new file mode 100644 index 0000000..2fe8f38 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/maxSafeInteger.js @@ -0,0 +1,8 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); +var $Number = GetIntrinsic('%Number%'); + +module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/mod.js b/node_modules/object.entries/node_modules/es-abstract/helpers/mod.js new file mode 100644 index 0000000..67c8b78 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/mod.js @@ -0,0 +1,8 @@ +'use strict'; + +var $floor = Math.floor; + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/padTimeComponent.js b/node_modules/object.entries/node_modules/es-abstract/helpers/padTimeComponent.js new file mode 100644 index 0000000..cbd8d06 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/padTimeComponent.js @@ -0,0 +1,9 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $strSlice = callBound('String.prototype.slice'); + +module.exports = function padTimeComponent(c, count) { + return $strSlice('00' + c, -(count || 2)); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/regexTester.js b/node_modules/object.entries/node_modules/es-abstract/helpers/regexTester.js new file mode 100644 index 0000000..982cc9f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/regexTester.js @@ -0,0 +1,11 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $test = GetIntrinsic('RegExp.prototype.test'); + +var callBind = require('./callBind'); + +module.exports = function regexTester(regex) { + return callBind($test, regex); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/setProto.js b/node_modules/object.entries/node_modules/es-abstract/helpers/setProto.js new file mode 100644 index 0000000..29ec991 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/setProto.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalSetProto || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayProto + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/sign.js b/node_modules/object.entries/node_modules/es-abstract/helpers/sign.js new file mode 100644 index 0000000..598ea7d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/sign.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/helpers/timeConstants.js b/node_modules/object.entries/node_modules/es-abstract/helpers/timeConstants.js new file mode 100644 index 0000000..c275b40 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/helpers/timeConstants.js @@ -0,0 +1,19 @@ +'use strict'; + +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1e3; +var msPerMinute = msPerSecond * SecondsPerMinute; +var msPerHour = msPerMinute * MinutesPerHour; +var msPerDay = 86400000; + +module.exports = { + HoursPerDay: HoursPerDay, + MinutesPerHour: MinutesPerHour, + SecondsPerMinute: SecondsPerMinute, + msPerSecond: msPerSecond, + msPerMinute: msPerMinute, + msPerHour: msPerHour, + msPerDay: msPerDay +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/index.js b/node_modules/object.entries/node_modules/es-abstract/index.js new file mode 100644 index 0000000..7cef039 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var assign = require('./helpers/assign'); + +var ES5 = require('./es5'); +var ES2015 = require('./es2015'); +var ES2016 = require('./es2016'); +var ES2017 = require('./es2017'); +var ES2018 = require('./es2018'); +var ES2019 = require('./es2019'); + +var ES = { + ES5: ES5, + ES6: ES2015, + ES2015: ES2015, + ES7: ES2016, + ES2016: ES2016, + ES2017: ES2017, + ES2018: ES2018, + ES2019: ES2019 +}; +assign(ES, ES5); +delete ES.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible +assign(ES, ES2015); + +module.exports = ES; diff --git a/node_modules/object.entries/node_modules/es-abstract/operations/.eslintrc b/node_modules/object.entries/node_modules/es-abstract/operations/.eslintrc new file mode 100644 index 0000000..bcd76f7 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/operations/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": 0, + }, +} diff --git a/node_modules/object.entries/node_modules/es-abstract/operations/2015.js b/node_modules/object.entries/node_modules/es-abstract/operations/2015.js new file mode 100644 index 0000000..6c50891 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/operations/2015.js @@ -0,0 +1,249 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatetypedarray', + ArrayCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/6.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/6.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/6.0/#sec-implicit-completion-values', + Construct: 'https://ecma-international.org/ecma-262/6.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/6.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/6.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/6.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/6.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-createrealm', + CreateSetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createsetiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/6.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/6.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/6.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/6.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/6.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/6.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-functioncreate', + FunctionInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/6.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/6.0/#sec-get-o-p', + GetBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/6.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/6.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/6.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetSubstitution: 'https://ecma-international.org/ecma-262/6.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/6.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/6.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getviewvalue', + HasOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + HasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasproperty', + HostResolveImportedModule: 'sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/6.0/#sec-importedlocalnames', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/6.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/6.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/6.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/6.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/6.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsRegExp: 'https://ecma-international.org/ecma-262/6.0/#sec-isregexp', + IsStrictReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsSuperReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsWordChar: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IteratorClose: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/6.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/6.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/6.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/6.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/6.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + msPerDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/6.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/6.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty', + ParseModule: 'https://ecma-international.org/ecma-262/6.0/#sec-parsemodule', + PerformEval: 'https://ecma-international.org/ecma-262/6.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/6.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/6.0/#sec-preparefortailcall', + ProxyCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/6.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/6.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvethisbinding', + SameValue: 'https://ecma-international.org/ecma-262/6.0/#sec-samevalue', + SameValueZero: 'https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero', + SecFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/6.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-setviewvalue', + sign: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + SortCompare: 'https://ecma-international.org/ecma-262/6.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/6.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-stringcreate', + StringGetIndexProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-stringgetindexproperty', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object', + thisNumberValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/6.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/6.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/6.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/6.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/6.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/6.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/6.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/6.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/6.0/#sec-toobject', + ToPrimitive: 'https://ecma-international.org/ecma-262/6.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/6.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/6.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/6.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/6.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values', + TypedArrayFrom: 'https://ecma-international.org/ecma-262/6.0/#sec-typedarrayfrom', + UpdateEmpty: 'https://ecma-international.org/ecma-262/6.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/6.0/#sec-utc-t', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor', + WeekDay: 'https://ecma-international.org/ecma-262/6.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number' +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/operations/2016.js b/node_modules/object.entries/node_modules/es-abstract/operations/2016.js new file mode 100644 index 0000000..6a58b9c --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/operations/2016.js @@ -0,0 +1,276 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/7.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/7.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arrayspeciescreate', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/7.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/7.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/7.0/#sec-completion-record-specification-type', + Construct: 'https://ecma-international.org/ecma-262/7.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/7.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/7.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/7.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/7.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/7.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createsetiterator', + CreateStringIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/7.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/7.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerableownnames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/7.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/7.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/7.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/7.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/7.0/#sec-getactivescriptormodule', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/7.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/7.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/7.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getprototypefromconstructor', + GetSubstitution: 'https://ecma-international.org/ecma-262/7.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/7.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/7.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getviewvalue', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-globaldeclarationinstantiation', + HasOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasownproperty', + HasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasproperty', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/7.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/7.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/7.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/7.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/7.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/7.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/7.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/7.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/7.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/7.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/7.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/7.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-ispropertykey', + IsRegExp: 'https://ecma-international.org/ecma-262/7.0/#sec-isregexp', + IsWordChar: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike', + IteratorClose: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/7.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/7.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/7.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/7.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/7.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/7.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/7.0/#sec-newpromisecapability', + NextJob: 'https://ecma-international.org/ecma-262/7.0/#sec-nextjob-result', + NormalCompletion: 'https://ecma-international.org/ecma-262/7.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof', + ParseModule: 'https://ecma-international.org/ecma-262/7.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/7.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/7.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/7.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/7.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/7.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/7.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/7.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-returnifabrupt', + SameValue: 'https://ecma-international.org/ecma-262/7.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/7.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/7.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/7.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-setviewvalue', + SortCompare: 'https://ecma-international.org/ecma-262/7.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/7.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-stringcreate', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/7.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/7.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/7.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/7.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/7.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/7.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/7.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/7.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/7.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/7.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/7.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/7.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/7.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/7.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/7.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/7.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/7.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/7.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/7.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-validateandapplypropertydescriptor', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-validatetypedarray', + WeekDay: 'https://ecma-international.org/ecma-262/7.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number' +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/operations/2017.js b/node_modules/object.entries/node_modules/es-abstract/operations/2017.js new file mode 100644 index 0000000..896fcee --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/operations/2017.js @@ -0,0 +1,324 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/8.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/8.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/8.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/8.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/8.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arrayspeciescreate', + AsyncFunctionAwait: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-await', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-start', + AtomicLoad: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicreadmodifywrite', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/8.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/8.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/8.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/8.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/8.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/8.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/8.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/8.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/8.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/8.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/8.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-entercriticalsection', + EnumerableOwnProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/8.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/8.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/8.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/8.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/8.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/8.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/8.0/#ao-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/8.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/8.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/8.0/#ao-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/8.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/8.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/8.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/8.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/8.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/8.0/#ao-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/8.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/8.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/8.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/8.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/8.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/8.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-InLeapYear', + InstanceofOperator: 'https://ecma-international.org/ecma-262/8.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/8.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/8.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/8.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/8.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/8.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/8.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#ao-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/8.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isstrictreference', + IsSuperReference: 'https://ecma-international.org/ecma-262/8.0/#ao-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/8.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/8.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/8.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/8.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/8.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/8.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/8.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/8.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/8.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/8.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/8.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/8.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-numbertorawbytes', + ObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarysetprototypeof', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/8.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/8.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/8.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/8.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/8.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/8.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/8.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/8.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/8.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/8.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/8.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/8.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/8.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/8.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/8.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/8.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/8.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/8.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisstringvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thistimevalue', + TimeClip: 'https://ecma-international.org/ecma-262/8.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeFromYear', + TimeWithinDay: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeWithinDay', + ToBoolean: 'https://ecma-international.org/ecma-262/8.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/8.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/8.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/8.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/8.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/8.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/8.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/8.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/8.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/8.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/8.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/8.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/8.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/8.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/8.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/8.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/8.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/8.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-YearFromTime' +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/operations/2018.js b/node_modules/object.entries/node_modules/es-abstract/operations/2018.js new file mode 100644 index 0000000..c93b561 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/operations/2018.js @@ -0,0 +1,350 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/9.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/9.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/9.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/9.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/9.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arrayspeciescreate', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/9.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/9.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/9.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/9.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/9.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/9.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/9.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/9.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/9.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/9.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/9.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/9.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/9.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/9.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/9.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/9.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/9.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/9.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/9.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/9.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/9.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/9.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/9.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/9.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/9.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/9.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/9.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/9.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/9.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/9.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/9.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/9.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/9.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/9.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/9.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/9.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/9.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/9.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/9.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/9.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/9.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/9.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/9.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/9.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/9.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/9.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/9.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/9.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/9.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/9.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/9.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/9.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/9.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/9.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MinFromTime', + ModuleDeclarationEnvironmentSetup: 'https://ecma-international.org/ecma-262/9.0/#sec-moduledeclarationenvironmentsetup', + ModuleExecution: 'https://ecma-international.org/ecma-262/9.0/#sec-moduleexecution', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/9.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/9.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/9.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/9.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/9.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/9.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/9.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/9.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/9.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/9.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/9.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/9.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/9.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/9.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/9.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/9.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/9.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/9.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/9.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/9.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/9.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/9.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/9.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/9.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/9.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/9.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/9.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/9.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/9.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/9.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/9.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/9.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/9.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/9.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/9.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/9.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/9.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/9.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/9.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-YearFromTime' +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/operations/2019.js b/node_modules/object.entries/node_modules/es-abstract/operations/2019.js new file mode 100644 index 0000000..73f05e8 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/operations/2019.js @@ -0,0 +1,355 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/10.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-relational-comparison', + AddEntriesFromIterable: 'https://ecma-international.org/ecma-262/10.0/#sec-add-entries-from-iterable', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/10.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/10.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/10.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/10.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arrayspeciescreate', + AsyncFromSyncIteratorContinuation: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncfromsynciteratorcontinuation', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/10.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/10.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/10.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/10.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/10.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/10.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/10.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/10.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/10.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/10.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/10.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/10.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/10.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/10.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-event-set', + ExecuteModule: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-execute-module', + FlattenIntoArray: 'https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray', + floor: 'https://ecma-international.org/ecma-262/10.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/10.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/10.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/10.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/10.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/10.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/10.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/10.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/10.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/10.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/10.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/10.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/10.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/10.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/10.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/10.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/10.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/10.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/10.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/10.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/10.0/#sec-initializeboundname', + InitializeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-initialize-environment', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/10.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/10.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/10.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/10.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/10.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/10.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/10.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/10.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/10.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/10.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/10.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/10.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/10.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/10.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/10.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/10.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/10.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/10.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/10.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/10.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/10.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-normalcompletion', + NotifyWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-notifywaiter', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/10.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/10.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/10.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/10.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/10.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/10.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/10.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/10.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/10.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/10.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/10.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/10.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/10.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/10.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/10.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/10.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/10.0/#sec-symboldescriptivestring', + SynchronizeEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizeeventset', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/10.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/10.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/10.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/10.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/10.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/10.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/10.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/10.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/10.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/10.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/10.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/10.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/10.0/#sec-triggerpromisereactions', + TrimString: 'https://ecma-international.org/ecma-262/10.0/#sec-trimstring', + Type: 'https://ecma-international.org/ecma-262/10.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/10.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/10.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/10.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/10.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/10.0/#sec-valueofreadevent', + WeekDay: 'https://ecma-international.org/ecma-262/10.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-YearFromTime' +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/package.json b/node_modules/object.entries/node_modules/es-abstract/package.json new file mode 100644 index 0000000..ddb07de --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/package.json @@ -0,0 +1,139 @@ +{ + "_from": "es-abstract@^1.17.5", + "_id": "es-abstract@1.17.7", + "_inBundle": false, + "_integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "_location": "/object.entries/es-abstract", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es-abstract@^1.17.5", + "name": "es-abstract", + "escapedName": "es-abstract", + "rawSpec": "^1.17.5", + "saveSpec": null, + "fetchSpec": "^1.17.5" + }, + "_requiredBy": [ + "/object.entries" + ], + "_resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "_shasum": "a4de61b2f66989fc7421676c1cb9787573ace54c", + "_spec": "es-abstract@^1.17.5", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/object.entries", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "bugs": { + "url": "https://github.com/ljharb/es-abstract/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "deprecated": false, + "description": "ECMAScript spec abstract operations.", + "devDependencies": { + "@ljharb/eslint-config": "^17.2.0", + "array.prototype.indexof": "^1.0.0", + "aud": "^1.1.2", + "cheerio": "^1.0.0-rc.3", + "diff": "^4.0.2", + "eclint": "^2.8.1", + "eslint": "^7.10.0", + "foreach": "^2.0.5", + "functions-have-names": "^1.2.1", + "has-strict-mode": "^1.0.0", + "in-publish": "^2.0.1", + "make-arrow-function": "^1.2.0", + "nyc": "^10.3.2", + "object-is": "^1.1.2", + "object.fromentries": "^2.0.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "greenkeeper": { + "//": "nyc is ignored because it requires node 4+, and we support older than that", + "ignore": [ + "nyc" + ] + }, + "homepage": "https://github.com/ljharb/es-abstract#readme", + "keywords": [ + "ECMAScript", + "ES", + "abstract", + "operation", + "abstract operation", + "JavaScript", + "ES5", + "ES6", + "ES7" + ], + "license": "MIT", + "main": "index.js", + "name": "es-abstract", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-abstract.git" + }, + "scripts": { + "coverage": "nyc npm run tests-only >/dev/null", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "lint": "eslint .", + "postcoverage": "nyc report", + "postspackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs git add", + "posttest": "aud --production", + "prepublish": "safe-publish-latest && (not-in-publish || npm run spackle)", + "prespackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs rm || true", + "pretest": "npm run lint", + "spackle": "node operations/spackle 1", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.17.7" +} diff --git a/node_modules/object.entries/node_modules/es-abstract/test/GetIntrinsic.js b/node_modules/object.entries/node_modules/es-abstract/test/GetIntrinsic.js new file mode 100644 index 0000000..a3e69a7 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/GetIntrinsic.js @@ -0,0 +1,94 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var test = require('tape'); +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + t.end(); +}); + +test('accessors', { skip: !Object.getOwnPropertyDescriptor || typeof Map !== 'function' }, function (t) { + var actual = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/diffOps.js b/node_modules/object.entries/node_modules/es-abstract/test/diffOps.js new file mode 100644 index 0000000..602098d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/diffOps.js @@ -0,0 +1,27 @@ +'use strict'; + +var keys = require('object-keys'); +var forEach = require('foreach'); +var indexOf = require('array.prototype.indexof'); + +module.exports = function diffOperations(actual, expected, expectedMissing) { + var actualKeys = keys(actual); + var expectedKeys = keys(expected); + + var extra = []; + var missing = []; + forEach(actualKeys, function (op) { + if (!(op in expected)) { + extra.push(op); + } else if (indexOf(expectedMissing, op) !== -1) { + extra.push(op); + } + }); + forEach(expectedKeys, function (op) { + if (typeof actual[op] !== 'function' && indexOf(expectedMissing, op) === -1) { + missing.push(op); + } + }); + + return { missing: missing, extra: extra }; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es2015.js b/node_modules/object.entries/node_modules/es-abstract/test/es2015.js new file mode 100644 index 0000000..9bb8ec9 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es2015.js @@ -0,0 +1,150 @@ +'use strict'; + +var ES = require('../').ES2015; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2015'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateSetIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'HasPrimitiveBase', + 'HostResolveImportedModule', + 'ImportedLocalNames', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'msPerDay', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'ParseModule', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'sign', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetIndexProperty', + 'TriggerPromiseReactions', + 'TypedArrayFrom', + 'UpdateEmpty', + 'UTC' +]; + +require('./tests').es2015(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2015); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es2016.js b/node_modules/object.entries/node_modules/es-abstract/test/es2016.js new file mode 100644 index 0000000..611ea6a --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es2016.js @@ -0,0 +1,173 @@ +'use strict'; + +var ES = require('../').ES2016; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2016'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GlobalDeclarationInstantiation', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NextJob', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateTypedArray' +]; + +require('./tests').es2016(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2016); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es2017.js b/node_modules/object.entries/node_modules/es-abstract/test/es2017.js new file mode 100644 index 0000000..74eb38e --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es2017.js @@ -0,0 +1,220 @@ +'use strict'; + +var ES = require('../').ES2017; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2017'); + +var expectedMissing = [ + 'abs', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionAwait', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters', + 'AddRestrictedFunctionProperties', + 'synchronizes-with' +]; + +require('./tests').es2017(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2017); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es2018.js b/node_modules/object.entries/node_modules/es-abstract/test/es2018.js new file mode 100644 index 0000000..5ca1087 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es2018.js @@ -0,0 +1,241 @@ +'use strict'; + +var ES = require('../').ES2018; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2018'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2018(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2018); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es2019.js b/node_modules/object.entries/node_modules/es-abstract/test/es2019.js new file mode 100644 index 0000000..c034b60 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es2019.js @@ -0,0 +1,246 @@ +'use strict'; + +var ES = require('../').ES2019; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2019'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFromSyncIteratorContinuation', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'ExecuteModule', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeEnvironment', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NotifyWaiter', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'SynchronizeEventSet', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2019(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2019); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es5.js b/node_modules/object.entries/node_modules/es-abstract/test/es5.js new file mode 100644 index 0000000..6647a1b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es5.js @@ -0,0 +1,786 @@ +'use strict'; + +var ES = require('../').ES5; +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +require('./helpers/runManifestTest')(test, ES, 5); + +ES = require('./helpers/createBoundESNamespace')(ES); + +test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + st.equal(ES.ToPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError'); + st.end(); + }); + + t.end(); +}); + +test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + forEach([0, -0, NaN], function (falsyNumber) { + t.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach([Infinity, 42, 1, -Infinity], function (truthyNumber) { + t.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + forEach(v.objects, function (obj) { + t.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + t.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + t.end(); +}); + +test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + t.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach([0, -0, 42, Infinity, -Infinity], function (num) { + t.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + t.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + forEach(v.objects, function (object) { + t.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + t['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); +}); + +test('ToString', function (t) { + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); +}); + +test('CheckObjectCoercible', function (t) { + t['throws'](function () { return ES.CheckObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.CheckObjectCoercible(null); }, TypeError, 'null throws'); + var checkCoercible = function (value) { + t.doesNotThrow(function () { return ES.CheckObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), checkCoercible); + t.end(); +}); + +test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.primitives); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); +}); + +test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); +}); + +test('Type', function (t) { + t.equal(ES.Type(), 'Undefined', 'Type() is Undefined'); + t.equal(ES.Type(undefined), 'Undefined', 'Type(undefined) is Undefined'); + t.equal(ES.Type(null), 'Null', 'Type(null) is Null'); + t.equal(ES.Type(true), 'Boolean', 'Type(true) is Boolean'); + t.equal(ES.Type(false), 'Boolean', 'Type(false) is Boolean'); + t.equal(ES.Type(0), 'Number', 'Type(0) is Number'); + t.equal(ES.Type(NaN), 'Number', 'Type(NaN) is Number'); + t.equal(ES.Type('abc'), 'String', 'Type("abc") is String'); + t.equal(ES.Type(function () {}), 'Object', 'Type(function () {}) is Object'); + t.equal(ES.Type({}), 'Object', 'Type({}) is Object'); + t.end(); +}); + +test('IsPropertyDescriptor', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsPropertyDescriptor(primitive), false, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptorWritable()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); +}); + +test('IsAccessorDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsAccessorDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); +}); + +test('IsDataDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsDataDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); +}); + +test('IsGenericDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('ToPropertyDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.descriptors.nonConfigurable(v.dataDescriptor()); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), data); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.ToPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ get: 'not callable' }); }, + TypeError, + '"get" must be undefined or callable' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ set: 'not callable' }); }, + TypeError, + '"set" must be undefined or callable' + ); + + t.end(); +}); + +test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); +}); + +test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); +}); + +test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); +}); + +test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); +}); + +var msPerSecond = 1e3; +var msPerMinute = 60 * msPerSecond; +var msPerHour = 60 * msPerMinute; +var msPerDay = 24 * msPerHour; + +test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); +}); + +test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); +}); + +test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); +}); + +test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); +}); + +test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); +}); + +test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); +}); + +test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); +}); + +test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); +}); + +test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); +}); + +test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); +}); + +test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); +}); + +test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); +}); + +test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); +}); + +test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + t.end(); +}); + +test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); +}); + +test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); +}); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es6.js b/node_modules/object.entries/node_modules/es-abstract/test/es6.js new file mode 100644 index 0000000..e7c9d98 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es6.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES6 = ES.ES6; +var ES2015 = ES.ES2015; +var ES6entry = require('../es6'); + +test('legacy es6 export', function (t) { + t.equal(ES6, ES2015, 'main ES6 === main ES2015'); + t.end(); +}); + +test('legacy es6 entry point', function (t) { + t.equal(ES6, ES6entry, 'main ES6 === ES6 entry point'); + t.end(); +}); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/es7.js b/node_modules/object.entries/node_modules/es-abstract/test/es7.js new file mode 100644 index 0000000..ee57e15 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/es7.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES7 = ES.ES7; +var ES2016 = ES.ES2016; +var ES7entry = require('../es7'); + +test('legacy es7 export', function (t) { + t.equal(ES7, ES2016, 'main ES7 === main ES2016'); + t.end(); +}); + +test('legacy es7 entry point', function (t) { + t.equal(ES7, ES7entry, 'main ES7 === ES7 entry point'); + t.end(); +}); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..9c2b4fc --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js @@ -0,0 +1,42 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('has-symbols')(); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); +var defineProperty = require('./defineProperty'); + +test('OwnPropertyKeys', function (t) { + t.deepEqual(OwnPropertyKeys({ a: 1, b: 2 }).sort(), ['a', 'b'].sort(), 'returns own string keys'); + + t.test('Symbols', { skip: !hasSymbols }, function (st) { + var o = { a: 1 }; + var sym = Symbol(); + o[sym] = 2; + + st.deepEqual(OwnPropertyKeys(o), ['a', sym], 'returns own string and symbol keys'); + + st.end(); + }); + + t.test('non-enumerables', { skip: !defineProperty.oDP }, function (st) { + var o = { a: 1, b: 42, c: NaN }; + defineProperty(o, 'b', { enumerable: false, value: 42 }); + defineProperty(o, 'c', { enumerable: false, get: function () { return NaN; } }); + + if (hasSymbols) { + defineProperty(o, 'd', { enumerable: false, value: true }); + defineProperty(o, 'e', { enumerable: false, get: function () { return true; } }); + } + + st.deepEqual( + OwnPropertyKeys(o).sort(), + (hasSymbols ? ['a', 'b', 'c', 'd', 'e'] : ['a', 'b', 'c']).sort(), + 'returns non-enumerable own keys, including accessors and symbols if available' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/assertRecord.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/assertRecord.js new file mode 100644 index 0000000..d6a80c2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/assertRecord.js @@ -0,0 +1,60 @@ +'use strict'; + +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var assertRecord = require('../../helpers/assertRecord'); +var v = require('./values'); + +module.exports = function assertRecordTests(ES, test) { + test('Property Descriptor', function (t) { + var record = 'Property Descriptor'; + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', { invalid: true }); }, + TypeError, + 'invalid keys not allowed on a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', {}); }, + 'empty object is an incomplete Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.accessorDescriptor()); }, + 'accessor descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.mutatorDescriptor()); }, + 'mutator descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.dataDescriptor()); }, + 'data descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.genericDescriptor()); }, + 'generic descriptor is a Property Descriptor' + ); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/createBoundESNamespace.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/createBoundESNamespace.js new file mode 100644 index 0000000..880ba3d --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/createBoundESNamespace.js @@ -0,0 +1,21 @@ +'use strict'; + +var bind = require('function-bind'); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); + +module.exports = function createBoundESNamespace(ES) { + var keys = OwnPropertyKeys(ES); + var result = {}; + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var prop = ES[key]; + if (typeof prop === 'function') { + prop = bind.call(prop, undefined); + } + result[key] = prop; + } + + return result; +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/defineProperty.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/defineProperty.js new file mode 100644 index 0000000..8f925be --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/defineProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var oDP = Object.defineProperty; +try { + oDP({}, 'a', { value: 1 }); +} catch (e) { + // IE 8 + oDP = null; +} + +module.exports = function defineProperty(O, P, Desc) { + if (oDP) { + return oDP(O, P, Desc); + } + if ((Desc.enumerable && Desc.configurable && Desc.writable) || !(P in O)) { + O[P] = Desc.value; // eslint-disable-line no-param-reassign + return O; + } + + throw new SyntaxError('helper does not yet support this configuration'); +}; +module.exports.oDP = oDP; diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/getSymbolDescription.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/getSymbolDescription.js new file mode 100644 index 0000000..fbe7a7b --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/getSymbolDescription.js @@ -0,0 +1,67 @@ +'use strict'; + +var test = require('tape'); +var debug = require('object-inspect'); +var forEach = require('foreach'); +var has = require('has'); + +var v = require('./values'); +var getSymbolDescription = require('../../helpers/getSymbolDescription'); +var getInferredName = require('../../helpers/getInferredName'); + +test('getSymbolDescription', function (t) { + t.test('no symbols', { skip: v.hasSymbols }, function (st) { + st['throws']( + getSymbolDescription, + SyntaxError, + 'requires Symbol support' + ); + + st.end(); + }); + + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { getSymbolDescription(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('with symbols', { skip: !v.hasSymbols }, function (st) { + forEach( + [ + [Symbol(), undefined], + [Symbol(undefined), undefined], + [Symbol(null), 'null'], + [Symbol.iterator, 'Symbol.iterator'], + [Symbol('foo'), 'foo'] + ], + function (pair) { + var sym = pair[0]; + var desc = pair[1]; + st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc)); + } + ); + + st.test('only possible when inference or native `Symbol.prototype.description` is supported', { + skip: !getInferredName && !has(Symbol.prototype, 'description') + }, function (s2t) { + s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""'); + + s2t.end(); + }); + + st.test('only possible when global symbols are supported', { + skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor') + }, function (s2t) { + // eslint-disable-next-line no-restricted-properties + s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/runManifestTest.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/runManifestTest.js new file mode 100644 index 0000000..2fdb4f2 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/runManifestTest.js @@ -0,0 +1,27 @@ +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +var forEach = require('foreach'); +var keys = require('object-keys'); + +module.exports = function runManifestTest(test, ES, edition) { + test('ES' + edition + ' manifest', { skip: !fs.readdirSync }, function (t) { + var files = fs.readdirSync(path.join(__dirname, '../../' + edition), 'utf-8'); + var map = { + AbstractEqualityComparison: 'Abstract Equality Comparison', + AbstractRelationalComparison: 'Abstract Relational Comparison', + StrictEqualityComparison: 'Strict Equality Comparison' + }; + forEach(files, function (file) { + var name = path.basename(file, path.extname(file)); + var actual = ES[map[name] || name]; + var expected = require(path.join(__dirname, '../../' + edition + '/', file)); // eslint-disable-line global-require + t.equal(actual, expected, 'ES["' + name + '"] === ' + file); + }); + var actualCount = keys(ES).length; + t.equal(actualCount, files.length, 'expected ' + files.length + ' files, got ' + actualCount); + t.end(); + }); +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/test/helpers/values.js b/node_modules/object.entries/node_modules/es-abstract/test/helpers/values.js new file mode 100644 index 0000000..ccef743 --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/helpers/values.js @@ -0,0 +1,121 @@ +'use strict'; + +var assign = require('../../helpers/assign'); + +var hasSymbols = require('has-symbols')(); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; +var objects = [{}, coercibleObject, coercibleFnObject, toStringOnlyObject, valueOfOnlyObject]; +var nullPrimitives = [undefined, null]; +var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3]; +var zeroes = [0, -0]; +var infinities = [Infinity, -Infinity]; +var numbers = zeroes.concat([42], infinities, nonIntegerNumbers); +var strings = ['', 'foo', 'a\uD83D\uDCA9c']; +var booleans = [true, false]; +var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; +var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers); +var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols); +var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols); +var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives); +var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects); +var primitives = [].concat(nullPrimitives, nonNullPrimitives); +var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects); +var propertyKeys = [].concat(strings, symbols); +var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects); +var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN); +var truthies = [].concat(true, 'foo', 42, symbols, objects); +var timestamps = [].concat(0, 946713600000, 1546329600000); +var nonFunctions = [].concat(primitives, objects, [42]); +var nonArrays = [].concat(nonFunctions); + +var descriptors = { + configurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': true }); + }, + nonConfigurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': false }); + }, + enumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': true }); + }, + nonEnumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': false }); + }, + writable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': true }); + }, + nonWritable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': false }); + } +}; + +module.exports = { + coercibleObject: coercibleObject, + coercibleFnObject: coercibleFnObject, + valueOfOnlyObject: valueOfOnlyObject, + toStringOnlyObject: toStringOnlyObject, + uncoercibleObject: uncoercibleObject, + uncoercibleFnObject: uncoercibleFnObject, + objects: objects, + nonFunctions: nonFunctions, + nonArrays: nonArrays, + nullPrimitives: nullPrimitives, + numbers: numbers, + zeroes: zeroes, + infinities: infinities, + strings: strings, + booleans: booleans, + symbols: symbols, + hasSymbols: hasSymbols, + nonSymbolPrimitives: nonSymbolPrimitives, + nonNumberPrimitives: nonNumberPrimitives, + nonNullPrimitives: nonNullPrimitives, + nonUndefinedPrimitives: nonUndefinedPrimitives, + nonStrings: nonStrings, + nonNumbers: nonNumberPrimitives.concat(objects), + nonIntegerNumbers: nonIntegerNumbers, + primitives: primitives, + nonPropertyKeys: nonPropertyKeys, + propertyKeys: propertyKeys, + nonBooleans: nonBooleans, + falsies: falsies, + truthies: truthies, + timestamps: timestamps, + bothDescriptor: function () { + return { '[[Get]]': function () {}, '[[Value]]': true }; + }, + bothDescriptorWritable: function () { + return descriptors.writable({ '[[Get]]': function () {} }); + }, + accessorDescriptor: function (value) { + return descriptors.enumerable(descriptors.configurable({ + '[[Get]]': function get() { return value; } + })); + }, + mutatorDescriptor: function () { + return descriptors.enumerable(descriptors.configurable({ + '[[Set]]': function () {} + })); + }, + dataDescriptor: function (value) { + return descriptors.nonWritable({ + '[[Value]]': arguments.length > 0 ? value : 42 + }); + }, + genericDescriptor: function () { + return descriptors.configurable(descriptors.nonEnumerable()); + }, + descriptors: descriptors +}; diff --git a/node_modules/object.entries/node_modules/es-abstract/test/index.js b/node_modules/object.entries/node_modules/es-abstract/test/index.js new file mode 100644 index 0000000..3f1adba --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var ES = require('../'); +var test = require('tape'); +var keys = require('object-keys'); +var forEach = require('foreach'); + +var ESkeys = keys(ES).sort(); +var ES6keys = keys(ES.ES6).sort(); + +test('exposed properties', function (t) { + t.deepEqual(ESkeys, ES6keys.concat(['ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); + t.end(); +}); + +test('methods match', function (t) { + forEach(ES6keys, function (key) { + t.equal(ES.ES6[key], ES[key], 'method ' + key + ' on main ES object is ES6 method'); + }); + t.end(); +}); + +require('./GetIntrinsic'); + +require('./helpers/getSymbolDescription'); +require('./helpers/OwnPropertyKeys'); + +require('./es5'); +require('./es6'); +require('./es2015'); +require('./es7'); +require('./es2016'); +require('./es2017'); +require('./es2018'); +require('./es2019'); diff --git a/node_modules/object.entries/node_modules/es-abstract/test/tests.js b/node_modules/object.entries/node_modules/es-abstract/test/tests.js new file mode 100644 index 0000000..844846f --- /dev/null +++ b/node_modules/object.entries/node_modules/es-abstract/test/tests.js @@ -0,0 +1,4193 @@ +'use strict'; + +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); +var assign = require('object.assign'); +var keys = require('object-keys'); +var has = require('has'); +var arrowFns = require('make-arrow-function').list(); +var hasStrictMode = require('has-strict-mode')(); +var functionsHaveNames = require('functions-have-names')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +var $getProto = require('../helpers/getProto'); +var $setProto = require('../helpers/setProto'); +var defineProperty = require('./helpers/defineProperty'); +var getInferredName = require('../helpers/getInferredName'); +var getOwnPropertyDescriptor = require('../helpers/getOwnPropertyDescriptor'); +var assertRecordTests = require('./helpers/assertRecord'); +var v = require('./helpers/values'); +var diffOps = require('./diffOps'); + +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +var getArraySubclassWithSpeciesConstructor = function getArraySubclass(speciesConstructor) { + var Bar = function Bar() { + var inst = []; + Object.setPrototypeOf(inst, Bar.prototype); + defineProperty(inst, 'constructor', { value: Bar }); + return inst; + }; + Bar.prototype = Object.create(Array.prototype); + Object.setPrototypeOf(Bar, Array); + defineProperty(Bar, Symbol.species, { value: speciesConstructor }); + + return Bar; +}; + +var testIterator = function (t, iterator, expected) { + var resultCount = 0; + var result; + while (result = iterator.next(), !result.done) { // eslint-disable-line no-sequences + t.deepEqual(result, { done: false, value: expected[resultCount] }, 'result ' + resultCount); + resultCount += 1; + } + t.equal(resultCount, expected.length, 'expected ' + expected.length + ', got ' + resultCount); +}; + +var hasSpecies = v.hasSymbols && Symbol.species; + +var hasLastIndex = 'lastIndex' in (/a/).exec('a'); // IE 8 +var hasGroups = 'groups' in (/a/).exec('a'); // modern engines +var kludgeMatch = function kludgeMatch(R, matchObject) { + if (hasGroups) { + assign(matchObject, { groups: matchObject.groups }); + } + if (hasLastIndex) { + assign(matchObject, { lastIndex: R.lastIndex }); + } + return matchObject; +}; + +var testEnumerableOwnNames = function (t, enumerableOwnNames) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { enumerableOwnNames(nonObject); }, + debug(nonObject) + ' is not an Object' + ); + }); + + var Child = function Child() { + this.own = {}; + }; + Child.prototype = { + inherited: {} + }; + + var obj = new Child(); + + t.equal('own' in obj, true, 'has "own"'); + t.equal(has(obj, 'own'), true, 'has own "own"'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, 'own'), true, 'has enumerable "own"'); + + t.equal('inherited' in obj, true, 'has "inherited"'); + t.equal(has(obj, 'inherited'), false, 'has non-own "inherited"'); + t.equal(has(Child.prototype, 'inherited'), true, 'Child.prototype has own "inherited"'); + t.equal(Child.prototype.inherited, obj.inherited, 'Child.prototype.inherited === obj.inherited'); + t.equal(Object.prototype.propertyIsEnumerable.call(Child.prototype, 'inherited'), true, 'has enumerable "inherited"'); + + t.equal('toString' in obj, true, 'has "toString"'); + t.equal(has(obj, 'toString'), false, 'has non-own "toString"'); + t.equal(has(Object.prototype, 'toString'), true, 'Object.prototype has own "toString"'); + t.equal(Object.prototype.toString, obj.toString, 'Object.prototype.toString === obj.toString'); + // eslint-disable-next-line no-useless-call + t.equal(Object.prototype.propertyIsEnumerable.call(Object.prototype, 'toString'), false, 'has non-enumerable "toString"'); + + return obj; +}; + +var es2015 = function ES2015(ES, ops, expectedMissing, skips) { + test('has expected operations', function (t) { + var diff = diffOps(ES, ops, expectedMissing); + + t.deepEqual(diff.extra, [], 'no extra ops'); + + t.deepEqual(diff.missing, [], 'no unexpected missing ops'); + + t.end(); + }); + + test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), 3, 'coercibleObject with no hint coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), 3, 'coercibleObject with hint Number coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to NaN'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), 42, 'coercibleObject with hint String coerces to nonstringified toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), 7, 'toStringOnlyObject returns non-stringified toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), 4, 'valueOfOnlyObject returns valueOf'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st.end(); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); + var now = new Date(); + st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); + st.end(); + }); + + t.end(); + }); + + test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + + t.test('numbers', function (st) { + forEach(v.zeroes.concat(NaN), function (falsyNumber) { + st.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach(v.infinities.concat([42, 1]), function (truthyNumber) { + st.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + + st.end(); + }); + + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + + t.test('objects', function (st) { + forEach(v.objects, function (obj) { + st.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + st.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + + st.end(); + }); + + t.end(); + }); + + test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + + t.test('numbers', function (st) { + st.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach(v.zeroes.concat(v.infinities, 42), function (num) { + st.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + st.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + st.end(); + }); + + t.test('objects', function (st) { + forEach(v.objects, function (object) { + st.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + st['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + st.end(); + }); + + t.test('binary literals', function (st) { + st.equal(ES.ToNumber('0b10'), 2, '0b10 is 2'); + st.equal(ES.ToNumber({ toString: function () { return '0b11'; } }), 3, 'Object that toStrings to 0b11 is 3'); + + st.equal(true, is(ES.ToNumber('0b12'), NaN), '0b12 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0b112'; } }), NaN), 'Object that toStrings to 0b112 is NaN'); + st.end(); + }); + + t.test('octal literals', function (st) { + st.equal(ES.ToNumber('0o10'), 8, '0o10 is 8'); + st.equal(ES.ToNumber({ toString: function () { return '0o11'; } }), 9, 'Object that toStrings to 0o11 is 9'); + + st.equal(true, is(ES.ToNumber('0o18'), NaN), '0o18 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0o118'; } }), NaN), 'Object that toStrings to 0o118 is NaN'); + st.end(); + }); + + t.test('signed hex numbers', function (st) { + st.equal(true, is(ES.ToNumber('-0xF'), NaN), '-0xF is NaN'); + st.equal(true, is(ES.ToNumber(' -0xF '), NaN), 'space-padded -0xF is NaN'); + st.equal(true, is(ES.ToNumber('+0xF'), NaN), '+0xF is NaN'); + st.equal(true, is(ES.ToNumber(' +0xF '), NaN), 'space-padded +0xF is NaN'); + + st.end(); + }); + + t.test('trimming of whitespace and non-whitespace characters', function (st) { + var whitespace = ' \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'; + st.equal(0, ES.ToNumber(whitespace + 0 + whitespace), 'whitespace is trimmed'); + + // Zero-width space (zws), next line character (nel), and non-character (bom) are not whitespace. + var nonWhitespaces = { + '\\u0085': '\u0085', + '\\u200b': '\u200b', + '\\ufffe': '\ufffe' + }; + + forEach(nonWhitespaces, function (desc, nonWS) { + st.equal(true, is(ES.ToNumber(nonWS + 0 + nonWS), NaN), 'non-whitespace ' + desc + ' not trimmed'); + }); + + st.end(); + }); + + forEach(v.symbols, function (symbol) { + t['throws']( + function () { ES.ToNumber(symbol); }, + TypeError, + 'Symbols can’t be converted to a Number: ' + debug(symbol) + ); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); + var now = +new Date(); + st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); + st.end(); + }); + + t.end(); + }); + + test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); + }); + + test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToInt16', function (t) { + t.ok(is(0, ES.ToInt16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt16(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt16(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt16(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.end(); + }); + + test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); + }); + + test('ToInt8', function (t) { + t.ok(is(0, ES.ToInt8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt8(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt8(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt8(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToInt8(0x100 - 1), -1), '2^8 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10), 0x10), '2^4 returns 2^4'); + t.end(); + }); + + test('ToUint8', function (t) { + t.ok(is(0, ES.ToUint8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint8(0x100000000 - 1), 0x100 - 1), '2^32 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint8(0x80000000 - 1), 0x100 - 1), '2^31 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint8(0x10000 - 1), 0x100 - 1), '2^16 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToUint8(0x100 - 1), 0x100 - 1), '2^8 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint8(0x10), 0x10), '2^4 returns 2^4'); + t.ok(is(ES.ToUint8(0x10 - 1), 0x10 - 1), '2^4 - 1 returns 2^4 - 1'); + t.end(); + }); + + test('ToUint8Clamp', function (t) { + t.ok(is(0, ES.ToUint8Clamp(NaN)), 'NaN coerces to +0'); + t.ok(is(0, ES.ToUint8Clamp(0)), '+0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-0)), '-0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-Infinity)), '-Infinity returns +0'); + t['throws'](function () { return ES.ToUint8Clamp(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + forEach([255, 256, 0x100000, Infinity], function (number) { + t.ok(is(255, ES.ToUint8Clamp(number)), number + ' coerces to 255'); + }); + t.equal(1, ES.ToUint8Clamp(1.49), '1.49 coerces to 1'); + t.equal(2, ES.ToUint8Clamp(1.5), '1.5 coerces to 2, because 2 is even'); + t.equal(2, ES.ToUint8Clamp(1.51), '1.51 coerces to 2'); + + t.equal(2, ES.ToUint8Clamp(2.49), '2.49 coerces to 2'); + t.equal(2, ES.ToUint8Clamp(2.5), '2.5 coerces to 2, because 2 is even'); + t.equal(3, ES.ToUint8Clamp(2.51), '2.51 coerces to 3'); + t.end(); + }); + + test('ToString', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (item) { + t.equal(ES.ToString(item), String(item), 'ES.ToString(' + debug(item) + ') ToStrings to String(' + debug(item) + ')'); + }); + + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + + forEach(v.symbols, function (symbol) { + t['throws'](function () { return ES.ToString(symbol); }, TypeError, debug(symbol) + ' throws'); + }); + t.end(); + }); + + test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); + }); + + test('RequireObjectCoercible', function (t) { + t.equal(false, 'CheckObjectCoercible' in ES, 'CheckObjectCoercible -> RequireObjectCoercible in ES6'); + t['throws'](function () { return ES.RequireObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.RequireObjectCoercible(null); }, TypeError, 'null throws'); + var isCoercible = function (value) { + t.doesNotThrow(function () { return ES.RequireObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), isCoercible); + t.end(); + }); + + test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.nonFunctions); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); + }); + + test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); + }); + + test('SameValueZero', function (t) { + t.equal(true, ES.SameValueZero(NaN, NaN), 'NaN is SameValueZero as NaN'); + t.equal(true, ES.SameValueZero(0, -0), '+0 is SameValueZero as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValueZero(val, val), debug(val) + ' is SameValueZero to itself'); + }); + t.end(); + }); + + test('ToPropertyKey', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (value) { + t.equal(ES.ToPropertyKey(value), String(value), 'ToPropertyKey(value) === String(value) for non-Symbols'); + }); + + forEach(v.symbols, function (symbol) { + t.equal( + ES.ToPropertyKey(symbol), + symbol, + 'ToPropertyKey(' + debug(symbol) + ') === ' + debug(symbol) + ); + t.equal( + ES.ToPropertyKey(Object(symbol)), + symbol, + 'ToPropertyKey(' + debug(Object(symbol)) + ') === ' + debug(symbol) + ); + }); + + t.end(); + }); + + test('ToLength', function (t) { + t['throws'](function () { return ES.ToLength(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + t.equal(3, ES.ToLength(v.coercibleObject), 'coercibleObject coerces to 3'); + t.equal(42, ES.ToLength('42.5'), '"42.5" coerces to 42'); + t.equal(7, ES.ToLength(7.3), '7.3 coerces to 7'); + forEach([-0, -1, -42, -Infinity], function (negative) { + t.ok(is(0, ES.ToLength(negative)), negative + ' coerces to +0'); + }); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 1), '2^53 coerces to 2^53 - 1'); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 3), '2^53 + 2 coerces to 2^53 - 1'); + t.end(); + }); + + test('IsArray', function (t) { + t.equal(true, ES.IsArray([]), '[] is array'); + t.equal(false, ES.IsArray({}), '{} is not array'); + t.equal(false, ES.IsArray({ length: 1, 0: true }), 'arraylike object is not array'); + forEach(v.objects.concat(v.primitives), function (value) { + t.equal(false, ES.IsArray(value), debug(value) + ' is not array'); + }); + t.end(); + }); + + test('IsRegExp', function (t) { + forEach([/a/g, new RegExp('a', 'g')], function (regex) { + t.equal(true, ES.IsRegExp(regex), regex + ' is regex'); + }); + + forEach(v.objects.concat(v.primitives), function (nonRegex) { + t.equal(false, ES.IsRegExp(nonRegex), debug(nonRegex) + ' is not regex'); + }); + + t.test('Symbol.match', { skip: !v.hasSymbols || !Symbol.match }, function (st) { + var obj = {}; + obj[Symbol.match] = true; + st.equal(true, ES.IsRegExp(obj), 'object with truthy Symbol.match is regex'); + + var regex = /a/; + regex[Symbol.match] = false; + st.equal(false, ES.IsRegExp(regex), 'regex with falsy Symbol.match is not regex'); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyKey', function (t) { + forEach(v.numbers.concat(v.objects), function (notKey) { + t.equal(false, ES.IsPropertyKey(notKey), debug(notKey) + ' is not property key'); + }); + + t.equal(true, ES.IsPropertyKey('foo'), 'string is property key'); + + forEach(v.symbols, function (symbol) { + t.equal(true, ES.IsPropertyKey(symbol), debug(symbol) + ' is property key'); + }); + t.end(); + }); + + test('IsInteger', function (t) { + for (var i = -100; i < 100; i += 10) { + t.equal(true, ES.IsInteger(i), i + ' is integer'); + t.equal(false, ES.IsInteger(i + 0.2), (i + 0.2) + ' is not integer'); + } + t.equal(true, ES.IsInteger(-0), '-0 is integer'); + var notInts = v.nonNumbers.concat(v.nonIntegerNumbers, v.infinities, [NaN, [], new Date()]); + forEach(notInts, function (notInt) { + t.equal(false, ES.IsInteger(notInt), debug(notInt) + ' is not integer'); + }); + t.equal(false, ES.IsInteger(v.uncoercibleObject), 'uncoercibleObject is not integer'); + t.end(); + }); + + test('IsExtensible', function (t) { + forEach(v.objects, function (object) { + t.equal(true, ES.IsExtensible(object), debug(object) + ' object is extensible'); + }); + forEach(v.primitives, function (primitive) { + t.equal(false, ES.IsExtensible(primitive), debug(primitive) + ' is not extensible'); + }); + if (Object.preventExtensions) { + t.equal(false, ES.IsExtensible(Object.preventExtensions({})), 'object with extensions prevented is not extensible'); + } + t.end(); + }); + + test('CanonicalNumericIndexString', function (t) { + var throwsOnNonString = function (notString) { + t['throws']( + function () { return ES.CanonicalNumericIndexString(notString); }, + TypeError, + debug(notString) + ' is not a string' + ); + }; + forEach(v.objects.concat(v.numbers), throwsOnNonString); + t.ok(is(-0, ES.CanonicalNumericIndexString('-0')), '"-0" returns -0'); + for (var i = -50; i < 50; i += 10) { + t.equal(i, ES.CanonicalNumericIndexString(String(i)), '"' + i + '" returns ' + i); + t.equal(undefined, ES.CanonicalNumericIndexString(String(i) + 'a'), '"' + i + 'a" returns undefined'); + } + t.end(); + }); + + test('IsConstructor', function (t) { + t.equal(true, ES.IsConstructor(function () {}), 'function is constructor'); + t.equal(false, ES.IsConstructor(/a/g), 'regex is not constructor'); + forEach(v.objects, function (object) { + t.equal(false, ES.IsConstructor(object), object + ' object is not constructor'); + }); + + try { + var arrow = Function('return () => {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(arrow), false, 'arrow function is not constructor'); + } catch (e) { + t.comment('SKIP: arrow function syntax not supported.'); + } + + try { + var foo = Function('return class Foo {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(foo), true, 'class is constructor'); + } catch (e) { + t.comment('SKIP: class syntax not supported.'); + } + + if (typeof Reflect !== 'object' || typeof Proxy !== 'function' || has(Proxy, 'prototype')) { + t.comment('SKIP: Proxy is constructor'); + } else { + t.equal(ES.IsConstructor(Proxy), true, 'Proxy is constructor'); + } + + t.end(); + }); + + test('Call', function (t) { + var receiver = {}; + var notFuncs = v.nonFunctions.concat([/a/g, new RegExp('a', 'g')]); + t.plan(notFuncs.length + 5); + var throwsIfNotCallable = function (notFunc) { + t['throws']( + function () { return ES.Call(notFunc, receiver); }, + TypeError, + debug(notFunc) + ' (' + typeof notFunc + ') is not callable' + ); + }; + forEach(notFuncs, throwsIfNotCallable); + ES.Call( + function (a, b) { + t.equal(this, receiver, 'context matches expected'); + t.deepEqual([a, b], [1, 2], 'named args are correct'); + t.equal(arguments.length, 3, 'extra argument was passed'); + t.equal(arguments[2], 3, 'extra argument was correct'); + }, + receiver, + [1, 2, 3] + ); + + t.test('Call doesn’t use func.apply', function (st) { + st.plan(4); + + var bad = function (a, b) { + st.equal(this, receiver, 'context matches expected'); + st.deepEqual([a, b], [1, 2], 'named args are correct'); + st.equal(arguments.length, 3, 'extra argument was passed'); + st.equal(arguments[2], 3, 'extra argument was correct'); + }; + + bad.apply = function () { + st.fail('bad.apply shouldn’t get called'); + }; + + ES.Call(bad, receiver, [1, 2, 3]); + st.end(); + }); + + t.end(); + }); + + test('GetV', function (t) { + t['throws'](function () { return ES.GetV({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + var obj = { a: function () {} }; + t.equal(ES.GetV(obj, 'a'), obj.a, 'returns property if it exists'); + t.equal(ES.GetV(obj, 'b'), undefined, 'returns undefiend if property does not exist'); + t.end(); + }); + + test('GetMethod', function (t) { + t['throws'](function () { return ES.GetMethod({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + t.equal(ES.GetMethod({}, 'a'), undefined, 'returns undefined in property is undefined'); + t.equal(ES.GetMethod({ a: null }, 'a'), undefined, 'returns undefined if property is null'); + t.equal(ES.GetMethod({ a: undefined }, 'a'), undefined, 'returns undefined if property is undefined'); + var obj = { a: function () {} }; + t['throws'](function () { ES.GetMethod({ a: 'b' }, 'a'); }, TypeError, 'throws TypeError if property exists and is not callable'); + t.equal(ES.GetMethod(obj, 'a'), obj.a, 'returns property if it is callable'); + t.end(); + }); + + test('Get', function (t) { + t['throws'](function () { return ES.Get('a', 'a'); }, TypeError, 'Throws a TypeError if `O` is not an Object'); + t['throws'](function () { return ES.Get({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + + var value = {}; + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var sym = Symbol('sym'); + var obj = {}; + obj[sym] = value; + st.equal(ES.Get(obj, sym), value, 'returns property `P` if it exists on object `O`'); + st.end(); + }); + t.equal(ES.Get({ a: value }, 'a'), value, 'returns property `P` if it exists on object `O`'); + t.end(); + }); + + test('Type', { skip: !v.hasSymbols }, function (t) { + t.equal(ES.Type(Symbol.iterator), 'Symbol', 'Type(Symbol.iterator) is Symbol'); + t.end(); + }); + + test('SpeciesConstructor', function (t) { + t['throws'](function () { ES.SpeciesConstructor(null); }, TypeError); + t['throws'](function () { ES.SpeciesConstructor(undefined); }, TypeError); + + var defaultConstructor = function Foo() {}; + + t.equal( + ES.SpeciesConstructor({ constructor: undefined }, defaultConstructor), + defaultConstructor, + 'undefined constructor returns defaultConstructor' + ); + + t['throws']( + function () { return ES.SpeciesConstructor({ constructor: null }, defaultConstructor); }, + TypeError, + 'non-undefined non-object constructor throws' + ); + + t.test('with Symbol.species', { skip: !hasSpecies }, function (st) { + var Bar = function Bar() {}; + Bar[Symbol.species] = null; + + st.equal( + ES.SpeciesConstructor(new Bar(), defaultConstructor), + defaultConstructor, + 'undefined/null Symbol.species returns default constructor' + ); + + var Baz = function Baz() {}; + Baz[Symbol.species] = Bar; + st.equal( + ES.SpeciesConstructor(new Baz(), defaultConstructor), + Bar, + 'returns Symbol.species constructor value' + ); + + Baz[Symbol.species] = {}; + st['throws']( + function () { ES.SpeciesConstructor(new Baz(), defaultConstructor); }, + TypeError, + 'throws when non-constructor non-null non-undefined species value found' + ); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyDescriptor', { skip: skips && skips.IsPropertyDescriptor }, function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t.equal( + ES.IsPropertyDescriptor(primitive), + false, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); + + assertRecordTests(ES, test); + + test('IsAccessorDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsAccessorDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); + }); + + test('IsDataDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsDataDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); + }); + + test('IsGenericDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); + }); + + test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'] + }); + + t.deepEqual(ES.FromPropertyDescriptor(v.genericDescriptor()), { + enumerable: false, + configurable: true + }); + + t.end(); + }); + + test('ToPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.dataDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), assign(data, { '[[Configurable]]': false })); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.FromPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('CompletePropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.CompletePropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var generic = v.genericDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(generic), + { + '[[Configurable]]': !!generic['[[Configurable]]'], + '[[Enumerable]]': !!generic['[[Enumerable]]'], + '[[Value]]': undefined, + '[[Writable]]': false + }, + 'completes a Generic Descriptor' + ); + + var data = v.dataDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(data), + { + '[[Configurable]]': !!data['[[Configurable]]'], + '[[Enumerable]]': false, + '[[Value]]': data['[[Value]]'], + '[[Writable]]': !!data['[[Writable]]'] + }, + 'completes a Data Descriptor' + ); + + var accessor = v.accessorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(accessor), + { + '[[Get]]': accessor['[[Get]]'], + '[[Enumerable]]': !!accessor['[[Enumerable]]'], + '[[Configurable]]': !!accessor['[[Configurable]]'], + '[[Set]]': undefined + }, + 'completes an Accessor Descriptor' + ); + + var mutator = v.mutatorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(mutator), + { + '[[Set]]': mutator['[[Set]]'], + '[[Enumerable]]': !!mutator['[[Enumerable]]'], + '[[Configurable]]': !!mutator['[[Configurable]]'], + '[[Get]]': undefined + }, + 'completes a mutator Descriptor' + ); + + t['throws']( + function () { ES.CompletePropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('Set', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.Set(primitive, '', null, false); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Set({}, nonKey, null, false); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.Set({}, '', null, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var o = {}; + var value = {}; + ES.Set(o, 'key', value, true); + t.deepEqual(o, { key: value }, 'key is set'); + + t.test('nonwritable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { writable: false }); + + st['throws']( + function () { ES.Set(obj, 'a', {}, true); }, + TypeError, + 'can not Set nonwritable property' + ); + + st.doesNotThrow( + function () { + st.equal(ES.Set(obj, 'a', {}, false), false, 'unsuccessful Set returns false'); + }, + 'setting Throw to false prevents an exception' + ); + + st.end(); + }); + + t.test('nonconfigurable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { configurable: false }); + + st.equal(ES.Set(obj, 'a', value, true), true, 'successful Set returns true'); + st.deepEqual(obj, { a: value }, 'key is set'); + + st.end(); + }); + + t.test('doesn’t call [[Get]] in conforming strict mode environments', { skip: noThrowOnStrictViolation }, function (st) { + var getterCalled = false; + var setterCalls = 0; + var obj = {}; + defineProperty(obj, 'a', { + get: function () { + getterCalled = true; + }, + set: function () { + setterCalls += 1; + } + }); + + st.equal(ES.Set(obj, 'a', value, false), true, 'successful Set returns true'); + st.equal(setterCalls, 1, 'setter was called once'); + st.equal(getterCalled, false, 'getter was not called'); + + st.end(); + }); + + t.end(); + }); + + test('HasOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasOwnProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasOwnProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasOwnProperty({}, 'toString'), false, 'inherited properties are not own'); + t.equal( + ES.HasOwnProperty({ toString: 1 }, 'toString'), + true, + 'shadowed inherited own properties are own' + ); + t.equal(ES.HasOwnProperty({ a: 1 }, 'a'), true, 'own properties are own'); + + t.end(); + }); + + test('HasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasProperty({}, 'nope'), false, 'object does not have nonexistent properties'); + t.equal(ES.HasProperty({}, 'toString'), true, 'object has inherited properties'); + t.equal( + ES.HasProperty({ toString: 1 }, 'toString'), + true, + 'object has shadowed inherited own properties' + ); + t.equal(ES.HasProperty({ a: 1 }, 'a'), true, 'object has own properties'); + + t.end(); + }); + + test('IsConcatSpreadable', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsConcatSpreadable(primitive), false, debug(primitive) + ' is not an Object'); + }); + + var hasSymbolConcatSpreadable = v.hasSymbols && Symbol.isConcatSpreadable; + t.test('Symbol.isConcatSpreadable', { skip: !hasSymbolConcatSpreadable }, function (st) { + forEach(v.falsies, function (falsy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = falsy; + st.equal( + ES.IsConcatSpreadable(obj), + false, + 'an object with ' + debug(falsy) + ' as Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + forEach(v.truthies, function (truthy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = truthy; + st.equal( + ES.IsConcatSpreadable(obj), + true, + 'an object with ' + debug(truthy) + ' as Symbol.isConcatSpreadable is concat spreadable' + ); + }); + + st.end(); + }); + + forEach(v.objects, function (object) { + t.equal( + ES.IsConcatSpreadable(object), + false, + 'non-array without Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + t.equal(ES.IsConcatSpreadable([]), true, 'arrays are concat spreadable'); + + t.end(); + }); + + test('Invoke', function (t) { + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Invoke({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t['throws'](function () { ES.Invoke({ o: false }, 'o'); }, TypeError, 'fails on a non-function'); + + t.test('invoked callback', function (st) { + var aValue = {}; + var bValue = {}; + var obj = { + f: function (a) { + st.equal(arguments.length, 2, '2 args passed'); + st.equal(a, aValue, 'first arg is correct'); + st.equal(arguments[1], bValue, 'second arg is correct'); + } + }; + st.plan(3); + ES.Invoke(obj, 'f', aValue, bValue); + }); + + t.end(); + }); + + test('GetIterator', function (t) { + var arr = [1, 2]; + testIterator(t, ES.GetIterator(arr), arr); + + testIterator(t, ES.GetIterator('abc'), 'abc'.split('')); + + t.test('Symbol.iterator', { skip: !v.hasSymbols }, function (st) { + var m = new Map(); + m.set(1, 'a'); + m.set(2, 'b'); + + testIterator(st, ES.GetIterator(m), [[1, 'a'], [2, 'b']]); + + st.end(); + }); + + t.end(); + }); + + test('IteratorNext', { skip: true }); + + test('IteratorComplete', { skip: true }); + + test('IteratorValue', { skip: true }); + + test('IteratorStep', { skip: true }); + + test('IteratorClose', { skip: true }); + + test('CreateIterResultObject', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.CreateIterResultObject({}, nonBoolean); }, + TypeError, + '"done" argument must be a boolean; ' + debug(nonBoolean) + ' is not' + ); + }); + + var value = {}; + t.deepEqual( + ES.CreateIterResultObject(value, true), + { value: value, done: true }, + 'creates a "done" iteration result' + ); + t.deepEqual( + ES.CreateIterResultObject(value, false), + { value: value, done: false }, + 'creates a "not done" iteration result' + ); + + t.end(); + }); + + test('RegExpExec', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.RegExpExec(primitive); }, + TypeError, + '"R" argument must be an object; ' + debug(primitive) + ' is not' + ); + }); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.RegExpExec({}, nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + t.test('gets and calls a callable "exec"', function (st) { + var str = '123'; + var o = { + exec: function (S) { + st.equal(this, o, '"exec" receiver is R'); + st.equal(S, str, '"exec" argument is S'); + + return null; + } + }; + st.plan(2); + ES.RegExpExec(o, str); + st.end(); + }); + + t.test('throws if a callable "exec" returns a non-null non-object', function (st) { + var str = '123'; + st.plan(v.nonNullPrimitives.length); + forEach(v.nonNullPrimitives, function (nonNullPrimitive) { + st['throws']( + function () { ES.RegExpExec({ exec: function () { return nonNullPrimitive; } }, str); }, + TypeError, + '"exec" method must return `null` or an Object; ' + debug(nonNullPrimitive) + ' is not' + ); + }); + st.end(); + }); + + t.test('actual regex that should match against a string', function (st) { + var S = 'aabc'; + var R = /a/g; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + + t.test('actual regex that should match against a string, with shadowed "exec"', function (st) { + var S = 'aabc'; + var R = /a/g; + R.exec = undefined; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + t.end(); + }); + + test('ArraySpeciesCreate', function (t) { + t.test('errors', function (st) { + var testNonNumber = function (nonNumber) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a number' + ); + }; + forEach(v.nonNumbers, testNonNumber); + + st['throws']( + function () { ES.ArraySpeciesCreate([], -1); }, + TypeError, + '-1 is not >= 0' + ); + st['throws']( + function () { ES.ArraySpeciesCreate([], -Infinity); }, + TypeError, + '-Infinity is not >= 0' + ); + + var testNonIntegers = function (nonInteger) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonInteger); }, + TypeError, + debug(nonInteger) + ' is not an integer' + ); + }; + forEach(v.nonIntegerNumbers, testNonIntegers); + + st.end(); + }); + + t.test('works with a non-array', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + var arr = ES.ArraySpeciesCreate(nonArray, 0); + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, 0, 'length is correct'); + st.equal(arr.constructor, Array, 'constructor is correct'); + }); + + st.end(); + }); + + t.test('works with a normal array', function (st) { + var len = 2; + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, len, 'length is correct'); + st.equal(arr.constructor, orig.constructor, 'constructor is correct'); + + st.end(); + }); + + t.test('-0 length produces +0 length', function (st) { + var len = -0; + st.ok(is(len, -0), '-0 is negative zero'); + st.notOk(is(len, 0), '-0 is not positive zero'); + + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.equal(ES.IsArray(arr), true); + st.ok(is(arr.length, 0)); + st.equal(arr.constructor, orig.constructor); + + st.end(); + }); + + t.test('works with species construtor', { skip: !hasSpecies }, function (st) { + var sentinel = {}; + var Foo = function Foo(len) { + this.length = len; + this.sentinel = sentinel; + }; + var Bar = getArraySubclassWithSpeciesConstructor(Foo); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Foo, 'result used species constructor'); + st.equal(arr.length, 3, 'length property is correct'); + st.equal(arr.sentinel, sentinel, 'Foo constructor was exercised'); + + st.end(); + }); + + t.test('works with null species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(null); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('works with undefined species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('throws with object non-construtor species constructor', { skip: !hasSpecies }, function (st) { + forEach(v.objects, function (obj) { + var Bar = getArraySubclassWithSpeciesConstructor(obj); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + st['throws']( + function () { ES.ArraySpeciesCreate(bar, 3); }, + TypeError, + debug(obj) + ' is not a constructor' + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('CreateDataProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataProperty(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = { id: 'sentinel' }; + var secondSentinel = { id: 'second sentinel' }; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataProperty(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + var secondStatus = ES.CreateDataProperty(obj, propertyKey, secondSentinel); + t.equal(secondStatus, true, 'second status is true'); + t.equal( + obj[propertyKey], + secondSentinel, + debug(secondSentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + t.test('with defineProperty', { skip: !defineProperty.oDP }, function (st) { + var nonWritable = defineProperty({}, propertyKey, { configurable: true, writable: false }); + + var nonWritableStatus = ES.CreateDataProperty(nonWritable, propertyKey, sentinel); + st.equal(nonWritableStatus, false, 'create data property failed'); + st.notEqual( + nonWritable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonwritable' + ); + + var nonConfigurable = defineProperty({}, propertyKey, { configurable: false, writable: true }); + + var nonConfigurableStatus = ES.CreateDataProperty(nonConfigurable, propertyKey, sentinel); + st.equal(nonConfigurableStatus, false, 'create data property failed'); + st.notEqual( + nonConfigurable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonconfigurable' + ); + st.end(); + }); + }); + + t.end(); + }); + + test('CreateDataPropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = {}; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataPropertyOrThrow(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + if (typeof Object.preventExtensions === 'function') { + var notExtensible = {}; + Object.preventExtensions(notExtensible); + + t['throws']( + function () { ES.CreateDataPropertyOrThrow(notExtensible, propertyKey, sentinel); }, + TypeError, + 'can not install ' + debug(propertyKey) + ' on non-extensible object' + ); + t.notEqual( + notExtensible[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object' + ); + } + }); + + t.end(); + }); + + test('ObjectCreate', function (t) { + forEach(v.nonNullPrimitives, function (value) { + t['throws']( + function () { ES.ObjectCreate(value); }, + TypeError, + debug(value) + ' is not null, or an object' + ); + }); + + t.test('proto arg', function (st) { + var Parent = function Parent() {}; + Parent.prototype.foo = {}; + var child = ES.ObjectCreate(Parent.prototype); + st.equal(child instanceof Parent, true, 'child is instanceof Parent'); + st.equal(child.foo, Parent.prototype.foo, 'child inherits properties from Parent.prototype'); + + st.end(); + }); + + t.test('internal slots arg', function (st) { + st.doesNotThrow(function () { ES.ObjectCreate({}, []); }, 'an empty slot list is valid'); + + st['throws']( + function () { ES.ObjectCreate({}, ['a']); }, + SyntaxError, + 'internal slots are not supported' + ); + + st.end(); + }); + + t.test('null proto', { skip: !Object.create && !$setProto }, function (st) { + st.equal('toString' in {}, true, 'normal objects have toString'); + st.equal('toString' in ES.ObjectCreate(null), false, 'makes a null object'); + + st.end(); + }); + + t.test('null proto when no native Object.create', { skip: Object.create || $setProto }, function (st) { + st['throws']( + function () { ES.ObjectCreate(null); }, + SyntaxError, + 'without a native Object.create, can not create null objects' + ); + + st.end(); + }); + + t.end(); + }); + + test('AdvanceStringIndex', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.AdvanceStringIndex(nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + var notInts = v.nonNumbers.concat( + v.nonIntegerNumbers, + v.infinities, + [NaN, [], new Date(), Math.pow(2, 53), -1] + ); + forEach(notInts, function (nonInt) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', nonInt); }, + TypeError, + '"index" argument must be an integer, ' + debug(nonInt) + ' is not.' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', 0, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var str = 'a\uD83D\uDCA9c'; + + t.test('non-unicode mode', function (st) { + for (var i = 0; i < str.length + 2; i += 1) { + st.equal(ES.AdvanceStringIndex(str, i, false), i + 1, i + ' advances to ' + (i + 1)); + } + + st.end(); + }); + + t.test('unicode mode', function (st) { + st.equal(ES.AdvanceStringIndex(str, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(str, 1, true), 3, '1 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 3, true), 4, '3 advances to 4'); + st.equal(ES.AdvanceStringIndex(str, 4, true), 5, '4 advances to 5'); + + st.end(); + }); + + t.test('lone surrogates', function (st) { + var halfPoo = 'a\uD83Dc'; + + st.equal(ES.AdvanceStringIndex(halfPoo, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(halfPoo, 1, true), 2, '1 advances to 2'); + st.equal(ES.AdvanceStringIndex(halfPoo, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(halfPoo, 3, true), 4, '3 advances to 4'); + + st.end(); + }); + + t.test('surrogate pairs', function (st) { + var lowestPair = String.fromCharCode('0xD800') + String.fromCharCode('0xDC00'); + var highestPair = String.fromCharCode('0xDBFF') + String.fromCharCode('0xDFFF'); + var poop = String.fromCharCode('0xD83D') + String.fromCharCode('0xDCA9'); + + st.equal(ES.AdvanceStringIndex(lowestPair, 0, true), 2, 'lowest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(highestPair, 0, true), 2, 'highest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(poop, 0, true), 2, 'poop, 0 -> 2'); + + st.end(); + }); + + t.end(); + }); + + test('CreateMethodProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateMethodProperty(primitive, 'key'); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateMethodProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var value = { foo: 'bar' }; + + st.equal(ES.CreateMethodProperty(obj, key, value), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + { + configurable: true, + enumerable: false, + value: value, + writable: true + }, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.equal(obj[key], value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.CreateMethodProperty(obj, 'foo', { value: 'baz' }); }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.CreateMethodProperty(function () {}, 'name', { value: 'baz' }); }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DefinePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DefinePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DefinePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var descriptor = { + configurable: true, + enumerable: false, + value: { foo: 'bar' }, + writable: true + }; + + st.equal(ES.DefinePropertyOrThrow(obj, key, descriptor), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + descriptor, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.deepEqual(obj[key], descriptor.value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { + ES.DefinePropertyOrThrow(obj, 'foo', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { + ES.DefinePropertyOrThrow(function () {}, 'name', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DeletePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DeletePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DeletePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = { 'the key': 42 }; + var key = 'the key'; + + st.equal(ES.DeletePropertyOrThrow(obj, key), true, 'deletes property successfully'); + st.equal(key in obj, false, 'key is no longer in the object'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.DeletePropertyOrThrow(obj, 'foo'); }, + TypeError, + 'nonconfigurable key can not be deleted' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.DeletePropertyOrThrow(function () {}, 'name'); }, + TypeError, + 'nonconfigurable function name can not be deleted' + ); + st.end(); + }); + + t.end(); + }); + + test('EnumerableOwnNames', { skip: skips && skips.EnumerableOwnNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { return ES.EnumerableOwnNames(O); }); + + t.deepEqual( + ES.EnumerableOwnNames(obj), + ['own'], + 'returns enumerable own names' + ); + + t.end(); + }); + + test('thisNumberValue', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.thisNumberValue(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.thisNumberValue(number), number, debug(number) + ' is its own thisNumberValue'); + var obj = Object(number); + t.equal(ES.thisNumberValue(obj), number, debug(obj) + ' is the boxed thisNumberValue'); + }); + + t.end(); + }); + + test('thisBooleanValue', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.thisBooleanValue(nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.booleans, function (boolean) { + t.equal(ES.thisBooleanValue(boolean), boolean, debug(boolean) + ' is its own thisBooleanValue'); + var obj = Object(boolean); + t.equal(ES.thisBooleanValue(obj), boolean, debug(obj) + ' is the boxed thisBooleanValue'); + }); + + t.end(); + }); + + test('thisStringValue', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.thisStringValue(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.thisStringValue(string), string, debug(string) + ' is its own thisStringValue'); + var obj = Object(string); + t.equal(ES.thisStringValue(obj), string, debug(obj) + ' is the boxed thisStringValue'); + }); + + t.end(); + }); + + test('thisTimeValue', function (t) { + forEach(v.primitives.concat(v.objects), function (nonDate) { + t['throws']( + function () { ES.thisTimeValue(nonDate); }, + TypeError, + debug(nonDate) + ' is not a Date' + ); + }); + + forEach(v.timestamps, function (timestamp) { + var date = new Date(timestamp); + + t.equal(ES.thisTimeValue(date), timestamp, debug(date) + ' is its own thisTimeValue'); + }); + + t.end(); + }); + + test('SetIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.SetIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.SetIntegrityLevel({}); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + var O = { a: 1 }; + t.test('sealed', { skip: !Object.preventExtensions || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'sealed'), true); + st['throws']( + function () { O.b = 2; }, + /^TypeError: (Cannot|Can't) add property b, object is not extensible$/, + 'sealing prevent new properties from being added' + ); + O.a = 2; + st.equal(O.a, 2, 'pre-frozen, existing properties are mutable'); + st.end(); + }); + + t.test('frozen', { skip: !Object.freeze || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'frozen'), true); + st['throws']( + function () { O.a = 3; }, + /^TypeError: Cannot assign to read only property 'a' of /, + 'freezing prevents existing properties from being mutated' + ); + st.end(); + }); + + t.end(); + }); + + test('TestIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.TestIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.TestIntegrityLevel({ a: 1 }); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'sealed'), false, 'basic object is not sealed'); + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'frozen'), false, 'basic object is not frozen'); + + t.test('preventExtensions', { skip: !Object.preventExtensions }, function (st) { + var o = Object.preventExtensions({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), false, 'nonextensible object is not sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'nonextensible object is not frozen'); + + var empty = Object.preventExtensions({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty nonextensible object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty nonextensible object is frozen'); + st.end(); + }); + + t.test('seal', { skip: !Object.seal }, function (st) { + var o = Object.seal({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'sealed object is not frozen'); + + var empty = Object.seal({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty sealed object is frozen'); + + st.end(); + }); + + t.test('freeze', { skip: !Object.freeze }, function (st) { + var o = Object.freeze({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), true, 'frozen object is frozen'); + + var empty = Object.freeze({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty frozen object is frozen'); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryHasInstance', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t.equal(ES.OrdinaryHasInstance(nonFunction, {}), false, debug(nonFunction) + ' is not callable'); + }); + + forEach(v.primitives, function (primitive) { + t.equal(ES.OrdinaryHasInstance(function () {}, primitive), false, debug(primitive) + ' is not an object'); + }); + + var C = function C() {}; + var D = function D() {}; + t.equal(ES.OrdinaryHasInstance(C, new C()), true, 'constructor function has an instance of itself'); + t.equal(ES.OrdinaryHasInstance(C, new D()), false, 'constructor/instance mismatch is false'); + t.equal(ES.OrdinaryHasInstance(D, new C()), false, 'instance/constructor mismatch is false'); + t.equal(ES.OrdinaryHasInstance(C, {}), false, 'plain object is not an instance of a constructor'); + t.equal(ES.OrdinaryHasInstance(Object, {}), true, 'plain object is an instance of Object'); + + t.end(); + }); + + test('OrdinaryHasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryHasProperty(primitive, ''); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryHasProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryHasProperty({ a: 1 }, 'a'), true, 'own property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'toString'), true, 'inherited property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'nope'), false, 'absent property is false'); + + t.end(); + }); + + test('InstanceofOperator', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.InstanceofOperator(primitive, function () {}); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.InstanceofOperator({}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not callable' + ); + }); + + var C = function C() {}; + var D = function D() {}; + + t.equal(ES.InstanceofOperator(new C(), C), true, 'constructor function has an instance of itself'); + t.equal(ES.InstanceofOperator(new D(), C), false, 'constructor/instance mismatch is false'); + t.equal(ES.InstanceofOperator(new C(), D), false, 'instance/constructor mismatch is false'); + t.equal(ES.InstanceofOperator({}, C), false, 'plain object is not an instance of a constructor'); + t.equal(ES.InstanceofOperator({}, Object), true, 'plain object is an instance of Object'); + + t.test('Symbol.hasInstance', { skip: !v.hasSymbols || !Symbol.hasInstance }, function (st) { + st.plan(4); + + var O = {}; + var C2 = function () {}; + st.equal(ES.InstanceofOperator(O, C2), false, 'O is not an instance of C2'); + + defineProperty(C2, Symbol.hasInstance, { + value: function (obj) { + st.equal(this, C2, 'hasInstance receiver is C2'); + st.equal(obj, O, 'hasInstance argument is O'); + + return {}; // testing coercion to boolean + } + }); + + st.equal(ES.InstanceofOperator(O, C2), true, 'O is now an instance of C2'); + + st.end(); + }); + + t.end(); + }); + + test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); + }); + + test('ValidateAndApplyPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (nonUndefinedPrimitive) { + t['throws']( + function () { ES.ValidateAndApplyPropertyDescriptor(nonUndefinedPrimitive, '', false, v.genericDescriptor(), v.genericDescriptor()); }, + TypeError, + 'O: ' + debug(nonUndefinedPrimitive) + ' is not undefined or an Object' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + nonBoolean, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'extensible: ' + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.primitives, function (primitive) { + // Desc must be a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + primitive, + v.genericDescriptor() + ); + }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + // current must be undefined or a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + v.genericDescriptor(), + primitive + ); + }, + TypeError, + 'current: ' + debug(primitive) + ' is not a Property Descriptor or undefined' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + // if O is an object, P must be a property key + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + {}, + nonPropertyKey, + false, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('current is undefined', function (st) { + var propertyKey = 'howdy'; + + st.test('generic descriptor', function (s2t) { + var generic = v.genericDescriptor(); + generic['[[Enumerable]]'] = true; + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, generic); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, generic), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, generic), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = undefined; + s2t.deepEqual(O, expected, 'generic descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('data descriptor', function (s2t) { + var data = v.dataDescriptor(); + data['[[Enumerable]]'] = true; + + var O = {}; + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, data), + true, + 'noop when O is undefined' + ); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, data), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, data), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = data['[[Value]]']; + s2t.deepEqual(O, expected, 'data descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('accessor descriptor', { skip: !defineProperty.oDP }, function (s2t) { + var count = 0; + var accessor = v.accessorDescriptor(); + accessor['[[Enumerable]]'] = true; + accessor['[[Get]]'] = function () { + count += 1; + return count; + }; + + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, accessor); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, accessor), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, accessor), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = accessor['[[Get]]']() + 1; + s2t.deepEqual(O, expected, 'accessor descriptor has been defined as an own accessor property'); + s2t.end(); + }); + + st.end(); + }); + + t.test('every field in Desc is absent', { skip: 'it is unclear if having no fields qualifies Desc to be a Property Descriptor' }); + + forEach([v.dataDescriptor, v.accessorDescriptor, v.mutatorDescriptor], function (getDescriptor) { + t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, 'property key', true, getDescriptor(), getDescriptor()), + true, + 'when Desc and current are the same, early return true' + ); + }); + + t.test('current is nonconfigurable', function (st) { + // note: these must not be generic descriptors, or else the algorithm returns an early true + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if Desc is configurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.enumerable(v.dataDescriptor()), + v.descriptors.nonEnumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is Enumerable and current is not' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.nonEnumerable(v.dataDescriptor()), + v.descriptors.enumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is not Enumerable and current is' + ); + + var descLackingEnumerable = v.accessorDescriptor(); + delete descLackingEnumerable['[[Enumerable]]']; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + descLackingEnumerable, + v.descriptors.enumerable(v.accessorDescriptor()) + ), + true, + 'not false if Desc lacks Enumerable' + ); + + st.end(); + }); + + t.test('Desc and current: one is a data descriptor, one is not', { skip: !defineProperty || !getOwnPropertyDescriptor }, function (st) { + // note: Desc must be configurable if current is nonconfigurable, to hit this branch + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.accessorDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if current (data) is nonconfigurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if current (not data) is nonconfigurable' + ); + + // one is data and one is not, + // // if current is data, convert to accessor + // // else convert to data + + var startsWithData = { + 'property key': 42 + }; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithData, + 'property key', + true, + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())) + ), + true, + 'operation is successful: current is data, Desc is accessor' + ); + var shouldBeAccessor = getOwnPropertyDescriptor(startsWithData, 'property key'); + st.equal(typeof shouldBeAccessor.get, 'function', 'has a getter'); + + var key = 'property key'; + var startsWithAccessor = {}; + defineProperty(startsWithAccessor, key, { + configurable: true, + enumerable: true, + get: function get() { return 42; } + }); + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithAccessor, + key, + true, + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor(42))) + ), + true, + 'operation is successful: current is accessor, Desc is data' + ); + var shouldBeData = getOwnPropertyDescriptor(startsWithAccessor, 'property key'); + st.deepEqual(shouldBeData, { configurable: true, enumerable: true, value: 42, writable: false }, 'is a data property'); + + st.end(); + }); + + t.test('Desc and current are both data descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.writable(v.dataDescriptor()), + v.descriptors.nonWritable(v.descriptors.nonConfigurable(v.dataDescriptor())) + ), + false, + 'false if frozen current and writable Desc' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable({ '[[Value]]': 42 }), + v.descriptors.nonWritable({ '[[Value]]': 7 }) + ), + false, + 'false if nonwritable current has a different value than Desc' + ); + + st.end(); + }); + + t.test('current is nonconfigurable; Desc and current are both accessor descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.mutatorDescriptor(), + v.descriptors.nonConfigurable(v.mutatorDescriptor()) + ), + false, + 'false if both Sets are not equal' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.accessorDescriptor(), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if both Gets are not equal' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryGetOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty(primitive, ''); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryGetOwnProperty({}, 'not in the object'), undefined, 'missing property yields undefined'); + t.equal(ES.OrdinaryGetOwnProperty({}, 'toString'), undefined, 'inherited non-own property yields undefined'); + + t.deepEqual( + ES.OrdinaryGetOwnProperty({ a: 1 }, 'a'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: true, + value: 1, + writable: true + }), + 'own assigned data property yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(/a/, 'lastIndex'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'regex lastIndex yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty([], 'length'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'array length yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(Object.prototype, 'toString'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: false, + value: Object.prototype.toString, + writable: true + }), + 'own non-enumerable data property yields expected descriptor' + ); + + t.test('ES5+', { skip: !defineProperty.oDP }, function (st) { + var O = {}; + defineProperty(O, 'foo', { + configurable: false, + enumerable: false, + value: O, + writable: true + }); + + st.deepEqual( + ES.OrdinaryGetOwnProperty(O, 'foo'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: O, + writable: true + }), + 'defined own property yields expected descriptor' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryDefineOwnProperty', { skip: !getOwnPropertyDescriptor }, function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty({}, nonPropertyKey, v.genericDescriptor()); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty(primitive, '', v.genericDescriptor()); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var O = {}; + var P = 'property key'; + var Desc = v.accessorDescriptor(); + t.equal( + ES.OrdinaryDefineOwnProperty(O, P, Desc), + true, + 'operation is successful' + ); + t.deepEqual( + getOwnPropertyDescriptor(O, P), + ES.FromPropertyDescriptor(ES.CompletePropertyDescriptor(Desc)), + 'expected property descriptor is defined' + ); + + t.end(); + }); + + test('ArrayCreate', function (t) { + forEach(v.nonIntegerNumbers.concat([-1]), function (nonIntegerNumber) { + t['throws']( + function () { ES.ArrayCreate(nonIntegerNumber); }, + TypeError, + 'length must be an integer number >= 0' + ); + }); + + t['throws']( + function () { ES.ArrayCreate(Math.pow(2, 32)); }, + RangeError, + 'length must be < 2**32' + ); + + t.deepEqual(ES.ArrayCreate(-0), [], 'length of -0 creates an empty array'); + t.deepEqual(ES.ArrayCreate(0), [], 'length of +0 creates an empty array'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(1), [,], 'length of 1 creates a sparse array of length 1'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(2), [,,], 'length of 2 creates a sparse array of length 2'); + + t.test('proto argument', { skip: !$setProto }, function (st) { + var fakeProto = { + push: { toString: function () { return 'not array push'; } } + }; + st.equal(ES.ArrayCreate(0, fakeProto).push, fakeProto.push, 'passing the proto argument works'); + st.end(); + }); + + t.end(); + }); + + test('ArraySetLength', function (t) { + forEach(v.primitives.concat(v.objects), function (nonArray) { + t['throws']( + function () { ES.ArraySetLength(nonArray, 0); }, + TypeError, + 'A: ' + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ArraySetLength([], primitive); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.test('making length nonwritable', { skip: !getOwnPropertyDescriptor }, function (st) { + var a = []; + ES.ArraySetLength(a, { '[[Writable]]': false }); + st.deepEqual( + getOwnPropertyDescriptor(a, 'length'), + { + configurable: false, + enumerable: false, + value: 0, + writable: false + }, + 'without a value, length becomes nonwritable' + ); + st.end(); + }); + + var arr = []; + ES.ArraySetLength(arr, { '[[Value]]': 7 }); + t.equal(arr.length, 7, 'array now has a length of 7'); + + t.end(); + }); + + test('CreateHTML', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.CreateHTML('', nonString, '', ''); }, + TypeError, + 'tag: ' + debug(nonString) + ' is not a String' + ); + t['throws']( + function () { ES.CreateHTML('', '', nonString, ''); }, + TypeError, + 'attribute: ' + debug(nonString) + ' is not a String' + ); + }); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + '' + ), + 'the string', + 'works with an empty string attribute value' + ); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + 'attr', + 'value "with quotes"' + ), + 'the string', + 'works with an attribute, and a value with quotes' + ); + + t.end(); + }); + + test('GetOwnPropertyKeys', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.GetOwnPropertyKeys(primitive, 'String'); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.GetOwnPropertyKeys({}, 'not string or symbol'); }, + TypeError, + 'Type: must be "String" or "Symbol"' + ); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var O = { a: 1 }; + O[Symbol.iterator] = true; + var s = Symbol('test'); + defineProperty(O, s, { enumerable: false, value: true }); + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'Symbol'), + [Symbol.iterator, s], + 'works with Symbols, enumerable or not' + ); + + st.end(); + }); + + t.test('non-enumerable names', { skip: !defineProperty.oDP }, function (st) { + var O = { a: 1 }; + defineProperty(O, 'b', { enumerable: false, value: 2 }); + if (v.hasSymbols) { + O[Symbol.iterator] = true; + } + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'String').sort(), + ['a', 'b'].sort(), + 'works with Strings, enumerable or not' + ); + + st.end(); + }); + + t.deepEqual( + ES.GetOwnPropertyKeys({ a: 1, b: 2 }, 'String').sort(), + ['a', 'b'].sort(), + 'works with enumerable keys' + ); + + t.end(); + }); + + test('SymbolDescriptiveString', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.SymbolDescriptiveString(nonSymbol); }, + TypeError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(ES.SymbolDescriptiveString(Symbol()), 'Symbol()', 'undefined description'); + st.equal(ES.SymbolDescriptiveString(Symbol('')), 'Symbol()', 'empty string description'); + st.equal(ES.SymbolDescriptiveString(Symbol.iterator), 'Symbol(Symbol.iterator)', 'well-known symbol'); + st.equal(ES.SymbolDescriptiveString(Symbol('foo')), 'Symbol(foo)', 'string description'); + + st.end(); + }); + + t.end(); + }); + + test('GetSubstitution', { skip: skips && skips.GetSubstitution }, function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + if (canDistinguishSparseFromUndefined || typeof nonString !== 'undefined') { + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + } + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); + }); + + test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); + }); + + test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); + }); + + test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); + }); + + var msPerSecond = 1e3; + var msPerMinute = 60 * msPerSecond; + var msPerHour = 60 * msPerMinute; + var msPerDay = 24 * msPerHour; + + test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); + }); + + test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); + }); + + test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); + }); + + test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); + }); + + test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); + }); + + test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); + }); + + test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); + }); + + test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); + }); + + test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); + }); + + test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); + }); + + test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); + }); + + test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); + }); + + test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); + }); + + test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + + t.end(); + }); + + test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); + }); + + test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); + }); + + test('ToDateString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.ToDateString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + t.equal(ES.ToDateString(NaN), 'Invalid Date', 'NaN becomes "Invalid Date"'); + var now = +new Date(); + t.equal(ES.ToDateString(now), Date(now), 'any timestamp becomes `Date(timestamp)`'); + t.end(); + }); + + test('CreateListFromArrayLike', function (t) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { ES.CreateListFromArrayLike(nonObject); }, + TypeError, + debug(nonObject) + ' is not an Object' + ); + }); + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.CreateListFromArrayLike({}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + t.deepEqual( + ES.CreateListFromArrayLike({ length: 2, 0: 'a', 1: 'b', 2: 'c' }), + ['a', 'b'], + 'arraylike stops at the length' + ); + + t.end(); + }); + + test('GetPrototypeFromConstructor', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(nonFunction, '%Array%'); }, + TypeError, + debug(nonFunction) + ' is not a constructor' + ); + }); + + forEach(arrowFns, function (arrowFn) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(arrowFn, '%Array%'); }, + TypeError, + debug(arrowFn) + ' is not a constructor' + ); + }); + + var f = function () {}; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + f.prototype, + 'function with normal `prototype` property returns it' + ); + forEach([true, 'foo', 42], function (truthyPrimitive) { + f.prototype = truthyPrimitive; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + Array.prototype, + 'function with non-object `prototype` property (' + debug(truthyPrimitive) + ') returns default intrinsic' + ); + }); + + t.end(); + }); + + var getNamelessFunction = function () { + var f = Object(function () {}); + try { + delete f.name; + } catch (e) { /**/ } + return f; + }; + + test('SetFunctionName', function (t) { + t.test('non-extensible function', { skip: !Object.preventExtensions }, function (st) { + var f = getNamelessFunction(); + Object.preventExtensions(f); + st['throws']( + function () { ES.SetFunctionName(f, ''); }, + TypeError, + 'throws on a non-extensible function' + ); + st.end(); + }); + + t.test('has an own name property', { skip: !functionsHaveNames }, function (st) { + st['throws']( + function () { ES.SetFunctionName(function g() {}, ''); }, + TypeError, + 'throws if function has an own `name` property' + ); + st.end(); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.SetFunctionName(getNamelessFunction(), nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Symbol or String' + ); + }); + + t.test('symbols', { skip: !v.hasSymbols || has(getNamelessFunction(), 'name') }, function (st) { + var pairs = [ + [Symbol(), ''], + [Symbol(undefined), ''], + [Symbol(null), '[null]'], + [Symbol(''), getInferredName ? '[]' : ''], + [Symbol.iterator, '[Symbol.iterator]'], + [Symbol('foo'), '[foo]'] + ]; + forEach(pairs, function (pair) { + var sym = pair[0]; + var desc = pair[1]; + var f = getNamelessFunction(); + ES.SetFunctionName(f, sym); + st.equal(f.name, desc, debug(sym) + ' yields a name of ' + debug(desc)); + }); + + st.end(); + }); + + var f = getNamelessFunction(); + t.test('when names are configurable', { skip: !functionsHaveConfigurableNames || has(f, 'name') }, function (st) { + // without prefix + st.notEqual(f.name, 'foo', 'precondition'); + ES.SetFunctionName(f, 'foo'); + st.equal(f.name, 'foo', 'function name is set without a prefix'); + + // with prefix + var g = getNamelessFunction(); + st.notEqual(g.name, 'pre- foo', 'precondition'); + ES.SetFunctionName(g, 'foo', 'pre-'); + st.equal(g.name, 'pre- foo', 'function name is set with a prefix'); + + st.end(); + }); + + t.end(); + }); +}; + +var es2016 = function ES2016(ES, ops, expectedMissing, skips) { + es2015(ES, ops, expectedMissing, skips); + + test('SameValueNonNumber', function (t) { + var willThrow = [ + [3, 4], + [NaN, 4], + [4, ''], + ['abc', true], + [{}, false] + ]; + forEach(willThrow, function (nums) { + t['throws'](function () { return ES.SameValueNonNumber.apply(ES, nums); }, TypeError, 'value must be same type and non-number'); + }); + + forEach(v.objects.concat(v.nonNumberPrimitives), function (val) { + t.equal(val === val, ES.SameValueNonNumber(val, val), debug(val) + ' is SameValueNonNumber to itself'); + }); + + t.end(); + }); + + test('IterableToArrayLike', { skip: skips && skips.IterableToArrayLike }, function (t) { + t.test('custom iterables', { skip: !v.hasSymbols }, function (st) { + var O = {}; + O[Symbol.iterator] = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + st.deepEqual( + ES.IterableToArrayLike(O), + [0, 1, 2, 3, 4], + 'Symbol.iterator method is called and values collected' + ); + + st.end(); + }); + + t.deepEqual(ES.IterableToArrayLike('abc'), ['a', 'b', 'c'], 'a string of code units spreads'); + t.deepEqual(ES.IterableToArrayLike('💩'), ['💩'], 'a string of code points spreads'); + t.deepEqual(ES.IterableToArrayLike('a💩c'), ['a', '💩', 'c'], 'a string of code points and units spreads'); + + var arr = [1, 2, 3]; + t.deepEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a similar array'); + t.notEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a different, but similar, array'); + + var O = {}; + t.equal(ES.IterableToArrayLike(O), O, 'a non-iterable non-array non-string object is returned directly'); + + t.end(); + }); + + test('OrdinaryGetPrototypeOf', function (t) { + t.test('values', { skip: !$getProto }, function (st) { + st.equal(ES.OrdinaryGetPrototypeOf([]), Array.prototype, 'array [[Prototype]] is Array.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf({}), Object.prototype, 'object [[Prototype]] is Object.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(/a/g), RegExp.prototype, 'regex [[Prototype]] is RegExp.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object('')), String.prototype, 'boxed string [[Prototype]] is String.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(42)), Number.prototype, 'boxed number [[Prototype]] is Number.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(true)), Boolean.prototype, 'boxed boolean [[Prototype]] is Boolean.prototype'); + if (v.hasSymbols) { + st.equal(ES.OrdinaryGetPrototypeOf(Object(Symbol.iterator)), Symbol.prototype, 'boxed symbol [[Prototype]] is Symbol.prototype'); + } + st.end(); + }); + + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetPrototypeOf(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + t.end(); + }); + + test('OrdinarySetPrototypeOf', { skip: !$getProto || !$setProto }, function (t) { + var a = []; + var proto = {}; + + t.equal(ES.OrdinaryGetPrototypeOf(a), Array.prototype, 'precondition'); + t.equal(ES.OrdinarySetPrototypeOf(a, proto), true, 'setting prototype is successful'); + t.equal(ES.OrdinaryGetPrototypeOf(a), proto, 'postcondition'); + + t.end(); + }); +}; + +var es2017 = function ES2017(ES, ops, expectedMissing, skips) { + es2016(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnNames: true, + IterableToArrayLike: true + })); + + test('ToIndex', function (t) { + t.ok(is(ES.ToIndex(), 0), 'no value gives 0'); + t.ok(is(ES.ToIndex(undefined), 0), 'undefined value gives 0'); + + t['throws'](function () { ES.ToIndex(-1); }, RangeError, 'negative numbers throw'); + + t['throws'](function () { ES.ToIndex(MAX_SAFE_INTEGER + 1); }, RangeError, 'too large numbers throw'); + + t.equal(ES.ToIndex(3), 3, 'numbers work'); + t.equal(ES.ToIndex(v.valueOfOnlyObject), 4, 'coercible objects are coerced'); + + t.end(); + }); + + test('EnumerableOwnProperties', { skip: skips && skips.EnumerableOwnProperties }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnProperties(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IterableToList', function (t) { + var customIterator = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + + t.deepEqual( + ES.IterableToList({}, customIterator), + [0, 1, 2, 3, 4], + 'iterator method is called and values collected' + ); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.deepEqual(ES.IterableToList('abc', String.prototype[Symbol.iterator]), ['a', 'b', 'c'], 'a string of code units spreads'); + st.deepEqual(ES.IterableToList('☃', String.prototype[Symbol.iterator]), ['☃'], 'a string of code points spreads'); + + var arr = [1, 2, 3]; + st.deepEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a similar array'); + st.notEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a different, but similar, array'); + + st.end(); + }); + + t['throws']( + function () { ES.IterableToList({}, void 0); }, + TypeError, + 'non-function iterator method' + ); + + t.end(); + }); +}; + +var es2018 = function ES2018(ES, ops, expectedMissing, skips) { + es2017(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnProperties: true, + GetSubstitution: true, + IsPropertyDescriptor: true + })); + + test('thisSymbolValue', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.thisSymbolValue(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('no native Symbols', { skip: v.hasSymbols }, function (st) { + forEach(v.objects.concat(v.primitives), function (value) { + st['throws']( + function () { ES.thisSymbolValue(value); }, + SyntaxError, + 'Symbols are not supported' + ); + }); + st.end(); + }); + + t.test('symbol values', { skip: !v.hasSymbols }, function (st) { + forEach(v.symbols, function (symbol) { + st.equal(ES.thisSymbolValue(symbol), symbol, 'Symbol value of ' + debug(symbol) + ' is same symbol'); + + st.equal( + ES.thisSymbolValue(Object(symbol)), + symbol, + 'Symbol value of ' + debug(Object(symbol)) + ' is ' + debug(symbol) + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('IsStringPrefix', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.IsStringPrefix(nonString, 'a'); }, + TypeError, + 'first arg: ' + debug(nonString) + ' is not a string' + ); + t['throws']( + function () { ES.IsStringPrefix('a', nonString); }, + TypeError, + 'second arg: ' + debug(nonString) + ' is not a string' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.IsStringPrefix(string, string), true, debug(string) + ' is a prefix of itself'); + + t.equal(ES.IsStringPrefix('', string), true, 'the empty string is a prefix of everything'); + }); + + t.equal(ES.IsStringPrefix('abc', 'abcd'), true, '"abc" is a prefix of "abcd"'); + t.equal(ES.IsStringPrefix('abcd', 'abc'), false, '"abcd" is not a prefix of "abc"'); + + t.equal(ES.IsStringPrefix('a', 'bc'), false, '"a" is not a prefix of "bc"'); + + t.end(); + }); + + test('NumberToString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.NumberToString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.NumberToString(number), String(number), debug(number) + ' stringifies to ' + number); + }); + + t.end(); + }); + + test('CopyDataProperties', function (t) { + t.test('first argument: target', function (st) { + forEach(v.primitives, function (primitive) { + st['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + st.end(); + }); + + t.test('second argument: source', function (st) { + var frozenTarget = Object.freeze ? Object.freeze({}) : {}; + forEach(v.nullPrimitives, function (nullish) { + st.equal( + ES.CopyDataProperties(frozenTarget, nullish, []), + frozenTarget, + debug(nullish) + ' "source" yields identical, unmodified target' + ); + }); + + forEach(v.nonNullPrimitives, function (objectCoercible) { + var target = {}; + var result = ES.CopyDataProperties(target, objectCoercible, []); + st.equal(result, target, 'result === target'); + st.deepEqual(keys(result), keys(Object(objectCoercible)), 'target ends up with keys of ' + debug(objectCoercible)); + }); + + st.test('enumerable accessor property', { skip: !defineProperty.oDP }, function (s2t) { + var target = {}; + var source = {}; + defineProperty(source, 'a', { + enumerable: true, + get: function () { return 42; } + }); + var result = ES.CopyDataProperties(target, source, []); + s2t.equal(result, target, 'result === target'); + s2t.deepEqual(result, { a: 42 }, 'target ends up with enumerable accessor of source'); + s2t.end(); + }); + + st.end(); + }); + + t.test('third argument: excludedItems', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, [nonPropertyKey]); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + var result = ES.CopyDataProperties({}, { a: 1, b: 2, c: 3 }, ['b']); + st.deepEqual(keys(result).sort(), ['a', 'c'].sort(), 'excluded string keys are excluded'); + + st.test('excluding symbols', { skip: !v.hasSymbols }, function (s2t) { + var source = {}; + forEach(v.symbols, function (symbol) { + source[symbol] = true; + }); + + var includedSymbols = v.symbols.slice(1); + var excludedSymbols = v.symbols.slice(0, 1); + var target = ES.CopyDataProperties({}, source, excludedSymbols); + + forEach(includedSymbols, function (symbol) { + s2t.equal(has(target, symbol), true, debug(symbol) + ' is included'); + }); + + forEach(excludedSymbols, function (symbol) { + s2t.equal(has(target, symbol), false, debug(symbol) + ' is excluded'); + }); + + s2t.end(); + }); + + st.end(); + }); + + t.end(); + }); + + test('PromiseResolve', function (t) { + t.test('Promises unsupported', { skip: typeof Promise === 'function' }, function (st) { + st['throws']( + function () { ES.PromiseResolve(); }, + SyntaxError, + 'Promises are not supported' + ); + st.end(); + }); + + t.test('Promises supported', { skip: typeof Promise !== 'function' }, function (st) { + st.plan(2); + + var a = {}; + var b = {}; + var fulfilled = Promise.resolve(a); + var rejected = Promise.reject(b); + + ES.PromiseResolve(Promise, fulfilled).then(function (x) { + st.equal(x, a, 'fulfilled promise resolves to fulfilled'); + }); + + ES.PromiseResolve(Promise, rejected)['catch'](function (e) { + st.equal(e, b, 'rejected promise resolves to rejected'); + }); + }); + + t.end(); + }); + + test('EnumerableOwnPropertyNames', { skip: skips && skips.EnumerableOwnPropertyNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnPropertyNames(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IsPromise', { skip: typeof Promise !== 'function' }, function (t) { + forEach(v.objects.concat(v.primitives), function (nonPromise) { + t.equal(ES.IsPromise(nonPromise), false, debug(nonPromise) + ' is not a Promise'); + }); + + var thenable = { then: Promise.prototype.then }; + t.equal(ES.IsPromise(thenable), false, 'generic thenable is not a Promise'); + + t.equal(ES.IsPromise(Promise.resolve()), true, 'Promise is a Promise'); + + t.end(); + }); + + test('GetSubstitution (ES2018+)', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], undefined, ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], undefined, ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], undefined, nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], undefined, ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], undefined, ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, undefined, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], undefined, ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('DateString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.DateString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + t.equal(ES.DateString(Date.UTC(2019, 8, 10, 7, 8, 9)), 'Tue Sep 10 2019'); + t.equal(ES.DateString(Date.UTC(2016, 1, 29, 7, 8, 9)), 'Mon Feb 29 2016'); // leap day + t.end(); + }); + + test('TimeString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.TimeString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + var tv = Date.UTC(2019, 8, 10, 7, 8, 9); + t.equal(ES.TimeString(tv), '07:08:09 GMT'); + t.end(); + }); +}; + +var es2019 = function ES2018(ES, ops, expectedMissing, skips) { + es2018(ES, ops, expectedMissing, assign({}, skips, { + })); + + test('AddEntriesFromIterable', function (t) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, undefined, function () {}); }, + TypeError, + 'iterable must not be undefined' + ); + t['throws']( + function () { ES.AddEntriesFromIterable({}, null, function () {}); }, + TypeError, + 'iterable must not be null' + ); + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, {}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.plan(4); + + var O = {}; + st.equal(ES.AddEntriesFromIterable(O, [], function () {}), O, 'returns the target'); + + var adder = function (key, value) { + st.equal(this, O, 'adder gets proper receiver'); + st.equal(key, 0, 'k is key'); + st.equal(value, 'a', 'v is value'); + }; + ES.AddEntriesFromIterable(O, ['a'].entries(), adder); + + st.end(); + }); + + t.end(); + }); + + test('FlattenIntoArray', function (t) { + t.test('no mapper function', function (st) { + var testDepth = function testDepth(tt, depth, expected) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, depth); + tt.deepEqual(a, expected, 'depth: ' + depth); + }; + + testDepth(st, 1, [1, 2, [3], 4, [[[5]]]]); + testDepth(st, 2, [1, 2, 3, 4, [[5]]]); + testDepth(st, 3, [1, 2, 3, 4, [5]]); + testDepth(st, 4, [1, 2, 3, 4, 5]); + testDepth(st, Infinity, [1, 2, 3, 4, 5]); + st.end(); + }); + + t.test('mapper function', function (st) { + var testMapper = function testMapper(tt, mapper, expected, thisArg) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, 1, mapper, thisArg); + tt.deepEqual(a, expected); + }; + + var double = function double(x) { + return typeof x === 'number' ? 2 * x : x; + }; + testMapper( + st, + double, + [1, 4, [3], 8, [[[5]]]] + ); + var receiver = hasStrictMode ? 42 : Object(42); + testMapper( + st, + function (x) { return [this, double(x)]; }, + [receiver, [1], receiver, 4, receiver, [[3]], receiver, [], receiver, 8, receiver, [[[[5]]]]], + 42 + ); + st.end(); + }); + + t.end(); + }); + + test('TrimString', function (t) { + t.test('non-object string', function (st) { + forEach(v.nullPrimitives, function (nullish) { + st['throws']( + function () { ES.TrimString(nullish); }, + debug(nullish) + ' is not an Object' + ); + }); + st.end(); + }); + + var string = ' \n abc \n '; + t.equal(ES.TrimString(string, 'start'), string.slice(string.indexOf('a'))); + t.equal(ES.TrimString(string, 'end'), string.slice(0, string.lastIndexOf('c') + 1)); + t.equal(ES.TrimString(string, 'start+end'), string.slice(string.indexOf('a'), string.lastIndexOf('c') + 1)); + + t.end(); + }); +}; + +module.exports = { + es2015: es2015, + es2016: es2016, + es2017: es2017, + es2018: es2018, + es2019: es2019 +}; diff --git a/node_modules/object.entries/package.json b/node_modules/object.entries/package.json new file mode 100644 index 0000000..9d9d8da --- /dev/null +++ b/node_modules/object.entries/package.json @@ -0,0 +1,129 @@ +{ + "_from": "object.entries@^1.1.2", + "_id": "object.entries@1.1.2", + "_inBundle": false, + "_integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", + "_location": "/object.entries", + "_phantomChildren": { + "es-to-primitive": "1.2.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "has-symbols": "1.0.1", + "is-callable": "1.2.2", + "is-regex": "1.1.1", + "object-inspect": "1.8.0", + "object-keys": "1.1.1", + "object.assign": "4.1.1", + "string.prototype.trimend": "1.0.1", + "string.prototype.trimstart": "1.0.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "object.entries@^1.1.2", + "name": "object.entries", + "escapedName": "object.entries", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/eslint-config-airbnb-base" + ], + "_resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", + "_shasum": "bc73f00acb6b6bb16c203434b10f9a7e797d3add", + "_spec": "object.entries@^1.1.2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-config-airbnb-base", + "author": { + "name": "Jordan Harband" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/es-shims/Object.entries/issues" + }, + "bundleDependencies": false, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "has": "^1.0.3" + }, + "deprecated": false, + "description": "ES2017 spec-compliant Object.entries shim.", + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^17.1.0", + "array-map": "^0.0.0", + "aud": "^1.1.2", + "auto-changelog": "^2.0.0", + "covert": "^1.1.1", + "eslint": "^7.0.0", + "functions-have-names": "^1.2.1", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "homepage": "https://github.com/es-shims/Object.entries#readme", + "keywords": [ + "Object.entries", + "Object.values", + "Object.keys", + "entries", + "values", + "ES7", + "ES8", + "ES2017", + "shim", + "object", + "keys", + "polyfill", + "es-shim API" + ], + "license": "MIT", + "main": "index.js", + "name": "object.entries", + "repository": { + "type": "git", + "url": "git://github.com/es-shims/Object.entries.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "lint": "eslint .", + "posttest": "npx aud --production", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run --silent lint", + "preversion": "auto-changelog", + "test": "npm run --silent tests-only", + "test:module": "node test/index", + "test:shimmed": "node test/shimmed", + "tests-only": "es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/9.0..latest", + "firefox/4.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/11.6..latest", + "opera/next", + "safari/5.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.1.2" +} diff --git a/node_modules/object.entries/polyfill.js b/node_modules/object.entries/polyfill.js new file mode 100644 index 0000000..32e3238 --- /dev/null +++ b/node_modules/object.entries/polyfill.js @@ -0,0 +1,7 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = function getPolyfill() { + return typeof Object.entries === 'function' ? Object.entries : implementation; +}; diff --git a/node_modules/object.entries/shim.js b/node_modules/object.entries/shim.js new file mode 100644 index 0000000..135defe --- /dev/null +++ b/node_modules/object.entries/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var getPolyfill = require('./polyfill'); +var define = require('define-properties'); + +module.exports = function shimEntries() { + var polyfill = getPolyfill(); + define(Object, { entries: polyfill }, { + entries: function testEntries() { + return Object.entries !== polyfill; + } + }); + return polyfill; +}; diff --git a/node_modules/object.entries/test/.eslintrc b/node_modules/object.entries/test/.eslintrc new file mode 100644 index 0000000..5bddce7 --- /dev/null +++ b/node_modules/object.entries/test/.eslintrc @@ -0,0 +1,11 @@ +{ + "rules": { + "array-bracket-newline": 0, + "max-lines-per-function": 0, + "max-nested-callbacks": [2, 3], + "max-statements": [2, 12], + "max-statements-per-line": [2, { "max": 3 }], + "no-invalid-this": [1], + "object-curly-newline": 0, + } +} diff --git a/node_modules/object.entries/test/index.js b/node_modules/object.entries/test/index.js new file mode 100644 index 0000000..1859a3f --- /dev/null +++ b/node_modules/object.entries/test/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var entries = require('../'); +var test = require('tape'); +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('bad array/this value', function (st) { + st['throws'](function () { entries(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { entries(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(entries, t); + + t.end(); +}); diff --git a/node_modules/object.entries/test/shimmed.js b/node_modules/object.entries/test/shimmed.js new file mode 100644 index 0000000..29bd7f0 --- /dev/null +++ b/node_modules/object.entries/test/shimmed.js @@ -0,0 +1,36 @@ +'use strict'; + +var entries = require('../'); +entries.shim(); + +var test = require('tape'); +var defineProperties = require('define-properties'); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names'); + +var runTests = require('./tests'); + +test('shimmed', function (t) { + t.equal(Object.entries.length, 1, 'Object.entries has a length of 1'); + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Object.entries.name, 'entries', 'Object.entries has name "entries"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Object, 'entries'), 'Object.entries is not enumerable'); + et.end(); + }); + + var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); + + t.test('bad object value', { skip: !supportsStrictMode }, function (st) { + st['throws'](function () { return Object.entries(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Object.entries(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(Object.entries, t); + + t.end(); +}); diff --git a/node_modules/object.entries/test/tests.js b/node_modules/object.entries/test/tests.js new file mode 100644 index 0000000..7925e47 --- /dev/null +++ b/node_modules/object.entries/test/tests.js @@ -0,0 +1,82 @@ +'use strict'; + +var keys = require('object-keys'); +var map = require('array-map'); +var define = require('define-properties'); + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +module.exports = function (entries, t) { + var a = {}; + var b = {}; + var c = {}; + var obj = { a: a, b: b, c: c }; + + t.deepEqual(entries(obj), [['a', a], ['b', b], ['c', c]], 'basic support'); + t.deepEqual(entries({ a: a, b: a, c: c }), [['a', a], ['b', a], ['c', c]], 'duplicate entries are included'); + + t.test('entries are in the same order as keys', function (st) { + var object = { a: a, b: b }; + object[0] = 3; + object.c = c; + object[1] = 4; + delete object[0]; + var objKeys = keys(object); + var objEntries = map(objKeys, function (key) { + return [key, object[key]]; + }); + st.deepEqual(entries(object), objEntries, 'entries match key order'); + st.end(); + }); + + t.test('non-enumerable properties are omitted', { skip: !Object.defineProperty }, function (st) { + var object = { a: a, b: b }; + Object.defineProperty(object, 'c', { enumerable: false, value: c }); + st.deepEqual(entries(object), [['a', a], ['b', b]], 'non-enumerable property‘s value is omitted'); + st.end(); + }); + + t.test('inherited properties are omitted', function (st) { + var F = function G() {}; + F.prototype.a = a; + var f = new F(); + f.b = b; + st.deepEqual(entries(f), [['b', b]], 'only own properties are included'); + st.end(); + }); + + t.test('Symbol properties are omitted', { skip: !hasSymbols }, function (st) { + var object = { a: a, b: b, c: c }; + var enumSym = Symbol('enum'); + var nonEnumSym = Symbol('non enum'); + object[enumSym] = enumSym; + object.d = enumSym; + Object.defineProperty(object, nonEnumSym, { enumerable: false, value: nonEnumSym }); + st.deepEqual(entries(object), [['a', a], ['b', b], ['c', c], ['d', enumSym]], 'symbol properties are omitted'); + st.end(); + }); + + t.test('not-yet-visited keys deleted on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) { + var o = { a: 1, b: 2, c: 3 }; + Object.defineProperty(o, 'a', { + get: function () { + delete this.b; + return 1; + } + }); + st.deepEqual(entries(o), [['a', 1], ['c', 3]], 'when "b" is deleted prior to being visited, it should not show up'); + st.end(); + }); + + t.test('not-yet-visited keys made non-enumerable on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) { + var o = { a: 'A', b: 'B' }; + Object.defineProperty(o, 'a', { + get: function () { + Object.defineProperty(o, 'b', { enumerable: false }); + return 'A'; + } + }); + st.deepEqual(entries(o), [['a', 'A']], 'when "b" is made non-enumerable prior to being visited, it should not show up'); + st.end(); + }); +}; diff --git a/node_modules/object.values/.eslintrc b/node_modules/object.values/.eslintrc new file mode 100644 index 0000000..15c95c1 --- /dev/null +++ b/node_modules/object.values/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "new-cap": [2, { "capIsNewExceptions": ["RequireObjectCoercible"] }], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"] + } +} diff --git a/node_modules/object.values/.github/workflows/rebase.yml b/node_modules/object.values/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/object.values/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object.values/.travis.yml b/node_modules/object.values/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/object.values/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/object.values/CHANGELOG.md b/node_modules/object.values/CHANGELOG.md new file mode 100644 index 0000000..475358f --- /dev/null +++ b/node_modules/object.values/CHANGELOG.md @@ -0,0 +1,44 @@ +1.1.1 / 2019-12-12 +================= + * [Refactor] use split-up `es-abstract` (85% bundle size decrease) + * [Deps] update `es-abstract` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names`, `tape`, `object-keys` + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + * [Tests] use shared travis-ci configs + * [Tests] use `functions-have-names` + * [meta] add `funding` field + * [actions] add automatic rebasing / merge commit blocking + +1.1.0 / 2019-01-01 +================= + * [New] add `auto` entry point` + * [Deps] update `define-properties`, `es-abstract`, `function-bind`, `has` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` + * [Tests] up to `node` `v11.6`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.16`, `v4.9`; use `nvm install-latest-npm` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + +1.0.4 / 2016-12-04 +================= + * [Docs] update to reflect ES2017 inclusion + * [Deps] update `es-abstract`, `function-bind`, `define-properties` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Tests] up to `node` `v7.2`, `v6.9`, `v4.6`; improve test matrix. + +1.0.3 / 2015-10-06 +================= + * [Fix] Not-yet-visited keys made non-enumerable on a `[[Get]]` must not show up in the output (https://github.com/ljharb/proposal-object-values-entries/issues/5) + +1.0.2 / 2015-09-25 +================= + * [Fix] Not-yet-visited keys deleted on a `[[Get]]` must not show up in the output (#1) + +1.0.1 / 2015-09-21 +================= + * [Docs] update version badge URL + * [Tests] on `io.js` `v3.3`, up to `node` `v4.1` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + +1.0.0 / 2015-09-02 +================= + * v1.0.0 diff --git a/node_modules/object.values/LICENSE b/node_modules/object.values/LICENSE new file mode 100644 index 0000000..b43df44 --- /dev/null +++ b/node_modules/object.values/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/object.values/README.md b/node_modules/object.values/README.md new file mode 100644 index 0000000..17fcf07 --- /dev/null +++ b/node_modules/object.values/README.md @@ -0,0 +1,59 @@ +# object.values [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +An ES2017 spec-compliant `Object.values` shim. Invoke its "shim" method to shim `Object.values` if it is unavailable or noncompliant. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.github.io/ecma262/#sec-object.values). + +Most common usage: +```js +var assert = require('assert'); +var values = require('object.values'); + +var obj = { a: 1, b: 2, c: 3 }; +var expected = [1, 2, 3]; + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + // for environments with Symbol support + var sym = Symbol(); + obj[sym] = 4; + obj.d = sym; + expected.push(sym); +} + +assert.deepEqual(values(obj), expected); + +if (!Object.values) { + values.shim(); +} + +assert.deepEqual(Object.values(obj), expected); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.com/package/object.values +[npm-version-svg]: http://versionbadg.es/es-shims/Object.values.svg +[travis-svg]: https://travis-ci.org/es-shims/Object.values.svg +[travis-url]: https://travis-ci.org/es-shims/Object.values +[deps-svg]: https://david-dm.org/es-shims/Object.values.svg +[deps-url]: https://david-dm.org/es-shims/Object.values +[dev-deps-svg]: https://david-dm.org/es-shims/Object.values/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/Object.values#info=devDependencies +[testling-svg]: https://ci.testling.com/es-shims/Object.values.png +[testling-url]: https://ci.testling.com/es-shims/Object.values +[npm-badge-png]: https://nodei.co/npm/object.values.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/object.values.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/object.values.svg +[downloads-url]: http://npm-stat.com/charts.html?package=object.values diff --git a/node_modules/object.values/auto.js b/node_modules/object.values/auto.js new file mode 100644 index 0000000..8ebf606 --- /dev/null +++ b/node_modules/object.values/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/object.values/implementation.js b/node_modules/object.values/implementation.js new file mode 100644 index 0000000..dd3bc07 --- /dev/null +++ b/node_modules/object.values/implementation.js @@ -0,0 +1,18 @@ +'use strict'; + +var has = require('has'); +var RequireObjectCoercible = require('es-abstract/2019/RequireObjectCoercible'); +var callBound = require('es-abstract/helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +module.exports = function values(O) { + var obj = RequireObjectCoercible(O); + var vals = []; + for (var key in obj) { + if (has(obj, key) && $isEnumerable(obj, key)) { + vals.push(obj[key]); + } + } + return vals; +}; diff --git a/node_modules/object.values/index.js b/node_modules/object.values/index.js new file mode 100644 index 0000000..b8ba091 --- /dev/null +++ b/node_modules/object.values/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var define = require('define-properties'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var polyfill = getPolyfill(); + +define(polyfill, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = polyfill; diff --git a/node_modules/object.values/node_modules/es-abstract/.editorconfig b/node_modules/object.values/node_modules/es-abstract/.editorconfig new file mode 100644 index 0000000..eaa2141 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/object.values/node_modules/es-abstract/.eslintignore b/node_modules/object.values/node_modules/es-abstract/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/node_modules/object.values/node_modules/es-abstract/.eslintrc b/node_modules/object.values/node_modules/es-abstract/.eslintrc new file mode 100644 index 0000000..1bac5b7 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.eslintrc @@ -0,0 +1,66 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + }, + + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 4], + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "new-cap": 0, + "no-extra-parens": 1, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "operations/*", + "rules": { + "max-lines": 0, + }, + }, + { + "files": "operations/*.js", + "parserOptions": { + "ecmaVersion": 2020, + }, + "rules": { + "no-console": 0, + "no-multi-str": 0, + }, + }, + { + "files": "operations/getOps.js", + "rules": { + "no-console": 0, + "no-process-exit": 0, + }, + }, + { + "files": "test/**", + "rules": { + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": 0, + "max-statements-per-line": [2, { "max": 3 }], + "max-statements": 0, + "no-implicit-coercion": 0, + "no-invalid-this": 1, + "object-curly-newline": 0, + "prefer-regex-literals": 0, + }, + }, + ], +} diff --git a/node_modules/object.values/node_modules/es-abstract/.gitattributes b/node_modules/object.values/node_modules/es-abstract/.gitattributes new file mode 100644 index 0000000..0b600dc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.gitattributes @@ -0,0 +1,472 @@ +2015/AbstractRelationalComparison.js spackled linguist-generated=true +2015/DateFromTime.js spackled linguist-generated=true +2015/Day.js spackled linguist-generated=true +2015/DayFromYear.js spackled linguist-generated=true +2015/DayWithinYear.js spackled linguist-generated=true +2015/DaysInYear.js spackled linguist-generated=true +2015/HourFromTime.js spackled linguist-generated=true +2015/InLeapYear.js spackled linguist-generated=true +2015/IsCallable.js spackled linguist-generated=true +2015/IsPropertyDescriptor.js spackled linguist-generated=true +2015/MakeDate.js spackled linguist-generated=true +2015/MakeDay.js spackled linguist-generated=true +2015/MakeTime.js spackled linguist-generated=true +2015/MinFromTime.js spackled linguist-generated=true +2015/MonthFromTime.js spackled linguist-generated=true +2015/SameValue.js spackled linguist-generated=true +2015/SecFromTime.js spackled linguist-generated=true +2015/StrictEqualityComparison.js spackled linguist-generated=true +2015/TimeClip.js spackled linguist-generated=true +2015/TimeFromYear.js spackled linguist-generated=true +2015/TimeWithinDay.js spackled linguist-generated=true +2015/ToBoolean.js spackled linguist-generated=true +2015/ToInt32.js spackled linguist-generated=true +2015/ToPropertyDescriptor.js spackled linguist-generated=true +2015/ToUint16.js spackled linguist-generated=true +2015/ToUint32.js spackled linguist-generated=true +2015/WeekDay.js spackled linguist-generated=true +2015/YearFromTime.js spackled linguist-generated=true +2015/modulo.js spackled linguist-generated=true +2015/msFromTime.js spackled linguist-generated=true +2016/AbstractEqualityComparison.js spackled linguist-generated=true +2016/AbstractRelationalComparison.js spackled linguist-generated=true +2016/AdvanceStringIndex.js spackled linguist-generated=true +2016/ArrayCreate.js spackled linguist-generated=true +2016/ArraySetLength.js spackled linguist-generated=true +2016/ArraySpeciesCreate.js spackled linguist-generated=true +2016/Call.js spackled linguist-generated=true +2016/CanonicalNumericIndexString.js spackled linguist-generated=true +2016/CompletePropertyDescriptor.js spackled linguist-generated=true +2016/CreateDataProperty.js spackled linguist-generated=true +2016/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2016/CreateHTML.js spackled linguist-generated=true +2016/CreateIterResultObject.js spackled linguist-generated=true +2016/CreateListFromArrayLike.js spackled linguist-generated=true +2016/CreateMethodProperty.js spackled linguist-generated=true +2016/DateFromTime.js spackled linguist-generated=true +2016/Day.js spackled linguist-generated=true +2016/DayFromYear.js spackled linguist-generated=true +2016/DayWithinYear.js spackled linguist-generated=true +2016/DaysInYear.js spackled linguist-generated=true +2016/DefinePropertyOrThrow.js spackled linguist-generated=true +2016/DeletePropertyOrThrow.js spackled linguist-generated=true +2016/EnumerableOwnNames.js spackled linguist-generated=true +2016/FromPropertyDescriptor.js spackled linguist-generated=true +2016/Get.js spackled linguist-generated=true +2016/GetIterator.js spackled linguist-generated=true +2016/GetMethod.js spackled linguist-generated=true +2016/GetOwnPropertyKeys.js spackled linguist-generated=true +2016/GetPrototypeFromConstructor.js spackled linguist-generated=true +2016/GetSubstitution.js spackled linguist-generated=true +2016/GetV.js spackled linguist-generated=true +2016/HasOwnProperty.js spackled linguist-generated=true +2016/HasProperty.js spackled linguist-generated=true +2016/HourFromTime.js spackled linguist-generated=true +2016/InLeapYear.js spackled linguist-generated=true +2016/InstanceofOperator.js spackled linguist-generated=true +2016/Invoke.js spackled linguist-generated=true +2016/IsAccessorDescriptor.js spackled linguist-generated=true +2016/IsArray.js spackled linguist-generated=true +2016/IsCallable.js spackled linguist-generated=true +2016/IsConcatSpreadable.js spackled linguist-generated=true +2016/IsConstructor.js spackled linguist-generated=true +2016/IsDataDescriptor.js spackled linguist-generated=true +2016/IsExtensible.js spackled linguist-generated=true +2016/IsGenericDescriptor.js spackled linguist-generated=true +2016/IsInteger.js spackled linguist-generated=true +2016/IsPromise.js spackled linguist-generated=true +2016/IsPropertyDescriptor.js spackled linguist-generated=true +2016/IsPropertyKey.js spackled linguist-generated=true +2016/IsRegExp.js spackled linguist-generated=true +2016/IteratorClose.js spackled linguist-generated=true +2016/IteratorComplete.js spackled linguist-generated=true +2016/IteratorNext.js spackled linguist-generated=true +2016/IteratorStep.js spackled linguist-generated=true +2016/IteratorValue.js spackled linguist-generated=true +2016/MakeDate.js spackled linguist-generated=true +2016/MakeDay.js spackled linguist-generated=true +2016/MakeTime.js spackled linguist-generated=true +2016/MinFromTime.js spackled linguist-generated=true +2016/MonthFromTime.js spackled linguist-generated=true +2016/ObjectCreate.js spackled linguist-generated=true +2016/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2016/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2016/OrdinaryHasInstance.js spackled linguist-generated=true +2016/OrdinaryHasProperty.js spackled linguist-generated=true +2016/RegExpExec.js spackled linguist-generated=true +2016/RequireObjectCoercible.js spackled linguist-generated=true +2016/SameValue.js spackled linguist-generated=true +2016/SameValueZero.js spackled linguist-generated=true +2016/SecFromTime.js spackled linguist-generated=true +2016/Set.js spackled linguist-generated=true +2016/SetFunctionName.js spackled linguist-generated=true +2016/SetIntegrityLevel.js spackled linguist-generated=true +2016/SpeciesConstructor.js spackled linguist-generated=true +2016/StrictEqualityComparison.js spackled linguist-generated=true +2016/SymbolDescriptiveString.js spackled linguist-generated=true +2016/TestIntegrityLevel.js spackled linguist-generated=true +2016/TimeClip.js spackled linguist-generated=true +2016/TimeFromYear.js spackled linguist-generated=true +2016/TimeWithinDay.js spackled linguist-generated=true +2016/ToBoolean.js spackled linguist-generated=true +2016/ToDateString.js spackled linguist-generated=true +2016/ToInt16.js spackled linguist-generated=true +2016/ToInt32.js spackled linguist-generated=true +2016/ToInt8.js spackled linguist-generated=true +2016/ToInteger.js spackled linguist-generated=true +2016/ToLength.js spackled linguist-generated=true +2016/ToNumber.js spackled linguist-generated=true +2016/ToObject.js spackled linguist-generated=true +2016/ToPrimitive.js spackled linguist-generated=true +2016/ToPropertyDescriptor.js spackled linguist-generated=true +2016/ToPropertyKey.js spackled linguist-generated=true +2016/ToString.js spackled linguist-generated=true +2016/ToUint16.js spackled linguist-generated=true +2016/ToUint32.js spackled linguist-generated=true +2016/ToUint8.js spackled linguist-generated=true +2016/ToUint8Clamp.js spackled linguist-generated=true +2016/Type.js spackled linguist-generated=true +2016/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2016/WeekDay.js spackled linguist-generated=true +2016/YearFromTime.js spackled linguist-generated=true +2016/modulo.js spackled linguist-generated=true +2016/msFromTime.js spackled linguist-generated=true +2016/thisBooleanValue.js spackled linguist-generated=true +2016/thisNumberValue.js spackled linguist-generated=true +2016/thisStringValue.js spackled linguist-generated=true +2016/thisTimeValue.js spackled linguist-generated=true +2017/AbstractEqualityComparison.js spackled linguist-generated=true +2017/AbstractRelationalComparison.js spackled linguist-generated=true +2017/AdvanceStringIndex.js spackled linguist-generated=true +2017/ArrayCreate.js spackled linguist-generated=true +2017/ArraySetLength.js spackled linguist-generated=true +2017/ArraySpeciesCreate.js spackled linguist-generated=true +2017/Call.js spackled linguist-generated=true +2017/CanonicalNumericIndexString.js spackled linguist-generated=true +2017/CompletePropertyDescriptor.js spackled linguist-generated=true +2017/CreateDataProperty.js spackled linguist-generated=true +2017/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2017/CreateHTML.js spackled linguist-generated=true +2017/CreateIterResultObject.js spackled linguist-generated=true +2017/CreateListFromArrayLike.js spackled linguist-generated=true +2017/CreateMethodProperty.js spackled linguist-generated=true +2017/DateFromTime.js spackled linguist-generated=true +2017/Day.js spackled linguist-generated=true +2017/DayFromYear.js spackled linguist-generated=true +2017/DayWithinYear.js spackled linguist-generated=true +2017/DaysInYear.js spackled linguist-generated=true +2017/DefinePropertyOrThrow.js spackled linguist-generated=true +2017/DeletePropertyOrThrow.js spackled linguist-generated=true +2017/FromPropertyDescriptor.js spackled linguist-generated=true +2017/Get.js spackled linguist-generated=true +2017/GetIterator.js spackled linguist-generated=true +2017/GetMethod.js spackled linguist-generated=true +2017/GetOwnPropertyKeys.js spackled linguist-generated=true +2017/GetPrototypeFromConstructor.js spackled linguist-generated=true +2017/GetSubstitution.js spackled linguist-generated=true +2017/GetV.js spackled linguist-generated=true +2017/HasOwnProperty.js spackled linguist-generated=true +2017/HasProperty.js spackled linguist-generated=true +2017/HourFromTime.js spackled linguist-generated=true +2017/InLeapYear.js spackled linguist-generated=true +2017/InstanceofOperator.js spackled linguist-generated=true +2017/Invoke.js spackled linguist-generated=true +2017/IsAccessorDescriptor.js spackled linguist-generated=true +2017/IsArray.js spackled linguist-generated=true +2017/IsCallable.js spackled linguist-generated=true +2017/IsConcatSpreadable.js spackled linguist-generated=true +2017/IsConstructor.js spackled linguist-generated=true +2017/IsDataDescriptor.js spackled linguist-generated=true +2017/IsExtensible.js spackled linguist-generated=true +2017/IsGenericDescriptor.js spackled linguist-generated=true +2017/IsInteger.js spackled linguist-generated=true +2017/IsPromise.js spackled linguist-generated=true +2017/IsPropertyDescriptor.js spackled linguist-generated=true +2017/IsPropertyKey.js spackled linguist-generated=true +2017/IsRegExp.js spackled linguist-generated=true +2017/IteratorClose.js spackled linguist-generated=true +2017/IteratorComplete.js spackled linguist-generated=true +2017/IteratorNext.js spackled linguist-generated=true +2017/IteratorStep.js spackled linguist-generated=true +2017/IteratorValue.js spackled linguist-generated=true +2017/MakeDate.js spackled linguist-generated=true +2017/MakeDay.js spackled linguist-generated=true +2017/MakeTime.js spackled linguist-generated=true +2017/MinFromTime.js spackled linguist-generated=true +2017/MonthFromTime.js spackled linguist-generated=true +2017/ObjectCreate.js spackled linguist-generated=true +2017/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2017/OrdinaryHasInstance.js spackled linguist-generated=true +2017/OrdinaryHasProperty.js spackled linguist-generated=true +2017/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2017/RegExpExec.js spackled linguist-generated=true +2017/RequireObjectCoercible.js spackled linguist-generated=true +2017/SameValue.js spackled linguist-generated=true +2017/SameValueNonNumber.js spackled linguist-generated=true +2017/SameValueZero.js spackled linguist-generated=true +2017/SecFromTime.js spackled linguist-generated=true +2017/Set.js spackled linguist-generated=true +2017/SetFunctionName.js spackled linguist-generated=true +2017/SetIntegrityLevel.js spackled linguist-generated=true +2017/SpeciesConstructor.js spackled linguist-generated=true +2017/StrictEqualityComparison.js spackled linguist-generated=true +2017/SymbolDescriptiveString.js spackled linguist-generated=true +2017/TestIntegrityLevel.js spackled linguist-generated=true +2017/TimeClip.js spackled linguist-generated=true +2017/TimeFromYear.js spackled linguist-generated=true +2017/TimeWithinDay.js spackled linguist-generated=true +2017/ToBoolean.js spackled linguist-generated=true +2017/ToDateString.js spackled linguist-generated=true +2017/ToInt16.js spackled linguist-generated=true +2017/ToInt32.js spackled linguist-generated=true +2017/ToInt8.js spackled linguist-generated=true +2017/ToInteger.js spackled linguist-generated=true +2017/ToLength.js spackled linguist-generated=true +2017/ToNumber.js spackled linguist-generated=true +2017/ToObject.js spackled linguist-generated=true +2017/ToPrimitive.js spackled linguist-generated=true +2017/ToPropertyDescriptor.js spackled linguist-generated=true +2017/ToPropertyKey.js spackled linguist-generated=true +2017/ToString.js spackled linguist-generated=true +2017/ToUint16.js spackled linguist-generated=true +2017/ToUint32.js spackled linguist-generated=true +2017/ToUint8.js spackled linguist-generated=true +2017/ToUint8Clamp.js spackled linguist-generated=true +2017/Type.js spackled linguist-generated=true +2017/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2017/WeekDay.js spackled linguist-generated=true +2017/YearFromTime.js spackled linguist-generated=true +2017/modulo.js spackled linguist-generated=true +2017/msFromTime.js spackled linguist-generated=true +2017/thisBooleanValue.js spackled linguist-generated=true +2017/thisNumberValue.js spackled linguist-generated=true +2017/thisStringValue.js spackled linguist-generated=true +2017/thisTimeValue.js spackled linguist-generated=true +2018/AbstractEqualityComparison.js spackled linguist-generated=true +2018/AbstractRelationalComparison.js spackled linguist-generated=true +2018/AdvanceStringIndex.js spackled linguist-generated=true +2018/ArrayCreate.js spackled linguist-generated=true +2018/ArraySetLength.js spackled linguist-generated=true +2018/ArraySpeciesCreate.js spackled linguist-generated=true +2018/Call.js spackled linguist-generated=true +2018/CanonicalNumericIndexString.js spackled linguist-generated=true +2018/CompletePropertyDescriptor.js spackled linguist-generated=true +2018/CreateDataProperty.js spackled linguist-generated=true +2018/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2018/CreateHTML.js spackled linguist-generated=true +2018/CreateIterResultObject.js spackled linguist-generated=true +2018/CreateListFromArrayLike.js spackled linguist-generated=true +2018/CreateMethodProperty.js spackled linguist-generated=true +2018/DateFromTime.js spackled linguist-generated=true +2018/Day.js spackled linguist-generated=true +2018/DayFromYear.js spackled linguist-generated=true +2018/DayWithinYear.js spackled linguist-generated=true +2018/DaysInYear.js spackled linguist-generated=true +2018/DefinePropertyOrThrow.js spackled linguist-generated=true +2018/DeletePropertyOrThrow.js spackled linguist-generated=true +2018/FromPropertyDescriptor.js spackled linguist-generated=true +2018/Get.js spackled linguist-generated=true +2018/GetIterator.js spackled linguist-generated=true +2018/GetMethod.js spackled linguist-generated=true +2018/GetOwnPropertyKeys.js spackled linguist-generated=true +2018/GetPrototypeFromConstructor.js spackled linguist-generated=true +2018/GetV.js spackled linguist-generated=true +2018/HasOwnProperty.js spackled linguist-generated=true +2018/HasProperty.js spackled linguist-generated=true +2018/HourFromTime.js spackled linguist-generated=true +2018/InLeapYear.js spackled linguist-generated=true +2018/InstanceofOperator.js spackled linguist-generated=true +2018/Invoke.js spackled linguist-generated=true +2018/IsAccessorDescriptor.js spackled linguist-generated=true +2018/IsArray.js spackled linguist-generated=true +2018/IsCallable.js spackled linguist-generated=true +2018/IsConcatSpreadable.js spackled linguist-generated=true +2018/IsConstructor.js spackled linguist-generated=true +2018/IsDataDescriptor.js spackled linguist-generated=true +2018/IsExtensible.js spackled linguist-generated=true +2018/IsGenericDescriptor.js spackled linguist-generated=true +2018/IsInteger.js spackled linguist-generated=true +2018/IsPromise.js spackled linguist-generated=true +2018/IsPropertyKey.js spackled linguist-generated=true +2018/IsRegExp.js spackled linguist-generated=true +2018/IterableToList.js spackled linguist-generated=true +2018/IteratorClose.js spackled linguist-generated=true +2018/IteratorComplete.js spackled linguist-generated=true +2018/IteratorNext.js spackled linguist-generated=true +2018/IteratorStep.js spackled linguist-generated=true +2018/IteratorValue.js spackled linguist-generated=true +2018/MakeDate.js spackled linguist-generated=true +2018/MakeDay.js spackled linguist-generated=true +2018/MakeTime.js spackled linguist-generated=true +2018/MinFromTime.js spackled linguist-generated=true +2018/MonthFromTime.js spackled linguist-generated=true +2018/ObjectCreate.js spackled linguist-generated=true +2018/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2018/OrdinaryHasInstance.js spackled linguist-generated=true +2018/OrdinaryHasProperty.js spackled linguist-generated=true +2018/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2018/RegExpExec.js spackled linguist-generated=true +2018/RequireObjectCoercible.js spackled linguist-generated=true +2018/SameValue.js spackled linguist-generated=true +2018/SameValueNonNumber.js spackled linguist-generated=true +2018/SameValueZero.js spackled linguist-generated=true +2018/SecFromTime.js spackled linguist-generated=true +2018/Set.js spackled linguist-generated=true +2018/SetFunctionName.js spackled linguist-generated=true +2018/SetIntegrityLevel.js spackled linguist-generated=true +2018/SpeciesConstructor.js spackled linguist-generated=true +2018/StrictEqualityComparison.js spackled linguist-generated=true +2018/SymbolDescriptiveString.js spackled linguist-generated=true +2018/TestIntegrityLevel.js spackled linguist-generated=true +2018/TimeClip.js spackled linguist-generated=true +2018/TimeFromYear.js spackled linguist-generated=true +2018/TimeWithinDay.js spackled linguist-generated=true +2018/ToBoolean.js spackled linguist-generated=true +2018/ToDateString.js spackled linguist-generated=true +2018/ToIndex.js spackled linguist-generated=true +2018/ToInt16.js spackled linguist-generated=true +2018/ToInt32.js spackled linguist-generated=true +2018/ToInt8.js spackled linguist-generated=true +2018/ToInteger.js spackled linguist-generated=true +2018/ToLength.js spackled linguist-generated=true +2018/ToNumber.js spackled linguist-generated=true +2018/ToObject.js spackled linguist-generated=true +2018/ToPrimitive.js spackled linguist-generated=true +2018/ToPropertyDescriptor.js spackled linguist-generated=true +2018/ToPropertyKey.js spackled linguist-generated=true +2018/ToString.js spackled linguist-generated=true +2018/ToUint16.js spackled linguist-generated=true +2018/ToUint32.js spackled linguist-generated=true +2018/ToUint8.js spackled linguist-generated=true +2018/ToUint8Clamp.js spackled linguist-generated=true +2018/Type.js spackled linguist-generated=true +2018/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2018/WeekDay.js spackled linguist-generated=true +2018/YearFromTime.js spackled linguist-generated=true +2018/modulo.js spackled linguist-generated=true +2018/msFromTime.js spackled linguist-generated=true +2018/thisBooleanValue.js spackled linguist-generated=true +2018/thisNumberValue.js spackled linguist-generated=true +2018/thisStringValue.js spackled linguist-generated=true +2018/thisTimeValue.js spackled linguist-generated=true +2019/AbstractEqualityComparison.js spackled linguist-generated=true +2019/AbstractRelationalComparison.js spackled linguist-generated=true +2019/AdvanceStringIndex.js spackled linguist-generated=true +2019/ArrayCreate.js spackled linguist-generated=true +2019/ArraySetLength.js spackled linguist-generated=true +2019/ArraySpeciesCreate.js spackled linguist-generated=true +2019/Call.js spackled linguist-generated=true +2019/CanonicalNumericIndexString.js spackled linguist-generated=true +2019/CompletePropertyDescriptor.js spackled linguist-generated=true +2019/CopyDataProperties.js spackled linguist-generated=true +2019/CreateDataProperty.js spackled linguist-generated=true +2019/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2019/CreateHTML.js spackled linguist-generated=true +2019/CreateIterResultObject.js spackled linguist-generated=true +2019/CreateListFromArrayLike.js spackled linguist-generated=true +2019/CreateMethodProperty.js spackled linguist-generated=true +2019/DateFromTime.js spackled linguist-generated=true +2019/DateString.js spackled linguist-generated=true +2019/Day.js spackled linguist-generated=true +2019/DayFromYear.js spackled linguist-generated=true +2019/DayWithinYear.js spackled linguist-generated=true +2019/DaysInYear.js spackled linguist-generated=true +2019/DefinePropertyOrThrow.js spackled linguist-generated=true +2019/DeletePropertyOrThrow.js spackled linguist-generated=true +2019/EnumerableOwnPropertyNames.js spackled linguist-generated=true +2019/FromPropertyDescriptor.js spackled linguist-generated=true +2019/Get.js spackled linguist-generated=true +2019/GetIterator.js spackled linguist-generated=true +2019/GetMethod.js spackled linguist-generated=true +2019/GetOwnPropertyKeys.js spackled linguist-generated=true +2019/GetPrototypeFromConstructor.js spackled linguist-generated=true +2019/GetSubstitution.js spackled linguist-generated=true +2019/GetV.js spackled linguist-generated=true +2019/HasOwnProperty.js spackled linguist-generated=true +2019/HasProperty.js spackled linguist-generated=true +2019/HourFromTime.js spackled linguist-generated=true +2019/InLeapYear.js spackled linguist-generated=true +2019/InstanceofOperator.js spackled linguist-generated=true +2019/Invoke.js spackled linguist-generated=true +2019/IsAccessorDescriptor.js spackled linguist-generated=true +2019/IsArray.js spackled linguist-generated=true +2019/IsCallable.js spackled linguist-generated=true +2019/IsConcatSpreadable.js spackled linguist-generated=true +2019/IsConstructor.js spackled linguist-generated=true +2019/IsDataDescriptor.js spackled linguist-generated=true +2019/IsExtensible.js spackled linguist-generated=true +2019/IsGenericDescriptor.js spackled linguist-generated=true +2019/IsInteger.js spackled linguist-generated=true +2019/IsPromise.js spackled linguist-generated=true +2019/IsPropertyKey.js spackled linguist-generated=true +2019/IsRegExp.js spackled linguist-generated=true +2019/IsStringPrefix.js spackled linguist-generated=true +2019/IterableToList.js spackled linguist-generated=true +2019/IteratorClose.js spackled linguist-generated=true +2019/IteratorComplete.js spackled linguist-generated=true +2019/IteratorNext.js spackled linguist-generated=true +2019/IteratorStep.js spackled linguist-generated=true +2019/IteratorValue.js spackled linguist-generated=true +2019/MakeDate.js spackled linguist-generated=true +2019/MakeDay.js spackled linguist-generated=true +2019/MakeTime.js spackled linguist-generated=true +2019/MinFromTime.js spackled linguist-generated=true +2019/MonthFromTime.js spackled linguist-generated=true +2019/NumberToString.js spackled linguist-generated=true +2019/ObjectCreate.js spackled linguist-generated=true +2019/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2019/OrdinaryHasInstance.js spackled linguist-generated=true +2019/OrdinaryHasProperty.js spackled linguist-generated=true +2019/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2019/PromiseResolve.js spackled linguist-generated=true +2019/RegExpExec.js spackled linguist-generated=true +2019/RequireObjectCoercible.js spackled linguist-generated=true +2019/SameValue.js spackled linguist-generated=true +2019/SameValueNonNumber.js spackled linguist-generated=true +2019/SameValueZero.js spackled linguist-generated=true +2019/SecFromTime.js spackled linguist-generated=true +2019/Set.js spackled linguist-generated=true +2019/SetFunctionName.js spackled linguist-generated=true +2019/SetIntegrityLevel.js spackled linguist-generated=true +2019/SpeciesConstructor.js spackled linguist-generated=true +2019/StrictEqualityComparison.js spackled linguist-generated=true +2019/SymbolDescriptiveString.js spackled linguist-generated=true +2019/TestIntegrityLevel.js spackled linguist-generated=true +2019/TimeClip.js spackled linguist-generated=true +2019/TimeFromYear.js spackled linguist-generated=true +2019/TimeString.js spackled linguist-generated=true +2019/TimeWithinDay.js spackled linguist-generated=true +2019/ToBoolean.js spackled linguist-generated=true +2019/ToDateString.js spackled linguist-generated=true +2019/ToIndex.js spackled linguist-generated=true +2019/ToInt16.js spackled linguist-generated=true +2019/ToInt32.js spackled linguist-generated=true +2019/ToInt8.js spackled linguist-generated=true +2019/ToInteger.js spackled linguist-generated=true +2019/ToLength.js spackled linguist-generated=true +2019/ToNumber.js spackled linguist-generated=true +2019/ToObject.js spackled linguist-generated=true +2019/ToPrimitive.js spackled linguist-generated=true +2019/ToPropertyDescriptor.js spackled linguist-generated=true +2019/ToPropertyKey.js spackled linguist-generated=true +2019/ToString.js spackled linguist-generated=true +2019/ToUint16.js spackled linguist-generated=true +2019/ToUint32.js spackled linguist-generated=true +2019/ToUint8.js spackled linguist-generated=true +2019/ToUint8Clamp.js spackled linguist-generated=true +2019/Type.js spackled linguist-generated=true +2019/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2019/WeekDay.js spackled linguist-generated=true +2019/YearFromTime.js spackled linguist-generated=true +2019/modulo.js spackled linguist-generated=true +2019/msFromTime.js spackled linguist-generated=true +2019/thisBooleanValue.js spackled linguist-generated=true +2019/thisNumberValue.js spackled linguist-generated=true +2019/thisStringValue.js spackled linguist-generated=true +2019/thisSymbolValue.js spackled linguist-generated=true \ No newline at end of file diff --git a/node_modules/object.values/node_modules/es-abstract/.github/FUNDING.yml b/node_modules/object.values/node_modules/es-abstract/.github/FUNDING.yml new file mode 100644 index 0000000..beeb7a2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-abstract +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/object.values/node_modules/es-abstract/.github/workflows/codeql-analysis.yml b/node_modules/object.values/node_modules/es-abstract/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..e77ad6a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.github/workflows/codeql-analysis.yml @@ -0,0 +1,52 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 17 * * 4' + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/node_modules/object.values/node_modules/es-abstract/.github/workflows/rebase.yml b/node_modules/object.values/node_modules/es-abstract/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/object.values/node_modules/es-abstract/.nycrc b/node_modules/object.values/node_modules/es-abstract/.nycrc new file mode 100644 index 0000000..d316b4d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.nycrc @@ -0,0 +1,14 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "operations", + "test" + ] +} diff --git a/node_modules/object.values/node_modules/es-abstract/.travis.yml b/node_modules/object.values/node_modules/es-abstract/.travis.yml new file mode 100644 index 0000000..5c34024 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/.travis.yml @@ -0,0 +1,32 @@ +version: ~> 1.0 +language: node_js +os: + - linux +cache: + directories: + - "$HOME/.npm" + - "$(nvm cache dir)" + - "$(nvm_version_path $(nvm_version_remote 0.4))" + - "$(nvm_version_path $(nvm_version_remote 0.6))" + - "$(nvm_version_path $(nvm_version_remote 0.10))" +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml +script: + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi' +matrix: + include: + - node_js: "8" + env: COVERAGE=true + - node_js: "4" + env: COVERAGE=true + - node_js: "0.12" + env: COVERAGE=true + - node_js: "0.8" + env: COVERAGE=true + exclude: + - node_js: "0.12" + env: TEST=true + - node_js: "0.8" + env: TEST=true diff --git a/node_modules/object.values/node_modules/es-abstract/2015/AbstractEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2015/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/AbstractRelationalComparison.js b/node_modules/object.values/node_modules/es-abstract/2015/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/AdvanceStringIndex.js b/node_modules/object.values/node_modules/es-abstract/2015/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ArrayCreate.js b/node_modules/object.values/node_modules/es-abstract/2015/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ArraySetLength.js b/node_modules/object.values/node_modules/es-abstract/2015/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ArraySpeciesCreate.js b/node_modules/object.values/node_modules/es-abstract/2015/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/Call.js b/node_modules/object.values/node_modules/es-abstract/2015/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CanonicalNumericIndexString.js b/node_modules/object.values/node_modules/es-abstract/2015/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CompletePropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CreateDataProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CreateHTML.js b/node_modules/object.values/node_modules/es-abstract/2015/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CreateIterResultObject.js b/node_modules/object.values/node_modules/es-abstract/2015/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CreateListFromArrayLike.js b/node_modules/object.values/node_modules/es-abstract/2015/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/CreateMethodProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/DateFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/Day.js b/node_modules/object.values/node_modules/es-abstract/2015/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/DayFromYear.js b/node_modules/object.values/node_modules/es-abstract/2015/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/DayWithinYear.js b/node_modules/object.values/node_modules/es-abstract/2015/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/DaysInYear.js b/node_modules/object.values/node_modules/es-abstract/2015/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/DefinePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2015/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/DeletePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2015/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/EnumerableOwnNames.js b/node_modules/object.values/node_modules/es-abstract/2015/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/FromPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/Get.js b/node_modules/object.values/node_modules/es-abstract/2015/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/GetIterator.js b/node_modules/object.values/node_modules/es-abstract/2015/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/GetMethod.js b/node_modules/object.values/node_modules/es-abstract/2015/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/GetOwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/2015/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js b/node_modules/object.values/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/GetSubstitution.js b/node_modules/object.values/node_modules/es-abstract/2015/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/GetV.js b/node_modules/object.values/node_modules/es-abstract/2015/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/HasOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/HasProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/HourFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/InLeapYear.js b/node_modules/object.values/node_modules/es-abstract/2015/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/InstanceofOperator.js b/node_modules/object.values/node_modules/es-abstract/2015/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/Invoke.js b/node_modules/object.values/node_modules/es-abstract/2015/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsAccessorDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsArray.js b/node_modules/object.values/node_modules/es-abstract/2015/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsCallable.js b/node_modules/object.values/node_modules/es-abstract/2015/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsConcatSpreadable.js b/node_modules/object.values/node_modules/es-abstract/2015/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsConstructor.js b/node_modules/object.values/node_modules/es-abstract/2015/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsDataDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsExtensible.js b/node_modules/object.values/node_modules/es-abstract/2015/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsGenericDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsInteger.js b/node_modules/object.values/node_modules/es-abstract/2015/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsPromise.js b/node_modules/object.values/node_modules/es-abstract/2015/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2015/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IsRegExp.js b/node_modules/object.values/node_modules/es-abstract/2015/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IteratorClose.js b/node_modules/object.values/node_modules/es-abstract/2015/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IteratorComplete.js b/node_modules/object.values/node_modules/es-abstract/2015/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IteratorNext.js b/node_modules/object.values/node_modules/es-abstract/2015/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IteratorStep.js b/node_modules/object.values/node_modules/es-abstract/2015/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/IteratorValue.js b/node_modules/object.values/node_modules/es-abstract/2015/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/MakeDate.js b/node_modules/object.values/node_modules/es-abstract/2015/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/MakeDay.js b/node_modules/object.values/node_modules/es-abstract/2015/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/MakeTime.js b/node_modules/object.values/node_modules/es-abstract/2015/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/MinFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/MonthFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ObjectCreate.js b/node_modules/object.values/node_modules/es-abstract/2015/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasInstance.js b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasProperty.js b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/RegExpExec.js b/node_modules/object.values/node_modules/es-abstract/2015/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/RequireObjectCoercible.js b/node_modules/object.values/node_modules/es-abstract/2015/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SameValue.js b/node_modules/object.values/node_modules/es-abstract/2015/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SameValueZero.js b/node_modules/object.values/node_modules/es-abstract/2015/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SecFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/Set.js b/node_modules/object.values/node_modules/es-abstract/2015/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SetFunctionName.js b/node_modules/object.values/node_modules/es-abstract/2015/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SetIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2015/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SpeciesConstructor.js b/node_modules/object.values/node_modules/es-abstract/2015/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/StrictEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2015/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/SymbolDescriptiveString.js b/node_modules/object.values/node_modules/es-abstract/2015/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/TestIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2015/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/TimeClip.js b/node_modules/object.values/node_modules/es-abstract/2015/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/TimeFromYear.js b/node_modules/object.values/node_modules/es-abstract/2015/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/TimeWithinDay.js b/node_modules/object.values/node_modules/es-abstract/2015/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToBoolean.js b/node_modules/object.values/node_modules/es-abstract/2015/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToDateString.js b/node_modules/object.values/node_modules/es-abstract/2015/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToInt16.js b/node_modules/object.values/node_modules/es-abstract/2015/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToInt32.js b/node_modules/object.values/node_modules/es-abstract/2015/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToInt8.js b/node_modules/object.values/node_modules/es-abstract/2015/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToInteger.js b/node_modules/object.values/node_modules/es-abstract/2015/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToLength.js b/node_modules/object.values/node_modules/es-abstract/2015/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToNumber.js b/node_modules/object.values/node_modules/es-abstract/2015/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToObject.js b/node_modules/object.values/node_modules/es-abstract/2015/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToPrimitive.js b/node_modules/object.values/node_modules/es-abstract/2015/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2015/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToString.js b/node_modules/object.values/node_modules/es-abstract/2015/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToUint16.js b/node_modules/object.values/node_modules/es-abstract/2015/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToUint32.js b/node_modules/object.values/node_modules/es-abstract/2015/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToUint8.js b/node_modules/object.values/node_modules/es-abstract/2015/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ToUint8Clamp.js b/node_modules/object.values/node_modules/es-abstract/2015/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/Type.js b/node_modules/object.values/node_modules/es-abstract/2015/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/WeekDay.js b/node_modules/object.values/node_modules/es-abstract/2015/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/YearFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/modulo.js b/node_modules/object.values/node_modules/es-abstract/2015/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/msFromTime.js b/node_modules/object.values/node_modules/es-abstract/2015/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/thisBooleanValue.js b/node_modules/object.values/node_modules/es-abstract/2015/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/thisNumberValue.js b/node_modules/object.values/node_modules/es-abstract/2015/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2015/thisStringValue.js b/node_modules/object.values/node_modules/es-abstract/2015/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2015/thisTimeValue.js b/node_modules/object.values/node_modules/es-abstract/2015/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2015/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/AbstractEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2016/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/AbstractRelationalComparison.js b/node_modules/object.values/node_modules/es-abstract/2016/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/AdvanceStringIndex.js b/node_modules/object.values/node_modules/es-abstract/2016/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ArrayCreate.js b/node_modules/object.values/node_modules/es-abstract/2016/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ArraySetLength.js b/node_modules/object.values/node_modules/es-abstract/2016/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ArraySpeciesCreate.js b/node_modules/object.values/node_modules/es-abstract/2016/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/Call.js b/node_modules/object.values/node_modules/es-abstract/2016/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CanonicalNumericIndexString.js b/node_modules/object.values/node_modules/es-abstract/2016/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CompletePropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CreateDataProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CreateHTML.js b/node_modules/object.values/node_modules/es-abstract/2016/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CreateIterResultObject.js b/node_modules/object.values/node_modules/es-abstract/2016/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CreateListFromArrayLike.js b/node_modules/object.values/node_modules/es-abstract/2016/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/CreateMethodProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/DateFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/Day.js b/node_modules/object.values/node_modules/es-abstract/2016/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/DayFromYear.js b/node_modules/object.values/node_modules/es-abstract/2016/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/DayWithinYear.js b/node_modules/object.values/node_modules/es-abstract/2016/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/DaysInYear.js b/node_modules/object.values/node_modules/es-abstract/2016/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/DefinePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2016/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/DeletePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2016/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/EnumerableOwnNames.js b/node_modules/object.values/node_modules/es-abstract/2016/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/FromPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/Get.js b/node_modules/object.values/node_modules/es-abstract/2016/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/GetIterator.js b/node_modules/object.values/node_modules/es-abstract/2016/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/GetMethod.js b/node_modules/object.values/node_modules/es-abstract/2016/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/GetOwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/2016/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js b/node_modules/object.values/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/GetSubstitution.js b/node_modules/object.values/node_modules/es-abstract/2016/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/GetV.js b/node_modules/object.values/node_modules/es-abstract/2016/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/HasOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/HasProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/HourFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/InLeapYear.js b/node_modules/object.values/node_modules/es-abstract/2016/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/InstanceofOperator.js b/node_modules/object.values/node_modules/es-abstract/2016/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/Invoke.js b/node_modules/object.values/node_modules/es-abstract/2016/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsAccessorDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsArray.js b/node_modules/object.values/node_modules/es-abstract/2016/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsCallable.js b/node_modules/object.values/node_modules/es-abstract/2016/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsConcatSpreadable.js b/node_modules/object.values/node_modules/es-abstract/2016/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsConstructor.js b/node_modules/object.values/node_modules/es-abstract/2016/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsDataDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsExtensible.js b/node_modules/object.values/node_modules/es-abstract/2016/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsGenericDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsInteger.js b/node_modules/object.values/node_modules/es-abstract/2016/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsPromise.js b/node_modules/object.values/node_modules/es-abstract/2016/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2016/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IsRegExp.js b/node_modules/object.values/node_modules/es-abstract/2016/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IterableToArrayLike.js b/node_modules/object.values/node_modules/es-abstract/2016/IterableToArrayLike.js new file mode 100644 index 0000000..885cade --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IterableToArrayLike.js @@ -0,0 +1,56 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var GetIterator = require('./GetIterator'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); +var ES = { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type +}; + +// https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike +/** + * 1. Let usingIterator be ? GetMethod(items, @@iterator). + * 2. If usingIterator is not undefined, then + * 1. Let iterator be ? GetIterator(items, usingIterator). + * 2. Let values be a new empty List. + * 3. Let next be true. + * 4. Repeat, while next is not false + * 1. Let next be ? IteratorStep(iterator). + * 2. If next is not false, then + * 1. Let nextValue be ? IteratorValue(next). + * 2. Append nextValue to the end of the List values. + * 5. Return CreateArrayFromList(values). + * 3. NOTE: items is not an Iterable so assume it is already an array-like object. + * 4. Return ! ToObject(items). + */ + +module.exports = function IterableToArrayLike(items) { + var usingIterator = getIteratorMethod(ES, items); + if (typeof usingIterator !== 'undefined') { + var iterator = GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return ToObject(items); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IteratorClose.js b/node_modules/object.values/node_modules/es-abstract/2016/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IteratorComplete.js b/node_modules/object.values/node_modules/es-abstract/2016/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IteratorNext.js b/node_modules/object.values/node_modules/es-abstract/2016/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IteratorStep.js b/node_modules/object.values/node_modules/es-abstract/2016/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/IteratorValue.js b/node_modules/object.values/node_modules/es-abstract/2016/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/MakeDate.js b/node_modules/object.values/node_modules/es-abstract/2016/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/MakeDay.js b/node_modules/object.values/node_modules/es-abstract/2016/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/MakeTime.js b/node_modules/object.values/node_modules/es-abstract/2016/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/MinFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/MonthFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ObjectCreate.js b/node_modules/object.values/node_modules/es-abstract/2016/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasInstance.js b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasProperty.js b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/RegExpExec.js b/node_modules/object.values/node_modules/es-abstract/2016/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/RequireObjectCoercible.js b/node_modules/object.values/node_modules/es-abstract/2016/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SameValue.js b/node_modules/object.values/node_modules/es-abstract/2016/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SameValueNonNumber.js b/node_modules/object.values/node_modules/es-abstract/2016/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SameValueZero.js b/node_modules/object.values/node_modules/es-abstract/2016/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SecFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/Set.js b/node_modules/object.values/node_modules/es-abstract/2016/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SetFunctionName.js b/node_modules/object.values/node_modules/es-abstract/2016/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SetIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2016/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SpeciesConstructor.js b/node_modules/object.values/node_modules/es-abstract/2016/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/StrictEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2016/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/SymbolDescriptiveString.js b/node_modules/object.values/node_modules/es-abstract/2016/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/TestIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2016/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/TimeClip.js b/node_modules/object.values/node_modules/es-abstract/2016/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/TimeFromYear.js b/node_modules/object.values/node_modules/es-abstract/2016/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/TimeWithinDay.js b/node_modules/object.values/node_modules/es-abstract/2016/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToBoolean.js b/node_modules/object.values/node_modules/es-abstract/2016/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToDateString.js b/node_modules/object.values/node_modules/es-abstract/2016/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToInt16.js b/node_modules/object.values/node_modules/es-abstract/2016/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToInt32.js b/node_modules/object.values/node_modules/es-abstract/2016/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToInt8.js b/node_modules/object.values/node_modules/es-abstract/2016/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToInteger.js b/node_modules/object.values/node_modules/es-abstract/2016/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToLength.js b/node_modules/object.values/node_modules/es-abstract/2016/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToNumber.js b/node_modules/object.values/node_modules/es-abstract/2016/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToObject.js b/node_modules/object.values/node_modules/es-abstract/2016/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToPrimitive.js b/node_modules/object.values/node_modules/es-abstract/2016/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2016/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToString.js b/node_modules/object.values/node_modules/es-abstract/2016/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToUint16.js b/node_modules/object.values/node_modules/es-abstract/2016/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToUint32.js b/node_modules/object.values/node_modules/es-abstract/2016/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToUint8.js b/node_modules/object.values/node_modules/es-abstract/2016/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ToUint8Clamp.js b/node_modules/object.values/node_modules/es-abstract/2016/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/Type.js b/node_modules/object.values/node_modules/es-abstract/2016/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/WeekDay.js b/node_modules/object.values/node_modules/es-abstract/2016/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/YearFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/modulo.js b/node_modules/object.values/node_modules/es-abstract/2016/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/msFromTime.js b/node_modules/object.values/node_modules/es-abstract/2016/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/thisBooleanValue.js b/node_modules/object.values/node_modules/es-abstract/2016/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/thisNumberValue.js b/node_modules/object.values/node_modules/es-abstract/2016/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2016/thisStringValue.js b/node_modules/object.values/node_modules/es-abstract/2016/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2016/thisTimeValue.js b/node_modules/object.values/node_modules/es-abstract/2016/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2016/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/AbstractEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2017/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/AbstractRelationalComparison.js b/node_modules/object.values/node_modules/es-abstract/2017/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/AdvanceStringIndex.js b/node_modules/object.values/node_modules/es-abstract/2017/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ArrayCreate.js b/node_modules/object.values/node_modules/es-abstract/2017/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ArraySetLength.js b/node_modules/object.values/node_modules/es-abstract/2017/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ArraySpeciesCreate.js b/node_modules/object.values/node_modules/es-abstract/2017/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/Call.js b/node_modules/object.values/node_modules/es-abstract/2017/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CanonicalNumericIndexString.js b/node_modules/object.values/node_modules/es-abstract/2017/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CompletePropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CreateDataProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CreateHTML.js b/node_modules/object.values/node_modules/es-abstract/2017/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CreateIterResultObject.js b/node_modules/object.values/node_modules/es-abstract/2017/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CreateListFromArrayLike.js b/node_modules/object.values/node_modules/es-abstract/2017/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/CreateMethodProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/DateFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/Day.js b/node_modules/object.values/node_modules/es-abstract/2017/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/DayFromYear.js b/node_modules/object.values/node_modules/es-abstract/2017/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/DayWithinYear.js b/node_modules/object.values/node_modules/es-abstract/2017/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/DaysInYear.js b/node_modules/object.values/node_modules/es-abstract/2017/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/DefinePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2017/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/DeletePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2017/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/EnumerableOwnProperties.js b/node_modules/object.values/node_modules/es-abstract/2017/EnumerableOwnProperties.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/EnumerableOwnProperties.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/FromPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/Get.js b/node_modules/object.values/node_modules/es-abstract/2017/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/GetIterator.js b/node_modules/object.values/node_modules/es-abstract/2017/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/GetMethod.js b/node_modules/object.values/node_modules/es-abstract/2017/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/GetOwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/2017/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js b/node_modules/object.values/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/GetSubstitution.js b/node_modules/object.values/node_modules/es-abstract/2017/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/GetV.js b/node_modules/object.values/node_modules/es-abstract/2017/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/HasOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/HasProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/HourFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/InLeapYear.js b/node_modules/object.values/node_modules/es-abstract/2017/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/InstanceofOperator.js b/node_modules/object.values/node_modules/es-abstract/2017/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/Invoke.js b/node_modules/object.values/node_modules/es-abstract/2017/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsAccessorDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsArray.js b/node_modules/object.values/node_modules/es-abstract/2017/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsCallable.js b/node_modules/object.values/node_modules/es-abstract/2017/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsConcatSpreadable.js b/node_modules/object.values/node_modules/es-abstract/2017/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsConstructor.js b/node_modules/object.values/node_modules/es-abstract/2017/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsDataDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsExtensible.js b/node_modules/object.values/node_modules/es-abstract/2017/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsGenericDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsInteger.js b/node_modules/object.values/node_modules/es-abstract/2017/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsPromise.js b/node_modules/object.values/node_modules/es-abstract/2017/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2017/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IsRegExp.js b/node_modules/object.values/node_modules/es-abstract/2017/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IterableToList.js b/node_modules/object.values/node_modules/es-abstract/2017/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IteratorClose.js b/node_modules/object.values/node_modules/es-abstract/2017/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IteratorComplete.js b/node_modules/object.values/node_modules/es-abstract/2017/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IteratorNext.js b/node_modules/object.values/node_modules/es-abstract/2017/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IteratorStep.js b/node_modules/object.values/node_modules/es-abstract/2017/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/IteratorValue.js b/node_modules/object.values/node_modules/es-abstract/2017/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/MakeDate.js b/node_modules/object.values/node_modules/es-abstract/2017/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/MakeDay.js b/node_modules/object.values/node_modules/es-abstract/2017/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/MakeTime.js b/node_modules/object.values/node_modules/es-abstract/2017/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/MinFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/MonthFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ObjectCreate.js b/node_modules/object.values/node_modules/es-abstract/2017/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasInstance.js b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasProperty.js b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/RegExpExec.js b/node_modules/object.values/node_modules/es-abstract/2017/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/RequireObjectCoercible.js b/node_modules/object.values/node_modules/es-abstract/2017/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SameValue.js b/node_modules/object.values/node_modules/es-abstract/2017/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SameValueNonNumber.js b/node_modules/object.values/node_modules/es-abstract/2017/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SameValueZero.js b/node_modules/object.values/node_modules/es-abstract/2017/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SecFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/Set.js b/node_modules/object.values/node_modules/es-abstract/2017/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SetFunctionName.js b/node_modules/object.values/node_modules/es-abstract/2017/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SetIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2017/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SpeciesConstructor.js b/node_modules/object.values/node_modules/es-abstract/2017/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/StrictEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2017/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/SymbolDescriptiveString.js b/node_modules/object.values/node_modules/es-abstract/2017/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/TestIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2017/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/TimeClip.js b/node_modules/object.values/node_modules/es-abstract/2017/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/TimeFromYear.js b/node_modules/object.values/node_modules/es-abstract/2017/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/TimeWithinDay.js b/node_modules/object.values/node_modules/es-abstract/2017/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToBoolean.js b/node_modules/object.values/node_modules/es-abstract/2017/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToDateString.js b/node_modules/object.values/node_modules/es-abstract/2017/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToIndex.js b/node_modules/object.values/node_modules/es-abstract/2017/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToInt16.js b/node_modules/object.values/node_modules/es-abstract/2017/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToInt32.js b/node_modules/object.values/node_modules/es-abstract/2017/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToInt8.js b/node_modules/object.values/node_modules/es-abstract/2017/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToInteger.js b/node_modules/object.values/node_modules/es-abstract/2017/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToLength.js b/node_modules/object.values/node_modules/es-abstract/2017/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToNumber.js b/node_modules/object.values/node_modules/es-abstract/2017/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToObject.js b/node_modules/object.values/node_modules/es-abstract/2017/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToPrimitive.js b/node_modules/object.values/node_modules/es-abstract/2017/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2017/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToString.js b/node_modules/object.values/node_modules/es-abstract/2017/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToUint16.js b/node_modules/object.values/node_modules/es-abstract/2017/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToUint32.js b/node_modules/object.values/node_modules/es-abstract/2017/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToUint8.js b/node_modules/object.values/node_modules/es-abstract/2017/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ToUint8Clamp.js b/node_modules/object.values/node_modules/es-abstract/2017/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/Type.js b/node_modules/object.values/node_modules/es-abstract/2017/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/WeekDay.js b/node_modules/object.values/node_modules/es-abstract/2017/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/YearFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/modulo.js b/node_modules/object.values/node_modules/es-abstract/2017/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/msFromTime.js b/node_modules/object.values/node_modules/es-abstract/2017/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/thisBooleanValue.js b/node_modules/object.values/node_modules/es-abstract/2017/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/thisNumberValue.js b/node_modules/object.values/node_modules/es-abstract/2017/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2017/thisStringValue.js b/node_modules/object.values/node_modules/es-abstract/2017/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2017/thisTimeValue.js b/node_modules/object.values/node_modules/es-abstract/2017/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2017/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/AbstractEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2018/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/AbstractRelationalComparison.js b/node_modules/object.values/node_modules/es-abstract/2018/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/AdvanceStringIndex.js b/node_modules/object.values/node_modules/es-abstract/2018/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ArrayCreate.js b/node_modules/object.values/node_modules/es-abstract/2018/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ArraySetLength.js b/node_modules/object.values/node_modules/es-abstract/2018/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ArraySpeciesCreate.js b/node_modules/object.values/node_modules/es-abstract/2018/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/Call.js b/node_modules/object.values/node_modules/es-abstract/2018/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CanonicalNumericIndexString.js b/node_modules/object.values/node_modules/es-abstract/2018/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CompletePropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CopyDataProperties.js b/node_modules/object.values/node_modules/es-abstract/2018/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CreateDataProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CreateHTML.js b/node_modules/object.values/node_modules/es-abstract/2018/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CreateIterResultObject.js b/node_modules/object.values/node_modules/es-abstract/2018/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CreateListFromArrayLike.js b/node_modules/object.values/node_modules/es-abstract/2018/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/CreateMethodProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DateFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DateString.js b/node_modules/object.values/node_modules/es-abstract/2018/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/Day.js b/node_modules/object.values/node_modules/es-abstract/2018/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DayFromYear.js b/node_modules/object.values/node_modules/es-abstract/2018/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DayWithinYear.js b/node_modules/object.values/node_modules/es-abstract/2018/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DaysInYear.js b/node_modules/object.values/node_modules/es-abstract/2018/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DefinePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2018/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/DeletePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2018/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js b/node_modules/object.values/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/FromPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/Get.js b/node_modules/object.values/node_modules/es-abstract/2018/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/GetIterator.js b/node_modules/object.values/node_modules/es-abstract/2018/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/GetMethod.js b/node_modules/object.values/node_modules/es-abstract/2018/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/GetOwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/2018/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js b/node_modules/object.values/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/GetSubstitution.js b/node_modules/object.values/node_modules/es-abstract/2018/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/GetV.js b/node_modules/object.values/node_modules/es-abstract/2018/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/HasOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/HasProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/HourFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/InLeapYear.js b/node_modules/object.values/node_modules/es-abstract/2018/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/InstanceofOperator.js b/node_modules/object.values/node_modules/es-abstract/2018/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/Invoke.js b/node_modules/object.values/node_modules/es-abstract/2018/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsAccessorDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsArray.js b/node_modules/object.values/node_modules/es-abstract/2018/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsCallable.js b/node_modules/object.values/node_modules/es-abstract/2018/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsConcatSpreadable.js b/node_modules/object.values/node_modules/es-abstract/2018/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsConstructor.js b/node_modules/object.values/node_modules/es-abstract/2018/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsDataDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsExtensible.js b/node_modules/object.values/node_modules/es-abstract/2018/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsGenericDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsInteger.js b/node_modules/object.values/node_modules/es-abstract/2018/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsPromise.js b/node_modules/object.values/node_modules/es-abstract/2018/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2018/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsRegExp.js b/node_modules/object.values/node_modules/es-abstract/2018/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IsStringPrefix.js b/node_modules/object.values/node_modules/es-abstract/2018/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IterableToList.js b/node_modules/object.values/node_modules/es-abstract/2018/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IteratorClose.js b/node_modules/object.values/node_modules/es-abstract/2018/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IteratorComplete.js b/node_modules/object.values/node_modules/es-abstract/2018/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IteratorNext.js b/node_modules/object.values/node_modules/es-abstract/2018/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IteratorStep.js b/node_modules/object.values/node_modules/es-abstract/2018/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/IteratorValue.js b/node_modules/object.values/node_modules/es-abstract/2018/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/MakeDate.js b/node_modules/object.values/node_modules/es-abstract/2018/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/MakeDay.js b/node_modules/object.values/node_modules/es-abstract/2018/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/MakeTime.js b/node_modules/object.values/node_modules/es-abstract/2018/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/MinFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/MonthFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/NumberToString.js b/node_modules/object.values/node_modules/es-abstract/2018/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ObjectCreate.js b/node_modules/object.values/node_modules/es-abstract/2018/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasInstance.js b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasProperty.js b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/PromiseResolve.js b/node_modules/object.values/node_modules/es-abstract/2018/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/RegExpExec.js b/node_modules/object.values/node_modules/es-abstract/2018/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/RequireObjectCoercible.js b/node_modules/object.values/node_modules/es-abstract/2018/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SameValue.js b/node_modules/object.values/node_modules/es-abstract/2018/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SameValueNonNumber.js b/node_modules/object.values/node_modules/es-abstract/2018/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SameValueZero.js b/node_modules/object.values/node_modules/es-abstract/2018/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SecFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/Set.js b/node_modules/object.values/node_modules/es-abstract/2018/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SetFunctionName.js b/node_modules/object.values/node_modules/es-abstract/2018/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SetIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2018/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SpeciesConstructor.js b/node_modules/object.values/node_modules/es-abstract/2018/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/StrictEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2018/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/SymbolDescriptiveString.js b/node_modules/object.values/node_modules/es-abstract/2018/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/TestIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2018/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/TimeClip.js b/node_modules/object.values/node_modules/es-abstract/2018/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/TimeFromYear.js b/node_modules/object.values/node_modules/es-abstract/2018/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/TimeString.js b/node_modules/object.values/node_modules/es-abstract/2018/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/TimeWithinDay.js b/node_modules/object.values/node_modules/es-abstract/2018/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToBoolean.js b/node_modules/object.values/node_modules/es-abstract/2018/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToDateString.js b/node_modules/object.values/node_modules/es-abstract/2018/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToIndex.js b/node_modules/object.values/node_modules/es-abstract/2018/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToInt16.js b/node_modules/object.values/node_modules/es-abstract/2018/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToInt32.js b/node_modules/object.values/node_modules/es-abstract/2018/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToInt8.js b/node_modules/object.values/node_modules/es-abstract/2018/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToInteger.js b/node_modules/object.values/node_modules/es-abstract/2018/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToLength.js b/node_modules/object.values/node_modules/es-abstract/2018/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToNumber.js b/node_modules/object.values/node_modules/es-abstract/2018/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToObject.js b/node_modules/object.values/node_modules/es-abstract/2018/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToPrimitive.js b/node_modules/object.values/node_modules/es-abstract/2018/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2018/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToString.js b/node_modules/object.values/node_modules/es-abstract/2018/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToUint16.js b/node_modules/object.values/node_modules/es-abstract/2018/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToUint32.js b/node_modules/object.values/node_modules/es-abstract/2018/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToUint8.js b/node_modules/object.values/node_modules/es-abstract/2018/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ToUint8Clamp.js b/node_modules/object.values/node_modules/es-abstract/2018/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/Type.js b/node_modules/object.values/node_modules/es-abstract/2018/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/WeekDay.js b/node_modules/object.values/node_modules/es-abstract/2018/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/YearFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/modulo.js b/node_modules/object.values/node_modules/es-abstract/2018/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/msFromTime.js b/node_modules/object.values/node_modules/es-abstract/2018/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/thisBooleanValue.js b/node_modules/object.values/node_modules/es-abstract/2018/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/thisNumberValue.js b/node_modules/object.values/node_modules/es-abstract/2018/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2018/thisStringValue.js b/node_modules/object.values/node_modules/es-abstract/2018/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/thisSymbolValue.js b/node_modules/object.values/node_modules/es-abstract/2018/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2018/thisTimeValue.js b/node_modules/object.values/node_modules/es-abstract/2018/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2018/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/AbstractEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2019/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/AbstractRelationalComparison.js b/node_modules/object.values/node_modules/es-abstract/2019/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/AddEntriesFromIterable.js b/node_modules/object.values/node_modules/es-abstract/2019/AddEntriesFromIterable.js new file mode 100644 index 0000000..5aed447 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/AddEntriesFromIterable.js @@ -0,0 +1,52 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var Get = require('./Get'); +var GetIterator = require('./GetIterator'); +var IsCallable = require('./IsCallable'); +var IteratorClose = require('./IteratorClose'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var Type = require('./Type'); + +// https://tc39.es/ecma262/#sec-add-entries-from-iterable + +module.exports = function AddEntriesFromIterable(target, iterable, adder) { + if (!IsCallable(adder)) { + throw new $TypeError('Assertion failed: `adder` is not callable'); + } + if (iterable == null) { + throw new $TypeError('Assertion failed: `iterable` is present, and not nullish'); + } + var iteratorRecord = GetIterator(iterable); + while (true) { // eslint-disable-line no-constant-condition + var next = IteratorStep(iteratorRecord); + if (!next) { + return target; + } + var nextItem = IteratorValue(next); + if (Type(nextItem) !== 'Object') { + var error = new $TypeError('iterator next must return an Object, got ' + inspect(nextItem)); + return IteratorClose( + iteratorRecord, + function () { throw error; } // eslint-disable-line no-loop-func + ); + } + try { + var k = Get(nextItem, '0'); + var v = Get(nextItem, '1'); + Call(adder, target, [k, v]); + } catch (e) { + return IteratorClose( + iteratorRecord, + function () { throw e; } + ); + } + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/AdvanceStringIndex.js b/node_modules/object.values/node_modules/es-abstract/2019/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ArrayCreate.js b/node_modules/object.values/node_modules/es-abstract/2019/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ArraySetLength.js b/node_modules/object.values/node_modules/es-abstract/2019/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ArraySpeciesCreate.js b/node_modules/object.values/node_modules/es-abstract/2019/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/Call.js b/node_modules/object.values/node_modules/es-abstract/2019/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CanonicalNumericIndexString.js b/node_modules/object.values/node_modules/es-abstract/2019/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CompletePropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CopyDataProperties.js b/node_modules/object.values/node_modules/es-abstract/2019/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CreateDataProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CreateHTML.js b/node_modules/object.values/node_modules/es-abstract/2019/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CreateIterResultObject.js b/node_modules/object.values/node_modules/es-abstract/2019/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CreateListFromArrayLike.js b/node_modules/object.values/node_modules/es-abstract/2019/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/CreateMethodProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DateFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DateString.js b/node_modules/object.values/node_modules/es-abstract/2019/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/Day.js b/node_modules/object.values/node_modules/es-abstract/2019/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DayFromYear.js b/node_modules/object.values/node_modules/es-abstract/2019/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DayWithinYear.js b/node_modules/object.values/node_modules/es-abstract/2019/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DaysInYear.js b/node_modules/object.values/node_modules/es-abstract/2019/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DefinePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2019/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/DeletePropertyOrThrow.js b/node_modules/object.values/node_modules/es-abstract/2019/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js b/node_modules/object.values/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/FlattenIntoArray.js b/node_modules/object.values/node_modules/es-abstract/2019/FlattenIntoArray.js new file mode 100644 index 0000000..313a6ed --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/FlattenIntoArray.js @@ -0,0 +1,58 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray + +// eslint-disable-next-line max-params, max-statements +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = ToLength(Get(element, 'length')); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/FromPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/Get.js b/node_modules/object.values/node_modules/es-abstract/2019/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/GetIterator.js b/node_modules/object.values/node_modules/es-abstract/2019/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/GetMethod.js b/node_modules/object.values/node_modules/es-abstract/2019/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/GetOwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/2019/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js b/node_modules/object.values/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/GetSubstitution.js b/node_modules/object.values/node_modules/es-abstract/2019/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/GetV.js b/node_modules/object.values/node_modules/es-abstract/2019/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/HasOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/HasProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/HourFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/InLeapYear.js b/node_modules/object.values/node_modules/es-abstract/2019/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/InstanceofOperator.js b/node_modules/object.values/node_modules/es-abstract/2019/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/Invoke.js b/node_modules/object.values/node_modules/es-abstract/2019/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsAccessorDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsArray.js b/node_modules/object.values/node_modules/es-abstract/2019/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsCallable.js b/node_modules/object.values/node_modules/es-abstract/2019/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsConcatSpreadable.js b/node_modules/object.values/node_modules/es-abstract/2019/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsConstructor.js b/node_modules/object.values/node_modules/es-abstract/2019/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsDataDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsExtensible.js b/node_modules/object.values/node_modules/es-abstract/2019/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsGenericDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsInteger.js b/node_modules/object.values/node_modules/es-abstract/2019/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsPromise.js b/node_modules/object.values/node_modules/es-abstract/2019/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2019/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsRegExp.js b/node_modules/object.values/node_modules/es-abstract/2019/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IsStringPrefix.js b/node_modules/object.values/node_modules/es-abstract/2019/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IterableToList.js b/node_modules/object.values/node_modules/es-abstract/2019/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IteratorClose.js b/node_modules/object.values/node_modules/es-abstract/2019/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IteratorComplete.js b/node_modules/object.values/node_modules/es-abstract/2019/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IteratorNext.js b/node_modules/object.values/node_modules/es-abstract/2019/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IteratorStep.js b/node_modules/object.values/node_modules/es-abstract/2019/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/IteratorValue.js b/node_modules/object.values/node_modules/es-abstract/2019/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/MakeDate.js b/node_modules/object.values/node_modules/es-abstract/2019/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/MakeDay.js b/node_modules/object.values/node_modules/es-abstract/2019/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/MakeTime.js b/node_modules/object.values/node_modules/es-abstract/2019/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/MinFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/MonthFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/NumberToString.js b/node_modules/object.values/node_modules/es-abstract/2019/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ObjectCreate.js b/node_modules/object.values/node_modules/es-abstract/2019/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasInstance.js b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasProperty.js b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js b/node_modules/object.values/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/PromiseResolve.js b/node_modules/object.values/node_modules/es-abstract/2019/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/RegExpExec.js b/node_modules/object.values/node_modules/es-abstract/2019/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/RequireObjectCoercible.js b/node_modules/object.values/node_modules/es-abstract/2019/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SameValue.js b/node_modules/object.values/node_modules/es-abstract/2019/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SameValueNonNumber.js b/node_modules/object.values/node_modules/es-abstract/2019/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SameValueZero.js b/node_modules/object.values/node_modules/es-abstract/2019/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SecFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/Set.js b/node_modules/object.values/node_modules/es-abstract/2019/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SetFunctionName.js b/node_modules/object.values/node_modules/es-abstract/2019/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SetIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2019/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SpeciesConstructor.js b/node_modules/object.values/node_modules/es-abstract/2019/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/StrictEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/2019/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/SymbolDescriptiveString.js b/node_modules/object.values/node_modules/es-abstract/2019/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/TestIntegrityLevel.js b/node_modules/object.values/node_modules/es-abstract/2019/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/TimeClip.js b/node_modules/object.values/node_modules/es-abstract/2019/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/TimeFromYear.js b/node_modules/object.values/node_modules/es-abstract/2019/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/TimeString.js b/node_modules/object.values/node_modules/es-abstract/2019/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/TimeWithinDay.js b/node_modules/object.values/node_modules/es-abstract/2019/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToBoolean.js b/node_modules/object.values/node_modules/es-abstract/2019/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToDateString.js b/node_modules/object.values/node_modules/es-abstract/2019/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToIndex.js b/node_modules/object.values/node_modules/es-abstract/2019/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToInt16.js b/node_modules/object.values/node_modules/es-abstract/2019/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToInt32.js b/node_modules/object.values/node_modules/es-abstract/2019/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToInt8.js b/node_modules/object.values/node_modules/es-abstract/2019/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToInteger.js b/node_modules/object.values/node_modules/es-abstract/2019/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToLength.js b/node_modules/object.values/node_modules/es-abstract/2019/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToNumber.js b/node_modules/object.values/node_modules/es-abstract/2019/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToObject.js b/node_modules/object.values/node_modules/es-abstract/2019/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToPrimitive.js b/node_modules/object.values/node_modules/es-abstract/2019/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToPropertyKey.js b/node_modules/object.values/node_modules/es-abstract/2019/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToString.js b/node_modules/object.values/node_modules/es-abstract/2019/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToUint16.js b/node_modules/object.values/node_modules/es-abstract/2019/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToUint32.js b/node_modules/object.values/node_modules/es-abstract/2019/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToUint8.js b/node_modules/object.values/node_modules/es-abstract/2019/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ToUint8Clamp.js b/node_modules/object.values/node_modules/es-abstract/2019/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/TrimString.js b/node_modules/object.values/node_modules/es-abstract/2019/TrimString.js new file mode 100644 index 0000000..b27112c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/TrimString.js @@ -0,0 +1,29 @@ +'use strict'; + +var trimStart = require('string.prototype.trimstart'); +var trimEnd = require('string.prototype.trimend'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-trimstring + +module.exports = function TrimString(string, where) { + var str = RequireObjectCoercible(string); + var S = ToString(str); + var T; + if (where === 'start') { + T = trimStart(S); + } else if (where === 'end') { + T = trimEnd(S); + } else if (where === 'start+end') { + T = trimStart(trimEnd(S)); + } else { + throw new $TypeError('Assertion failed: invalid `where` value; must be "start", "end", or "start+end"'); + } + return T; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/Type.js b/node_modules/object.values/node_modules/es-abstract/2019/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/WeekDay.js b/node_modules/object.values/node_modules/es-abstract/2019/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/YearFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/modulo.js b/node_modules/object.values/node_modules/es-abstract/2019/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/msFromTime.js b/node_modules/object.values/node_modules/es-abstract/2019/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/thisBooleanValue.js b/node_modules/object.values/node_modules/es-abstract/2019/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/thisNumberValue.js b/node_modules/object.values/node_modules/es-abstract/2019/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/2019/thisStringValue.js b/node_modules/object.values/node_modules/es-abstract/2019/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/thisSymbolValue.js b/node_modules/object.values/node_modules/es-abstract/2019/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/2019/thisTimeValue.js b/node_modules/object.values/node_modules/es-abstract/2019/thisTimeValue.js new file mode 100644 index 0000000..a9a47ac --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/2019/thisTimeValue.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../2018/thisTimeValue'); diff --git a/node_modules/object.values/node_modules/es-abstract/5/AbstractEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/5/AbstractEqualityComparison.js new file mode 100644 index 0000000..e55c764 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/AbstractRelationalComparison.js b/node_modules/object.values/node_modules/es-abstract/5/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/CheckObjectCoercible.js b/node_modules/object.values/node_modules/es-abstract/5/CheckObjectCoercible.js new file mode 100644 index 0000000..f02b289 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/CheckObjectCoercible.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 + +module.exports = function CheckObjectCoercible(value, optMessage) { + if (value == null) { + throw new $TypeError(optMessage || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/DateFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/Day.js b/node_modules/object.values/node_modules/es-abstract/5/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/DayFromYear.js b/node_modules/object.values/node_modules/es-abstract/5/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/5/DayWithinYear.js b/node_modules/object.values/node_modules/es-abstract/5/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/DaysInYear.js b/node_modules/object.values/node_modules/es-abstract/5/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/FromPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/5/FromPropertyDescriptor.js new file mode 100644 index 0000000..a3cefbe --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/FromPropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/HourFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/InLeapYear.js b/node_modules/object.values/node_modules/es-abstract/5/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/IsAccessorDescriptor.js b/node_modules/object.values/node_modules/es-abstract/5/IsAccessorDescriptor.js new file mode 100644 index 0000000..561382a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/IsCallable.js b/node_modules/object.values/node_modules/es-abstract/5/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/object.values/node_modules/es-abstract/5/IsDataDescriptor.js b/node_modules/object.values/node_modules/es-abstract/5/IsDataDescriptor.js new file mode 100644 index 0000000..783e2dc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/IsGenericDescriptor.js b/node_modules/object.values/node_modules/es-abstract/5/IsGenericDescriptor.js new file mode 100644 index 0000000..93340e9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/IsPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/5/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/MakeDate.js b/node_modules/object.values/node_modules/es-abstract/5/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/MakeDay.js b/node_modules/object.values/node_modules/es-abstract/5/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/MakeTime.js b/node_modules/object.values/node_modules/es-abstract/5/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/MinFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/MonthFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/SameValue.js b/node_modules/object.values/node_modules/es-abstract/5/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/SecFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/StrictEqualityComparison.js b/node_modules/object.values/node_modules/es-abstract/5/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/TimeClip.js b/node_modules/object.values/node_modules/es-abstract/5/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/5/TimeFromYear.js b/node_modules/object.values/node_modules/es-abstract/5/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/TimeWithinDay.js b/node_modules/object.values/node_modules/es-abstract/5/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToBoolean.js b/node_modules/object.values/node_modules/es-abstract/5/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToInt32.js b/node_modules/object.values/node_modules/es-abstract/5/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToInteger.js b/node_modules/object.values/node_modules/es-abstract/5/ToInteger.js new file mode 100644 index 0000000..a95265b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToInteger.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4 + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return $sign(number) * $floor($abs(number)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToNumber.js b/node_modules/object.values/node_modules/es-abstract/5/ToNumber.js new file mode 100644 index 0000000..4a7a3b8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToNumber.js @@ -0,0 +1,7 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 + +module.exports = function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToObject.js b/node_modules/object.values/node_modules/es-abstract/5/ToObject.js new file mode 100644 index 0000000..1d27a13 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var CheckObjectCoercible = require('./CheckObjectCoercible'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.9 + +module.exports = function ToObject(value) { + CheckObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToPrimitive.js b/node_modules/object.values/node_modules/es-abstract/5/ToPrimitive.js new file mode 100644 index 0000000..071df70 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.1 + +module.exports = require('es-to-primitive/es5'); diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/5/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToString.js b/node_modules/object.values/node_modules/es-abstract/5/ToString.js new file mode 100644 index 0000000..80ece42 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToString.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.8 + +module.exports = function ToString(value) { + return $String(value); +}; + diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToUint16.js b/node_modules/object.values/node_modules/es-abstract/5/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/ToUint32.js b/node_modules/object.values/node_modules/es-abstract/5/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/Type.js b/node_modules/object.values/node_modules/es-abstract/5/Type.js new file mode 100644 index 0000000..9cc750c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/Type.js @@ -0,0 +1,24 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/5.1/#sec-8 + +module.exports = function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/WeekDay.js b/node_modules/object.values/node_modules/es-abstract/5/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/YearFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/modulo.js b/node_modules/object.values/node_modules/es-abstract/5/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/5/msFromTime.js b/node_modules/object.values/node_modules/es-abstract/5/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/5/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/CHANGELOG.md b/node_modules/object.values/node_modules/es-abstract/CHANGELOG.md new file mode 100644 index 0000000..584b7cd --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/CHANGELOG.md @@ -0,0 +1,395 @@ +1.18.0-next.1 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [eslint] fix warning + * [Tests] temporarily allow SES tests to fail (#115) + * [Tests] ses-compat - initialize module after ses lockdown (#113) + * [Tests] [Refactor] use defineProperty helper rather than assignment + * [Tests] [Refactor] clean up defineProperty test helper + +1.18.0-next.0 / 2020-08-14 +================= + * [New] add `ES2020` + * [New] `GetIntrinsic`: add `%AggregateError%`, `%FinalizationRegistry%`, and `%WeakRef%` + * [New] `ES5`+: add `abs`, `floor`; use `modulo` consistently + * [New] `GetIntrinsic`: Cache accessed intrinsics (#98) + * [New] `GetIntrinsic`: Add ES201x function intrinsics (#97) + * [New] `ES2015`+: add `QuoteJSONString`, `OrdinaryCreateFromConstructor` + * [New] `ES2017`+: add `StringGetOwnProperty` + * [New] `ES2016`+: add `UTF16Encoding` + * [New] `ES2018`+: add `SetFunctionLength`, `UnicodeEscape` + * [New] add `isLeadingSurrogate`/`isTrailingSurrogate` helpers + * [Fix] `ES5`+: `ToPropertyDescriptor`: use intrinsic TypeError + * [Fix] `ES2018+`: `CopyDataProperties`/`NumberToString`: use intrinsic TypeError + * [Deps] update `is-regex`, `object-inspect` + * [Dev Deps] update `eslint` + +1.17.7 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `is-regex`, `object-inspect`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + +1.17.6 / 2020-06-13 +================= + * [Fix] `helpers/getSymbolDescription`: use the global Symbol registry when available (#92) + * [Fix] `ES2015+`: `IsConstructor`: when `Reflect.construct` is available, be spec-accurate (#93) + * [Fix] `ES2015+`: `Set`: Always return boolean value (#101) + * [Fix] `ES2015+`: `Set`: ensure exceptions are thrown in IE 9 when requested + * [Fix] Use `Reflect.apply(…)` if available (#99) + * [Fix] `helpers/floor`: module-cache `Math.floor` + * [Fix] `helpers/getSymbolDescription`: Prefer bound `description` getter when present + * [Fix] `2016`: Use `getIteratorMethod` in `IterableToArrayLike` (#94) + * [Fix] `helpers/OwnPropertyKeys`: Use `Reflect.ownKeys(…)` if available (#91) + * [Fix] `2018+`: Fix `CopyDataProperties` depending on `this` (#95) + * [meta] mark spackled files as autogenerated + * [meta] `Type`: fix spec URL + * [meta] `ES2015`: complete ops list + * [Deps] update `is‑callable`, `is‑regex` + * [Deps] switch from `string.prototype.trimleft`/`string.prototype.trimright` to `string.prototype.trimstart`/`string.prototype.trimend` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `in-publish`, `object-is`, `tape`; add `aud` + * [eslint] `helpers/isPropertyDescriptor`: fix indentation + * [Tests] `helpers/getSymbolDescription`: add test cases; some envs have `Symbol.for` but can not infer a name (#92) + * [Tests] try out CodeQL analysis + * [Tests] reformat expected missing ops + * [Tests] Run tests with `undefined` this (#96) + +1.17.5 / 2020-03-22 +================= + * [Fix] `CreateDataProperty`: update an existing property + * [Fix] run missing spackle from cd7504701879ddea0f5981e99cbcf93bfea9171d + * [Dev Deps] update `make-arrow-function`, `tape`, `@ljharb/eslint-config` + +1.17.4 / 2020-01-21 +================= + * [Fix] `2015+`: add code to handle IE 8’s problems + * [Tests] fix tests for IE 8 + +1.17.3 / 2020-01-19 +================= + * [Fix] `ObjectCreate` `2015+`: Fall back to `__proto__` and normal `new` in older browsers + * [Fix] `GetIntrinsic`: ensure the `allowMissing` property actually works on dotted intrinsics + +1.17.2 / 2020-01-14 +================= + * [Fix] `helpers/OwnPropertyKeys`: include non-enumerables too + +1.17.1 / 2020-01-14 +================= + * [Refactor] add `OwnPropertyKeys` helper, use it in `CopyDataProperties` + * [Refactor] `IteratorClose`: remove useless assignment + * [Dev Deps] update `eslint`, `tape`, `diff` + +1.17.0 / 2019-12-20 +================= + * [New] Split up each operation into its own file (prereleased) + * [Fix] `GetIntrinsic`: IE 8 has a broken `Object.getOwnPropertyDescriptor` + * [Fix] `object.assign` is a runtime dep (prereleased) + * [Refactor] `GetIntrinsic`: remove the internal property salts, since % already handles that + * [Refactor] `GetIntrinsic`: further simplification + * [Deps] update `is-callable`, `string.prototype.trimleft`, `string.prototype.trimright`, `is-regex` + * [Dev Deps] update `@ljharb/eslint-config`, `object-is`, `object.fromentries`, `tape` + * [Tests] add `.eslintignore` + * [meta] remove unused Makefile and associated utils + * [meta] only run spackle script in publish (#78) (prereleased) + +1.17.0-next.1 / 2019-12-11 +================= + * [Fix] `object.assign` is a runtime dep + * [meta] only run spackle script in publish (#78) + +1.17.0-next.0 / 2019-12-11 +================= + * [New] Split up each operation into its own file + +1.16.3 / 2019-12-04 +================= + * [Fix] `GetIntrinsic`: when given a path to a getter, return the actual getter + * [Dev Deps] update `eslint` + +1.16.2 / 2019-11-24 +================= + * [Fix] IE 6-7 lack JSON + * [Fix] IE 6-8 strings can’t use array slice, they need string slice + * [Dev Deps] update `eslint` + +1.16.1 / 2019-11-24 +================= + * [Fix] `GetIntrinsics`: turns out IE 8 throws when `Object.getOwnPropertyDescriptor(arguments);`, and does not throw on `callee` anyways + * [Deps] update `es-to-primitive`, `has-symbols`, `object-inspect` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + * [meta] re-include year files inside `operations` + * [meta] add `funding` field + * [actions] add Automatic Rebase github action + * [Tests] use shared travis-ci config + * [Tests] disable `check-coverage`, and let codecov do it + +1.16.0 / 2019-10-18 +================= + * [New] `ES2015+`: add `SetFunctionName` + * [New] `ES2015+`: add `GetPrototypeFromConstructor`, with caveats + * [New] `ES2015+`: add `CreateListFromArrayLike` + * [New] `ES2016+`: add `OrdinarySetPrototypeOf` + * [New] `ES2016+`: add `OrdinaryGetPrototypeOf` + * [New] add `getSymbolDescription` and `getInferredName` helpers + * [Fix] `GetIterator`: add fallback for pre-Symbol environments, tests + * [Dev Deps] update `object.fromentries` + * [Tests] add `node` `v12.2` + +1.15.0 / 2019-10-02 +================= + * [New] `ES2018`+: add `DateString`, `TimeString` + * [New] `ES2015`+: add `ToDateString` + * [New] `ES5`+: add `msFromTime`, `SecFromTime`, `MinFromTime`, `HourFromTime`, `TimeWithinDay`, `Day`, `DayFromYear`, `TimeFromYear`, `YearFromTime`, `WeekDay`, `DaysInYear`, `InLeapYear`, `DayWithinYear`, `MonthFromTime`, `DateFromTime`, `MakeDay`, `MakeDate`, `MakeTime`, `TimeClip`, `modulo` + * [New] add `regexTester` helper + * [New] add `callBound` helper + * [New] add ES2020’s intrinsic dot notation + * [New] add `isPrefixOf` helper + * [New] add `maxSafeInteger` helper + * [Deps] update `string.prototype.trimleft`, `string.prototype.trimright` + * [Dev Deps] update `eslint` + * [Tests] on `node` `v12.11` + * [meta] npmignore operations scripts; add "deltas" + +1.14.2 / 2019-09-08 +================= + * [Fix] `ES2016`: `IterableToArrayLike`: add proper fallback for strings, pre-Symbols + * [Tests] on `node` `v12.10` + +1.14.1 / 2019-09-03 +================= + * [meta] republish with some extra files removed + +1.14.0 / 2019-09-02 +================= + * [New] add ES2019 + * [New] `ES2017+`: add `IterableToList` + * [New] `ES2016`: add `IterableToArrayLike` + * [New] `ES2015+`: add `ArrayCreate`, `ArraySetLength`, `OrdinaryDefineOwnProperty`, `OrdinaryGetOwnProperty`, `OrdinaryHasProperty`, `CreateHTML`, `GetOwnPropertyKeys`, `InstanceofOperator`, `SymbolDescriptiveString`, `GetSubstitution`, `ValidateAndApplyPropertyDescriptor`, `IsPromise`, `OrdinaryHasInstance`, `TestIntegrityLevel`, `SetIntegrityLevel` + * [New] add `callBind` helper, and use it + * [New] add helpers: `isPropertyDescriptor`, `every` + * [New] ES5+: add `Abstract Relational Comparison` + * [New] ES5+: add `Abstract Equality Comparison`, `Strict Equality Comparison` + * [Fix] `ES2015+`: `GetIterator`: only require native Symbols when `method` is omitted + * [Fix] `ES2015`: `Call`: error message now properly displays Symbols using `object-inspect` + * [Fix] `ES2015+`: `ValidateAndApplyPropertyDescriptor`: use ES2017 logic to bypass spec bugs + * [Fix] `ES2015+`: `CreateDataProperty`, `DefinePropertyOrThrow`, `ValidateAndApplyPropertyDescriptor`: add fallbacks for ES3 + * [Fix] `ES2015+`: `FromPropertyDescriptor`: no longer requires a fully complete Property Descriptor + * [Fix] `ES5`: `IsPropertyDescriptor`: call into `IsDataDescriptor` and `IsAccessorDescriptor` + * [Refactor] use `has-symbols` for Symbol detection + * [Fix] `helpers/assertRecord`: remove `console.log` + * [Deps] update `object-keys` + * [readme] add security note + * [meta] change http URLs to https + * [meta] linter cleanup + * [meta] fix getOps script + * [meta] add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `replace`, `cheerio`, `tape` + * [Tests] up to `node` `v12.9`, `v11.15`, `v10.16`, `v8.16`, `v6.17` + * [Tests] temporarily allow node 0.6 to fail; segfaulting in travis + * [Tests] use the values helper more in es5 tests + * [Tests] fix linting to apply to all files + * [Tests] run `npx aud` only on prod deps + * [Tests] add v.descriptors helpers + * [Tests] use `npx aud` instead of `npm audit` with hoops + * [Tests] use `eclint` instead of `editorconfig-tools` + * [Tests] some intrinsic cleanup + * [Tests] migrate es5 tests to use values helper + * [Tests] add some missing ES2015 ops + +1.13.0 / 2019-01-02 +================= + * [New] add ES2018 + * [New] add ES2015/ES2016: EnumerableOwnNames; ES2017: EnumerableOwnProperties + * [New] `ES2015+`: add `thisBooleanValue`, `thisNumberValue`, `thisStringValue`, `thisTimeValue` + * [New] `ES2015+`: add `DefinePropertyOrThrow`, `DeletePropertyOrThrow`, `CreateMethodProperty` + * [New] add `assertRecord` helper + * [Deps] update `is-callable`, `has`, `object-keys`, `es-to-primitive` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `semver`, `safe-publish-latest`, `replace` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + * [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` + * [Tests] move descriptor factories to `values` helper + * [Tests] add `getOps` to programmatically fetch abstract operation names + +1.12.0 / 2018-05-31 +================= + * [New] add `GetIntrinsic` entry point + * [New] `ES2015`+: add `ObjectCreate` + * [Robustness]: `ES2015+`: ensure `Math.{abs,floor}` and `Function.call` are cached + +1.11.0 / 2018-03-21 +================= + * [New] `ES2015+`: add iterator abstract ops + * [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape` + * [Tests] up to `node` `v9.8`, `v8.10`, `v6.13` + +1.10.0 / 2017-11-24 +================= + * [New] ES2015+: `AdvanceStringIndex` + * [Dev Deps] update `eslint`, `nsp` + * [Tests] require node 0.6 to pass again + * [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS + +1.9.0 / 2017-09-30 +================= + * [New] `es2015+`: add `ArraySpeciesCreate` + * [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow` + * [Tests] consolidate duplicated tests + * [Tests] increase coverage + * [Dev Deps] update `nsp`, `eslint` + +1.8.2 / 2017-09-03 +================= + * [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27) + * [Dev Deps] update `eslint` + +1.8.1 / 2017-08-30 +================= + * [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26) + * [Deps] update `function-bind` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [Docs] github broke markdown parsing + +1.8.0 / 2017-08-04 +================= + * [New] add ES2017 + * [New] move es6+ to es2015+; leave es6/es7 as aliases + * [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor` + * [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec` + * [Fix] es7/es2016: do not mutate ES6 + * [Fix] assign helper only supports one source + * [Deps] update `is-regex` + * [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` + * [Tests] add tests for missing and excess operations + * [Tests] add codecov for coverage + * [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node + * [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same + * [Tests] ES2015: add ToNumber symbol tests + * [Tests] switch to `nyc` for code coverage + * [Tests] make IsRegExp tests consistent across editions + +1.7.0 / 2017-01-22 +================= + * [New] ES6: Add `GetMethod` (#16) + * [New] ES6: Add `GetV` (#16) + * [New] ES6: Add `Get` (#17) + * [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix + * [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + +1.6.1 / 2016-08-21 +================= + * [Fix] ES6: IsConstructor should return true for `class` constructors. + +1.6.0 / 2016-08-20 +================= + * [New] ES5 / ES6: add `Type` + * [New] ES6: `SpeciesConstructor` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest` + * [Tests] up to `node` `v6.4`, `v5.12`, `v4.5` + +1.5.1 / 2016-05-30 +================= + * [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument + * [Refactor] create `isNaN` helper + * [Deps] update `is-callable`, `function-bind` + * [Deps] update `es-to-primitive`, fix ES5 tests + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp` + * [Tests] up to `node` `v6.2`, `v5.11`, `v4.4` + * [Tests] use pretest/posttest for linting/security + +1.5.0 / 2015-12-27 +================= + * [New] adds `Symbol.toPrimitive` support via `es-to-primitive` + * [Deps] update `is-callable`, `es-to-primitive` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape` + * [Tests] up to `node` `v5.3` + +1.4.3 / 2015-11-04 +================= + * [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4) + * [Refactor] `ES6.ToNumber`: No need to double-trim + * [Refactor] group tests better + * [Tests] should still pass on `node` `v0.8` + +1.4.2 / 2015-11-02 +================= + * [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3) + +1.4.1 / 2015-10-31 +================= + * [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2) + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v5.0` + * [Tests] fix npm upgrades for older node versions + * package.json: use object form of "authors", add "contributors" + +1.4.0 / 2015-09-26 +================= + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v4.2` + * [New] Add `SameValueNonNumber` to ES7 + +1.3.2 / 2015-09-26 +================= + * [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` + +1.3.1 / 2015-08-15 +================= + * [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly + +1.3.0 / 2015-08-15 +================= + * [New] ES6’s ToNumber now supports binary and octal literals. + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] up to `io.js` `v3.0` + +1.2.2 / 2015-07-28 +================= + * [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw. + * [Tests] Test on latest `io.js` versions. + * [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp` + +1.2.1 / 2015-03-20 +================= + * Fix `isFinite` helper. + +1.2.0 / 2015-03-19 +================= + * Use `es-to-primitive` for ToPrimitive methods. + * Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions. + +1.1.2 / 2015-03-20 +================= + * Fix isFinite helper. + +1.1.1 / 2015-03-19 +================= + * Fix isPrimitive check for functions + * Update `eslint`, `editorconfig-tools`, `semver`, `nsp` + +1.1.0 / 2015-02-17 +================= + * Add ES7 export (non-default). + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Test on `iojs-v1.2`. + +1.0.1 / 2015-01-30 +================= + * Use `is-callable` instead of an internal function. + * Update `tape`, `jscs`, `nsp`, `eslint` + +1.0.0 / 2015-01-10 +================= + * v1.0.0 diff --git a/node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js b/node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js new file mode 100644 index 0000000..5d38e1f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js @@ -0,0 +1,225 @@ +'use strict'; + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; + +var $TypeError = TypeError; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayPrototype%': Array.prototype, + '%ArrayProto_entries%': Array.prototype.entries, + '%ArrayProto_forEach%': Array.prototype.forEach, + '%ArrayProto_keys%': Array.prototype.keys, + '%ArrayProto_values%': Array.prototype.values, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': asyncFunction, + '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%Boolean%': Boolean, + '%BooleanPrototype%': Boolean.prototype, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '%Date%': Date, + '%DatePrototype%': Date.prototype, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%ErrorPrototype%': Error.prototype, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%EvalErrorPrototype%': EvalError.prototype, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '%Function%': Function, + '%FunctionPrototype%': Function.prototype, + '%Generator%': generator ? getProto(generator()) : undefined, + '%GeneratorFunction%': generatorFunction, + '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '%Math%': Math, + '%Number%': Number, + '%NumberPrototype%': Number.prototype, + '%Object%': Object, + '%ObjectPrototype%': Object.prototype, + '%ObjProto_toString%': Object.prototype.toString, + '%ObjProto_valueOf%': Object.prototype.valueOf, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%RangeErrorPrototype%': RangeError.prototype, + '%ReferenceError%': ReferenceError, + '%ReferenceErrorPrototype%': ReferenceError.prototype, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%RegExpPrototype%': RegExp.prototype, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringPrototype%': String.prototype, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '%SyntaxError%': SyntaxError, + '%SyntaxErrorPrototype%': SyntaxError.prototype, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '%TypeError%': $TypeError, + '%TypeErrorPrototype%': $TypeError.prototype, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '%URIError%': URIError, + '%URIErrorPrototype%': URIError.prototype, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +var bind = require('function-bind'); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + if (!(name in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[name]; +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, parts[i]); + if (!allowMissing && !(parts[i] in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]]; + } else { + value = value[parts[i]]; + } + } + } + return value; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/LICENSE b/node_modules/object.values/node_modules/es-abstract/LICENSE new file mode 100644 index 0000000..8c271c1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/object.values/node_modules/es-abstract/README.md b/node_modules/object.values/node_modules/es-abstract/README.md new file mode 100644 index 0000000..20342d1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/README.md @@ -0,0 +1,48 @@ +# es-abstract [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +ECMAScript spec abstract operations. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +All abstract operations will also be available under an `es5`/`es2015`/`es2016`/`es2017`/`es2018`/`es2019` entry point, and exported property, if you require a specific version. + +## Example + +```js +var ES = require('es-abstract'); +var assert = require('assert'); + +assert(ES.isCallable(function () {})); +assert(!ES.isCallable(/a/g)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-abstract +[npm-version-svg]: http://versionbadg.es/ljharb/es-abstract.svg +[travis-svg]: https://travis-ci.org/ljharb/es-abstract.svg +[travis-url]: https://travis-ci.org/ljharb/es-abstract +[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg +[deps-url]: https://david-dm.org/ljharb/es-abstract +[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/es-abstract.png +[testling-url]: https://ci.testling.com/ljharb/es-abstract +[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-abstract.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-abstract.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-abstract diff --git a/node_modules/object.values/node_modules/es-abstract/es2015.js b/node_modules/object.values/node_modules/es-abstract/es2015.js new file mode 100644 index 0000000..dc02ca4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es2015.js @@ -0,0 +1,115 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-operations +var ES6 = { + 'Abstract Equality Comparison': require('./2015/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2015/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2015/StrictEqualityComparison'), + AdvanceStringIndex: require('./2015/AdvanceStringIndex'), + ArrayCreate: require('./2015/ArrayCreate'), + ArraySetLength: require('./2015/ArraySetLength'), + ArraySpeciesCreate: require('./2015/ArraySpeciesCreate'), + Call: require('./2015/Call'), + CanonicalNumericIndexString: require('./2015/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2015/CompletePropertyDescriptor'), + CreateDataProperty: require('./2015/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2015/CreateDataPropertyOrThrow'), + CreateHTML: require('./2015/CreateHTML'), + CreateIterResultObject: require('./2015/CreateIterResultObject'), + CreateListFromArrayLike: require('./2015/CreateListFromArrayLike'), + CreateMethodProperty: require('./2015/CreateMethodProperty'), + DateFromTime: require('./2015/DateFromTime'), + Day: require('./2015/Day'), + DayFromYear: require('./2015/DayFromYear'), + DaysInYear: require('./2015/DaysInYear'), + DayWithinYear: require('./2015/DayWithinYear'), + DefinePropertyOrThrow: require('./2015/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2015/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2015/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2015/FromPropertyDescriptor'), + Get: require('./2015/Get'), + GetIterator: require('./2015/GetIterator'), + GetMethod: require('./2015/GetMethod'), + GetOwnPropertyKeys: require('./2015/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2015/GetPrototypeFromConstructor'), + GetSubstitution: require('./2015/GetSubstitution'), + GetV: require('./2015/GetV'), + HasOwnProperty: require('./2015/HasOwnProperty'), + HasProperty: require('./2015/HasProperty'), + HourFromTime: require('./2015/HourFromTime'), + InLeapYear: require('./2015/InLeapYear'), + InstanceofOperator: require('./2015/InstanceofOperator'), + Invoke: require('./2015/Invoke'), + IsAccessorDescriptor: require('./2015/IsAccessorDescriptor'), + IsArray: require('./2015/IsArray'), + IsCallable: require('./2015/IsCallable'), + IsConcatSpreadable: require('./2015/IsConcatSpreadable'), + IsConstructor: require('./2015/IsConstructor'), + IsDataDescriptor: require('./2015/IsDataDescriptor'), + IsExtensible: require('./2015/IsExtensible'), + IsGenericDescriptor: require('./2015/IsGenericDescriptor'), + IsInteger: require('./2015/IsInteger'), + IsPromise: require('./2015/IsPromise'), + IsPropertyDescriptor: require('./2015/IsPropertyDescriptor'), + IsPropertyKey: require('./2015/IsPropertyKey'), + IsRegExp: require('./2015/IsRegExp'), + IteratorClose: require('./2015/IteratorClose'), + IteratorComplete: require('./2015/IteratorComplete'), + IteratorNext: require('./2015/IteratorNext'), + IteratorStep: require('./2015/IteratorStep'), + IteratorValue: require('./2015/IteratorValue'), + MakeDate: require('./2015/MakeDate'), + MakeDay: require('./2015/MakeDay'), + MakeTime: require('./2015/MakeTime'), + MinFromTime: require('./2015/MinFromTime'), + modulo: require('./2015/modulo'), + MonthFromTime: require('./2015/MonthFromTime'), + msFromTime: require('./2015/msFromTime'), + ObjectCreate: require('./2015/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2015/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2015/OrdinaryGetOwnProperty'), + OrdinaryHasInstance: require('./2015/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2015/OrdinaryHasProperty'), + RegExpExec: require('./2015/RegExpExec'), + RequireObjectCoercible: require('./2015/RequireObjectCoercible'), + SameValue: require('./2015/SameValue'), + SameValueZero: require('./2015/SameValueZero'), + SecFromTime: require('./2015/SecFromTime'), + Set: require('./2015/Set'), + SetFunctionName: require('./2015/SetFunctionName'), + SetIntegrityLevel: require('./2015/SetIntegrityLevel'), + SpeciesConstructor: require('./2015/SpeciesConstructor'), + SymbolDescriptiveString: require('./2015/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2015/TestIntegrityLevel'), + thisBooleanValue: require('./2015/thisBooleanValue'), + thisNumberValue: require('./2015/thisNumberValue'), + thisStringValue: require('./2015/thisStringValue'), + thisTimeValue: require('./2015/thisTimeValue'), + TimeClip: require('./2015/TimeClip'), + TimeFromYear: require('./2015/TimeFromYear'), + TimeWithinDay: require('./2015/TimeWithinDay'), + ToBoolean: require('./2015/ToBoolean'), + ToDateString: require('./2015/ToDateString'), + ToInt16: require('./2015/ToInt16'), + ToInt32: require('./2015/ToInt32'), + ToInt8: require('./2015/ToInt8'), + ToInteger: require('./2015/ToInteger'), + ToLength: require('./2015/ToLength'), + ToNumber: require('./2015/ToNumber'), + ToObject: require('./2015/ToObject'), + ToPrimitive: require('./2015/ToPrimitive'), + ToPropertyDescriptor: require('./2015/ToPropertyDescriptor'), + ToPropertyKey: require('./2015/ToPropertyKey'), + ToString: require('./2015/ToString'), + ToUint16: require('./2015/ToUint16'), + ToUint32: require('./2015/ToUint32'), + ToUint8: require('./2015/ToUint8'), + ToUint8Clamp: require('./2015/ToUint8Clamp'), + Type: require('./2015/Type'), + ValidateAndApplyPropertyDescriptor: require('./2015/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2015/WeekDay'), + YearFromTime: require('./2015/YearFromTime') +}; + +module.exports = ES6; diff --git a/node_modules/object.values/node_modules/es-abstract/es2016.js b/node_modules/object.values/node_modules/es-abstract/es2016.js new file mode 100644 index 0000000..9e72e82 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es2016.js @@ -0,0 +1,119 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/7.0/#sec-abstract-operations +var ES2016 = { + 'Abstract Equality Comparison': require('./2016/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2016/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2016/StrictEqualityComparison'), + AdvanceStringIndex: require('./2016/AdvanceStringIndex'), + ArrayCreate: require('./2016/ArrayCreate'), + ArraySetLength: require('./2016/ArraySetLength'), + ArraySpeciesCreate: require('./2016/ArraySpeciesCreate'), + Call: require('./2016/Call'), + CanonicalNumericIndexString: require('./2016/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2016/CompletePropertyDescriptor'), + CreateDataProperty: require('./2016/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2016/CreateDataPropertyOrThrow'), + CreateHTML: require('./2016/CreateHTML'), + CreateIterResultObject: require('./2016/CreateIterResultObject'), + CreateListFromArrayLike: require('./2016/CreateListFromArrayLike'), + CreateMethodProperty: require('./2016/CreateMethodProperty'), + DateFromTime: require('./2016/DateFromTime'), + Day: require('./2016/Day'), + DayFromYear: require('./2016/DayFromYear'), + DaysInYear: require('./2016/DaysInYear'), + DayWithinYear: require('./2016/DayWithinYear'), + DefinePropertyOrThrow: require('./2016/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2016/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2016/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2016/FromPropertyDescriptor'), + Get: require('./2016/Get'), + GetIterator: require('./2016/GetIterator'), + GetMethod: require('./2016/GetMethod'), + GetOwnPropertyKeys: require('./2016/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2016/GetPrototypeFromConstructor'), + GetSubstitution: require('./2016/GetSubstitution'), + GetV: require('./2016/GetV'), + HasOwnProperty: require('./2016/HasOwnProperty'), + HasProperty: require('./2016/HasProperty'), + HourFromTime: require('./2016/HourFromTime'), + InLeapYear: require('./2016/InLeapYear'), + InstanceofOperator: require('./2016/InstanceofOperator'), + Invoke: require('./2016/Invoke'), + IsAccessorDescriptor: require('./2016/IsAccessorDescriptor'), + IsArray: require('./2016/IsArray'), + IsCallable: require('./2016/IsCallable'), + IsConcatSpreadable: require('./2016/IsConcatSpreadable'), + IsConstructor: require('./2016/IsConstructor'), + IsDataDescriptor: require('./2016/IsDataDescriptor'), + IsExtensible: require('./2016/IsExtensible'), + IsGenericDescriptor: require('./2016/IsGenericDescriptor'), + IsInteger: require('./2016/IsInteger'), + IsPromise: require('./2016/IsPromise'), + IsPropertyDescriptor: require('./2016/IsPropertyDescriptor'), + IsPropertyKey: require('./2016/IsPropertyKey'), + IsRegExp: require('./2016/IsRegExp'), + IterableToArrayLike: require('./2016/IterableToArrayLike'), + IteratorClose: require('./2016/IteratorClose'), + IteratorComplete: require('./2016/IteratorComplete'), + IteratorNext: require('./2016/IteratorNext'), + IteratorStep: require('./2016/IteratorStep'), + IteratorValue: require('./2016/IteratorValue'), + MakeDate: require('./2016/MakeDate'), + MakeDay: require('./2016/MakeDay'), + MakeTime: require('./2016/MakeTime'), + MinFromTime: require('./2016/MinFromTime'), + modulo: require('./2016/modulo'), + MonthFromTime: require('./2016/MonthFromTime'), + msFromTime: require('./2016/msFromTime'), + ObjectCreate: require('./2016/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2016/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2016/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2016/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2016/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2016/OrdinaryHasProperty'), + RegExpExec: require('./2016/RegExpExec'), + RequireObjectCoercible: require('./2016/RequireObjectCoercible'), + SameValue: require('./2016/SameValue'), + SameValueNonNumber: require('./2016/SameValueNonNumber'), + SameValueZero: require('./2016/SameValueZero'), + SecFromTime: require('./2016/SecFromTime'), + Set: require('./2016/Set'), + SetFunctionName: require('./2016/SetFunctionName'), + SetIntegrityLevel: require('./2016/SetIntegrityLevel'), + SpeciesConstructor: require('./2016/SpeciesConstructor'), + SymbolDescriptiveString: require('./2016/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2016/TestIntegrityLevel'), + thisBooleanValue: require('./2016/thisBooleanValue'), + thisNumberValue: require('./2016/thisNumberValue'), + thisStringValue: require('./2016/thisStringValue'), + thisTimeValue: require('./2016/thisTimeValue'), + TimeClip: require('./2016/TimeClip'), + TimeFromYear: require('./2016/TimeFromYear'), + TimeWithinDay: require('./2016/TimeWithinDay'), + ToBoolean: require('./2016/ToBoolean'), + ToDateString: require('./2016/ToDateString'), + ToInt16: require('./2016/ToInt16'), + ToInt32: require('./2016/ToInt32'), + ToInt8: require('./2016/ToInt8'), + ToInteger: require('./2016/ToInteger'), + ToLength: require('./2016/ToLength'), + ToNumber: require('./2016/ToNumber'), + ToObject: require('./2016/ToObject'), + ToPrimitive: require('./2016/ToPrimitive'), + ToPropertyDescriptor: require('./2016/ToPropertyDescriptor'), + ToPropertyKey: require('./2016/ToPropertyKey'), + ToString: require('./2016/ToString'), + ToUint16: require('./2016/ToUint16'), + ToUint32: require('./2016/ToUint32'), + ToUint8: require('./2016/ToUint8'), + ToUint8Clamp: require('./2016/ToUint8Clamp'), + Type: require('./2016/Type'), + ValidateAndApplyPropertyDescriptor: require('./2016/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2016/WeekDay'), + YearFromTime: require('./2016/YearFromTime') +}; + +module.exports = ES2016; diff --git a/node_modules/object.values/node_modules/es-abstract/es2017.js b/node_modules/object.values/node_modules/es-abstract/es2017.js new file mode 100644 index 0000000..5f317b7 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es2017.js @@ -0,0 +1,120 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/8.0/#sec-abstract-operations +var ES2017 = { + 'Abstract Equality Comparison': require('./2017/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2017/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2017/StrictEqualityComparison'), + AdvanceStringIndex: require('./2017/AdvanceStringIndex'), + ArrayCreate: require('./2017/ArrayCreate'), + ArraySetLength: require('./2017/ArraySetLength'), + ArraySpeciesCreate: require('./2017/ArraySpeciesCreate'), + Call: require('./2017/Call'), + CanonicalNumericIndexString: require('./2017/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2017/CompletePropertyDescriptor'), + CreateDataProperty: require('./2017/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2017/CreateDataPropertyOrThrow'), + CreateHTML: require('./2017/CreateHTML'), + CreateIterResultObject: require('./2017/CreateIterResultObject'), + CreateListFromArrayLike: require('./2017/CreateListFromArrayLike'), + CreateMethodProperty: require('./2017/CreateMethodProperty'), + DateFromTime: require('./2017/DateFromTime'), + Day: require('./2017/Day'), + DayFromYear: require('./2017/DayFromYear'), + DaysInYear: require('./2017/DaysInYear'), + DayWithinYear: require('./2017/DayWithinYear'), + DefinePropertyOrThrow: require('./2017/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2017/DeletePropertyOrThrow'), + EnumerableOwnProperties: require('./2017/EnumerableOwnProperties'), + FromPropertyDescriptor: require('./2017/FromPropertyDescriptor'), + Get: require('./2017/Get'), + GetIterator: require('./2017/GetIterator'), + GetMethod: require('./2017/GetMethod'), + GetOwnPropertyKeys: require('./2017/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2017/GetPrototypeFromConstructor'), + GetSubstitution: require('./2017/GetSubstitution'), + GetV: require('./2017/GetV'), + HasOwnProperty: require('./2017/HasOwnProperty'), + HasProperty: require('./2017/HasProperty'), + HourFromTime: require('./2017/HourFromTime'), + InLeapYear: require('./2017/InLeapYear'), + InstanceofOperator: require('./2017/InstanceofOperator'), + Invoke: require('./2017/Invoke'), + IsAccessorDescriptor: require('./2017/IsAccessorDescriptor'), + IsArray: require('./2017/IsArray'), + IsCallable: require('./2017/IsCallable'), + IsConcatSpreadable: require('./2017/IsConcatSpreadable'), + IsConstructor: require('./2017/IsConstructor'), + IsDataDescriptor: require('./2017/IsDataDescriptor'), + IsExtensible: require('./2017/IsExtensible'), + IsGenericDescriptor: require('./2017/IsGenericDescriptor'), + IsInteger: require('./2017/IsInteger'), + IsPromise: require('./2017/IsPromise'), + IsPropertyDescriptor: require('./2017/IsPropertyDescriptor'), + IsPropertyKey: require('./2017/IsPropertyKey'), + IsRegExp: require('./2017/IsRegExp'), + IterableToList: require('./2017/IterableToList'), + IteratorClose: require('./2017/IteratorClose'), + IteratorComplete: require('./2017/IteratorComplete'), + IteratorNext: require('./2017/IteratorNext'), + IteratorStep: require('./2017/IteratorStep'), + IteratorValue: require('./2017/IteratorValue'), + MakeDate: require('./2017/MakeDate'), + MakeDay: require('./2017/MakeDay'), + MakeTime: require('./2017/MakeTime'), + MinFromTime: require('./2017/MinFromTime'), + modulo: require('./2017/modulo'), + MonthFromTime: require('./2017/MonthFromTime'), + msFromTime: require('./2017/msFromTime'), + ObjectCreate: require('./2017/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2017/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2017/OrdinaryGetOwnProperty'), + OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), + OrdinaryGetPrototypeOf: require('./2017/OrdinaryGetPrototypeOf'), + OrdinaryHasInstance: require('./2017/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2017/OrdinaryHasProperty'), + RegExpExec: require('./2017/RegExpExec'), + RequireObjectCoercible: require('./2017/RequireObjectCoercible'), + SameValue: require('./2017/SameValue'), + SameValueNonNumber: require('./2017/SameValueNonNumber'), + SameValueZero: require('./2017/SameValueZero'), + SecFromTime: require('./2017/SecFromTime'), + Set: require('./2017/Set'), + SetFunctionName: require('./2017/SetFunctionName'), + SetIntegrityLevel: require('./2017/SetIntegrityLevel'), + SpeciesConstructor: require('./2017/SpeciesConstructor'), + SymbolDescriptiveString: require('./2017/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2017/TestIntegrityLevel'), + thisBooleanValue: require('./2017/thisBooleanValue'), + thisNumberValue: require('./2017/thisNumberValue'), + thisStringValue: require('./2017/thisStringValue'), + thisTimeValue: require('./2017/thisTimeValue'), + TimeClip: require('./2017/TimeClip'), + TimeFromYear: require('./2017/TimeFromYear'), + TimeWithinDay: require('./2017/TimeWithinDay'), + ToBoolean: require('./2017/ToBoolean'), + ToDateString: require('./2017/ToDateString'), + ToIndex: require('./2017/ToIndex'), + ToInt16: require('./2017/ToInt16'), + ToInt32: require('./2017/ToInt32'), + ToInt8: require('./2017/ToInt8'), + ToInteger: require('./2017/ToInteger'), + ToLength: require('./2017/ToLength'), + ToNumber: require('./2017/ToNumber'), + ToObject: require('./2017/ToObject'), + ToPrimitive: require('./2017/ToPrimitive'), + ToPropertyDescriptor: require('./2017/ToPropertyDescriptor'), + ToPropertyKey: require('./2017/ToPropertyKey'), + ToString: require('./2017/ToString'), + ToUint16: require('./2017/ToUint16'), + ToUint32: require('./2017/ToUint32'), + ToUint8: require('./2017/ToUint8'), + ToUint8Clamp: require('./2017/ToUint8Clamp'), + Type: require('./2017/Type'), + ValidateAndApplyPropertyDescriptor: require('./2017/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2017/WeekDay'), + YearFromTime: require('./2017/YearFromTime') +}; + +module.exports = ES2017; diff --git a/node_modules/object.values/node_modules/es-abstract/es2018.js b/node_modules/object.values/node_modules/es-abstract/es2018.js new file mode 100644 index 0000000..e68910b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es2018.js @@ -0,0 +1,126 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/9.0/#sec-abstract-operations +var ES2018 = { + 'Abstract Equality Comparison': require('./2018/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2018/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2018/StrictEqualityComparison'), + AdvanceStringIndex: require('./2018/AdvanceStringIndex'), + ArrayCreate: require('./2018/ArrayCreate'), + ArraySetLength: require('./2018/ArraySetLength'), + ArraySpeciesCreate: require('./2018/ArraySpeciesCreate'), + Call: require('./2018/Call'), + CanonicalNumericIndexString: require('./2018/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2018/CompletePropertyDescriptor'), + CopyDataProperties: require('./2018/CopyDataProperties'), + CreateDataProperty: require('./2018/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2018/CreateDataPropertyOrThrow'), + CreateHTML: require('./2018/CreateHTML'), + CreateIterResultObject: require('./2018/CreateIterResultObject'), + CreateListFromArrayLike: require('./2018/CreateListFromArrayLike'), + CreateMethodProperty: require('./2018/CreateMethodProperty'), + DateFromTime: require('./2018/DateFromTime'), + DateString: require('./2018/DateString'), + Day: require('./2018/Day'), + DayFromYear: require('./2018/DayFromYear'), + DaysInYear: require('./2018/DaysInYear'), + DayWithinYear: require('./2018/DayWithinYear'), + DefinePropertyOrThrow: require('./2018/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2018/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'), + FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'), + Get: require('./2018/Get'), + GetIterator: require('./2018/GetIterator'), + GetMethod: require('./2018/GetMethod'), + GetOwnPropertyKeys: require('./2018/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2018/GetPrototypeFromConstructor'), + GetSubstitution: require('./2018/GetSubstitution'), + GetV: require('./2018/GetV'), + HasOwnProperty: require('./2018/HasOwnProperty'), + HasProperty: require('./2018/HasProperty'), + HourFromTime: require('./2018/HourFromTime'), + InLeapYear: require('./2018/InLeapYear'), + InstanceofOperator: require('./2018/InstanceofOperator'), + Invoke: require('./2018/Invoke'), + IsAccessorDescriptor: require('./2018/IsAccessorDescriptor'), + IsArray: require('./2018/IsArray'), + IsCallable: require('./2018/IsCallable'), + IsConcatSpreadable: require('./2018/IsConcatSpreadable'), + IsConstructor: require('./2018/IsConstructor'), + IsDataDescriptor: require('./2018/IsDataDescriptor'), + IsExtensible: require('./2018/IsExtensible'), + IsGenericDescriptor: require('./2018/IsGenericDescriptor'), + IsInteger: require('./2018/IsInteger'), + IsPromise: require('./2018/IsPromise'), + IsPropertyKey: require('./2018/IsPropertyKey'), + IsRegExp: require('./2018/IsRegExp'), + IsStringPrefix: require('./2018/IsStringPrefix'), + IterableToList: require('./2018/IterableToList'), + IteratorClose: require('./2018/IteratorClose'), + IteratorComplete: require('./2018/IteratorComplete'), + IteratorNext: require('./2018/IteratorNext'), + IteratorStep: require('./2018/IteratorStep'), + IteratorValue: require('./2018/IteratorValue'), + MakeDate: require('./2018/MakeDate'), + MakeDay: require('./2018/MakeDay'), + MakeTime: require('./2018/MakeTime'), + MinFromTime: require('./2018/MinFromTime'), + modulo: require('./2018/modulo'), + MonthFromTime: require('./2018/MonthFromTime'), + msFromTime: require('./2018/msFromTime'), + NumberToString: require('./2018/NumberToString'), + ObjectCreate: require('./2018/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'), + PromiseResolve: require('./2018/PromiseResolve'), + RegExpExec: require('./2018/RegExpExec'), + RequireObjectCoercible: require('./2018/RequireObjectCoercible'), + SameValue: require('./2018/SameValue'), + SameValueNonNumber: require('./2018/SameValueNonNumber'), + SameValueZero: require('./2018/SameValueZero'), + SecFromTime: require('./2018/SecFromTime'), + Set: require('./2018/Set'), + SetFunctionName: require('./2018/SetFunctionName'), + SetIntegrityLevel: require('./2018/SetIntegrityLevel'), + SpeciesConstructor: require('./2018/SpeciesConstructor'), + SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2018/TestIntegrityLevel'), + thisBooleanValue: require('./2018/thisBooleanValue'), + thisNumberValue: require('./2018/thisNumberValue'), + thisStringValue: require('./2018/thisStringValue'), + thisSymbolValue: require('./2018/thisSymbolValue'), + thisTimeValue: require('./2018/thisTimeValue'), + TimeClip: require('./2018/TimeClip'), + TimeFromYear: require('./2018/TimeFromYear'), + TimeString: require('./2018/TimeString'), + TimeWithinDay: require('./2018/TimeWithinDay'), + ToBoolean: require('./2018/ToBoolean'), + ToDateString: require('./2018/ToDateString'), + ToIndex: require('./2018/ToIndex'), + ToInt16: require('./2018/ToInt16'), + ToInt32: require('./2018/ToInt32'), + ToInt8: require('./2018/ToInt8'), + ToInteger: require('./2018/ToInteger'), + ToLength: require('./2018/ToLength'), + ToNumber: require('./2018/ToNumber'), + ToObject: require('./2018/ToObject'), + ToPrimitive: require('./2018/ToPrimitive'), + ToPropertyDescriptor: require('./2018/ToPropertyDescriptor'), + ToPropertyKey: require('./2018/ToPropertyKey'), + ToString: require('./2018/ToString'), + ToUint16: require('./2018/ToUint16'), + ToUint32: require('./2018/ToUint32'), + ToUint8: require('./2018/ToUint8'), + ToUint8Clamp: require('./2018/ToUint8Clamp'), + Type: require('./2018/Type'), + ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2018/WeekDay'), + YearFromTime: require('./2018/YearFromTime') +}; + +module.exports = ES2018; diff --git a/node_modules/object.values/node_modules/es-abstract/es2019.js b/node_modules/object.values/node_modules/es-abstract/es2019.js new file mode 100644 index 0000000..3bd65e4 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es2019.js @@ -0,0 +1,129 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/10.0/#sec-abstract-operations +var ES2019 = { + 'Abstract Equality Comparison': require('./2019/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2019/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2019/StrictEqualityComparison'), + AddEntriesFromIterable: require('./2019/AddEntriesFromIterable'), + AdvanceStringIndex: require('./2019/AdvanceStringIndex'), + ArrayCreate: require('./2019/ArrayCreate'), + ArraySetLength: require('./2019/ArraySetLength'), + ArraySpeciesCreate: require('./2019/ArraySpeciesCreate'), + Call: require('./2019/Call'), + CanonicalNumericIndexString: require('./2019/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2019/CompletePropertyDescriptor'), + CopyDataProperties: require('./2019/CopyDataProperties'), + CreateDataProperty: require('./2019/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2019/CreateDataPropertyOrThrow'), + CreateHTML: require('./2019/CreateHTML'), + CreateIterResultObject: require('./2019/CreateIterResultObject'), + CreateListFromArrayLike: require('./2019/CreateListFromArrayLike'), + CreateMethodProperty: require('./2019/CreateMethodProperty'), + DateFromTime: require('./2019/DateFromTime'), + DateString: require('./2019/DateString'), + Day: require('./2019/Day'), + DayFromYear: require('./2019/DayFromYear'), + DaysInYear: require('./2019/DaysInYear'), + DayWithinYear: require('./2019/DayWithinYear'), + DefinePropertyOrThrow: require('./2019/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2019/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2019/EnumerableOwnPropertyNames'), + FlattenIntoArray: require('./2019/FlattenIntoArray'), + FromPropertyDescriptor: require('./2019/FromPropertyDescriptor'), + Get: require('./2019/Get'), + GetIterator: require('./2019/GetIterator'), + GetMethod: require('./2019/GetMethod'), + GetOwnPropertyKeys: require('./2019/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2019/GetPrototypeFromConstructor'), + GetSubstitution: require('./2019/GetSubstitution'), + GetV: require('./2019/GetV'), + HasOwnProperty: require('./2019/HasOwnProperty'), + HasProperty: require('./2019/HasProperty'), + HourFromTime: require('./2019/HourFromTime'), + InLeapYear: require('./2019/InLeapYear'), + InstanceofOperator: require('./2019/InstanceofOperator'), + Invoke: require('./2019/Invoke'), + IsAccessorDescriptor: require('./2019/IsAccessorDescriptor'), + IsArray: require('./2019/IsArray'), + IsCallable: require('./2019/IsCallable'), + IsConcatSpreadable: require('./2019/IsConcatSpreadable'), + IsConstructor: require('./2019/IsConstructor'), + IsDataDescriptor: require('./2019/IsDataDescriptor'), + IsExtensible: require('./2019/IsExtensible'), + IsGenericDescriptor: require('./2019/IsGenericDescriptor'), + IsInteger: require('./2019/IsInteger'), + IsPromise: require('./2019/IsPromise'), + IsPropertyKey: require('./2019/IsPropertyKey'), + IsRegExp: require('./2019/IsRegExp'), + IsStringPrefix: require('./2019/IsStringPrefix'), + IterableToList: require('./2019/IterableToList'), + IteratorClose: require('./2019/IteratorClose'), + IteratorComplete: require('./2019/IteratorComplete'), + IteratorNext: require('./2019/IteratorNext'), + IteratorStep: require('./2019/IteratorStep'), + IteratorValue: require('./2019/IteratorValue'), + MakeDate: require('./2019/MakeDate'), + MakeDay: require('./2019/MakeDay'), + MakeTime: require('./2019/MakeTime'), + MinFromTime: require('./2019/MinFromTime'), + modulo: require('./2019/modulo'), + MonthFromTime: require('./2019/MonthFromTime'), + msFromTime: require('./2019/msFromTime'), + NumberToString: require('./2019/NumberToString'), + ObjectCreate: require('./2019/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2019/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2019/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2019/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2019/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2019/OrdinaryHasProperty'), + PromiseResolve: require('./2019/PromiseResolve'), + RegExpExec: require('./2019/RegExpExec'), + RequireObjectCoercible: require('./2019/RequireObjectCoercible'), + SameValue: require('./2019/SameValue'), + SameValueNonNumber: require('./2019/SameValueNonNumber'), + SameValueZero: require('./2019/SameValueZero'), + SecFromTime: require('./2019/SecFromTime'), + Set: require('./2019/Set'), + SetFunctionName: require('./2019/SetFunctionName'), + SetIntegrityLevel: require('./2019/SetIntegrityLevel'), + SpeciesConstructor: require('./2019/SpeciesConstructor'), + SymbolDescriptiveString: require('./2019/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2019/TestIntegrityLevel'), + thisBooleanValue: require('./2019/thisBooleanValue'), + thisNumberValue: require('./2019/thisNumberValue'), + thisStringValue: require('./2019/thisStringValue'), + thisSymbolValue: require('./2019/thisSymbolValue'), + thisTimeValue: require('./2019/thisTimeValue'), + TimeClip: require('./2019/TimeClip'), + TimeFromYear: require('./2019/TimeFromYear'), + TimeString: require('./2019/TimeString'), + TimeWithinDay: require('./2019/TimeWithinDay'), + ToBoolean: require('./2019/ToBoolean'), + ToDateString: require('./2019/ToDateString'), + ToIndex: require('./2019/ToIndex'), + ToInt16: require('./2019/ToInt16'), + ToInt32: require('./2019/ToInt32'), + ToInt8: require('./2019/ToInt8'), + ToInteger: require('./2019/ToInteger'), + ToLength: require('./2019/ToLength'), + ToNumber: require('./2019/ToNumber'), + ToObject: require('./2019/ToObject'), + ToPrimitive: require('./2019/ToPrimitive'), + ToPropertyDescriptor: require('./2019/ToPropertyDescriptor'), + ToPropertyKey: require('./2019/ToPropertyKey'), + ToString: require('./2019/ToString'), + ToUint16: require('./2019/ToUint16'), + ToUint32: require('./2019/ToUint32'), + ToUint8: require('./2019/ToUint8'), + ToUint8Clamp: require('./2019/ToUint8Clamp'), + TrimString: require('./2019/TrimString'), + Type: require('./2019/Type'), + ValidateAndApplyPropertyDescriptor: require('./2019/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2019/WeekDay'), + YearFromTime: require('./2019/YearFromTime') +}; + +module.exports = ES2019; diff --git a/node_modules/object.values/node_modules/es-abstract/es5.js b/node_modules/object.values/node_modules/es-abstract/es5.js new file mode 100644 index 0000000..2cc9515 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es5.js @@ -0,0 +1,49 @@ +'use strict'; + +/* eslint global-require: 0 */ + +// https://es5.github.io/#x9 +module.exports = { + 'Abstract Equality Comparison': require('./5/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./5/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./5/StrictEqualityComparison'), + CheckObjectCoercible: require('./5/CheckObjectCoercible'), + DateFromTime: require('./5/DateFromTime'), + Day: require('./5/Day'), + DayFromYear: require('./5/DayFromYear'), + DaysInYear: require('./5/DaysInYear'), + DayWithinYear: require('./5/DayWithinYear'), + FromPropertyDescriptor: require('./5/FromPropertyDescriptor'), + HourFromTime: require('./5/HourFromTime'), + InLeapYear: require('./5/InLeapYear'), + IsAccessorDescriptor: require('./5/IsAccessorDescriptor'), + IsCallable: require('./5/IsCallable'), + IsDataDescriptor: require('./5/IsDataDescriptor'), + IsGenericDescriptor: require('./5/IsGenericDescriptor'), + IsPropertyDescriptor: require('./5/IsPropertyDescriptor'), + MakeDate: require('./5/MakeDate'), + MakeDay: require('./5/MakeDay'), + MakeTime: require('./5/MakeTime'), + MinFromTime: require('./5/MinFromTime'), + modulo: require('./5/modulo'), + MonthFromTime: require('./5/MonthFromTime'), + msFromTime: require('./5/msFromTime'), + SameValue: require('./5/SameValue'), + SecFromTime: require('./5/SecFromTime'), + TimeClip: require('./5/TimeClip'), + TimeFromYear: require('./5/TimeFromYear'), + TimeWithinDay: require('./5/TimeWithinDay'), + ToBoolean: require('./5/ToBoolean'), + ToInt32: require('./5/ToInt32'), + ToInteger: require('./5/ToInteger'), + ToNumber: require('./5/ToNumber'), + ToObject: require('./5/ToObject'), + ToPrimitive: require('./5/ToPrimitive'), + ToPropertyDescriptor: require('./5/ToPropertyDescriptor'), + ToString: require('./5/ToString'), + ToUint16: require('./5/ToUint16'), + ToUint32: require('./5/ToUint32'), + Type: require('./5/Type'), + WeekDay: require('./5/WeekDay'), + YearFromTime: require('./5/YearFromTime') +}; diff --git a/node_modules/object.values/node_modules/es-abstract/es6.js b/node_modules/object.values/node_modules/es-abstract/es6.js new file mode 100644 index 0000000..2d1f4dc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es6.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2015'); diff --git a/node_modules/object.values/node_modules/es-abstract/es7.js b/node_modules/object.values/node_modules/es-abstract/es7.js new file mode 100644 index 0000000..f2f15c0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/es7.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2016'); diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/DefineOwnProperty.js b/node_modules/object.values/node_modules/es-abstract/helpers/DefineOwnProperty.js new file mode 100644 index 0000000..99ace10 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/DefineOwnProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +// eslint-disable-next-line max-params +module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { + if (!$defineProperty) { + if (!IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + // eslint-disable-next-line no-param-reassign + O[P] = V; // will use [[Define]] + return SameValue(O[P], V); + } + $defineProperty(O, P, FromPropertyDescriptor(desc)); + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/OwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..4a06ce3 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/OwnPropertyKeys.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); +var callBound = require('./callBound'); + +var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); +var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; + +var keys = require('object-keys'); + +module.exports = $ownKeys || function OwnPropertyKeys(source) { + var ownKeys = ($gOPN || keys)(source); + if ($gOPS) { + $pushApply(ownKeys, $gOPS(source)); + } + return ownKeys; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js b/node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js new file mode 100644 index 0000000..45e115a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js @@ -0,0 +1,48 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = require('has'); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { + if (Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(Type, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(Type, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/assign.js b/node_modules/object.values/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 0000000..7e6666e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/callBind.js b/node_modules/object.values/node_modules/es-abstract/helpers/callBind.js new file mode 100644 index 0000000..3c1a327 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/callBind.js @@ -0,0 +1,34 @@ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind() { + return $reflectApply(bind, $call, arguments); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/callBound.js b/node_modules/object.values/node_modules/es-abstract/helpers/callBound.js new file mode 100644 index 0000000..9dc8fc5 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/every.js b/node_modules/object.values/node_modules/es-abstract/helpers/every.js new file mode 100644 index 0000000..42a4582 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/every.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/forEach.js b/node_modules/object.values/node_modules/es-abstract/helpers/forEach.js new file mode 100644 index 0000000..35915a6 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/forEach.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/getInferredName.js b/node_modules/object.values/node_modules/es-abstract/helpers/getInferredName.js new file mode 100644 index 0000000..2dab6e7 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/getInferredName.js @@ -0,0 +1,10 @@ +'use strict'; + +var getInferredName; +try { + // eslint-disable-next-line no-new-func + getInferredName = Function('s', 'return { [s]() {} }[s].name;'); +} catch (e) {} + +var inferred = function () {}; +module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/getIteratorMethod.js b/node_modules/object.values/node_modules/es-abstract/helpers/getIteratorMethod.js new file mode 100644 index 0000000..02f932c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/getIteratorMethod.js @@ -0,0 +1,45 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('./callBound'); + +var $iterator = GetIntrinsic('%Symbol.iterator%', true); +var $stringSlice = callBound('String.prototype.slice'); + +module.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (ES.Type(iterable) === 'String') { + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(iterable, i, true); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + }; + } + return usingIterator; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js new file mode 100644 index 0000000..71168e9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/getProto.js b/node_modules/object.values/node_modules/es-abstract/helpers/getProto.js new file mode 100644 index 0000000..af10fd8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/getProto.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalGetProto || ( + // eslint-disable-next-line no-proto + [].__proto__ === $ArrayProto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/getSymbolDescription.js b/node_modules/object.values/node_modules/es-abstract/helpers/getSymbolDescription.js new file mode 100644 index 0000000..45d80d2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/getSymbolDescription.js @@ -0,0 +1,41 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('./callBound'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true); +var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true); +var symToStr = callBound('Symbol.prototype.toString', true); + +var getInferredName = require('./getInferredName'); + +/* eslint-disable consistent-return */ +module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) { + if (!thisSymbolValue) { + throw new $SyntaxError('Symbols are not supported in this environment'); + } + + // will throw if not a symbol primitive or wrapper object + var sym = thisSymbolValue(symbol); + + if (getInferredName) { + var name = getInferredName(sym); + if (name === '') { return; } + return name.slice(1, -1); // name.slice('['.length, -']'.length); + } + + var desc; + if (getGlobalSymbolDescription) { + desc = getGlobalSymbolDescription(sym); + if (typeof desc === 'string') { + return desc; + } + } + + desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length); + if (desc) { + return desc; + } +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js b/node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js new file mode 100644 index 0000000..9e7cd4f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js @@ -0,0 +1,5 @@ +'use strict'; + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js b/node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js new file mode 100644 index 0000000..cb8631d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/isPrefixOf.js b/node_modules/object.values/node_modules/es-abstract/helpers/isPrefixOf.js new file mode 100644 index 0000000..b67d640 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/isPrefixOf.js @@ -0,0 +1,13 @@ +'use strict'; + +var $strSlice = require('../helpers/callBound')('String.prototype.slice'); + +module.exports = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return $strSlice(string, 0, prefix.length) === prefix; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js new file mode 100644 index 0000000..06f0bf0 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js new file mode 100644 index 0000000..3eff7eb --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line no-restricted-syntax + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js b/node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js new file mode 100644 index 0000000..a6162a1 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js @@ -0,0 +1,20 @@ +'use strict'; + +var every = require('./every'); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/maxSafeInteger.js b/node_modules/object.values/node_modules/es-abstract/helpers/maxSafeInteger.js new file mode 100644 index 0000000..2fe8f38 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/maxSafeInteger.js @@ -0,0 +1,8 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); +var $Number = GetIntrinsic('%Number%'); + +module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/mod.js b/node_modules/object.values/node_modules/es-abstract/helpers/mod.js new file mode 100644 index 0000000..67c8b78 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/mod.js @@ -0,0 +1,8 @@ +'use strict'; + +var $floor = Math.floor; + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/padTimeComponent.js b/node_modules/object.values/node_modules/es-abstract/helpers/padTimeComponent.js new file mode 100644 index 0000000..cbd8d06 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/padTimeComponent.js @@ -0,0 +1,9 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $strSlice = callBound('String.prototype.slice'); + +module.exports = function padTimeComponent(c, count) { + return $strSlice('00' + c, -(count || 2)); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/regexTester.js b/node_modules/object.values/node_modules/es-abstract/helpers/regexTester.js new file mode 100644 index 0000000..982cc9f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/regexTester.js @@ -0,0 +1,11 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $test = GetIntrinsic('RegExp.prototype.test'); + +var callBind = require('./callBind'); + +module.exports = function regexTester(regex) { + return callBind($test, regex); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/setProto.js b/node_modules/object.values/node_modules/es-abstract/helpers/setProto.js new file mode 100644 index 0000000..29ec991 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/setProto.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalSetProto || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayProto + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/sign.js b/node_modules/object.values/node_modules/es-abstract/helpers/sign.js new file mode 100644 index 0000000..598ea7d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/sign.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/helpers/timeConstants.js b/node_modules/object.values/node_modules/es-abstract/helpers/timeConstants.js new file mode 100644 index 0000000..c275b40 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/helpers/timeConstants.js @@ -0,0 +1,19 @@ +'use strict'; + +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1e3; +var msPerMinute = msPerSecond * SecondsPerMinute; +var msPerHour = msPerMinute * MinutesPerHour; +var msPerDay = 86400000; + +module.exports = { + HoursPerDay: HoursPerDay, + MinutesPerHour: MinutesPerHour, + SecondsPerMinute: SecondsPerMinute, + msPerSecond: msPerSecond, + msPerMinute: msPerMinute, + msPerHour: msPerHour, + msPerDay: msPerDay +}; diff --git a/node_modules/object.values/node_modules/es-abstract/index.js b/node_modules/object.values/node_modules/es-abstract/index.js new file mode 100644 index 0000000..7cef039 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var assign = require('./helpers/assign'); + +var ES5 = require('./es5'); +var ES2015 = require('./es2015'); +var ES2016 = require('./es2016'); +var ES2017 = require('./es2017'); +var ES2018 = require('./es2018'); +var ES2019 = require('./es2019'); + +var ES = { + ES5: ES5, + ES6: ES2015, + ES2015: ES2015, + ES7: ES2016, + ES2016: ES2016, + ES2017: ES2017, + ES2018: ES2018, + ES2019: ES2019 +}; +assign(ES, ES5); +delete ES.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible +assign(ES, ES2015); + +module.exports = ES; diff --git a/node_modules/object.values/node_modules/es-abstract/operations/.eslintrc b/node_modules/object.values/node_modules/es-abstract/operations/.eslintrc new file mode 100644 index 0000000..bcd76f7 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/operations/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": 0, + }, +} diff --git a/node_modules/object.values/node_modules/es-abstract/operations/2015.js b/node_modules/object.values/node_modules/es-abstract/operations/2015.js new file mode 100644 index 0000000..6c50891 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/operations/2015.js @@ -0,0 +1,249 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatetypedarray', + ArrayCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/6.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/6.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/6.0/#sec-implicit-completion-values', + Construct: 'https://ecma-international.org/ecma-262/6.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/6.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/6.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/6.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/6.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-createrealm', + CreateSetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createsetiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/6.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/6.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/6.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/6.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/6.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/6.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-functioncreate', + FunctionInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/6.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/6.0/#sec-get-o-p', + GetBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/6.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/6.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/6.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetSubstitution: 'https://ecma-international.org/ecma-262/6.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/6.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/6.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getviewvalue', + HasOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + HasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasproperty', + HostResolveImportedModule: 'sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/6.0/#sec-importedlocalnames', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/6.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/6.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/6.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/6.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/6.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsRegExp: 'https://ecma-international.org/ecma-262/6.0/#sec-isregexp', + IsStrictReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsSuperReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsWordChar: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IteratorClose: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/6.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/6.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/6.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/6.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/6.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + msPerDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/6.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/6.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty', + ParseModule: 'https://ecma-international.org/ecma-262/6.0/#sec-parsemodule', + PerformEval: 'https://ecma-international.org/ecma-262/6.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/6.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/6.0/#sec-preparefortailcall', + ProxyCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/6.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/6.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvethisbinding', + SameValue: 'https://ecma-international.org/ecma-262/6.0/#sec-samevalue', + SameValueZero: 'https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero', + SecFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/6.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-setviewvalue', + sign: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + SortCompare: 'https://ecma-international.org/ecma-262/6.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/6.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-stringcreate', + StringGetIndexProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-stringgetindexproperty', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object', + thisNumberValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/6.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/6.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/6.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/6.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/6.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/6.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/6.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/6.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/6.0/#sec-toobject', + ToPrimitive: 'https://ecma-international.org/ecma-262/6.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/6.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/6.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/6.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/6.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values', + TypedArrayFrom: 'https://ecma-international.org/ecma-262/6.0/#sec-typedarrayfrom', + UpdateEmpty: 'https://ecma-international.org/ecma-262/6.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/6.0/#sec-utc-t', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor', + WeekDay: 'https://ecma-international.org/ecma-262/6.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number' +}; diff --git a/node_modules/object.values/node_modules/es-abstract/operations/2016.js b/node_modules/object.values/node_modules/es-abstract/operations/2016.js new file mode 100644 index 0000000..6a58b9c --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/operations/2016.js @@ -0,0 +1,276 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/7.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/7.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arrayspeciescreate', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/7.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/7.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/7.0/#sec-completion-record-specification-type', + Construct: 'https://ecma-international.org/ecma-262/7.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/7.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/7.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/7.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/7.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/7.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createsetiterator', + CreateStringIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/7.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/7.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerableownnames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/7.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/7.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/7.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/7.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/7.0/#sec-getactivescriptormodule', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/7.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/7.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/7.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getprototypefromconstructor', + GetSubstitution: 'https://ecma-international.org/ecma-262/7.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/7.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/7.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getviewvalue', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-globaldeclarationinstantiation', + HasOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasownproperty', + HasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasproperty', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/7.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/7.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/7.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/7.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/7.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/7.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/7.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/7.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/7.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/7.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/7.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/7.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-ispropertykey', + IsRegExp: 'https://ecma-international.org/ecma-262/7.0/#sec-isregexp', + IsWordChar: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike', + IteratorClose: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/7.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/7.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/7.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/7.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/7.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/7.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/7.0/#sec-newpromisecapability', + NextJob: 'https://ecma-international.org/ecma-262/7.0/#sec-nextjob-result', + NormalCompletion: 'https://ecma-international.org/ecma-262/7.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof', + ParseModule: 'https://ecma-international.org/ecma-262/7.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/7.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/7.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/7.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/7.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/7.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/7.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/7.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-returnifabrupt', + SameValue: 'https://ecma-international.org/ecma-262/7.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/7.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/7.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/7.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-setviewvalue', + SortCompare: 'https://ecma-international.org/ecma-262/7.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/7.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-stringcreate', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/7.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/7.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/7.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/7.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/7.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/7.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/7.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/7.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/7.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/7.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/7.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/7.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/7.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/7.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/7.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/7.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/7.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/7.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/7.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-validateandapplypropertydescriptor', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-validatetypedarray', + WeekDay: 'https://ecma-international.org/ecma-262/7.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number' +}; diff --git a/node_modules/object.values/node_modules/es-abstract/operations/2017.js b/node_modules/object.values/node_modules/es-abstract/operations/2017.js new file mode 100644 index 0000000..896fcee --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/operations/2017.js @@ -0,0 +1,324 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/8.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/8.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/8.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/8.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/8.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arrayspeciescreate', + AsyncFunctionAwait: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-await', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-start', + AtomicLoad: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicreadmodifywrite', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/8.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/8.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/8.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/8.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/8.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/8.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/8.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/8.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/8.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/8.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/8.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-entercriticalsection', + EnumerableOwnProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/8.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/8.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/8.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/8.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/8.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/8.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/8.0/#ao-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/8.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/8.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/8.0/#ao-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/8.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/8.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/8.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/8.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/8.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/8.0/#ao-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/8.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/8.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/8.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/8.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/8.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/8.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-InLeapYear', + InstanceofOperator: 'https://ecma-international.org/ecma-262/8.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/8.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/8.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/8.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/8.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/8.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/8.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#ao-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/8.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isstrictreference', + IsSuperReference: 'https://ecma-international.org/ecma-262/8.0/#ao-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/8.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/8.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/8.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/8.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/8.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/8.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/8.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/8.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/8.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/8.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/8.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/8.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-numbertorawbytes', + ObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarysetprototypeof', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/8.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/8.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/8.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/8.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/8.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/8.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/8.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/8.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/8.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/8.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/8.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/8.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/8.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/8.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/8.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/8.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/8.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/8.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisstringvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thistimevalue', + TimeClip: 'https://ecma-international.org/ecma-262/8.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeFromYear', + TimeWithinDay: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeWithinDay', + ToBoolean: 'https://ecma-international.org/ecma-262/8.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/8.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/8.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/8.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/8.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/8.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/8.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/8.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/8.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/8.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/8.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/8.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/8.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/8.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/8.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/8.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/8.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/8.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-YearFromTime' +}; diff --git a/node_modules/object.values/node_modules/es-abstract/operations/2018.js b/node_modules/object.values/node_modules/es-abstract/operations/2018.js new file mode 100644 index 0000000..c93b561 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/operations/2018.js @@ -0,0 +1,350 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/9.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/9.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/9.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/9.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/9.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arrayspeciescreate', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/9.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/9.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/9.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/9.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/9.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/9.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/9.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/9.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/9.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/9.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/9.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/9.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/9.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/9.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/9.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/9.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/9.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/9.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/9.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/9.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/9.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/9.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/9.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/9.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/9.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/9.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/9.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/9.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/9.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/9.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/9.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/9.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/9.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/9.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/9.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/9.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/9.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/9.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/9.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/9.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/9.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/9.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/9.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/9.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/9.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/9.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/9.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/9.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/9.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/9.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/9.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/9.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/9.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/9.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MinFromTime', + ModuleDeclarationEnvironmentSetup: 'https://ecma-international.org/ecma-262/9.0/#sec-moduledeclarationenvironmentsetup', + ModuleExecution: 'https://ecma-international.org/ecma-262/9.0/#sec-moduleexecution', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/9.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/9.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/9.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/9.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/9.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/9.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/9.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/9.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/9.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/9.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/9.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/9.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/9.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/9.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/9.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/9.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/9.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/9.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/9.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/9.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/9.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/9.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/9.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/9.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/9.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/9.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/9.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/9.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/9.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/9.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/9.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/9.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/9.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/9.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/9.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/9.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/9.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/9.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/9.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-YearFromTime' +}; diff --git a/node_modules/object.values/node_modules/es-abstract/operations/2019.js b/node_modules/object.values/node_modules/es-abstract/operations/2019.js new file mode 100644 index 0000000..73f05e8 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/operations/2019.js @@ -0,0 +1,355 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/10.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-relational-comparison', + AddEntriesFromIterable: 'https://ecma-international.org/ecma-262/10.0/#sec-add-entries-from-iterable', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/10.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/10.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/10.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/10.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arrayspeciescreate', + AsyncFromSyncIteratorContinuation: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncfromsynciteratorcontinuation', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/10.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/10.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/10.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/10.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/10.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/10.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/10.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/10.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/10.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/10.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/10.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/10.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/10.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/10.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-event-set', + ExecuteModule: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-execute-module', + FlattenIntoArray: 'https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray', + floor: 'https://ecma-international.org/ecma-262/10.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/10.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/10.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/10.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/10.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/10.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/10.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/10.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/10.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/10.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/10.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/10.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/10.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/10.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/10.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/10.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/10.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/10.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/10.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/10.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/10.0/#sec-initializeboundname', + InitializeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-initialize-environment', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/10.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/10.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/10.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/10.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/10.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/10.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/10.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/10.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/10.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/10.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/10.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/10.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/10.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/10.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/10.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/10.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/10.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/10.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/10.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/10.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/10.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-normalcompletion', + NotifyWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-notifywaiter', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/10.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/10.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/10.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/10.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/10.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/10.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/10.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/10.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/10.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/10.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/10.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/10.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/10.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/10.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/10.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/10.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/10.0/#sec-symboldescriptivestring', + SynchronizeEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizeeventset', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/10.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/10.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/10.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/10.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/10.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/10.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/10.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/10.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/10.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/10.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/10.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/10.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/10.0/#sec-triggerpromisereactions', + TrimString: 'https://ecma-international.org/ecma-262/10.0/#sec-trimstring', + Type: 'https://ecma-international.org/ecma-262/10.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/10.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/10.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/10.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/10.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/10.0/#sec-valueofreadevent', + WeekDay: 'https://ecma-international.org/ecma-262/10.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-YearFromTime' +}; diff --git a/node_modules/object.values/node_modules/es-abstract/package.json b/node_modules/object.values/node_modules/es-abstract/package.json new file mode 100644 index 0000000..81c503e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/package.json @@ -0,0 +1,139 @@ +{ + "_from": "es-abstract@^1.17.0-next.1", + "_id": "es-abstract@1.17.7", + "_inBundle": false, + "_integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "_location": "/object.values/es-abstract", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es-abstract@^1.17.0-next.1", + "name": "es-abstract", + "escapedName": "es-abstract", + "rawSpec": "^1.17.0-next.1", + "saveSpec": null, + "fetchSpec": "^1.17.0-next.1" + }, + "_requiredBy": [ + "/object.values" + ], + "_resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "_shasum": "a4de61b2f66989fc7421676c1cb9787573ace54c", + "_spec": "es-abstract@^1.17.0-next.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/object.values", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "bugs": { + "url": "https://github.com/ljharb/es-abstract/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "deprecated": false, + "description": "ECMAScript spec abstract operations.", + "devDependencies": { + "@ljharb/eslint-config": "^17.2.0", + "array.prototype.indexof": "^1.0.0", + "aud": "^1.1.2", + "cheerio": "^1.0.0-rc.3", + "diff": "^4.0.2", + "eclint": "^2.8.1", + "eslint": "^7.10.0", + "foreach": "^2.0.5", + "functions-have-names": "^1.2.1", + "has-strict-mode": "^1.0.0", + "in-publish": "^2.0.1", + "make-arrow-function": "^1.2.0", + "nyc": "^10.3.2", + "object-is": "^1.1.2", + "object.fromentries": "^2.0.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "greenkeeper": { + "//": "nyc is ignored because it requires node 4+, and we support older than that", + "ignore": [ + "nyc" + ] + }, + "homepage": "https://github.com/ljharb/es-abstract#readme", + "keywords": [ + "ECMAScript", + "ES", + "abstract", + "operation", + "abstract operation", + "JavaScript", + "ES5", + "ES6", + "ES7" + ], + "license": "MIT", + "main": "index.js", + "name": "es-abstract", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-abstract.git" + }, + "scripts": { + "coverage": "nyc npm run tests-only >/dev/null", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "lint": "eslint .", + "postcoverage": "nyc report", + "postspackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs git add", + "posttest": "aud --production", + "prepublish": "safe-publish-latest && (not-in-publish || npm run spackle)", + "prespackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs rm || true", + "pretest": "npm run lint", + "spackle": "node operations/spackle 1", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.17.7" +} diff --git a/node_modules/object.values/node_modules/es-abstract/test/GetIntrinsic.js b/node_modules/object.values/node_modules/es-abstract/test/GetIntrinsic.js new file mode 100644 index 0000000..a3e69a7 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/GetIntrinsic.js @@ -0,0 +1,94 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var test = require('tape'); +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + t.end(); +}); + +test('accessors', { skip: !Object.getOwnPropertyDescriptor || typeof Map !== 'function' }, function (t) { + var actual = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); diff --git a/node_modules/object.values/node_modules/es-abstract/test/diffOps.js b/node_modules/object.values/node_modules/es-abstract/test/diffOps.js new file mode 100644 index 0000000..602098d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/diffOps.js @@ -0,0 +1,27 @@ +'use strict'; + +var keys = require('object-keys'); +var forEach = require('foreach'); +var indexOf = require('array.prototype.indexof'); + +module.exports = function diffOperations(actual, expected, expectedMissing) { + var actualKeys = keys(actual); + var expectedKeys = keys(expected); + + var extra = []; + var missing = []; + forEach(actualKeys, function (op) { + if (!(op in expected)) { + extra.push(op); + } else if (indexOf(expectedMissing, op) !== -1) { + extra.push(op); + } + }); + forEach(expectedKeys, function (op) { + if (typeof actual[op] !== 'function' && indexOf(expectedMissing, op) === -1) { + missing.push(op); + } + }); + + return { missing: missing, extra: extra }; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/test/es2015.js b/node_modules/object.values/node_modules/es-abstract/test/es2015.js new file mode 100644 index 0000000..9bb8ec9 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es2015.js @@ -0,0 +1,150 @@ +'use strict'; + +var ES = require('../').ES2015; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2015'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateSetIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'HasPrimitiveBase', + 'HostResolveImportedModule', + 'ImportedLocalNames', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'msPerDay', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'ParseModule', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'sign', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetIndexProperty', + 'TriggerPromiseReactions', + 'TypedArrayFrom', + 'UpdateEmpty', + 'UTC' +]; + +require('./tests').es2015(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2015); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es2016.js b/node_modules/object.values/node_modules/es-abstract/test/es2016.js new file mode 100644 index 0000000..611ea6a --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es2016.js @@ -0,0 +1,173 @@ +'use strict'; + +var ES = require('../').ES2016; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2016'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GlobalDeclarationInstantiation', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NextJob', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateTypedArray' +]; + +require('./tests').es2016(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2016); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es2017.js b/node_modules/object.values/node_modules/es-abstract/test/es2017.js new file mode 100644 index 0000000..74eb38e --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es2017.js @@ -0,0 +1,220 @@ +'use strict'; + +var ES = require('../').ES2017; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2017'); + +var expectedMissing = [ + 'abs', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionAwait', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters', + 'AddRestrictedFunctionProperties', + 'synchronizes-with' +]; + +require('./tests').es2017(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2017); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es2018.js b/node_modules/object.values/node_modules/es-abstract/test/es2018.js new file mode 100644 index 0000000..5ca1087 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es2018.js @@ -0,0 +1,241 @@ +'use strict'; + +var ES = require('../').ES2018; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2018'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2018(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2018); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es2019.js b/node_modules/object.values/node_modules/es-abstract/test/es2019.js new file mode 100644 index 0000000..c034b60 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es2019.js @@ -0,0 +1,246 @@ +'use strict'; + +var ES = require('../').ES2019; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2019'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFromSyncIteratorContinuation', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'ExecuteModule', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeEnvironment', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NotifyWaiter', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'SynchronizeEventSet', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2019(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2019); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es5.js b/node_modules/object.values/node_modules/es-abstract/test/es5.js new file mode 100644 index 0000000..6647a1b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es5.js @@ -0,0 +1,786 @@ +'use strict'; + +var ES = require('../').ES5; +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +require('./helpers/runManifestTest')(test, ES, 5); + +ES = require('./helpers/createBoundESNamespace')(ES); + +test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + st.equal(ES.ToPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError'); + st.end(); + }); + + t.end(); +}); + +test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + forEach([0, -0, NaN], function (falsyNumber) { + t.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach([Infinity, 42, 1, -Infinity], function (truthyNumber) { + t.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + forEach(v.objects, function (obj) { + t.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + t.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + t.end(); +}); + +test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + t.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach([0, -0, 42, Infinity, -Infinity], function (num) { + t.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + t.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + forEach(v.objects, function (object) { + t.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + t['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); +}); + +test('ToString', function (t) { + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); +}); + +test('CheckObjectCoercible', function (t) { + t['throws'](function () { return ES.CheckObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.CheckObjectCoercible(null); }, TypeError, 'null throws'); + var checkCoercible = function (value) { + t.doesNotThrow(function () { return ES.CheckObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), checkCoercible); + t.end(); +}); + +test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.primitives); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); +}); + +test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); +}); + +test('Type', function (t) { + t.equal(ES.Type(), 'Undefined', 'Type() is Undefined'); + t.equal(ES.Type(undefined), 'Undefined', 'Type(undefined) is Undefined'); + t.equal(ES.Type(null), 'Null', 'Type(null) is Null'); + t.equal(ES.Type(true), 'Boolean', 'Type(true) is Boolean'); + t.equal(ES.Type(false), 'Boolean', 'Type(false) is Boolean'); + t.equal(ES.Type(0), 'Number', 'Type(0) is Number'); + t.equal(ES.Type(NaN), 'Number', 'Type(NaN) is Number'); + t.equal(ES.Type('abc'), 'String', 'Type("abc") is String'); + t.equal(ES.Type(function () {}), 'Object', 'Type(function () {}) is Object'); + t.equal(ES.Type({}), 'Object', 'Type({}) is Object'); + t.end(); +}); + +test('IsPropertyDescriptor', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsPropertyDescriptor(primitive), false, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptorWritable()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); +}); + +test('IsAccessorDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsAccessorDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); +}); + +test('IsDataDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsDataDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); +}); + +test('IsGenericDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('ToPropertyDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.descriptors.nonConfigurable(v.dataDescriptor()); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), data); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.ToPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ get: 'not callable' }); }, + TypeError, + '"get" must be undefined or callable' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ set: 'not callable' }); }, + TypeError, + '"set" must be undefined or callable' + ); + + t.end(); +}); + +test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); +}); + +test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); +}); + +test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); +}); + +test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); +}); + +var msPerSecond = 1e3; +var msPerMinute = 60 * msPerSecond; +var msPerHour = 60 * msPerMinute; +var msPerDay = 24 * msPerHour; + +test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); +}); + +test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); +}); + +test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); +}); + +test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); +}); + +test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); +}); + +test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); +}); + +test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); +}); + +test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); +}); + +test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); +}); + +test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); +}); + +test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); +}); + +test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); +}); + +test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); +}); + +test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + t.end(); +}); + +test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); +}); + +test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); +}); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es6.js b/node_modules/object.values/node_modules/es-abstract/test/es6.js new file mode 100644 index 0000000..e7c9d98 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es6.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES6 = ES.ES6; +var ES2015 = ES.ES2015; +var ES6entry = require('../es6'); + +test('legacy es6 export', function (t) { + t.equal(ES6, ES2015, 'main ES6 === main ES2015'); + t.end(); +}); + +test('legacy es6 entry point', function (t) { + t.equal(ES6, ES6entry, 'main ES6 === ES6 entry point'); + t.end(); +}); diff --git a/node_modules/object.values/node_modules/es-abstract/test/es7.js b/node_modules/object.values/node_modules/es-abstract/test/es7.js new file mode 100644 index 0000000..ee57e15 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/es7.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES7 = ES.ES7; +var ES2016 = ES.ES2016; +var ES7entry = require('../es7'); + +test('legacy es7 export', function (t) { + t.equal(ES7, ES2016, 'main ES7 === main ES2016'); + t.end(); +}); + +test('legacy es7 entry point', function (t) { + t.equal(ES7, ES7entry, 'main ES7 === ES7 entry point'); + t.end(); +}); diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..9c2b4fc --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js @@ -0,0 +1,42 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('has-symbols')(); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); +var defineProperty = require('./defineProperty'); + +test('OwnPropertyKeys', function (t) { + t.deepEqual(OwnPropertyKeys({ a: 1, b: 2 }).sort(), ['a', 'b'].sort(), 'returns own string keys'); + + t.test('Symbols', { skip: !hasSymbols }, function (st) { + var o = { a: 1 }; + var sym = Symbol(); + o[sym] = 2; + + st.deepEqual(OwnPropertyKeys(o), ['a', sym], 'returns own string and symbol keys'); + + st.end(); + }); + + t.test('non-enumerables', { skip: !defineProperty.oDP }, function (st) { + var o = { a: 1, b: 42, c: NaN }; + defineProperty(o, 'b', { enumerable: false, value: 42 }); + defineProperty(o, 'c', { enumerable: false, get: function () { return NaN; } }); + + if (hasSymbols) { + defineProperty(o, 'd', { enumerable: false, value: true }); + defineProperty(o, 'e', { enumerable: false, get: function () { return true; } }); + } + + st.deepEqual( + OwnPropertyKeys(o).sort(), + (hasSymbols ? ['a', 'b', 'c', 'd', 'e'] : ['a', 'b', 'c']).sort(), + 'returns non-enumerable own keys, including accessors and symbols if available' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/assertRecord.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/assertRecord.js new file mode 100644 index 0000000..d6a80c2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/assertRecord.js @@ -0,0 +1,60 @@ +'use strict'; + +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var assertRecord = require('../../helpers/assertRecord'); +var v = require('./values'); + +module.exports = function assertRecordTests(ES, test) { + test('Property Descriptor', function (t) { + var record = 'Property Descriptor'; + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', { invalid: true }); }, + TypeError, + 'invalid keys not allowed on a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', {}); }, + 'empty object is an incomplete Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.accessorDescriptor()); }, + 'accessor descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.mutatorDescriptor()); }, + 'mutator descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.dataDescriptor()); }, + 'data descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.genericDescriptor()); }, + 'generic descriptor is a Property Descriptor' + ); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/createBoundESNamespace.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/createBoundESNamespace.js new file mode 100644 index 0000000..880ba3d --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/createBoundESNamespace.js @@ -0,0 +1,21 @@ +'use strict'; + +var bind = require('function-bind'); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); + +module.exports = function createBoundESNamespace(ES) { + var keys = OwnPropertyKeys(ES); + var result = {}; + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var prop = ES[key]; + if (typeof prop === 'function') { + prop = bind.call(prop, undefined); + } + result[key] = prop; + } + + return result; +}; diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/defineProperty.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/defineProperty.js new file mode 100644 index 0000000..8f925be --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/defineProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var oDP = Object.defineProperty; +try { + oDP({}, 'a', { value: 1 }); +} catch (e) { + // IE 8 + oDP = null; +} + +module.exports = function defineProperty(O, P, Desc) { + if (oDP) { + return oDP(O, P, Desc); + } + if ((Desc.enumerable && Desc.configurable && Desc.writable) || !(P in O)) { + O[P] = Desc.value; // eslint-disable-line no-param-reassign + return O; + } + + throw new SyntaxError('helper does not yet support this configuration'); +}; +module.exports.oDP = oDP; diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/getSymbolDescription.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/getSymbolDescription.js new file mode 100644 index 0000000..fbe7a7b --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/getSymbolDescription.js @@ -0,0 +1,67 @@ +'use strict'; + +var test = require('tape'); +var debug = require('object-inspect'); +var forEach = require('foreach'); +var has = require('has'); + +var v = require('./values'); +var getSymbolDescription = require('../../helpers/getSymbolDescription'); +var getInferredName = require('../../helpers/getInferredName'); + +test('getSymbolDescription', function (t) { + t.test('no symbols', { skip: v.hasSymbols }, function (st) { + st['throws']( + getSymbolDescription, + SyntaxError, + 'requires Symbol support' + ); + + st.end(); + }); + + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { getSymbolDescription(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('with symbols', { skip: !v.hasSymbols }, function (st) { + forEach( + [ + [Symbol(), undefined], + [Symbol(undefined), undefined], + [Symbol(null), 'null'], + [Symbol.iterator, 'Symbol.iterator'], + [Symbol('foo'), 'foo'] + ], + function (pair) { + var sym = pair[0]; + var desc = pair[1]; + st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc)); + } + ); + + st.test('only possible when inference or native `Symbol.prototype.description` is supported', { + skip: !getInferredName && !has(Symbol.prototype, 'description') + }, function (s2t) { + s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""'); + + s2t.end(); + }); + + st.test('only possible when global symbols are supported', { + skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor') + }, function (s2t) { + // eslint-disable-next-line no-restricted-properties + s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/runManifestTest.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/runManifestTest.js new file mode 100644 index 0000000..2fdb4f2 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/runManifestTest.js @@ -0,0 +1,27 @@ +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +var forEach = require('foreach'); +var keys = require('object-keys'); + +module.exports = function runManifestTest(test, ES, edition) { + test('ES' + edition + ' manifest', { skip: !fs.readdirSync }, function (t) { + var files = fs.readdirSync(path.join(__dirname, '../../' + edition), 'utf-8'); + var map = { + AbstractEqualityComparison: 'Abstract Equality Comparison', + AbstractRelationalComparison: 'Abstract Relational Comparison', + StrictEqualityComparison: 'Strict Equality Comparison' + }; + forEach(files, function (file) { + var name = path.basename(file, path.extname(file)); + var actual = ES[map[name] || name]; + var expected = require(path.join(__dirname, '../../' + edition + '/', file)); // eslint-disable-line global-require + t.equal(actual, expected, 'ES["' + name + '"] === ' + file); + }); + var actualCount = keys(ES).length; + t.equal(actualCount, files.length, 'expected ' + files.length + ' files, got ' + actualCount); + t.end(); + }); +}; diff --git a/node_modules/object.values/node_modules/es-abstract/test/helpers/values.js b/node_modules/object.values/node_modules/es-abstract/test/helpers/values.js new file mode 100644 index 0000000..ccef743 --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/helpers/values.js @@ -0,0 +1,121 @@ +'use strict'; + +var assign = require('../../helpers/assign'); + +var hasSymbols = require('has-symbols')(); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; +var objects = [{}, coercibleObject, coercibleFnObject, toStringOnlyObject, valueOfOnlyObject]; +var nullPrimitives = [undefined, null]; +var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3]; +var zeroes = [0, -0]; +var infinities = [Infinity, -Infinity]; +var numbers = zeroes.concat([42], infinities, nonIntegerNumbers); +var strings = ['', 'foo', 'a\uD83D\uDCA9c']; +var booleans = [true, false]; +var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; +var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers); +var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols); +var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols); +var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives); +var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects); +var primitives = [].concat(nullPrimitives, nonNullPrimitives); +var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects); +var propertyKeys = [].concat(strings, symbols); +var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects); +var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN); +var truthies = [].concat(true, 'foo', 42, symbols, objects); +var timestamps = [].concat(0, 946713600000, 1546329600000); +var nonFunctions = [].concat(primitives, objects, [42]); +var nonArrays = [].concat(nonFunctions); + +var descriptors = { + configurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': true }); + }, + nonConfigurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': false }); + }, + enumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': true }); + }, + nonEnumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': false }); + }, + writable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': true }); + }, + nonWritable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': false }); + } +}; + +module.exports = { + coercibleObject: coercibleObject, + coercibleFnObject: coercibleFnObject, + valueOfOnlyObject: valueOfOnlyObject, + toStringOnlyObject: toStringOnlyObject, + uncoercibleObject: uncoercibleObject, + uncoercibleFnObject: uncoercibleFnObject, + objects: objects, + nonFunctions: nonFunctions, + nonArrays: nonArrays, + nullPrimitives: nullPrimitives, + numbers: numbers, + zeroes: zeroes, + infinities: infinities, + strings: strings, + booleans: booleans, + symbols: symbols, + hasSymbols: hasSymbols, + nonSymbolPrimitives: nonSymbolPrimitives, + nonNumberPrimitives: nonNumberPrimitives, + nonNullPrimitives: nonNullPrimitives, + nonUndefinedPrimitives: nonUndefinedPrimitives, + nonStrings: nonStrings, + nonNumbers: nonNumberPrimitives.concat(objects), + nonIntegerNumbers: nonIntegerNumbers, + primitives: primitives, + nonPropertyKeys: nonPropertyKeys, + propertyKeys: propertyKeys, + nonBooleans: nonBooleans, + falsies: falsies, + truthies: truthies, + timestamps: timestamps, + bothDescriptor: function () { + return { '[[Get]]': function () {}, '[[Value]]': true }; + }, + bothDescriptorWritable: function () { + return descriptors.writable({ '[[Get]]': function () {} }); + }, + accessorDescriptor: function (value) { + return descriptors.enumerable(descriptors.configurable({ + '[[Get]]': function get() { return value; } + })); + }, + mutatorDescriptor: function () { + return descriptors.enumerable(descriptors.configurable({ + '[[Set]]': function () {} + })); + }, + dataDescriptor: function (value) { + return descriptors.nonWritable({ + '[[Value]]': arguments.length > 0 ? value : 42 + }); + }, + genericDescriptor: function () { + return descriptors.configurable(descriptors.nonEnumerable()); + }, + descriptors: descriptors +}; diff --git a/node_modules/object.values/node_modules/es-abstract/test/index.js b/node_modules/object.values/node_modules/es-abstract/test/index.js new file mode 100644 index 0000000..3f1adba --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var ES = require('../'); +var test = require('tape'); +var keys = require('object-keys'); +var forEach = require('foreach'); + +var ESkeys = keys(ES).sort(); +var ES6keys = keys(ES.ES6).sort(); + +test('exposed properties', function (t) { + t.deepEqual(ESkeys, ES6keys.concat(['ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); + t.end(); +}); + +test('methods match', function (t) { + forEach(ES6keys, function (key) { + t.equal(ES.ES6[key], ES[key], 'method ' + key + ' on main ES object is ES6 method'); + }); + t.end(); +}); + +require('./GetIntrinsic'); + +require('./helpers/getSymbolDescription'); +require('./helpers/OwnPropertyKeys'); + +require('./es5'); +require('./es6'); +require('./es2015'); +require('./es7'); +require('./es2016'); +require('./es2017'); +require('./es2018'); +require('./es2019'); diff --git a/node_modules/object.values/node_modules/es-abstract/test/tests.js b/node_modules/object.values/node_modules/es-abstract/test/tests.js new file mode 100644 index 0000000..844846f --- /dev/null +++ b/node_modules/object.values/node_modules/es-abstract/test/tests.js @@ -0,0 +1,4193 @@ +'use strict'; + +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); +var assign = require('object.assign'); +var keys = require('object-keys'); +var has = require('has'); +var arrowFns = require('make-arrow-function').list(); +var hasStrictMode = require('has-strict-mode')(); +var functionsHaveNames = require('functions-have-names')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +var $getProto = require('../helpers/getProto'); +var $setProto = require('../helpers/setProto'); +var defineProperty = require('./helpers/defineProperty'); +var getInferredName = require('../helpers/getInferredName'); +var getOwnPropertyDescriptor = require('../helpers/getOwnPropertyDescriptor'); +var assertRecordTests = require('./helpers/assertRecord'); +var v = require('./helpers/values'); +var diffOps = require('./diffOps'); + +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +var getArraySubclassWithSpeciesConstructor = function getArraySubclass(speciesConstructor) { + var Bar = function Bar() { + var inst = []; + Object.setPrototypeOf(inst, Bar.prototype); + defineProperty(inst, 'constructor', { value: Bar }); + return inst; + }; + Bar.prototype = Object.create(Array.prototype); + Object.setPrototypeOf(Bar, Array); + defineProperty(Bar, Symbol.species, { value: speciesConstructor }); + + return Bar; +}; + +var testIterator = function (t, iterator, expected) { + var resultCount = 0; + var result; + while (result = iterator.next(), !result.done) { // eslint-disable-line no-sequences + t.deepEqual(result, { done: false, value: expected[resultCount] }, 'result ' + resultCount); + resultCount += 1; + } + t.equal(resultCount, expected.length, 'expected ' + expected.length + ', got ' + resultCount); +}; + +var hasSpecies = v.hasSymbols && Symbol.species; + +var hasLastIndex = 'lastIndex' in (/a/).exec('a'); // IE 8 +var hasGroups = 'groups' in (/a/).exec('a'); // modern engines +var kludgeMatch = function kludgeMatch(R, matchObject) { + if (hasGroups) { + assign(matchObject, { groups: matchObject.groups }); + } + if (hasLastIndex) { + assign(matchObject, { lastIndex: R.lastIndex }); + } + return matchObject; +}; + +var testEnumerableOwnNames = function (t, enumerableOwnNames) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { enumerableOwnNames(nonObject); }, + debug(nonObject) + ' is not an Object' + ); + }); + + var Child = function Child() { + this.own = {}; + }; + Child.prototype = { + inherited: {} + }; + + var obj = new Child(); + + t.equal('own' in obj, true, 'has "own"'); + t.equal(has(obj, 'own'), true, 'has own "own"'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, 'own'), true, 'has enumerable "own"'); + + t.equal('inherited' in obj, true, 'has "inherited"'); + t.equal(has(obj, 'inherited'), false, 'has non-own "inherited"'); + t.equal(has(Child.prototype, 'inherited'), true, 'Child.prototype has own "inherited"'); + t.equal(Child.prototype.inherited, obj.inherited, 'Child.prototype.inherited === obj.inherited'); + t.equal(Object.prototype.propertyIsEnumerable.call(Child.prototype, 'inherited'), true, 'has enumerable "inherited"'); + + t.equal('toString' in obj, true, 'has "toString"'); + t.equal(has(obj, 'toString'), false, 'has non-own "toString"'); + t.equal(has(Object.prototype, 'toString'), true, 'Object.prototype has own "toString"'); + t.equal(Object.prototype.toString, obj.toString, 'Object.prototype.toString === obj.toString'); + // eslint-disable-next-line no-useless-call + t.equal(Object.prototype.propertyIsEnumerable.call(Object.prototype, 'toString'), false, 'has non-enumerable "toString"'); + + return obj; +}; + +var es2015 = function ES2015(ES, ops, expectedMissing, skips) { + test('has expected operations', function (t) { + var diff = diffOps(ES, ops, expectedMissing); + + t.deepEqual(diff.extra, [], 'no extra ops'); + + t.deepEqual(diff.missing, [], 'no unexpected missing ops'); + + t.end(); + }); + + test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), 3, 'coercibleObject with no hint coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), 3, 'coercibleObject with hint Number coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to NaN'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), 42, 'coercibleObject with hint String coerces to nonstringified toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), 7, 'toStringOnlyObject returns non-stringified toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), 4, 'valueOfOnlyObject returns valueOf'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st.end(); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); + var now = new Date(); + st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); + st.end(); + }); + + t.end(); + }); + + test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + + t.test('numbers', function (st) { + forEach(v.zeroes.concat(NaN), function (falsyNumber) { + st.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach(v.infinities.concat([42, 1]), function (truthyNumber) { + st.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + + st.end(); + }); + + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + + t.test('objects', function (st) { + forEach(v.objects, function (obj) { + st.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + st.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + + st.end(); + }); + + t.end(); + }); + + test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + + t.test('numbers', function (st) { + st.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach(v.zeroes.concat(v.infinities, 42), function (num) { + st.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + st.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + st.end(); + }); + + t.test('objects', function (st) { + forEach(v.objects, function (object) { + st.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + st['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + st.end(); + }); + + t.test('binary literals', function (st) { + st.equal(ES.ToNumber('0b10'), 2, '0b10 is 2'); + st.equal(ES.ToNumber({ toString: function () { return '0b11'; } }), 3, 'Object that toStrings to 0b11 is 3'); + + st.equal(true, is(ES.ToNumber('0b12'), NaN), '0b12 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0b112'; } }), NaN), 'Object that toStrings to 0b112 is NaN'); + st.end(); + }); + + t.test('octal literals', function (st) { + st.equal(ES.ToNumber('0o10'), 8, '0o10 is 8'); + st.equal(ES.ToNumber({ toString: function () { return '0o11'; } }), 9, 'Object that toStrings to 0o11 is 9'); + + st.equal(true, is(ES.ToNumber('0o18'), NaN), '0o18 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0o118'; } }), NaN), 'Object that toStrings to 0o118 is NaN'); + st.end(); + }); + + t.test('signed hex numbers', function (st) { + st.equal(true, is(ES.ToNumber('-0xF'), NaN), '-0xF is NaN'); + st.equal(true, is(ES.ToNumber(' -0xF '), NaN), 'space-padded -0xF is NaN'); + st.equal(true, is(ES.ToNumber('+0xF'), NaN), '+0xF is NaN'); + st.equal(true, is(ES.ToNumber(' +0xF '), NaN), 'space-padded +0xF is NaN'); + + st.end(); + }); + + t.test('trimming of whitespace and non-whitespace characters', function (st) { + var whitespace = ' \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'; + st.equal(0, ES.ToNumber(whitespace + 0 + whitespace), 'whitespace is trimmed'); + + // Zero-width space (zws), next line character (nel), and non-character (bom) are not whitespace. + var nonWhitespaces = { + '\\u0085': '\u0085', + '\\u200b': '\u200b', + '\\ufffe': '\ufffe' + }; + + forEach(nonWhitespaces, function (desc, nonWS) { + st.equal(true, is(ES.ToNumber(nonWS + 0 + nonWS), NaN), 'non-whitespace ' + desc + ' not trimmed'); + }); + + st.end(); + }); + + forEach(v.symbols, function (symbol) { + t['throws']( + function () { ES.ToNumber(symbol); }, + TypeError, + 'Symbols can’t be converted to a Number: ' + debug(symbol) + ); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); + var now = +new Date(); + st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); + st.end(); + }); + + t.end(); + }); + + test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); + }); + + test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToInt16', function (t) { + t.ok(is(0, ES.ToInt16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt16(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt16(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt16(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.end(); + }); + + test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); + }); + + test('ToInt8', function (t) { + t.ok(is(0, ES.ToInt8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt8(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt8(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt8(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToInt8(0x100 - 1), -1), '2^8 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10), 0x10), '2^4 returns 2^4'); + t.end(); + }); + + test('ToUint8', function (t) { + t.ok(is(0, ES.ToUint8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint8(0x100000000 - 1), 0x100 - 1), '2^32 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint8(0x80000000 - 1), 0x100 - 1), '2^31 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint8(0x10000 - 1), 0x100 - 1), '2^16 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToUint8(0x100 - 1), 0x100 - 1), '2^8 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint8(0x10), 0x10), '2^4 returns 2^4'); + t.ok(is(ES.ToUint8(0x10 - 1), 0x10 - 1), '2^4 - 1 returns 2^4 - 1'); + t.end(); + }); + + test('ToUint8Clamp', function (t) { + t.ok(is(0, ES.ToUint8Clamp(NaN)), 'NaN coerces to +0'); + t.ok(is(0, ES.ToUint8Clamp(0)), '+0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-0)), '-0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-Infinity)), '-Infinity returns +0'); + t['throws'](function () { return ES.ToUint8Clamp(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + forEach([255, 256, 0x100000, Infinity], function (number) { + t.ok(is(255, ES.ToUint8Clamp(number)), number + ' coerces to 255'); + }); + t.equal(1, ES.ToUint8Clamp(1.49), '1.49 coerces to 1'); + t.equal(2, ES.ToUint8Clamp(1.5), '1.5 coerces to 2, because 2 is even'); + t.equal(2, ES.ToUint8Clamp(1.51), '1.51 coerces to 2'); + + t.equal(2, ES.ToUint8Clamp(2.49), '2.49 coerces to 2'); + t.equal(2, ES.ToUint8Clamp(2.5), '2.5 coerces to 2, because 2 is even'); + t.equal(3, ES.ToUint8Clamp(2.51), '2.51 coerces to 3'); + t.end(); + }); + + test('ToString', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (item) { + t.equal(ES.ToString(item), String(item), 'ES.ToString(' + debug(item) + ') ToStrings to String(' + debug(item) + ')'); + }); + + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + + forEach(v.symbols, function (symbol) { + t['throws'](function () { return ES.ToString(symbol); }, TypeError, debug(symbol) + ' throws'); + }); + t.end(); + }); + + test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); + }); + + test('RequireObjectCoercible', function (t) { + t.equal(false, 'CheckObjectCoercible' in ES, 'CheckObjectCoercible -> RequireObjectCoercible in ES6'); + t['throws'](function () { return ES.RequireObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.RequireObjectCoercible(null); }, TypeError, 'null throws'); + var isCoercible = function (value) { + t.doesNotThrow(function () { return ES.RequireObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), isCoercible); + t.end(); + }); + + test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.nonFunctions); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); + }); + + test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); + }); + + test('SameValueZero', function (t) { + t.equal(true, ES.SameValueZero(NaN, NaN), 'NaN is SameValueZero as NaN'); + t.equal(true, ES.SameValueZero(0, -0), '+0 is SameValueZero as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValueZero(val, val), debug(val) + ' is SameValueZero to itself'); + }); + t.end(); + }); + + test('ToPropertyKey', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (value) { + t.equal(ES.ToPropertyKey(value), String(value), 'ToPropertyKey(value) === String(value) for non-Symbols'); + }); + + forEach(v.symbols, function (symbol) { + t.equal( + ES.ToPropertyKey(symbol), + symbol, + 'ToPropertyKey(' + debug(symbol) + ') === ' + debug(symbol) + ); + t.equal( + ES.ToPropertyKey(Object(symbol)), + symbol, + 'ToPropertyKey(' + debug(Object(symbol)) + ') === ' + debug(symbol) + ); + }); + + t.end(); + }); + + test('ToLength', function (t) { + t['throws'](function () { return ES.ToLength(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + t.equal(3, ES.ToLength(v.coercibleObject), 'coercibleObject coerces to 3'); + t.equal(42, ES.ToLength('42.5'), '"42.5" coerces to 42'); + t.equal(7, ES.ToLength(7.3), '7.3 coerces to 7'); + forEach([-0, -1, -42, -Infinity], function (negative) { + t.ok(is(0, ES.ToLength(negative)), negative + ' coerces to +0'); + }); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 1), '2^53 coerces to 2^53 - 1'); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 3), '2^53 + 2 coerces to 2^53 - 1'); + t.end(); + }); + + test('IsArray', function (t) { + t.equal(true, ES.IsArray([]), '[] is array'); + t.equal(false, ES.IsArray({}), '{} is not array'); + t.equal(false, ES.IsArray({ length: 1, 0: true }), 'arraylike object is not array'); + forEach(v.objects.concat(v.primitives), function (value) { + t.equal(false, ES.IsArray(value), debug(value) + ' is not array'); + }); + t.end(); + }); + + test('IsRegExp', function (t) { + forEach([/a/g, new RegExp('a', 'g')], function (regex) { + t.equal(true, ES.IsRegExp(regex), regex + ' is regex'); + }); + + forEach(v.objects.concat(v.primitives), function (nonRegex) { + t.equal(false, ES.IsRegExp(nonRegex), debug(nonRegex) + ' is not regex'); + }); + + t.test('Symbol.match', { skip: !v.hasSymbols || !Symbol.match }, function (st) { + var obj = {}; + obj[Symbol.match] = true; + st.equal(true, ES.IsRegExp(obj), 'object with truthy Symbol.match is regex'); + + var regex = /a/; + regex[Symbol.match] = false; + st.equal(false, ES.IsRegExp(regex), 'regex with falsy Symbol.match is not regex'); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyKey', function (t) { + forEach(v.numbers.concat(v.objects), function (notKey) { + t.equal(false, ES.IsPropertyKey(notKey), debug(notKey) + ' is not property key'); + }); + + t.equal(true, ES.IsPropertyKey('foo'), 'string is property key'); + + forEach(v.symbols, function (symbol) { + t.equal(true, ES.IsPropertyKey(symbol), debug(symbol) + ' is property key'); + }); + t.end(); + }); + + test('IsInteger', function (t) { + for (var i = -100; i < 100; i += 10) { + t.equal(true, ES.IsInteger(i), i + ' is integer'); + t.equal(false, ES.IsInteger(i + 0.2), (i + 0.2) + ' is not integer'); + } + t.equal(true, ES.IsInteger(-0), '-0 is integer'); + var notInts = v.nonNumbers.concat(v.nonIntegerNumbers, v.infinities, [NaN, [], new Date()]); + forEach(notInts, function (notInt) { + t.equal(false, ES.IsInteger(notInt), debug(notInt) + ' is not integer'); + }); + t.equal(false, ES.IsInteger(v.uncoercibleObject), 'uncoercibleObject is not integer'); + t.end(); + }); + + test('IsExtensible', function (t) { + forEach(v.objects, function (object) { + t.equal(true, ES.IsExtensible(object), debug(object) + ' object is extensible'); + }); + forEach(v.primitives, function (primitive) { + t.equal(false, ES.IsExtensible(primitive), debug(primitive) + ' is not extensible'); + }); + if (Object.preventExtensions) { + t.equal(false, ES.IsExtensible(Object.preventExtensions({})), 'object with extensions prevented is not extensible'); + } + t.end(); + }); + + test('CanonicalNumericIndexString', function (t) { + var throwsOnNonString = function (notString) { + t['throws']( + function () { return ES.CanonicalNumericIndexString(notString); }, + TypeError, + debug(notString) + ' is not a string' + ); + }; + forEach(v.objects.concat(v.numbers), throwsOnNonString); + t.ok(is(-0, ES.CanonicalNumericIndexString('-0')), '"-0" returns -0'); + for (var i = -50; i < 50; i += 10) { + t.equal(i, ES.CanonicalNumericIndexString(String(i)), '"' + i + '" returns ' + i); + t.equal(undefined, ES.CanonicalNumericIndexString(String(i) + 'a'), '"' + i + 'a" returns undefined'); + } + t.end(); + }); + + test('IsConstructor', function (t) { + t.equal(true, ES.IsConstructor(function () {}), 'function is constructor'); + t.equal(false, ES.IsConstructor(/a/g), 'regex is not constructor'); + forEach(v.objects, function (object) { + t.equal(false, ES.IsConstructor(object), object + ' object is not constructor'); + }); + + try { + var arrow = Function('return () => {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(arrow), false, 'arrow function is not constructor'); + } catch (e) { + t.comment('SKIP: arrow function syntax not supported.'); + } + + try { + var foo = Function('return class Foo {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(foo), true, 'class is constructor'); + } catch (e) { + t.comment('SKIP: class syntax not supported.'); + } + + if (typeof Reflect !== 'object' || typeof Proxy !== 'function' || has(Proxy, 'prototype')) { + t.comment('SKIP: Proxy is constructor'); + } else { + t.equal(ES.IsConstructor(Proxy), true, 'Proxy is constructor'); + } + + t.end(); + }); + + test('Call', function (t) { + var receiver = {}; + var notFuncs = v.nonFunctions.concat([/a/g, new RegExp('a', 'g')]); + t.plan(notFuncs.length + 5); + var throwsIfNotCallable = function (notFunc) { + t['throws']( + function () { return ES.Call(notFunc, receiver); }, + TypeError, + debug(notFunc) + ' (' + typeof notFunc + ') is not callable' + ); + }; + forEach(notFuncs, throwsIfNotCallable); + ES.Call( + function (a, b) { + t.equal(this, receiver, 'context matches expected'); + t.deepEqual([a, b], [1, 2], 'named args are correct'); + t.equal(arguments.length, 3, 'extra argument was passed'); + t.equal(arguments[2], 3, 'extra argument was correct'); + }, + receiver, + [1, 2, 3] + ); + + t.test('Call doesn’t use func.apply', function (st) { + st.plan(4); + + var bad = function (a, b) { + st.equal(this, receiver, 'context matches expected'); + st.deepEqual([a, b], [1, 2], 'named args are correct'); + st.equal(arguments.length, 3, 'extra argument was passed'); + st.equal(arguments[2], 3, 'extra argument was correct'); + }; + + bad.apply = function () { + st.fail('bad.apply shouldn’t get called'); + }; + + ES.Call(bad, receiver, [1, 2, 3]); + st.end(); + }); + + t.end(); + }); + + test('GetV', function (t) { + t['throws'](function () { return ES.GetV({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + var obj = { a: function () {} }; + t.equal(ES.GetV(obj, 'a'), obj.a, 'returns property if it exists'); + t.equal(ES.GetV(obj, 'b'), undefined, 'returns undefiend if property does not exist'); + t.end(); + }); + + test('GetMethod', function (t) { + t['throws'](function () { return ES.GetMethod({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + t.equal(ES.GetMethod({}, 'a'), undefined, 'returns undefined in property is undefined'); + t.equal(ES.GetMethod({ a: null }, 'a'), undefined, 'returns undefined if property is null'); + t.equal(ES.GetMethod({ a: undefined }, 'a'), undefined, 'returns undefined if property is undefined'); + var obj = { a: function () {} }; + t['throws'](function () { ES.GetMethod({ a: 'b' }, 'a'); }, TypeError, 'throws TypeError if property exists and is not callable'); + t.equal(ES.GetMethod(obj, 'a'), obj.a, 'returns property if it is callable'); + t.end(); + }); + + test('Get', function (t) { + t['throws'](function () { return ES.Get('a', 'a'); }, TypeError, 'Throws a TypeError if `O` is not an Object'); + t['throws'](function () { return ES.Get({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + + var value = {}; + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var sym = Symbol('sym'); + var obj = {}; + obj[sym] = value; + st.equal(ES.Get(obj, sym), value, 'returns property `P` if it exists on object `O`'); + st.end(); + }); + t.equal(ES.Get({ a: value }, 'a'), value, 'returns property `P` if it exists on object `O`'); + t.end(); + }); + + test('Type', { skip: !v.hasSymbols }, function (t) { + t.equal(ES.Type(Symbol.iterator), 'Symbol', 'Type(Symbol.iterator) is Symbol'); + t.end(); + }); + + test('SpeciesConstructor', function (t) { + t['throws'](function () { ES.SpeciesConstructor(null); }, TypeError); + t['throws'](function () { ES.SpeciesConstructor(undefined); }, TypeError); + + var defaultConstructor = function Foo() {}; + + t.equal( + ES.SpeciesConstructor({ constructor: undefined }, defaultConstructor), + defaultConstructor, + 'undefined constructor returns defaultConstructor' + ); + + t['throws']( + function () { return ES.SpeciesConstructor({ constructor: null }, defaultConstructor); }, + TypeError, + 'non-undefined non-object constructor throws' + ); + + t.test('with Symbol.species', { skip: !hasSpecies }, function (st) { + var Bar = function Bar() {}; + Bar[Symbol.species] = null; + + st.equal( + ES.SpeciesConstructor(new Bar(), defaultConstructor), + defaultConstructor, + 'undefined/null Symbol.species returns default constructor' + ); + + var Baz = function Baz() {}; + Baz[Symbol.species] = Bar; + st.equal( + ES.SpeciesConstructor(new Baz(), defaultConstructor), + Bar, + 'returns Symbol.species constructor value' + ); + + Baz[Symbol.species] = {}; + st['throws']( + function () { ES.SpeciesConstructor(new Baz(), defaultConstructor); }, + TypeError, + 'throws when non-constructor non-null non-undefined species value found' + ); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyDescriptor', { skip: skips && skips.IsPropertyDescriptor }, function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t.equal( + ES.IsPropertyDescriptor(primitive), + false, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); + + assertRecordTests(ES, test); + + test('IsAccessorDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsAccessorDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); + }); + + test('IsDataDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsDataDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); + }); + + test('IsGenericDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); + }); + + test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'] + }); + + t.deepEqual(ES.FromPropertyDescriptor(v.genericDescriptor()), { + enumerable: false, + configurable: true + }); + + t.end(); + }); + + test('ToPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.dataDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), assign(data, { '[[Configurable]]': false })); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.FromPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('CompletePropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.CompletePropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var generic = v.genericDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(generic), + { + '[[Configurable]]': !!generic['[[Configurable]]'], + '[[Enumerable]]': !!generic['[[Enumerable]]'], + '[[Value]]': undefined, + '[[Writable]]': false + }, + 'completes a Generic Descriptor' + ); + + var data = v.dataDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(data), + { + '[[Configurable]]': !!data['[[Configurable]]'], + '[[Enumerable]]': false, + '[[Value]]': data['[[Value]]'], + '[[Writable]]': !!data['[[Writable]]'] + }, + 'completes a Data Descriptor' + ); + + var accessor = v.accessorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(accessor), + { + '[[Get]]': accessor['[[Get]]'], + '[[Enumerable]]': !!accessor['[[Enumerable]]'], + '[[Configurable]]': !!accessor['[[Configurable]]'], + '[[Set]]': undefined + }, + 'completes an Accessor Descriptor' + ); + + var mutator = v.mutatorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(mutator), + { + '[[Set]]': mutator['[[Set]]'], + '[[Enumerable]]': !!mutator['[[Enumerable]]'], + '[[Configurable]]': !!mutator['[[Configurable]]'], + '[[Get]]': undefined + }, + 'completes a mutator Descriptor' + ); + + t['throws']( + function () { ES.CompletePropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('Set', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.Set(primitive, '', null, false); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Set({}, nonKey, null, false); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.Set({}, '', null, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var o = {}; + var value = {}; + ES.Set(o, 'key', value, true); + t.deepEqual(o, { key: value }, 'key is set'); + + t.test('nonwritable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { writable: false }); + + st['throws']( + function () { ES.Set(obj, 'a', {}, true); }, + TypeError, + 'can not Set nonwritable property' + ); + + st.doesNotThrow( + function () { + st.equal(ES.Set(obj, 'a', {}, false), false, 'unsuccessful Set returns false'); + }, + 'setting Throw to false prevents an exception' + ); + + st.end(); + }); + + t.test('nonconfigurable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { configurable: false }); + + st.equal(ES.Set(obj, 'a', value, true), true, 'successful Set returns true'); + st.deepEqual(obj, { a: value }, 'key is set'); + + st.end(); + }); + + t.test('doesn’t call [[Get]] in conforming strict mode environments', { skip: noThrowOnStrictViolation }, function (st) { + var getterCalled = false; + var setterCalls = 0; + var obj = {}; + defineProperty(obj, 'a', { + get: function () { + getterCalled = true; + }, + set: function () { + setterCalls += 1; + } + }); + + st.equal(ES.Set(obj, 'a', value, false), true, 'successful Set returns true'); + st.equal(setterCalls, 1, 'setter was called once'); + st.equal(getterCalled, false, 'getter was not called'); + + st.end(); + }); + + t.end(); + }); + + test('HasOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasOwnProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasOwnProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasOwnProperty({}, 'toString'), false, 'inherited properties are not own'); + t.equal( + ES.HasOwnProperty({ toString: 1 }, 'toString'), + true, + 'shadowed inherited own properties are own' + ); + t.equal(ES.HasOwnProperty({ a: 1 }, 'a'), true, 'own properties are own'); + + t.end(); + }); + + test('HasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasProperty({}, 'nope'), false, 'object does not have nonexistent properties'); + t.equal(ES.HasProperty({}, 'toString'), true, 'object has inherited properties'); + t.equal( + ES.HasProperty({ toString: 1 }, 'toString'), + true, + 'object has shadowed inherited own properties' + ); + t.equal(ES.HasProperty({ a: 1 }, 'a'), true, 'object has own properties'); + + t.end(); + }); + + test('IsConcatSpreadable', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsConcatSpreadable(primitive), false, debug(primitive) + ' is not an Object'); + }); + + var hasSymbolConcatSpreadable = v.hasSymbols && Symbol.isConcatSpreadable; + t.test('Symbol.isConcatSpreadable', { skip: !hasSymbolConcatSpreadable }, function (st) { + forEach(v.falsies, function (falsy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = falsy; + st.equal( + ES.IsConcatSpreadable(obj), + false, + 'an object with ' + debug(falsy) + ' as Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + forEach(v.truthies, function (truthy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = truthy; + st.equal( + ES.IsConcatSpreadable(obj), + true, + 'an object with ' + debug(truthy) + ' as Symbol.isConcatSpreadable is concat spreadable' + ); + }); + + st.end(); + }); + + forEach(v.objects, function (object) { + t.equal( + ES.IsConcatSpreadable(object), + false, + 'non-array without Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + t.equal(ES.IsConcatSpreadable([]), true, 'arrays are concat spreadable'); + + t.end(); + }); + + test('Invoke', function (t) { + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Invoke({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t['throws'](function () { ES.Invoke({ o: false }, 'o'); }, TypeError, 'fails on a non-function'); + + t.test('invoked callback', function (st) { + var aValue = {}; + var bValue = {}; + var obj = { + f: function (a) { + st.equal(arguments.length, 2, '2 args passed'); + st.equal(a, aValue, 'first arg is correct'); + st.equal(arguments[1], bValue, 'second arg is correct'); + } + }; + st.plan(3); + ES.Invoke(obj, 'f', aValue, bValue); + }); + + t.end(); + }); + + test('GetIterator', function (t) { + var arr = [1, 2]; + testIterator(t, ES.GetIterator(arr), arr); + + testIterator(t, ES.GetIterator('abc'), 'abc'.split('')); + + t.test('Symbol.iterator', { skip: !v.hasSymbols }, function (st) { + var m = new Map(); + m.set(1, 'a'); + m.set(2, 'b'); + + testIterator(st, ES.GetIterator(m), [[1, 'a'], [2, 'b']]); + + st.end(); + }); + + t.end(); + }); + + test('IteratorNext', { skip: true }); + + test('IteratorComplete', { skip: true }); + + test('IteratorValue', { skip: true }); + + test('IteratorStep', { skip: true }); + + test('IteratorClose', { skip: true }); + + test('CreateIterResultObject', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.CreateIterResultObject({}, nonBoolean); }, + TypeError, + '"done" argument must be a boolean; ' + debug(nonBoolean) + ' is not' + ); + }); + + var value = {}; + t.deepEqual( + ES.CreateIterResultObject(value, true), + { value: value, done: true }, + 'creates a "done" iteration result' + ); + t.deepEqual( + ES.CreateIterResultObject(value, false), + { value: value, done: false }, + 'creates a "not done" iteration result' + ); + + t.end(); + }); + + test('RegExpExec', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.RegExpExec(primitive); }, + TypeError, + '"R" argument must be an object; ' + debug(primitive) + ' is not' + ); + }); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.RegExpExec({}, nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + t.test('gets and calls a callable "exec"', function (st) { + var str = '123'; + var o = { + exec: function (S) { + st.equal(this, o, '"exec" receiver is R'); + st.equal(S, str, '"exec" argument is S'); + + return null; + } + }; + st.plan(2); + ES.RegExpExec(o, str); + st.end(); + }); + + t.test('throws if a callable "exec" returns a non-null non-object', function (st) { + var str = '123'; + st.plan(v.nonNullPrimitives.length); + forEach(v.nonNullPrimitives, function (nonNullPrimitive) { + st['throws']( + function () { ES.RegExpExec({ exec: function () { return nonNullPrimitive; } }, str); }, + TypeError, + '"exec" method must return `null` or an Object; ' + debug(nonNullPrimitive) + ' is not' + ); + }); + st.end(); + }); + + t.test('actual regex that should match against a string', function (st) { + var S = 'aabc'; + var R = /a/g; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + + t.test('actual regex that should match against a string, with shadowed "exec"', function (st) { + var S = 'aabc'; + var R = /a/g; + R.exec = undefined; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + t.end(); + }); + + test('ArraySpeciesCreate', function (t) { + t.test('errors', function (st) { + var testNonNumber = function (nonNumber) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a number' + ); + }; + forEach(v.nonNumbers, testNonNumber); + + st['throws']( + function () { ES.ArraySpeciesCreate([], -1); }, + TypeError, + '-1 is not >= 0' + ); + st['throws']( + function () { ES.ArraySpeciesCreate([], -Infinity); }, + TypeError, + '-Infinity is not >= 0' + ); + + var testNonIntegers = function (nonInteger) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonInteger); }, + TypeError, + debug(nonInteger) + ' is not an integer' + ); + }; + forEach(v.nonIntegerNumbers, testNonIntegers); + + st.end(); + }); + + t.test('works with a non-array', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + var arr = ES.ArraySpeciesCreate(nonArray, 0); + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, 0, 'length is correct'); + st.equal(arr.constructor, Array, 'constructor is correct'); + }); + + st.end(); + }); + + t.test('works with a normal array', function (st) { + var len = 2; + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, len, 'length is correct'); + st.equal(arr.constructor, orig.constructor, 'constructor is correct'); + + st.end(); + }); + + t.test('-0 length produces +0 length', function (st) { + var len = -0; + st.ok(is(len, -0), '-0 is negative zero'); + st.notOk(is(len, 0), '-0 is not positive zero'); + + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.equal(ES.IsArray(arr), true); + st.ok(is(arr.length, 0)); + st.equal(arr.constructor, orig.constructor); + + st.end(); + }); + + t.test('works with species construtor', { skip: !hasSpecies }, function (st) { + var sentinel = {}; + var Foo = function Foo(len) { + this.length = len; + this.sentinel = sentinel; + }; + var Bar = getArraySubclassWithSpeciesConstructor(Foo); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Foo, 'result used species constructor'); + st.equal(arr.length, 3, 'length property is correct'); + st.equal(arr.sentinel, sentinel, 'Foo constructor was exercised'); + + st.end(); + }); + + t.test('works with null species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(null); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('works with undefined species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('throws with object non-construtor species constructor', { skip: !hasSpecies }, function (st) { + forEach(v.objects, function (obj) { + var Bar = getArraySubclassWithSpeciesConstructor(obj); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + st['throws']( + function () { ES.ArraySpeciesCreate(bar, 3); }, + TypeError, + debug(obj) + ' is not a constructor' + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('CreateDataProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataProperty(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = { id: 'sentinel' }; + var secondSentinel = { id: 'second sentinel' }; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataProperty(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + var secondStatus = ES.CreateDataProperty(obj, propertyKey, secondSentinel); + t.equal(secondStatus, true, 'second status is true'); + t.equal( + obj[propertyKey], + secondSentinel, + debug(secondSentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + t.test('with defineProperty', { skip: !defineProperty.oDP }, function (st) { + var nonWritable = defineProperty({}, propertyKey, { configurable: true, writable: false }); + + var nonWritableStatus = ES.CreateDataProperty(nonWritable, propertyKey, sentinel); + st.equal(nonWritableStatus, false, 'create data property failed'); + st.notEqual( + nonWritable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonwritable' + ); + + var nonConfigurable = defineProperty({}, propertyKey, { configurable: false, writable: true }); + + var nonConfigurableStatus = ES.CreateDataProperty(nonConfigurable, propertyKey, sentinel); + st.equal(nonConfigurableStatus, false, 'create data property failed'); + st.notEqual( + nonConfigurable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonconfigurable' + ); + st.end(); + }); + }); + + t.end(); + }); + + test('CreateDataPropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = {}; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataPropertyOrThrow(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + if (typeof Object.preventExtensions === 'function') { + var notExtensible = {}; + Object.preventExtensions(notExtensible); + + t['throws']( + function () { ES.CreateDataPropertyOrThrow(notExtensible, propertyKey, sentinel); }, + TypeError, + 'can not install ' + debug(propertyKey) + ' on non-extensible object' + ); + t.notEqual( + notExtensible[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object' + ); + } + }); + + t.end(); + }); + + test('ObjectCreate', function (t) { + forEach(v.nonNullPrimitives, function (value) { + t['throws']( + function () { ES.ObjectCreate(value); }, + TypeError, + debug(value) + ' is not null, or an object' + ); + }); + + t.test('proto arg', function (st) { + var Parent = function Parent() {}; + Parent.prototype.foo = {}; + var child = ES.ObjectCreate(Parent.prototype); + st.equal(child instanceof Parent, true, 'child is instanceof Parent'); + st.equal(child.foo, Parent.prototype.foo, 'child inherits properties from Parent.prototype'); + + st.end(); + }); + + t.test('internal slots arg', function (st) { + st.doesNotThrow(function () { ES.ObjectCreate({}, []); }, 'an empty slot list is valid'); + + st['throws']( + function () { ES.ObjectCreate({}, ['a']); }, + SyntaxError, + 'internal slots are not supported' + ); + + st.end(); + }); + + t.test('null proto', { skip: !Object.create && !$setProto }, function (st) { + st.equal('toString' in {}, true, 'normal objects have toString'); + st.equal('toString' in ES.ObjectCreate(null), false, 'makes a null object'); + + st.end(); + }); + + t.test('null proto when no native Object.create', { skip: Object.create || $setProto }, function (st) { + st['throws']( + function () { ES.ObjectCreate(null); }, + SyntaxError, + 'without a native Object.create, can not create null objects' + ); + + st.end(); + }); + + t.end(); + }); + + test('AdvanceStringIndex', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.AdvanceStringIndex(nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + var notInts = v.nonNumbers.concat( + v.nonIntegerNumbers, + v.infinities, + [NaN, [], new Date(), Math.pow(2, 53), -1] + ); + forEach(notInts, function (nonInt) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', nonInt); }, + TypeError, + '"index" argument must be an integer, ' + debug(nonInt) + ' is not.' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', 0, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var str = 'a\uD83D\uDCA9c'; + + t.test('non-unicode mode', function (st) { + for (var i = 0; i < str.length + 2; i += 1) { + st.equal(ES.AdvanceStringIndex(str, i, false), i + 1, i + ' advances to ' + (i + 1)); + } + + st.end(); + }); + + t.test('unicode mode', function (st) { + st.equal(ES.AdvanceStringIndex(str, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(str, 1, true), 3, '1 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 3, true), 4, '3 advances to 4'); + st.equal(ES.AdvanceStringIndex(str, 4, true), 5, '4 advances to 5'); + + st.end(); + }); + + t.test('lone surrogates', function (st) { + var halfPoo = 'a\uD83Dc'; + + st.equal(ES.AdvanceStringIndex(halfPoo, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(halfPoo, 1, true), 2, '1 advances to 2'); + st.equal(ES.AdvanceStringIndex(halfPoo, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(halfPoo, 3, true), 4, '3 advances to 4'); + + st.end(); + }); + + t.test('surrogate pairs', function (st) { + var lowestPair = String.fromCharCode('0xD800') + String.fromCharCode('0xDC00'); + var highestPair = String.fromCharCode('0xDBFF') + String.fromCharCode('0xDFFF'); + var poop = String.fromCharCode('0xD83D') + String.fromCharCode('0xDCA9'); + + st.equal(ES.AdvanceStringIndex(lowestPair, 0, true), 2, 'lowest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(highestPair, 0, true), 2, 'highest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(poop, 0, true), 2, 'poop, 0 -> 2'); + + st.end(); + }); + + t.end(); + }); + + test('CreateMethodProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateMethodProperty(primitive, 'key'); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateMethodProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var value = { foo: 'bar' }; + + st.equal(ES.CreateMethodProperty(obj, key, value), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + { + configurable: true, + enumerable: false, + value: value, + writable: true + }, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.equal(obj[key], value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.CreateMethodProperty(obj, 'foo', { value: 'baz' }); }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.CreateMethodProperty(function () {}, 'name', { value: 'baz' }); }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DefinePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DefinePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DefinePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var descriptor = { + configurable: true, + enumerable: false, + value: { foo: 'bar' }, + writable: true + }; + + st.equal(ES.DefinePropertyOrThrow(obj, key, descriptor), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + descriptor, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.deepEqual(obj[key], descriptor.value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { + ES.DefinePropertyOrThrow(obj, 'foo', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { + ES.DefinePropertyOrThrow(function () {}, 'name', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DeletePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DeletePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DeletePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = { 'the key': 42 }; + var key = 'the key'; + + st.equal(ES.DeletePropertyOrThrow(obj, key), true, 'deletes property successfully'); + st.equal(key in obj, false, 'key is no longer in the object'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.DeletePropertyOrThrow(obj, 'foo'); }, + TypeError, + 'nonconfigurable key can not be deleted' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.DeletePropertyOrThrow(function () {}, 'name'); }, + TypeError, + 'nonconfigurable function name can not be deleted' + ); + st.end(); + }); + + t.end(); + }); + + test('EnumerableOwnNames', { skip: skips && skips.EnumerableOwnNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { return ES.EnumerableOwnNames(O); }); + + t.deepEqual( + ES.EnumerableOwnNames(obj), + ['own'], + 'returns enumerable own names' + ); + + t.end(); + }); + + test('thisNumberValue', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.thisNumberValue(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.thisNumberValue(number), number, debug(number) + ' is its own thisNumberValue'); + var obj = Object(number); + t.equal(ES.thisNumberValue(obj), number, debug(obj) + ' is the boxed thisNumberValue'); + }); + + t.end(); + }); + + test('thisBooleanValue', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.thisBooleanValue(nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.booleans, function (boolean) { + t.equal(ES.thisBooleanValue(boolean), boolean, debug(boolean) + ' is its own thisBooleanValue'); + var obj = Object(boolean); + t.equal(ES.thisBooleanValue(obj), boolean, debug(obj) + ' is the boxed thisBooleanValue'); + }); + + t.end(); + }); + + test('thisStringValue', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.thisStringValue(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.thisStringValue(string), string, debug(string) + ' is its own thisStringValue'); + var obj = Object(string); + t.equal(ES.thisStringValue(obj), string, debug(obj) + ' is the boxed thisStringValue'); + }); + + t.end(); + }); + + test('thisTimeValue', function (t) { + forEach(v.primitives.concat(v.objects), function (nonDate) { + t['throws']( + function () { ES.thisTimeValue(nonDate); }, + TypeError, + debug(nonDate) + ' is not a Date' + ); + }); + + forEach(v.timestamps, function (timestamp) { + var date = new Date(timestamp); + + t.equal(ES.thisTimeValue(date), timestamp, debug(date) + ' is its own thisTimeValue'); + }); + + t.end(); + }); + + test('SetIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.SetIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.SetIntegrityLevel({}); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + var O = { a: 1 }; + t.test('sealed', { skip: !Object.preventExtensions || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'sealed'), true); + st['throws']( + function () { O.b = 2; }, + /^TypeError: (Cannot|Can't) add property b, object is not extensible$/, + 'sealing prevent new properties from being added' + ); + O.a = 2; + st.equal(O.a, 2, 'pre-frozen, existing properties are mutable'); + st.end(); + }); + + t.test('frozen', { skip: !Object.freeze || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'frozen'), true); + st['throws']( + function () { O.a = 3; }, + /^TypeError: Cannot assign to read only property 'a' of /, + 'freezing prevents existing properties from being mutated' + ); + st.end(); + }); + + t.end(); + }); + + test('TestIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.TestIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.TestIntegrityLevel({ a: 1 }); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'sealed'), false, 'basic object is not sealed'); + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'frozen'), false, 'basic object is not frozen'); + + t.test('preventExtensions', { skip: !Object.preventExtensions }, function (st) { + var o = Object.preventExtensions({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), false, 'nonextensible object is not sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'nonextensible object is not frozen'); + + var empty = Object.preventExtensions({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty nonextensible object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty nonextensible object is frozen'); + st.end(); + }); + + t.test('seal', { skip: !Object.seal }, function (st) { + var o = Object.seal({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'sealed object is not frozen'); + + var empty = Object.seal({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty sealed object is frozen'); + + st.end(); + }); + + t.test('freeze', { skip: !Object.freeze }, function (st) { + var o = Object.freeze({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), true, 'frozen object is frozen'); + + var empty = Object.freeze({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty frozen object is frozen'); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryHasInstance', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t.equal(ES.OrdinaryHasInstance(nonFunction, {}), false, debug(nonFunction) + ' is not callable'); + }); + + forEach(v.primitives, function (primitive) { + t.equal(ES.OrdinaryHasInstance(function () {}, primitive), false, debug(primitive) + ' is not an object'); + }); + + var C = function C() {}; + var D = function D() {}; + t.equal(ES.OrdinaryHasInstance(C, new C()), true, 'constructor function has an instance of itself'); + t.equal(ES.OrdinaryHasInstance(C, new D()), false, 'constructor/instance mismatch is false'); + t.equal(ES.OrdinaryHasInstance(D, new C()), false, 'instance/constructor mismatch is false'); + t.equal(ES.OrdinaryHasInstance(C, {}), false, 'plain object is not an instance of a constructor'); + t.equal(ES.OrdinaryHasInstance(Object, {}), true, 'plain object is an instance of Object'); + + t.end(); + }); + + test('OrdinaryHasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryHasProperty(primitive, ''); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryHasProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryHasProperty({ a: 1 }, 'a'), true, 'own property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'toString'), true, 'inherited property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'nope'), false, 'absent property is false'); + + t.end(); + }); + + test('InstanceofOperator', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.InstanceofOperator(primitive, function () {}); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.InstanceofOperator({}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not callable' + ); + }); + + var C = function C() {}; + var D = function D() {}; + + t.equal(ES.InstanceofOperator(new C(), C), true, 'constructor function has an instance of itself'); + t.equal(ES.InstanceofOperator(new D(), C), false, 'constructor/instance mismatch is false'); + t.equal(ES.InstanceofOperator(new C(), D), false, 'instance/constructor mismatch is false'); + t.equal(ES.InstanceofOperator({}, C), false, 'plain object is not an instance of a constructor'); + t.equal(ES.InstanceofOperator({}, Object), true, 'plain object is an instance of Object'); + + t.test('Symbol.hasInstance', { skip: !v.hasSymbols || !Symbol.hasInstance }, function (st) { + st.plan(4); + + var O = {}; + var C2 = function () {}; + st.equal(ES.InstanceofOperator(O, C2), false, 'O is not an instance of C2'); + + defineProperty(C2, Symbol.hasInstance, { + value: function (obj) { + st.equal(this, C2, 'hasInstance receiver is C2'); + st.equal(obj, O, 'hasInstance argument is O'); + + return {}; // testing coercion to boolean + } + }); + + st.equal(ES.InstanceofOperator(O, C2), true, 'O is now an instance of C2'); + + st.end(); + }); + + t.end(); + }); + + test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); + }); + + test('ValidateAndApplyPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (nonUndefinedPrimitive) { + t['throws']( + function () { ES.ValidateAndApplyPropertyDescriptor(nonUndefinedPrimitive, '', false, v.genericDescriptor(), v.genericDescriptor()); }, + TypeError, + 'O: ' + debug(nonUndefinedPrimitive) + ' is not undefined or an Object' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + nonBoolean, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'extensible: ' + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.primitives, function (primitive) { + // Desc must be a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + primitive, + v.genericDescriptor() + ); + }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + // current must be undefined or a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + v.genericDescriptor(), + primitive + ); + }, + TypeError, + 'current: ' + debug(primitive) + ' is not a Property Descriptor or undefined' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + // if O is an object, P must be a property key + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + {}, + nonPropertyKey, + false, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('current is undefined', function (st) { + var propertyKey = 'howdy'; + + st.test('generic descriptor', function (s2t) { + var generic = v.genericDescriptor(); + generic['[[Enumerable]]'] = true; + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, generic); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, generic), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, generic), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = undefined; + s2t.deepEqual(O, expected, 'generic descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('data descriptor', function (s2t) { + var data = v.dataDescriptor(); + data['[[Enumerable]]'] = true; + + var O = {}; + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, data), + true, + 'noop when O is undefined' + ); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, data), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, data), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = data['[[Value]]']; + s2t.deepEqual(O, expected, 'data descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('accessor descriptor', { skip: !defineProperty.oDP }, function (s2t) { + var count = 0; + var accessor = v.accessorDescriptor(); + accessor['[[Enumerable]]'] = true; + accessor['[[Get]]'] = function () { + count += 1; + return count; + }; + + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, accessor); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, accessor), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, accessor), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = accessor['[[Get]]']() + 1; + s2t.deepEqual(O, expected, 'accessor descriptor has been defined as an own accessor property'); + s2t.end(); + }); + + st.end(); + }); + + t.test('every field in Desc is absent', { skip: 'it is unclear if having no fields qualifies Desc to be a Property Descriptor' }); + + forEach([v.dataDescriptor, v.accessorDescriptor, v.mutatorDescriptor], function (getDescriptor) { + t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, 'property key', true, getDescriptor(), getDescriptor()), + true, + 'when Desc and current are the same, early return true' + ); + }); + + t.test('current is nonconfigurable', function (st) { + // note: these must not be generic descriptors, or else the algorithm returns an early true + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if Desc is configurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.enumerable(v.dataDescriptor()), + v.descriptors.nonEnumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is Enumerable and current is not' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.nonEnumerable(v.dataDescriptor()), + v.descriptors.enumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is not Enumerable and current is' + ); + + var descLackingEnumerable = v.accessorDescriptor(); + delete descLackingEnumerable['[[Enumerable]]']; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + descLackingEnumerable, + v.descriptors.enumerable(v.accessorDescriptor()) + ), + true, + 'not false if Desc lacks Enumerable' + ); + + st.end(); + }); + + t.test('Desc and current: one is a data descriptor, one is not', { skip: !defineProperty || !getOwnPropertyDescriptor }, function (st) { + // note: Desc must be configurable if current is nonconfigurable, to hit this branch + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.accessorDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if current (data) is nonconfigurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if current (not data) is nonconfigurable' + ); + + // one is data and one is not, + // // if current is data, convert to accessor + // // else convert to data + + var startsWithData = { + 'property key': 42 + }; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithData, + 'property key', + true, + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())) + ), + true, + 'operation is successful: current is data, Desc is accessor' + ); + var shouldBeAccessor = getOwnPropertyDescriptor(startsWithData, 'property key'); + st.equal(typeof shouldBeAccessor.get, 'function', 'has a getter'); + + var key = 'property key'; + var startsWithAccessor = {}; + defineProperty(startsWithAccessor, key, { + configurable: true, + enumerable: true, + get: function get() { return 42; } + }); + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithAccessor, + key, + true, + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor(42))) + ), + true, + 'operation is successful: current is accessor, Desc is data' + ); + var shouldBeData = getOwnPropertyDescriptor(startsWithAccessor, 'property key'); + st.deepEqual(shouldBeData, { configurable: true, enumerable: true, value: 42, writable: false }, 'is a data property'); + + st.end(); + }); + + t.test('Desc and current are both data descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.writable(v.dataDescriptor()), + v.descriptors.nonWritable(v.descriptors.nonConfigurable(v.dataDescriptor())) + ), + false, + 'false if frozen current and writable Desc' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable({ '[[Value]]': 42 }), + v.descriptors.nonWritable({ '[[Value]]': 7 }) + ), + false, + 'false if nonwritable current has a different value than Desc' + ); + + st.end(); + }); + + t.test('current is nonconfigurable; Desc and current are both accessor descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.mutatorDescriptor(), + v.descriptors.nonConfigurable(v.mutatorDescriptor()) + ), + false, + 'false if both Sets are not equal' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.accessorDescriptor(), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if both Gets are not equal' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryGetOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty(primitive, ''); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryGetOwnProperty({}, 'not in the object'), undefined, 'missing property yields undefined'); + t.equal(ES.OrdinaryGetOwnProperty({}, 'toString'), undefined, 'inherited non-own property yields undefined'); + + t.deepEqual( + ES.OrdinaryGetOwnProperty({ a: 1 }, 'a'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: true, + value: 1, + writable: true + }), + 'own assigned data property yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(/a/, 'lastIndex'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'regex lastIndex yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty([], 'length'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'array length yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(Object.prototype, 'toString'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: false, + value: Object.prototype.toString, + writable: true + }), + 'own non-enumerable data property yields expected descriptor' + ); + + t.test('ES5+', { skip: !defineProperty.oDP }, function (st) { + var O = {}; + defineProperty(O, 'foo', { + configurable: false, + enumerable: false, + value: O, + writable: true + }); + + st.deepEqual( + ES.OrdinaryGetOwnProperty(O, 'foo'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: O, + writable: true + }), + 'defined own property yields expected descriptor' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryDefineOwnProperty', { skip: !getOwnPropertyDescriptor }, function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty({}, nonPropertyKey, v.genericDescriptor()); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty(primitive, '', v.genericDescriptor()); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var O = {}; + var P = 'property key'; + var Desc = v.accessorDescriptor(); + t.equal( + ES.OrdinaryDefineOwnProperty(O, P, Desc), + true, + 'operation is successful' + ); + t.deepEqual( + getOwnPropertyDescriptor(O, P), + ES.FromPropertyDescriptor(ES.CompletePropertyDescriptor(Desc)), + 'expected property descriptor is defined' + ); + + t.end(); + }); + + test('ArrayCreate', function (t) { + forEach(v.nonIntegerNumbers.concat([-1]), function (nonIntegerNumber) { + t['throws']( + function () { ES.ArrayCreate(nonIntegerNumber); }, + TypeError, + 'length must be an integer number >= 0' + ); + }); + + t['throws']( + function () { ES.ArrayCreate(Math.pow(2, 32)); }, + RangeError, + 'length must be < 2**32' + ); + + t.deepEqual(ES.ArrayCreate(-0), [], 'length of -0 creates an empty array'); + t.deepEqual(ES.ArrayCreate(0), [], 'length of +0 creates an empty array'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(1), [,], 'length of 1 creates a sparse array of length 1'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(2), [,,], 'length of 2 creates a sparse array of length 2'); + + t.test('proto argument', { skip: !$setProto }, function (st) { + var fakeProto = { + push: { toString: function () { return 'not array push'; } } + }; + st.equal(ES.ArrayCreate(0, fakeProto).push, fakeProto.push, 'passing the proto argument works'); + st.end(); + }); + + t.end(); + }); + + test('ArraySetLength', function (t) { + forEach(v.primitives.concat(v.objects), function (nonArray) { + t['throws']( + function () { ES.ArraySetLength(nonArray, 0); }, + TypeError, + 'A: ' + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ArraySetLength([], primitive); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.test('making length nonwritable', { skip: !getOwnPropertyDescriptor }, function (st) { + var a = []; + ES.ArraySetLength(a, { '[[Writable]]': false }); + st.deepEqual( + getOwnPropertyDescriptor(a, 'length'), + { + configurable: false, + enumerable: false, + value: 0, + writable: false + }, + 'without a value, length becomes nonwritable' + ); + st.end(); + }); + + var arr = []; + ES.ArraySetLength(arr, { '[[Value]]': 7 }); + t.equal(arr.length, 7, 'array now has a length of 7'); + + t.end(); + }); + + test('CreateHTML', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.CreateHTML('', nonString, '', ''); }, + TypeError, + 'tag: ' + debug(nonString) + ' is not a String' + ); + t['throws']( + function () { ES.CreateHTML('', '', nonString, ''); }, + TypeError, + 'attribute: ' + debug(nonString) + ' is not a String' + ); + }); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + '' + ), + 'the string', + 'works with an empty string attribute value' + ); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + 'attr', + 'value "with quotes"' + ), + 'the string', + 'works with an attribute, and a value with quotes' + ); + + t.end(); + }); + + test('GetOwnPropertyKeys', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.GetOwnPropertyKeys(primitive, 'String'); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.GetOwnPropertyKeys({}, 'not string or symbol'); }, + TypeError, + 'Type: must be "String" or "Symbol"' + ); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var O = { a: 1 }; + O[Symbol.iterator] = true; + var s = Symbol('test'); + defineProperty(O, s, { enumerable: false, value: true }); + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'Symbol'), + [Symbol.iterator, s], + 'works with Symbols, enumerable or not' + ); + + st.end(); + }); + + t.test('non-enumerable names', { skip: !defineProperty.oDP }, function (st) { + var O = { a: 1 }; + defineProperty(O, 'b', { enumerable: false, value: 2 }); + if (v.hasSymbols) { + O[Symbol.iterator] = true; + } + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'String').sort(), + ['a', 'b'].sort(), + 'works with Strings, enumerable or not' + ); + + st.end(); + }); + + t.deepEqual( + ES.GetOwnPropertyKeys({ a: 1, b: 2 }, 'String').sort(), + ['a', 'b'].sort(), + 'works with enumerable keys' + ); + + t.end(); + }); + + test('SymbolDescriptiveString', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.SymbolDescriptiveString(nonSymbol); }, + TypeError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(ES.SymbolDescriptiveString(Symbol()), 'Symbol()', 'undefined description'); + st.equal(ES.SymbolDescriptiveString(Symbol('')), 'Symbol()', 'empty string description'); + st.equal(ES.SymbolDescriptiveString(Symbol.iterator), 'Symbol(Symbol.iterator)', 'well-known symbol'); + st.equal(ES.SymbolDescriptiveString(Symbol('foo')), 'Symbol(foo)', 'string description'); + + st.end(); + }); + + t.end(); + }); + + test('GetSubstitution', { skip: skips && skips.GetSubstitution }, function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + if (canDistinguishSparseFromUndefined || typeof nonString !== 'undefined') { + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + } + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); + }); + + test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); + }); + + test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); + }); + + test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); + }); + + var msPerSecond = 1e3; + var msPerMinute = 60 * msPerSecond; + var msPerHour = 60 * msPerMinute; + var msPerDay = 24 * msPerHour; + + test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); + }); + + test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); + }); + + test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); + }); + + test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); + }); + + test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); + }); + + test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); + }); + + test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); + }); + + test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); + }); + + test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); + }); + + test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); + }); + + test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); + }); + + test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); + }); + + test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); + }); + + test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + + t.end(); + }); + + test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); + }); + + test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); + }); + + test('ToDateString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.ToDateString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + t.equal(ES.ToDateString(NaN), 'Invalid Date', 'NaN becomes "Invalid Date"'); + var now = +new Date(); + t.equal(ES.ToDateString(now), Date(now), 'any timestamp becomes `Date(timestamp)`'); + t.end(); + }); + + test('CreateListFromArrayLike', function (t) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { ES.CreateListFromArrayLike(nonObject); }, + TypeError, + debug(nonObject) + ' is not an Object' + ); + }); + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.CreateListFromArrayLike({}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + t.deepEqual( + ES.CreateListFromArrayLike({ length: 2, 0: 'a', 1: 'b', 2: 'c' }), + ['a', 'b'], + 'arraylike stops at the length' + ); + + t.end(); + }); + + test('GetPrototypeFromConstructor', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(nonFunction, '%Array%'); }, + TypeError, + debug(nonFunction) + ' is not a constructor' + ); + }); + + forEach(arrowFns, function (arrowFn) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(arrowFn, '%Array%'); }, + TypeError, + debug(arrowFn) + ' is not a constructor' + ); + }); + + var f = function () {}; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + f.prototype, + 'function with normal `prototype` property returns it' + ); + forEach([true, 'foo', 42], function (truthyPrimitive) { + f.prototype = truthyPrimitive; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + Array.prototype, + 'function with non-object `prototype` property (' + debug(truthyPrimitive) + ') returns default intrinsic' + ); + }); + + t.end(); + }); + + var getNamelessFunction = function () { + var f = Object(function () {}); + try { + delete f.name; + } catch (e) { /**/ } + return f; + }; + + test('SetFunctionName', function (t) { + t.test('non-extensible function', { skip: !Object.preventExtensions }, function (st) { + var f = getNamelessFunction(); + Object.preventExtensions(f); + st['throws']( + function () { ES.SetFunctionName(f, ''); }, + TypeError, + 'throws on a non-extensible function' + ); + st.end(); + }); + + t.test('has an own name property', { skip: !functionsHaveNames }, function (st) { + st['throws']( + function () { ES.SetFunctionName(function g() {}, ''); }, + TypeError, + 'throws if function has an own `name` property' + ); + st.end(); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.SetFunctionName(getNamelessFunction(), nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Symbol or String' + ); + }); + + t.test('symbols', { skip: !v.hasSymbols || has(getNamelessFunction(), 'name') }, function (st) { + var pairs = [ + [Symbol(), ''], + [Symbol(undefined), ''], + [Symbol(null), '[null]'], + [Symbol(''), getInferredName ? '[]' : ''], + [Symbol.iterator, '[Symbol.iterator]'], + [Symbol('foo'), '[foo]'] + ]; + forEach(pairs, function (pair) { + var sym = pair[0]; + var desc = pair[1]; + var f = getNamelessFunction(); + ES.SetFunctionName(f, sym); + st.equal(f.name, desc, debug(sym) + ' yields a name of ' + debug(desc)); + }); + + st.end(); + }); + + var f = getNamelessFunction(); + t.test('when names are configurable', { skip: !functionsHaveConfigurableNames || has(f, 'name') }, function (st) { + // without prefix + st.notEqual(f.name, 'foo', 'precondition'); + ES.SetFunctionName(f, 'foo'); + st.equal(f.name, 'foo', 'function name is set without a prefix'); + + // with prefix + var g = getNamelessFunction(); + st.notEqual(g.name, 'pre- foo', 'precondition'); + ES.SetFunctionName(g, 'foo', 'pre-'); + st.equal(g.name, 'pre- foo', 'function name is set with a prefix'); + + st.end(); + }); + + t.end(); + }); +}; + +var es2016 = function ES2016(ES, ops, expectedMissing, skips) { + es2015(ES, ops, expectedMissing, skips); + + test('SameValueNonNumber', function (t) { + var willThrow = [ + [3, 4], + [NaN, 4], + [4, ''], + ['abc', true], + [{}, false] + ]; + forEach(willThrow, function (nums) { + t['throws'](function () { return ES.SameValueNonNumber.apply(ES, nums); }, TypeError, 'value must be same type and non-number'); + }); + + forEach(v.objects.concat(v.nonNumberPrimitives), function (val) { + t.equal(val === val, ES.SameValueNonNumber(val, val), debug(val) + ' is SameValueNonNumber to itself'); + }); + + t.end(); + }); + + test('IterableToArrayLike', { skip: skips && skips.IterableToArrayLike }, function (t) { + t.test('custom iterables', { skip: !v.hasSymbols }, function (st) { + var O = {}; + O[Symbol.iterator] = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + st.deepEqual( + ES.IterableToArrayLike(O), + [0, 1, 2, 3, 4], + 'Symbol.iterator method is called and values collected' + ); + + st.end(); + }); + + t.deepEqual(ES.IterableToArrayLike('abc'), ['a', 'b', 'c'], 'a string of code units spreads'); + t.deepEqual(ES.IterableToArrayLike('💩'), ['💩'], 'a string of code points spreads'); + t.deepEqual(ES.IterableToArrayLike('a💩c'), ['a', '💩', 'c'], 'a string of code points and units spreads'); + + var arr = [1, 2, 3]; + t.deepEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a similar array'); + t.notEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a different, but similar, array'); + + var O = {}; + t.equal(ES.IterableToArrayLike(O), O, 'a non-iterable non-array non-string object is returned directly'); + + t.end(); + }); + + test('OrdinaryGetPrototypeOf', function (t) { + t.test('values', { skip: !$getProto }, function (st) { + st.equal(ES.OrdinaryGetPrototypeOf([]), Array.prototype, 'array [[Prototype]] is Array.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf({}), Object.prototype, 'object [[Prototype]] is Object.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(/a/g), RegExp.prototype, 'regex [[Prototype]] is RegExp.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object('')), String.prototype, 'boxed string [[Prototype]] is String.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(42)), Number.prototype, 'boxed number [[Prototype]] is Number.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(true)), Boolean.prototype, 'boxed boolean [[Prototype]] is Boolean.prototype'); + if (v.hasSymbols) { + st.equal(ES.OrdinaryGetPrototypeOf(Object(Symbol.iterator)), Symbol.prototype, 'boxed symbol [[Prototype]] is Symbol.prototype'); + } + st.end(); + }); + + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetPrototypeOf(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + t.end(); + }); + + test('OrdinarySetPrototypeOf', { skip: !$getProto || !$setProto }, function (t) { + var a = []; + var proto = {}; + + t.equal(ES.OrdinaryGetPrototypeOf(a), Array.prototype, 'precondition'); + t.equal(ES.OrdinarySetPrototypeOf(a, proto), true, 'setting prototype is successful'); + t.equal(ES.OrdinaryGetPrototypeOf(a), proto, 'postcondition'); + + t.end(); + }); +}; + +var es2017 = function ES2017(ES, ops, expectedMissing, skips) { + es2016(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnNames: true, + IterableToArrayLike: true + })); + + test('ToIndex', function (t) { + t.ok(is(ES.ToIndex(), 0), 'no value gives 0'); + t.ok(is(ES.ToIndex(undefined), 0), 'undefined value gives 0'); + + t['throws'](function () { ES.ToIndex(-1); }, RangeError, 'negative numbers throw'); + + t['throws'](function () { ES.ToIndex(MAX_SAFE_INTEGER + 1); }, RangeError, 'too large numbers throw'); + + t.equal(ES.ToIndex(3), 3, 'numbers work'); + t.equal(ES.ToIndex(v.valueOfOnlyObject), 4, 'coercible objects are coerced'); + + t.end(); + }); + + test('EnumerableOwnProperties', { skip: skips && skips.EnumerableOwnProperties }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnProperties(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IterableToList', function (t) { + var customIterator = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + + t.deepEqual( + ES.IterableToList({}, customIterator), + [0, 1, 2, 3, 4], + 'iterator method is called and values collected' + ); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.deepEqual(ES.IterableToList('abc', String.prototype[Symbol.iterator]), ['a', 'b', 'c'], 'a string of code units spreads'); + st.deepEqual(ES.IterableToList('☃', String.prototype[Symbol.iterator]), ['☃'], 'a string of code points spreads'); + + var arr = [1, 2, 3]; + st.deepEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a similar array'); + st.notEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a different, but similar, array'); + + st.end(); + }); + + t['throws']( + function () { ES.IterableToList({}, void 0); }, + TypeError, + 'non-function iterator method' + ); + + t.end(); + }); +}; + +var es2018 = function ES2018(ES, ops, expectedMissing, skips) { + es2017(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnProperties: true, + GetSubstitution: true, + IsPropertyDescriptor: true + })); + + test('thisSymbolValue', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.thisSymbolValue(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('no native Symbols', { skip: v.hasSymbols }, function (st) { + forEach(v.objects.concat(v.primitives), function (value) { + st['throws']( + function () { ES.thisSymbolValue(value); }, + SyntaxError, + 'Symbols are not supported' + ); + }); + st.end(); + }); + + t.test('symbol values', { skip: !v.hasSymbols }, function (st) { + forEach(v.symbols, function (symbol) { + st.equal(ES.thisSymbolValue(symbol), symbol, 'Symbol value of ' + debug(symbol) + ' is same symbol'); + + st.equal( + ES.thisSymbolValue(Object(symbol)), + symbol, + 'Symbol value of ' + debug(Object(symbol)) + ' is ' + debug(symbol) + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('IsStringPrefix', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.IsStringPrefix(nonString, 'a'); }, + TypeError, + 'first arg: ' + debug(nonString) + ' is not a string' + ); + t['throws']( + function () { ES.IsStringPrefix('a', nonString); }, + TypeError, + 'second arg: ' + debug(nonString) + ' is not a string' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.IsStringPrefix(string, string), true, debug(string) + ' is a prefix of itself'); + + t.equal(ES.IsStringPrefix('', string), true, 'the empty string is a prefix of everything'); + }); + + t.equal(ES.IsStringPrefix('abc', 'abcd'), true, '"abc" is a prefix of "abcd"'); + t.equal(ES.IsStringPrefix('abcd', 'abc'), false, '"abcd" is not a prefix of "abc"'); + + t.equal(ES.IsStringPrefix('a', 'bc'), false, '"a" is not a prefix of "bc"'); + + t.end(); + }); + + test('NumberToString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.NumberToString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.NumberToString(number), String(number), debug(number) + ' stringifies to ' + number); + }); + + t.end(); + }); + + test('CopyDataProperties', function (t) { + t.test('first argument: target', function (st) { + forEach(v.primitives, function (primitive) { + st['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + st.end(); + }); + + t.test('second argument: source', function (st) { + var frozenTarget = Object.freeze ? Object.freeze({}) : {}; + forEach(v.nullPrimitives, function (nullish) { + st.equal( + ES.CopyDataProperties(frozenTarget, nullish, []), + frozenTarget, + debug(nullish) + ' "source" yields identical, unmodified target' + ); + }); + + forEach(v.nonNullPrimitives, function (objectCoercible) { + var target = {}; + var result = ES.CopyDataProperties(target, objectCoercible, []); + st.equal(result, target, 'result === target'); + st.deepEqual(keys(result), keys(Object(objectCoercible)), 'target ends up with keys of ' + debug(objectCoercible)); + }); + + st.test('enumerable accessor property', { skip: !defineProperty.oDP }, function (s2t) { + var target = {}; + var source = {}; + defineProperty(source, 'a', { + enumerable: true, + get: function () { return 42; } + }); + var result = ES.CopyDataProperties(target, source, []); + s2t.equal(result, target, 'result === target'); + s2t.deepEqual(result, { a: 42 }, 'target ends up with enumerable accessor of source'); + s2t.end(); + }); + + st.end(); + }); + + t.test('third argument: excludedItems', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, [nonPropertyKey]); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + var result = ES.CopyDataProperties({}, { a: 1, b: 2, c: 3 }, ['b']); + st.deepEqual(keys(result).sort(), ['a', 'c'].sort(), 'excluded string keys are excluded'); + + st.test('excluding symbols', { skip: !v.hasSymbols }, function (s2t) { + var source = {}; + forEach(v.symbols, function (symbol) { + source[symbol] = true; + }); + + var includedSymbols = v.symbols.slice(1); + var excludedSymbols = v.symbols.slice(0, 1); + var target = ES.CopyDataProperties({}, source, excludedSymbols); + + forEach(includedSymbols, function (symbol) { + s2t.equal(has(target, symbol), true, debug(symbol) + ' is included'); + }); + + forEach(excludedSymbols, function (symbol) { + s2t.equal(has(target, symbol), false, debug(symbol) + ' is excluded'); + }); + + s2t.end(); + }); + + st.end(); + }); + + t.end(); + }); + + test('PromiseResolve', function (t) { + t.test('Promises unsupported', { skip: typeof Promise === 'function' }, function (st) { + st['throws']( + function () { ES.PromiseResolve(); }, + SyntaxError, + 'Promises are not supported' + ); + st.end(); + }); + + t.test('Promises supported', { skip: typeof Promise !== 'function' }, function (st) { + st.plan(2); + + var a = {}; + var b = {}; + var fulfilled = Promise.resolve(a); + var rejected = Promise.reject(b); + + ES.PromiseResolve(Promise, fulfilled).then(function (x) { + st.equal(x, a, 'fulfilled promise resolves to fulfilled'); + }); + + ES.PromiseResolve(Promise, rejected)['catch'](function (e) { + st.equal(e, b, 'rejected promise resolves to rejected'); + }); + }); + + t.end(); + }); + + test('EnumerableOwnPropertyNames', { skip: skips && skips.EnumerableOwnPropertyNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnPropertyNames(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IsPromise', { skip: typeof Promise !== 'function' }, function (t) { + forEach(v.objects.concat(v.primitives), function (nonPromise) { + t.equal(ES.IsPromise(nonPromise), false, debug(nonPromise) + ' is not a Promise'); + }); + + var thenable = { then: Promise.prototype.then }; + t.equal(ES.IsPromise(thenable), false, 'generic thenable is not a Promise'); + + t.equal(ES.IsPromise(Promise.resolve()), true, 'Promise is a Promise'); + + t.end(); + }); + + test('GetSubstitution (ES2018+)', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], undefined, ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], undefined, ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], undefined, nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], undefined, ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], undefined, ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, undefined, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], undefined, ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('DateString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.DateString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + t.equal(ES.DateString(Date.UTC(2019, 8, 10, 7, 8, 9)), 'Tue Sep 10 2019'); + t.equal(ES.DateString(Date.UTC(2016, 1, 29, 7, 8, 9)), 'Mon Feb 29 2016'); // leap day + t.end(); + }); + + test('TimeString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.TimeString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + var tv = Date.UTC(2019, 8, 10, 7, 8, 9); + t.equal(ES.TimeString(tv), '07:08:09 GMT'); + t.end(); + }); +}; + +var es2019 = function ES2018(ES, ops, expectedMissing, skips) { + es2018(ES, ops, expectedMissing, assign({}, skips, { + })); + + test('AddEntriesFromIterable', function (t) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, undefined, function () {}); }, + TypeError, + 'iterable must not be undefined' + ); + t['throws']( + function () { ES.AddEntriesFromIterable({}, null, function () {}); }, + TypeError, + 'iterable must not be null' + ); + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, {}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.plan(4); + + var O = {}; + st.equal(ES.AddEntriesFromIterable(O, [], function () {}), O, 'returns the target'); + + var adder = function (key, value) { + st.equal(this, O, 'adder gets proper receiver'); + st.equal(key, 0, 'k is key'); + st.equal(value, 'a', 'v is value'); + }; + ES.AddEntriesFromIterable(O, ['a'].entries(), adder); + + st.end(); + }); + + t.end(); + }); + + test('FlattenIntoArray', function (t) { + t.test('no mapper function', function (st) { + var testDepth = function testDepth(tt, depth, expected) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, depth); + tt.deepEqual(a, expected, 'depth: ' + depth); + }; + + testDepth(st, 1, [1, 2, [3], 4, [[[5]]]]); + testDepth(st, 2, [1, 2, 3, 4, [[5]]]); + testDepth(st, 3, [1, 2, 3, 4, [5]]); + testDepth(st, 4, [1, 2, 3, 4, 5]); + testDepth(st, Infinity, [1, 2, 3, 4, 5]); + st.end(); + }); + + t.test('mapper function', function (st) { + var testMapper = function testMapper(tt, mapper, expected, thisArg) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, 1, mapper, thisArg); + tt.deepEqual(a, expected); + }; + + var double = function double(x) { + return typeof x === 'number' ? 2 * x : x; + }; + testMapper( + st, + double, + [1, 4, [3], 8, [[[5]]]] + ); + var receiver = hasStrictMode ? 42 : Object(42); + testMapper( + st, + function (x) { return [this, double(x)]; }, + [receiver, [1], receiver, 4, receiver, [[3]], receiver, [], receiver, 8, receiver, [[[[5]]]]], + 42 + ); + st.end(); + }); + + t.end(); + }); + + test('TrimString', function (t) { + t.test('non-object string', function (st) { + forEach(v.nullPrimitives, function (nullish) { + st['throws']( + function () { ES.TrimString(nullish); }, + debug(nullish) + ' is not an Object' + ); + }); + st.end(); + }); + + var string = ' \n abc \n '; + t.equal(ES.TrimString(string, 'start'), string.slice(string.indexOf('a'))); + t.equal(ES.TrimString(string, 'end'), string.slice(0, string.lastIndexOf('c') + 1)); + t.equal(ES.TrimString(string, 'start+end'), string.slice(string.indexOf('a'), string.lastIndexOf('c') + 1)); + + t.end(); + }); +}; + +module.exports = { + es2015: es2015, + es2016: es2016, + es2017: es2017, + es2018: es2018, + es2019: es2019 +}; diff --git a/node_modules/object.values/package.json b/node_modules/object.values/package.json new file mode 100644 index 0000000..90cb904 --- /dev/null +++ b/node_modules/object.values/package.json @@ -0,0 +1,121 @@ +{ + "_from": "object.values@^1.1.1", + "_id": "object.values@1.1.1", + "_inBundle": false, + "_integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "_location": "/object.values", + "_phantomChildren": { + "es-to-primitive": "1.2.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "has-symbols": "1.0.1", + "is-callable": "1.2.2", + "is-regex": "1.1.1", + "object-inspect": "1.8.0", + "object-keys": "1.1.1", + "object.assign": "4.1.1", + "string.prototype.trimend": "1.0.1", + "string.prototype.trimstart": "1.0.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "object.values@^1.1.1", + "name": "object.values", + "escapedName": "object.values", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/eslint-plugin-import" + ], + "_resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "_shasum": "68a99ecde356b7e9295a3c5e0ce31dc8c953de5e", + "_spec": "object.values@^1.1.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-plugin-import", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "bugs": { + "url": "https://github.com/es-shims/Object.values/issues" + }, + "bundleDependencies": false, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + }, + "deprecated": false, + "description": "ES2017 spec-compliant Object.values shim.", + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^15.0.2", + "array-map": "^0.0.0", + "covert": "^1.1.1", + "eslint": "^6.7.2", + "functions-have-names": "^1.2.0", + "object-keys": "^1.1.1", + "tape": "^4.11.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/es-shims/Object.values#readme", + "keywords": [ + "Object.values", + "Object.keys", + "Object.entries", + "values", + "ES7", + "ES8", + "ES2017", + "shim", + "object", + "keys", + "entries", + "polyfill", + "es-shim API" + ], + "license": "MIT", + "main": "index.js", + "name": "object.values", + "repository": { + "type": "git", + "url": "git://github.com/es-shims/Object.values.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "lint": "eslint .", + "posttest": "npx aud", + "pretest": "npm run lint", + "test": "npm run tests-only", + "test:module": "node test/index", + "test:shimmed": "node test/shimmed", + "tests-only": "es-shim-api && npm run test:shimmed && npm run test:module" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/9.0..latest", + "firefox/4.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/11.6..latest", + "opera/next", + "safari/5.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.1.1" +} diff --git a/node_modules/object.values/polyfill.js b/node_modules/object.values/polyfill.js new file mode 100644 index 0000000..2790be4 --- /dev/null +++ b/node_modules/object.values/polyfill.js @@ -0,0 +1,7 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = function getPolyfill() { + return typeof Object.values === 'function' ? Object.values : implementation; +}; diff --git a/node_modules/object.values/shim.js b/node_modules/object.values/shim.js new file mode 100644 index 0000000..a680e98 --- /dev/null +++ b/node_modules/object.values/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var getPolyfill = require('./polyfill'); +var define = require('define-properties'); + +module.exports = function shimValues() { + var polyfill = getPolyfill(); + define(Object, { values: polyfill }, { + values: function testValues() { + return Object.values !== polyfill; + } + }); + return polyfill; +}; diff --git a/node_modules/object.values/test/.eslintrc b/node_modules/object.values/test/.eslintrc new file mode 100644 index 0000000..5562962 --- /dev/null +++ b/node_modules/object.values/test/.eslintrc @@ -0,0 +1,11 @@ +{ + "rules": { + "array-bracket-newline": 0, + "max-lines-per-function": 0, + "max-nested-callbacks": [2, 3], + "max-statements": [2, 12], + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": [1], + "object-curly-newline": 0, + } +} diff --git a/node_modules/object.values/test/index.js b/node_modules/object.values/test/index.js new file mode 100644 index 0000000..2c1bba5 --- /dev/null +++ b/node_modules/object.values/test/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var values = require('../'); +var test = require('tape'); +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('bad array/this value', function (st) { + st['throws'](function () { values(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { values(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(values, t); + + t.end(); +}); diff --git a/node_modules/object.values/test/shimmed.js b/node_modules/object.values/test/shimmed.js new file mode 100644 index 0000000..c5db49b --- /dev/null +++ b/node_modules/object.values/test/shimmed.js @@ -0,0 +1,36 @@ +'use strict'; + +var values = require('../'); +values.shim(); + +var test = require('tape'); +var defineProperties = require('define-properties'); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names')(); + +var runTests = require('./tests'); + +test('shimmed', function (t) { + t.equal(Object.values.length, 1, 'Object.values has a length of 1'); + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal(Object.values.name, 'values', 'Object.values has name "values"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(Object, 'values'), 'Object.values is not enumerable'); + et.end(); + }); + + var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); + + t.test('bad object value', { skip: !supportsStrictMode }, function (st) { + st['throws'](function () { return Object.values(undefined); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return Object.values(null); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(Object.values, t); + + t.end(); +}); diff --git a/node_modules/object.values/test/tests.js b/node_modules/object.values/test/tests.js new file mode 100644 index 0000000..6055983 --- /dev/null +++ b/node_modules/object.values/test/tests.js @@ -0,0 +1,82 @@ +'use strict'; + +var keys = require('object-keys'); +var map = require('array-map'); +var define = require('define-properties'); + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +module.exports = function (values, t) { + var a = {}; + var b = {}; + var c = {}; + var obj = { a: a, b: b, c: c }; + + t.deepEqual(values(obj), [a, b, c], 'basic support'); + t.deepEqual(values({ a: a, b: a, c: c }), [a, a, c], 'duplicate values are included'); + + t.test('values are in the same order as keys', function (st) { + var object = { a: a, b: b }; + object[0] = 3; + object.c = c; + object[1] = 4; + delete object[0]; + var objKeys = keys(object); + var objValues = map(objKeys, function (key) { + return object[key]; + }); + st.deepEqual(values(object), objValues, 'values match key order'); + st.end(); + }); + + t.test('non-enumerable properties are omitted', { skip: !Object.defineProperty }, function (st) { + var object = { a: a, b: b }; + Object.defineProperty(object, 'c', { enumerable: false, value: c }); + st.deepEqual(values(object), [a, b], 'non-enumerable property‘s value is omitted'); + st.end(); + }); + + t.test('inherited properties are omitted', function (st) { + var F = function G() {}; + F.prototype.a = a; + var f = new F(); + f.b = b; + st.deepEqual(values(f), [b], 'only own properties are included'); + st.end(); + }); + + t.test('Symbol properties are omitted', { skip: !hasSymbols }, function (st) { + var object = { a: a, b: b, c: c }; + var enumSym = Symbol('enum'); + var nonEnumSym = Symbol('non enum'); + object[enumSym] = enumSym; + object.d = enumSym; + Object.defineProperty(object, nonEnumSym, { enumerable: false, value: nonEnumSym }); + st.deepEqual(values(object), [a, b, c, enumSym], 'symbol properties are omitted'); + st.end(); + }); + + t.test('not-yet-visited keys deleted on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) { + var o = { a: 1, b: 2, c: 3 }; + Object.defineProperty(o, 'a', { + get: function () { + delete this.b; + return 1; + } + }); + st.deepEqual(values(o), [1, 3], 'when "b" is deleted prior to being visited, it should not show up'); + st.end(); + }); + + t.test('not-yet-visited keys made non-enumerable on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) { + var o = { a: 'A', b: 'B' }; + Object.defineProperty(o, 'a', { + get: function () { + Object.defineProperty(o, 'b', { enumerable: false }); + return 'A'; + } + }); + st.deepEqual(values(o), ['A'], 'when "b" is made non-enumerable prior to being visited, it should not show up'); + st.end(); + }); +}; diff --git a/node_modules/optionator/CHANGELOG.md b/node_modules/optionator/CHANGELOG.md new file mode 100644 index 0000000..2928cc2 --- /dev/null +++ b/node_modules/optionator/CHANGELOG.md @@ -0,0 +1,59 @@ +# 0.9.0 +- update dependencies, in particular `levn` and `type-check` - this could affect behaviour of argument parsing + +# 0.8.3 +- changes dependency from `wordwrap` to `word-wrap` due to license issue +- update dependencies + +# 0.8.2 +- fix bug #18 - detect missing value when flag is last item +- update dependencies + +# 0.8.1 +- update `fast-levenshtein` dependency + +# 0.8.0 +- update `levn` dependency - supplying a float value to an option with type `Int` now throws an error, instead of silently converting to an `Int` + +# 0.7.1 +- fix bug with use of `defaults` and `concatRepeatedArrays` or `mergeRepeatedObjects` + +# 0.7.0 +- added `concatrepeatedarrays` option: `oneValuePerFlag`, only allows one array value per flag +- added `typeAliases` option +- added `parseArgv` which takes an array and parses with the first two items sliced off +- changed enum help style +- bug fixes (#12) +- use of `concatRepeatedArrays` and `mergeRepeatedObjects` at the top level is deprecated, use it as either a per-option option, or set them in the `defaults` object to set them for all objects + +# 0.6.0 +- added `defaults` lib-option flag, allowing one to set default properties for all options +- added `concatRepeatedArrays` and `mergeRepeatedObjects` as option level properties, allowing you to turn this feature on for specific options only + +# 0.5.0 +- `Boolean` flags with `default: 'true'`, and no short aliases, will by default show the `--no` version in help + +# 0.4.0 +- add `mergeRepeatedObjects` setting + +# 0.3.0 +- add `concatRepeatedArrays` setting +- add `overrideRequired` option setting +- use just Levenshtein string compare algo rather than Levenshtein Damerau to due dependency license issue + +# 0.2.2 +- bug fixes + +# 0.2.1 +- improved interpolation +- added changelog + +# 0.2.0 +- add dependency checks to options - added `dependsOn` as an option property +- add interpolation for `prepend` and `append` text with new `generateHelp` option, `interpolate` + +# 0.1.1 +- update dependencies + +# 0.1.0 +- initial release diff --git a/node_modules/optionator/LICENSE b/node_modules/optionator/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/optionator/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/optionator/README.md b/node_modules/optionator/README.md new file mode 100644 index 0000000..b1c5391 --- /dev/null +++ b/node_modules/optionator/README.md @@ -0,0 +1,238 @@ +# Optionator +
+ +Optionator is a JavaScript/Node.js option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator). + +For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo). + +[About](#about) · [Usage](#usage) · [Settings Format](#settings-format) · [Argument Format](#argument-format) + +## Why? +The problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not. +With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant). +If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application. + + $ cmd --halp + Invalid option '--halp' - perhaps you meant '--help'? + + $ cmd --count str + Invalid value for option 'count' - expected type Int, received value: str. + +Other helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier. + +## About +Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types. + +MIT license. Version 0.9.1 + + npm install optionator + +For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev). + +Optionator is a Node.js module, but can be used in the browser as well if packed with webpack/browserify. + +## Usage +`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions. + +```js +var optionator = require('optionator')({ + prepend: 'Usage: cmd [options]', + append: 'Version 1.0.0', + options: [{ + option: 'help', + alias: 'h', + type: 'Boolean', + description: 'displays help' + }, { + option: 'count', + alias: 'c', + type: 'Int', + description: 'number of things', + example: 'cmd --count 2' + }] +}); + +var options = optionator.parseArgv(process.argv); +if (options.help) { + console.log(optionator.generateHelp()); +} +... +``` + +### parse(input, parseOptions) +`parse` processes the `input` according to your settings, and returns an object with the results. + +##### arguments +* input - `[String] | Object | String` - the input you wish to parse +* parseOptions - `{slice: Int}` - all options optional + - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`) + +##### returns +`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key. + +##### example +```js +parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']} +parse('--count 2 positional'); // {count: 2, _: ['positional']} +parse({count: 2, _:['positional']}); // {count: 2, _: ['positional']} +``` + +### parseArgv(input) +`parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements. + +##### arguments +* input - `[String]` - the input you wish to parse + +##### returns +See "returns" section in "parse" + +##### example +```js +parseArgv(process.argv); +``` + +### generateHelp(helpOptions) +`generateHelp` produces help text based on your settings. + +##### arguments +* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional + - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false` + - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2` + +##### returns +`String` - the generated help text + +##### example +```js +generateHelp(); /* +"Usage: cmd [options] positional + + -h, --help displays help + -c, --count Int number of things + +Version 1.0.0 +"*/ +``` + +### generateHelpForOption(optionName) +`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`. + +##### arguments +* optionName - `String` - the name of the option to display + +##### returns +`String` - the generated help text for the option + +##### example +```js +generateHelpForOption('count'); /* +"-c, --count Int +description: number of things +example: cmd --count 2 +"*/ +``` + +## Settings Format +When your `require('optionator')`, you get a function that takes in a settings object. This object has the type: + + { + prepend: String, + append: String, + options: [{heading: String} | { + option: String, + alias: [String] | String, + type: String, + enum: [String], + default: String, + restPositional: Boolean, + required: Boolean, + overrideRequired: Boolean, + dependsOn: [String] | String, + concatRepeatedArrays: Boolean | (Boolean, Object), + mergeRepeatedObjects: Boolean, + description: String, + longDescription: String, + example: [String] | String + }], + helpStyle: { + aliasSeparator: String, + typeSeparator: String, + descriptionSeparator: String, + initialIndent: Int, + secondaryIndent: Int, + maxPadFactor: Number + }, + mutuallyExclusive: [[String | [String]]], + concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object + mergeRepeatedObjects: Boolean, // deprecated, set in defaults object + positionalAnywhere: Boolean, + typeAliases: Object, + defaults: Object + } + +All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array. + +### Top Level Properties +* `prepend` is an optional string to be placed before the options in the help text +* `append` is an optional string to be placed after the options in the help text +* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified +* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text +* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present +* `concatRepeatedArrays` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property +* `mergeRepeatedObjects` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property +* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack` +* `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String` +* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property + +#### Heading Properties +* `heading` a required string, the name of the heading + +#### Option Properties +* `option` the required name of the option - use dash-case, without the leading dashes +* `alias` is an optional string or array of strings which specify any aliases for the option +* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it +* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type` +* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type` +* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument +* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined +* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags +* `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']` + + You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma. +* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}` +* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set +* `description` is an optional string, which will be displayed next to the option in the help text +* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used +* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used + +#### Help Style Properties +* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,' +* `typeSeparator` is an optional string, separates the type from the names - default: ' ' +* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' ' +* `initialIndent` is an optional int - the amount of indent for options - default: 2 +* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4 +* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5 + +## Argument Format +At the highest level there are two types of arguments: named, and positional. + +Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`). + +There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value. + +For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages. + +You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`. + +Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`. + +Everything after an `--` is positional, even if it looks like a named argument. + +You may optionally use `=` to separate option names from values, for example: `--count=2`. + +If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`. + +If duplicate named arguments are present, the last one will be taken. + +## Technical About +`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/optionator/lib/help.js b/node_modules/optionator/lib/help.js new file mode 100644 index 0000000..59e6f96 --- /dev/null +++ b/node_modules/optionator/lib/help.js @@ -0,0 +1,260 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var ref$, id, find, sort, min, max, map, unlines, nameToRaw, dasherize, naturalJoin, wordWrap, wordwrap, getPreText, setHelpStyleDefaults, generateHelpForOption, generateHelp; + ref$ = require('prelude-ls'), id = ref$.id, find = ref$.find, sort = ref$.sort, min = ref$.min, max = ref$.max, map = ref$.map, unlines = ref$.unlines; + ref$ = require('./util'), nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin; + wordWrap = require('word-wrap'); + wordwrap = function(a, b){ + var ref$, indent, width; + ref$ = b === undefined + ? ['', a - 1] + : [repeatString$(' ', a), b - a - 1], indent = ref$[0], width = ref$[1]; + return function(text){ + return wordWrap(text, { + indent: indent, + width: width, + trim: true + }); + }; + }; + getPreText = function(option, arg$, maxWidth){ + var mainName, shortNames, ref$, longNames, type, description, aliasSeparator, typeSeparator, initialIndent, names, namesString, namesStringLen, typeSeparatorString, typeSeparatorStringLen, wrap; + mainName = option.option, shortNames = (ref$ = option.shortNames) != null + ? ref$ + : [], longNames = (ref$ = option.longNames) != null + ? ref$ + : [], type = option.type, description = option.description; + aliasSeparator = arg$.aliasSeparator, typeSeparator = arg$.typeSeparator, initialIndent = arg$.initialIndent; + if (option.negateName) { + mainName = "no-" + mainName; + if (longNames) { + longNames = map(function(it){ + return "no-" + it; + }, longNames); + } + } + names = mainName.length === 1 + ? [mainName].concat(shortNames, longNames) + : shortNames.concat([mainName], longNames); + namesString = map(nameToRaw, names).join(aliasSeparator); + namesStringLen = namesString.length; + typeSeparatorString = mainName === 'NUM' ? '::' : typeSeparator; + typeSeparatorStringLen = typeSeparatorString.length; + if (maxWidth != null && !option.boolean && initialIndent + namesStringLen + typeSeparatorStringLen + type.length > maxWidth) { + wrap = wordwrap(initialIndent + namesStringLen + typeSeparatorStringLen, maxWidth); + return namesString + "" + typeSeparatorString + wrap(type).replace(/^\s+/, ''); + } else { + return namesString + "" + (option.boolean + ? '' + : typeSeparatorString + "" + type); + } + }; + setHelpStyleDefaults = function(helpStyle){ + helpStyle.aliasSeparator == null && (helpStyle.aliasSeparator = ', '); + helpStyle.typeSeparator == null && (helpStyle.typeSeparator = ' '); + helpStyle.descriptionSeparator == null && (helpStyle.descriptionSeparator = ' '); + helpStyle.initialIndent == null && (helpStyle.initialIndent = 2); + helpStyle.secondaryIndent == null && (helpStyle.secondaryIndent = 4); + helpStyle.maxPadFactor == null && (helpStyle.maxPadFactor = 1.5); + }; + generateHelpForOption = function(getOption, arg$){ + var stdout, helpStyle, ref$; + stdout = arg$.stdout, helpStyle = (ref$ = arg$.helpStyle) != null + ? ref$ + : {}; + setHelpStyleDefaults(helpStyle); + return function(optionName){ + var maxWidth, wrap, option, e, pre, defaultString, restPositionalString, description, fullDescription, that, preDescription, descriptionString, exampleString, examples, seperator; + maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; + wrap = maxWidth ? wordwrap(maxWidth) : id; + try { + option = getOption(dasherize(optionName)); + } catch (e$) { + e = e$; + return e.message; + } + pre = getPreText(option, helpStyle); + defaultString = option['default'] && !option.negateName ? "\ndefault: " + option['default'] : ''; + restPositionalString = option.restPositional ? 'Everything after this option is considered a positional argument, even if it looks like an option.' : ''; + description = option.longDescription || option.description && sentencize(option.description); + fullDescription = description && restPositionalString + ? description + " " + restPositionalString + : (that = description || restPositionalString) ? that : ''; + preDescription = 'description:'; + descriptionString = !fullDescription + ? '' + : maxWidth && fullDescription.length - 1 - preDescription.length > maxWidth + ? "\n" + preDescription + "\n" + wrap(fullDescription) + : "\n" + preDescription + " " + fullDescription; + exampleString = (that = option.example) ? (examples = [].concat(that), examples.length > 1 + ? "\nexamples:\n" + unlines(examples) + : "\nexample: " + examples[0]) : ''; + seperator = defaultString || descriptionString || exampleString ? "\n" + repeatString$('=', pre.length) : ''; + return pre + "" + seperator + defaultString + descriptionString + exampleString; + }; + }; + generateHelp = function(arg$){ + var options, prepend, append, helpStyle, ref$, stdout, aliasSeparator, typeSeparator, descriptionSeparator, maxPadFactor, initialIndent, secondaryIndent; + options = arg$.options, prepend = arg$.prepend, append = arg$.append, helpStyle = (ref$ = arg$.helpStyle) != null + ? ref$ + : {}, stdout = arg$.stdout; + setHelpStyleDefaults(helpStyle); + aliasSeparator = helpStyle.aliasSeparator, typeSeparator = helpStyle.typeSeparator, descriptionSeparator = helpStyle.descriptionSeparator, maxPadFactor = helpStyle.maxPadFactor, initialIndent = helpStyle.initialIndent, secondaryIndent = helpStyle.secondaryIndent; + return function(arg$){ + var ref$, showHidden, interpolate, maxWidth, output, out, data, optionCount, totalPreLen, preLens, i$, len$, item, that, pre, descParts, desc, preLen, sortedPreLens, maxPreLen, preLenMean, x, padAmount, descSepLen, fullWrapCount, partialWrapCount, descLen, totalLen, initialSpace, wrapAllFull, i, wrap; + ref$ = arg$ != null + ? arg$ + : {}, showHidden = ref$.showHidden, interpolate = ref$.interpolate; + maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; + output = []; + out = function(it){ + return output.push(it != null ? it : ''); + }; + if (prepend) { + out(interpolate ? interp(prepend, interpolate) : prepend); + out(); + } + data = []; + optionCount = 0; + totalPreLen = 0; + preLens = []; + for (i$ = 0, len$ = (ref$ = options).length; i$ < len$; ++i$) { + item = ref$[i$]; + if (showHidden || !item.hidden) { + if (that = item.heading) { + data.push({ + type: 'heading', + value: that + }); + } else { + pre = getPreText(item, helpStyle, maxWidth); + descParts = []; + if ((that = item.description) != null) { + descParts.push(that); + } + if (that = item['enum']) { + descParts.push("either: " + naturalJoin(that)); + } + if (item['default'] && !item.negateName) { + descParts.push("default: " + item['default']); + } + desc = descParts.join(' - '); + data.push({ + type: 'option', + pre: pre, + desc: desc, + descLen: desc.length + }); + preLen = pre.length; + optionCount++; + totalPreLen += preLen; + preLens.push(preLen); + } + } + } + sortedPreLens = sort(preLens); + maxPreLen = sortedPreLens[sortedPreLens.length - 1]; + preLenMean = initialIndent + totalPreLen / optionCount; + x = optionCount > 2 ? min(preLenMean * maxPadFactor, maxPreLen) : maxPreLen; + for (i$ = sortedPreLens.length - 1; i$ >= 0; --i$) { + preLen = sortedPreLens[i$]; + if (preLen <= x) { + padAmount = preLen; + break; + } + } + descSepLen = descriptionSeparator.length; + if (maxWidth != null) { + fullWrapCount = 0; + partialWrapCount = 0; + for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { + item = data[i$]; + if (item.type === 'option') { + pre = item.pre, desc = item.desc, descLen = item.descLen; + if (descLen === 0) { + item.wrap = 'none'; + } else { + preLen = max(padAmount, pre.length) + initialIndent + descSepLen; + totalLen = preLen + descLen; + if (totalLen > maxWidth) { + if (descLen / 2.5 > maxWidth - preLen) { + fullWrapCount++; + item.wrap = 'full'; + } else { + partialWrapCount++; + item.wrap = 'partial'; + } + } else { + item.wrap = 'none'; + } + } + } + } + } + initialSpace = repeatString$(' ', initialIndent); + wrapAllFull = optionCount > 1 && fullWrapCount + partialWrapCount * 0.5 > optionCount * 0.5; + for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { + i = i$; + item = data[i$]; + if (item.type === 'heading') { + if (i !== 0) { + out(); + } + out(item.value + ":"); + } else { + pre = item.pre, desc = item.desc, descLen = item.descLen, wrap = item.wrap; + if (maxWidth != null) { + if (wrapAllFull || wrap === 'full') { + wrap = wordwrap(initialIndent + secondaryIndent, maxWidth); + out(initialSpace + "" + pre + "\n" + wrap(desc)); + continue; + } else if (wrap === 'partial') { + wrap = wordwrap(initialIndent + descSepLen + max(padAmount, pre.length), maxWidth); + out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\s+/, '')); + continue; + } + } + if (descLen === 0) { + out(initialSpace + "" + pre); + } else { + out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + desc); + } + } + } + if (append) { + out(); + out(interpolate ? interp(append, interpolate) : append); + } + return unlines(output); + }; + }; + function pad(str, num){ + var len, padAmount; + len = str.length; + padAmount = num - len; + return str + "" + repeatString$(' ', padAmount > 0 ? padAmount : 0); + } + function sentencize(str){ + var first, rest, period; + first = str.charAt(0).toUpperCase(); + rest = str.slice(1); + period = /[\.!\?]$/.test(str) ? '' : '.'; + return first + "" + rest + period; + } + function interp(string, object){ + return string.replace(/{{([a-zA-Z$_][a-zA-Z$_0-9]*)}}/g, function(arg$, key){ + var ref$; + return (ref$ = object[key]) != null + ? ref$ + : "{{" + key + "}}"; + }); + } + module.exports = { + generateHelp: generateHelp, + generateHelpForOption: generateHelpForOption + }; + function repeatString$(str, n){ + for (var r = ''; n > 0; (n >>= 1) && (str += str)) if (n & 1) r += str; + return r; + } +}).call(this); diff --git a/node_modules/optionator/lib/index.js b/node_modules/optionator/lib/index.js new file mode 100644 index 0000000..20d914b --- /dev/null +++ b/node_modules/optionator/lib/index.js @@ -0,0 +1,465 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var VERSION, ref$, id, map, compact, any, groupBy, partition, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, naturalJoin, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice, arrayFrom$ = Array.from || function(x){return slice$.call(x);}; + VERSION = '0.9.1'; + ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, partition = ref$.partition, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize; + deepIs = require('deep-is'); + ref$ = require('./util'), closestString = ref$.closestString, nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin; + ref$ = require('./help'), generateHelp = ref$.generateHelp, generateHelpForOption = ref$.generateHelpForOption; + ref$ = require('type-check'), parsedTypeCheck = ref$.parsedTypeCheck, parseType = ref$.parseType; + parseLevn = require('levn').parsedTypeParse; + camelizeKeys = function(obj){ + var key, value, resultObj$ = {}; + for (key in obj) { + value = obj[key]; + resultObj$[camelize(key)] = value; + } + return resultObj$; + }; + parseString = function(string){ + var assignOpt, regex, replaceRegex, result; + assignOpt = '--?[a-zA-Z][-a-z-A-Z0-9]*='; + regex = RegExp('(?:' + assignOpt + ')?(?:\'(?:\\\\\'|[^\'])+\'|"(?:\\\\"|[^"])+")|[^\'"\\s]+', 'g'); + replaceRegex = RegExp('^(' + assignOpt + ')?[\'"]([\\s\\S]*)[\'"]$'); + result = map(function(it){ + return it.replace(replaceRegex, '$1$2'); + }, string.match(regex) || []); + return result; + }; + main = function(libOptions){ + var opts, defaults, required, traverse, getOption, parse; + opts = {}; + defaults = {}; + required = []; + if (toString$.call(libOptions.stdout).slice(8, -1) === 'Undefined') { + libOptions.stdout = process.stdout; + } + libOptions.positionalAnywhere == null && (libOptions.positionalAnywhere = true); + libOptions.typeAliases == null && (libOptions.typeAliases = {}); + libOptions.defaults == null && (libOptions.defaults = {}); + if (libOptions.concatRepeatedArrays != null) { + libOptions.defaults.concatRepeatedArrays = libOptions.concatRepeatedArrays; + } + if (libOptions.mergeRepeatedObjects != null) { + libOptions.defaults.mergeRepeatedObjects = libOptions.mergeRepeatedObjects; + } + traverse = function(options){ + var i$, len$, option, name, k, ref$, v, type, that, e, parsedPossibilities, parsedType, j$, len1$, possibility, rawDependsType, dependsOpts, dependsType, cra, alias, shortNames, longNames; + if (toString$.call(options).slice(8, -1) !== 'Array') { + throw new Error('No options defined.'); + } + for (i$ = 0, len$ = options.length; i$ < len$; ++i$) { + option = options[i$]; + if (option.heading == null) { + name = option.option; + if (opts[name] != null) { + throw new Error("Option '" + name + "' already defined."); + } + for (k in ref$ = libOptions.defaults) { + v = ref$[k]; + option[k] == null && (option[k] = v); + } + if (option.type === 'Boolean') { + option.boolean == null && (option.boolean = true); + } + if (option.parsedType == null) { + if (!option.type) { + throw new Error("No type defined for option '" + name + "'."); + } + try { + type = (that = libOptions.typeAliases[option.type]) != null + ? that + : option.type; + option.parsedType = parseType(type); + } catch (e$) { + e = e$; + throw new Error("Option '" + name + "': Error parsing type '" + option.type + "': " + e.message); + } + } + if (option['default']) { + try { + defaults[name] = parseLevn(option.parsedType, option['default']); + } catch (e$) { + e = e$; + throw new Error("Option '" + name + "': Error parsing default value '" + option['default'] + "' for type '" + option.type + "': " + e.message); + } + } + if (option['enum'] && !option.parsedPossiblities) { + parsedPossibilities = []; + parsedType = option.parsedType; + for (j$ = 0, len1$ = (ref$ = option['enum']).length; j$ < len1$; ++j$) { + possibility = ref$[j$]; + try { + parsedPossibilities.push(parseLevn(parsedType, possibility)); + } catch (e$) { + e = e$; + throw new Error("Option '" + name + "': Error parsing enum value '" + possibility + "' for type '" + option.type + "': " + e.message); + } + } + option.parsedPossibilities = parsedPossibilities; + } + if (that = option.dependsOn) { + if (that.length) { + ref$ = [].concat(option.dependsOn), rawDependsType = ref$[0], dependsOpts = slice$.call(ref$, 1); + dependsType = rawDependsType.toLowerCase(); + if (dependsOpts.length) { + if (dependsType === 'and' || dependsType === 'or') { + option.dependsOn = [dependsType].concat(arrayFrom$(dependsOpts)); + } else { + throw new Error("Option '" + name + "': If you have more than one dependency, you must specify either 'and' or 'or'"); + } + } else { + if ((ref$ = dependsType.toLowerCase()) === 'and' || ref$ === 'or') { + option.dependsOn = null; + } else { + option.dependsOn = ['and', rawDependsType]; + } + } + } else { + option.dependsOn = null; + } + } + if (option.required) { + required.push(name); + } + opts[name] = option; + if (option.concatRepeatedArrays != null) { + cra = option.concatRepeatedArrays; + if ('Boolean' === toString$.call(cra).slice(8, -1)) { + option.concatRepeatedArrays = [cra, {}]; + } else if (cra.length === 1) { + option.concatRepeatedArrays = [cra[0], {}]; + } else if (cra.length !== 2) { + throw new Error("Invalid setting for concatRepeatedArrays"); + } + } + if (option.alias || option.aliases) { + if (name === 'NUM') { + throw new Error("-NUM option can't have aliases."); + } + if (option.alias) { + option.aliases == null && (option.aliases = [].concat(option.alias)); + } + for (j$ = 0, len1$ = (ref$ = option.aliases).length; j$ < len1$; ++j$) { + alias = ref$[j$]; + if (opts[alias] != null) { + throw new Error("Option '" + alias + "' already defined."); + } + opts[alias] = option; + } + ref$ = partition(fn$, option.aliases), shortNames = ref$[0], longNames = ref$[1]; + option.shortNames == null && (option.shortNames = shortNames); + option.longNames == null && (option.longNames = longNames); + } + if ((!option.aliases || option.shortNames.length === 0) && option.type === 'Boolean' && option['default'] === 'true') { + option.negateName = true; + } + } + } + function fn$(it){ + return it.length === 1; + } + }; + traverse(libOptions.options); + getOption = function(name){ + var opt, possiblyMeant; + opt = opts[name]; + if (opt == null) { + possiblyMeant = closestString(keys(opts), name); + throw new Error("Invalid option '" + nameToRaw(name) + "'" + (possiblyMeant ? " - perhaps you meant '" + nameToRaw(possiblyMeant) + "'?" : '.')); + } + return opt; + }; + parse = function(input, arg$){ + var slice, obj, positional, restPositional, overrideRequired, prop, setValue, setDefaults, checkRequired, mutuallyExclusiveError, checkMutuallyExclusive, checkDependency, checkDependencies, checkProp, args, key, value, option, ref$, i$, len$, arg, that, result, short, argName, usingAssign, val, flags, len, j$, len1$, i, flag, opt, name, valPrime, negated, noedName; + slice = (arg$ != null + ? arg$ + : {}).slice; + obj = {}; + positional = []; + restPositional = false; + overrideRequired = false; + prop = null; + setValue = function(name, value){ + var opt, val, cra, e, currentType; + opt = getOption(name); + if (opt.boolean) { + val = value; + } else { + try { + cra = opt.concatRepeatedArrays; + if (cra != null && cra[0] && cra[1].oneValuePerFlag && opt.parsedType.length === 1 && opt.parsedType[0].structure === 'array') { + val = [parseLevn(opt.parsedType[0].of, value)]; + } else { + val = parseLevn(opt.parsedType, value); + } + } catch (e$) { + e = e$; + throw new Error("Invalid value for option '" + name + "' - expected type " + opt.type + ", received value: " + value + "."); + } + if (opt['enum'] && !any(function(it){ + return deepIs(it, val); + }, opt.parsedPossibilities)) { + throw new Error("Option " + name + ": '" + val + "' not one of " + naturalJoin(opt['enum']) + "."); + } + } + currentType = toString$.call(obj[name]).slice(8, -1); + if (obj[name] != null) { + if (opt.concatRepeatedArrays != null && opt.concatRepeatedArrays[0] && currentType === 'Array') { + obj[name] = obj[name].concat(val); + } else if (opt.mergeRepeatedObjects && currentType === 'Object') { + import$(obj[name], val); + } else { + obj[name] = val; + } + } else { + obj[name] = val; + } + if (opt.restPositional) { + restPositional = true; + } + if (opt.overrideRequired) { + overrideRequired = true; + } + }; + setDefaults = function(){ + var name, ref$, value; + for (name in ref$ = defaults) { + value = ref$[name]; + if (obj[name] == null) { + obj[name] = value; + } + } + }; + checkRequired = function(){ + var i$, ref$, len$, name; + if (overrideRequired) { + return; + } + for (i$ = 0, len$ = (ref$ = required).length; i$ < len$; ++i$) { + name = ref$[i$]; + if (!obj[name]) { + throw new Error("Option " + nameToRaw(name) + " is required."); + } + } + }; + mutuallyExclusiveError = function(first, second){ + throw new Error("The options " + nameToRaw(first) + " and " + nameToRaw(second) + " are mutually exclusive - you cannot use them at the same time."); + }; + checkMutuallyExclusive = function(){ + var rules, i$, len$, rule, present, j$, len1$, element, k$, len2$, opt; + rules = libOptions.mutuallyExclusive; + if (!rules) { + return; + } + for (i$ = 0, len$ = rules.length; i$ < len$; ++i$) { + rule = rules[i$]; + present = null; + for (j$ = 0, len1$ = rule.length; j$ < len1$; ++j$) { + element = rule[j$]; + if (toString$.call(element).slice(8, -1) === 'Array') { + for (k$ = 0, len2$ = element.length; k$ < len2$; ++k$) { + opt = element[k$]; + if (opt in obj) { + if (present != null) { + mutuallyExclusiveError(present, opt); + } else { + present = opt; + break; + } + } + } + } else { + if (element in obj) { + if (present != null) { + mutuallyExclusiveError(present, element); + } else { + present = element; + } + } + } + } + } + }; + checkDependency = function(option){ + var dependsOn, type, targetOptionNames, i$, len$, targetOptionName, targetOption; + dependsOn = option.dependsOn; + if (!dependsOn || option.dependenciesMet) { + return true; + } + type = dependsOn[0], targetOptionNames = slice$.call(dependsOn, 1); + for (i$ = 0, len$ = targetOptionNames.length; i$ < len$; ++i$) { + targetOptionName = targetOptionNames[i$]; + targetOption = obj[targetOptionName]; + if (targetOption && checkDependency(targetOption)) { + if (type === 'or') { + return true; + } + } else if (type === 'and') { + throw new Error("The option '" + option.option + "' did not have its dependencies met."); + } + } + if (type === 'and') { + return true; + } else { + throw new Error("The option '" + option.option + "' did not meet any of its dependencies."); + } + }; + checkDependencies = function(){ + var name; + for (name in obj) { + checkDependency(opts[name]); + } + }; + checkProp = function(){ + if (prop) { + throw new Error("Value for '" + prop + "' of type '" + getOption(prop).type + "' required."); + } + }; + switch (toString$.call(input).slice(8, -1)) { + case 'String': + args = parseString(input.slice(slice != null ? slice : 0)); + break; + case 'Array': + args = input.slice(slice != null ? slice : 2); + break; + case 'Object': + obj = {}; + for (key in input) { + value = input[key]; + if (key !== '_') { + option = getOption(dasherize(key)); + if (parsedTypeCheck(option.parsedType, value)) { + obj[option.option] = value; + } else { + throw new Error("Option '" + option.option + "': Invalid type for '" + value + "' - expected type '" + option.type + "'."); + } + } + } + checkMutuallyExclusive(); + checkDependencies(); + setDefaults(); + checkRequired(); + return ref$ = camelizeKeys(obj), ref$._ = input._ || [], ref$; + default: + throw new Error("Invalid argument to 'parse': " + input + "."); + } + for (i$ = 0, len$ = args.length; i$ < len$; ++i$) { + arg = args[i$]; + if (arg === '--') { + restPositional = true; + } else if (restPositional) { + positional.push(arg); + } else { + if (that = arg.match(/^(--?)([a-zA-Z][-a-zA-Z0-9]*)(=)?(.*)?$/)) { + result = that; + checkProp(); + short = result[1].length === 1; + argName = result[2]; + usingAssign = result[3] != null; + val = result[4]; + if (usingAssign && val == null) { + throw new Error("No value for '" + argName + "' specified."); + } + if (short) { + flags = chars(argName); + len = flags.length; + for (j$ = 0, len1$ = flags.length; j$ < len1$; ++j$) { + i = j$; + flag = flags[j$]; + opt = getOption(flag); + name = opt.option; + if (restPositional) { + positional.push(flag); + } else if (i === len - 1) { + if (usingAssign) { + valPrime = opt.boolean ? parseLevn([{ + type: 'Boolean' + }], val) : val; + setValue(name, valPrime); + } else if (opt.boolean) { + setValue(name, true); + } else { + prop = name; + } + } else if (opt.boolean) { + setValue(name, true); + } else { + throw new Error("Can't set argument '" + flag + "' when not last flag in a group of short flags."); + } + } + } else { + negated = false; + if (that = argName.match(/^no-(.+)$/)) { + negated = true; + noedName = that[1]; + opt = getOption(noedName); + } else { + opt = getOption(argName); + } + name = opt.option; + if (opt.boolean) { + valPrime = usingAssign ? parseLevn([{ + type: 'Boolean' + }], val) : true; + if (negated) { + setValue(name, !valPrime); + } else { + setValue(name, valPrime); + } + } else { + if (negated) { + throw new Error("Only use 'no-' prefix for Boolean options, not with '" + noedName + "'."); + } + if (usingAssign) { + setValue(name, val); + } else { + prop = name; + } + } + } + } else if (that = arg.match(/^-([0-9]+(?:\.[0-9]+)?)$/)) { + opt = opts.NUM; + if (!opt) { + throw new Error('No -NUM option defined.'); + } + setValue(opt.option, that[1]); + } else { + if (prop) { + setValue(prop, arg); + prop = null; + } else { + positional.push(arg); + if (!libOptions.positionalAnywhere) { + restPositional = true; + } + } + } + } + } + checkProp(); + checkMutuallyExclusive(); + checkDependencies(); + setDefaults(); + checkRequired(); + return ref$ = camelizeKeys(obj), ref$._ = positional, ref$; + }; + return { + parse: parse, + parseArgv: function(it){ + return parse(it, { + slice: 2 + }); + }, + generateHelp: generateHelp(libOptions), + generateHelpForOption: generateHelpForOption(getOption, libOptions) + }; + }; + main.VERSION = VERSION; + module.exports = main; + function import$(obj, src){ + var own = {}.hasOwnProperty; + for (var key in src) if (own.call(src, key)) obj[key] = src[key]; + return obj; + } +}).call(this); diff --git a/node_modules/optionator/lib/util.js b/node_modules/optionator/lib/util.js new file mode 100644 index 0000000..5bc0cbb --- /dev/null +++ b/node_modules/optionator/lib/util.js @@ -0,0 +1,54 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var prelude, map, sortBy, fl, closestString, nameToRaw, dasherize, naturalJoin; + prelude = require('prelude-ls'), map = prelude.map, sortBy = prelude.sortBy; + fl = require('fast-levenshtein'); + closestString = function(possibilities, input){ + var distances, ref$, string, distance; + if (!possibilities.length) { + return; + } + distances = map(function(it){ + var ref$, longer, shorter; + ref$ = input.length > it.length + ? [input, it] + : [it, input], longer = ref$[0], shorter = ref$[1]; + return { + string: it, + distance: fl.get(longer, shorter) + }; + })( + possibilities); + ref$ = sortBy(function(it){ + return it.distance; + }, distances)[0], string = ref$.string, distance = ref$.distance; + return string; + }; + nameToRaw = function(name){ + if (name.length === 1 || name === 'NUM') { + return "-" + name; + } else { + return "--" + name; + } + }; + dasherize = function(string){ + if (/^[A-Z]/.test(string)) { + return string; + } else { + return prelude.dasherize(string); + } + }; + naturalJoin = function(array){ + if (array.length < 3) { + return array.join(' or '); + } else { + return array.slice(0, -1).join(', ') + ", or " + array[array.length - 1]; + } + }; + module.exports = { + closestString: closestString, + nameToRaw: nameToRaw, + dasherize: dasherize, + naturalJoin: naturalJoin + }; +}).call(this); diff --git a/node_modules/optionator/package.json b/node_modules/optionator/package.json new file mode 100644 index 0000000..b9579e4 --- /dev/null +++ b/node_modules/optionator/package.json @@ -0,0 +1,73 @@ +{ + "_from": "optionator@^0.9.1", + "_id": "optionator@0.9.1", + "_inBundle": false, + "_integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "_location": "/optionator", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "optionator@^0.9.1", + "name": "optionator", + "escapedName": "optionator", + "rawSpec": "^0.9.1", + "saveSpec": null, + "fetchSpec": "^0.9.1" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "_shasum": "4f236a6373dae0566a6d43e1326674f50c291499", + "_spec": "optionator@^0.9.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/optionator/issues" + }, + "bundleDependencies": false, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "deprecated": false, + "description": "option parsing and help generation", + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "homepage": "https://github.com/gkz/optionator", + "keywords": [ + "options", + "flags", + "option parsing", + "cli" + ], + "license": "MIT", + "main": "./lib/", + "name": "optionator", + "repository": { + "type": "git", + "url": "git://github.com/gkz/optionator.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.9.1" +} diff --git a/node_modules/p-limit/index.js b/node_modules/p-limit/index.js new file mode 100644 index 0000000..873f0e7 --- /dev/null +++ b/node_modules/p-limit/index.js @@ -0,0 +1,42 @@ +'use strict'; +const pTry = require('p-try'); + +module.exports = concurrency => { + if (concurrency < 1) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + return fn => new Promise((resolve, reject) => { + const run = () => { + activeCount++; + + pTry(fn).then( + val => { + resolve(val); + next(); + }, + err => { + reject(err); + next(); + } + ); + }; + + if (activeCount < concurrency) { + run(); + } else { + queue.push(run); + } + }); +}; diff --git a/node_modules/p-limit/license b/node_modules/p-limit/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-limit/package.json b/node_modules/p-limit/package.json new file mode 100644 index 0000000..178acb3 --- /dev/null +++ b/node_modules/p-limit/package.json @@ -0,0 +1,81 @@ +{ + "_from": "p-limit@^1.1.0", + "_id": "p-limit@1.3.0", + "_inBundle": false, + "_integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "_location": "/p-limit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-limit@^1.1.0", + "name": "p-limit", + "escapedName": "p-limit", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/p-locate" + ], + "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "_shasum": "b86bd5f0c25690911c7590fcbfc2010d54b3ccb8", + "_spec": "p-limit@^1.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-limit/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-try": "^1.0.0" + }, + "deprecated": false, + "description": "Run multiple promise-returning & async functions with limited concurrency", + "devDependencies": { + "ava": "*", + "delay": "^2.0.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-limit#readme", + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "license": "MIT", + "name": "p-limit", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-limit.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.3.0" +} diff --git a/node_modules/p-limit/readme.md b/node_modules/p-limit/readme.md new file mode 100644 index 0000000..9012992 --- /dev/null +++ b/node_modules/p-limit/readme.md @@ -0,0 +1,69 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + + +## Install + +``` +$ npm install p-limit +``` + + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`
+Minimum: `1` + +Concurrency limit. + +### limit(fn) + +Returns the promise returned by calling `fn`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/p-locate/index.js b/node_modules/p-locate/index.js new file mode 100644 index 0000000..7461d66 --- /dev/null +++ b/node_modules/p-locate/index.js @@ -0,0 +1,31 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// the input can also be a promise, so we `Promise.all()` them both +const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); + +module.exports = (iterable, tester, opts) => { + opts = Object.assign({ + concurrency: Infinity, + preserveOrder: true + }, opts); + + const limit = pLimit(opts.concurrency); + + // start all the promises concurrently with optional limit + const items = Array.from(iterable).map(el => [el, limit(() => Promise.resolve(el).then(tester))]); + + // check the promises either serially or concurrently + const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); + + return Promise.all(items.map(el => checkLimit(() => finder(el)))) + .then(() => {}) + .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); +}; diff --git a/node_modules/p-locate/license b/node_modules/p-locate/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/p-locate/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/p-locate/package.json b/node_modules/p-locate/package.json new file mode 100644 index 0000000..90639e3 --- /dev/null +++ b/node_modules/p-locate/package.json @@ -0,0 +1,86 @@ +{ + "_from": "p-locate@^2.0.0", + "_id": "p-locate@2.0.0", + "_inBundle": false, + "_integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "_location": "/p-locate", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-locate@^2.0.0", + "name": "p-locate", + "escapedName": "p-locate", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/locate-path" + ], + "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "_shasum": "20a0103b222a70c8fd39cc2e580680f3dde5ec43", + "_spec": "p-locate@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-locate/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-limit": "^1.1.0" + }, + "deprecated": false, + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "devDependencies": { + "ava": "*", + "delay": "^1.3.1", + "in-range": "^1.0.0", + "time-span": "^1.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-locate#readme", + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "license": "MIT", + "name": "p-locate", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-locate.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/p-locate/readme.md b/node_modules/p-locate/readme.md new file mode 100644 index 0000000..68b96a4 --- /dev/null +++ b/node_modules/p-locate/readme.md @@ -0,0 +1,86 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install --save p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // only this one actually exists on disk + 'pony.png' +]; + +pLocate(files, file => pathExists(file)).then(foundPath => { + console.log(foundPath); + //=> 'rainbow' +}); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +#### tester(element) + +Type: `Function` + +Expected to return a `Promise` or boolean. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/p-try/index.js b/node_modules/p-try/index.js new file mode 100644 index 0000000..efa2f74 --- /dev/null +++ b/node_modules/p-try/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = cb => new Promise(resolve => { + resolve(cb()); +}); diff --git a/node_modules/p-try/license b/node_modules/p-try/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/p-try/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/p-try/package.json b/node_modules/p-try/package.json new file mode 100644 index 0000000..28c2c97 --- /dev/null +++ b/node_modules/p-try/package.json @@ -0,0 +1,75 @@ +{ + "_from": "p-try@^1.0.0", + "_id": "p-try@1.0.0", + "_inBundle": false, + "_integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "_location": "/p-try", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-try@^1.0.0", + "name": "p-try", + "escapedName": "p-try", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/p-limit" + ], + "_resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "_shasum": "cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3", + "_spec": "p-try@^1.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/p-limit", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-try/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "`Promise#try()` ponyfill - Starts a promise chain", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-try#readme", + "keywords": [ + "promise", + "try", + "resolve", + "function", + "catch", + "async", + "await", + "promises", + "settled", + "ponyfill", + "polyfill", + "shim", + "bluebird" + ], + "license": "MIT", + "name": "p-try", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-try.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/p-try/readme.md b/node_modules/p-try/readme.md new file mode 100644 index 0000000..8e5fddd --- /dev/null +++ b/node_modules/p-try/readme.md @@ -0,0 +1,38 @@ +# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) + +> [`Promise#try()`](https://github.com/ljharb/proposal-promise-try) [ponyfill](https://ponyfill.com) - Starts a promise chain + +[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) + + +## Install + +``` +$ npm install --save p-try +``` + + +## Usage + +```js +const pTry = require('p-try'); + +pTry(() => { + return synchronousFunctionThatMightThrow(); +}).then(value => { + console.log(value); +}).catch(error => { + console.error(error); +}); +``` + + +## Related + +- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/parent-module/index.js b/node_modules/parent-module/index.js new file mode 100644 index 0000000..a26f953 --- /dev/null +++ b/node_modules/parent-module/index.js @@ -0,0 +1,37 @@ +'use strict'; +const callsites = require('callsites'); + +module.exports = filepath => { + const stacks = callsites(); + + if (!filepath) { + return stacks[2].getFileName(); + } + + let seenVal = false; + + // Skip the first stack as it's this function + stacks.shift(); + + for (const stack of stacks) { + const parentFilepath = stack.getFileName(); + + if (typeof parentFilepath !== 'string') { + continue; + } + + if (parentFilepath === filepath) { + seenVal = true; + continue; + } + + // Skip native modules + if (parentFilepath === 'module.js') { + continue; + } + + if (seenVal && parentFilepath !== filepath) { + return parentFilepath; + } + } +}; diff --git a/node_modules/parent-module/license b/node_modules/parent-module/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/parent-module/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parent-module/package.json b/node_modules/parent-module/package.json new file mode 100644 index 0000000..704168b --- /dev/null +++ b/node_modules/parent-module/package.json @@ -0,0 +1,78 @@ +{ + "_from": "parent-module@^1.0.0", + "_id": "parent-module@1.0.1", + "_inBundle": false, + "_integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "_location": "/parent-module", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parent-module@^1.0.0", + "name": "parent-module", + "escapedName": "parent-module", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/import-fresh" + ], + "_resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "_shasum": "691d2709e78c79fae3a156622452d00762caaaa2", + "_spec": "parent-module@^1.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/import-fresh", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/parent-module/issues" + }, + "bundleDependencies": false, + "dependencies": { + "callsites": "^3.0.0" + }, + "deprecated": false, + "description": "Get the path of the parent module", + "devDependencies": { + "ava": "^1.4.1", + "execa": "^1.0.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/parent-module#readme", + "keywords": [ + "parent", + "module", + "package", + "pkg", + "caller", + "calling", + "module", + "path", + "callsites", + "callsite", + "stacktrace", + "stack", + "trace", + "function", + "file" + ], + "license": "MIT", + "name": "parent-module", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/parent-module.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.1" +} diff --git a/node_modules/parent-module/readme.md b/node_modules/parent-module/readme.md new file mode 100644 index 0000000..dffb4ce --- /dev/null +++ b/node_modules/parent-module/readme.md @@ -0,0 +1,67 @@ +# parent-module [![Build Status](https://travis-ci.org/sindresorhus/parent-module.svg?branch=master)](https://travis-ci.org/sindresorhus/parent-module) + +> Get the path of the parent module + +Node.js exposes `module.parent`, but it only gives you the first cached parent, which is not necessarily the actual parent. + + +## Install + +``` +$ npm install parent-module +``` + + +## Usage + +```js +// bar.js +const parentModule = require('parent-module'); + +module.exports = () => { + console.log(parentModule()); + //=> '/Users/sindresorhus/dev/unicorn/foo.js' +}; +``` + +```js +// foo.js +const bar = require('./bar'); + +bar(); +``` + + +## API + +### parentModule([filepath]) + +By default, it will return the path of the immediate parent. + +#### filepath + +Type: `string`
+Default: [`__filename`](https://nodejs.org/api/globals.html#globals_filename) + +Filepath of the module of which to get the parent path. + +Useful if you want it to work [multiple module levels down](https://github.com/sindresorhus/parent-module/tree/master/fixtures/filepath). + + +## Tip + +Combine it with [`read-pkg-up`](https://github.com/sindresorhus/read-pkg-up) to read the package.json of the parent module. + +```js +const path = require('path'); +const readPkgUp = require('read-pkg-up'); +const parentModule = require('parent-module'); + +console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg); +//=> {name: 'chalk', version: '1.0.0', …} +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/parse-json/index.js b/node_modules/parse-json/index.js new file mode 100644 index 0000000..04add8a --- /dev/null +++ b/node_modules/parse-json/index.js @@ -0,0 +1,35 @@ +'use strict'; +var errorEx = require('error-ex'); +var fallback = require('./vendor/parse'); + +var JSONError = errorEx('JSONError', { + fileName: errorEx.append('in %s') +}); + +module.exports = function (x, reviver, filename) { + if (typeof reviver === 'string') { + filename = reviver; + reviver = null; + } + + try { + try { + return JSON.parse(x, reviver); + } catch (err) { + fallback.parse(x, { + mode: 'json', + reviver: reviver + }); + + throw err; + } + } catch (err) { + var jsonErr = new JSONError(err); + + if (filename) { + jsonErr.fileName = filename; + } + + throw jsonErr; + } +}; diff --git a/node_modules/parse-json/license b/node_modules/parse-json/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/parse-json/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/parse-json/package.json b/node_modules/parse-json/package.json new file mode 100644 index 0000000..425c066 --- /dev/null +++ b/node_modules/parse-json/package.json @@ -0,0 +1,78 @@ +{ + "_from": "parse-json@^2.2.0", + "_id": "parse-json@2.2.0", + "_inBundle": false, + "_integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "_location": "/parse-json", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-json@^2.2.0", + "name": "parse-json", + "escapedName": "parse-json", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/load-json-file" + ], + "_resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "_shasum": "f480f40434ef80741f8469099f8dea18f55a4dc9", + "_spec": "parse-json@^2.2.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/load-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/parse-json/issues" + }, + "bundleDependencies": false, + "dependencies": { + "error-ex": "^1.2.0" + }, + "deprecated": false, + "description": "Parse JSON with more helpful errors", + "devDependencies": { + "ava": "0.0.4", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "vendor" + ], + "homepage": "https://github.com/sindresorhus/parse-json#readme", + "keywords": [ + "parse", + "json", + "graceful", + "error", + "message", + "humanize", + "friendly", + "helpful", + "string", + "str" + ], + "license": "MIT", + "name": "parse-json", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/parse-json.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "2.2.0", + "xo": { + "ignores": [ + "vendor/**" + ] + } +} diff --git a/node_modules/parse-json/readme.md b/node_modules/parse-json/readme.md new file mode 100644 index 0000000..ca96e60 --- /dev/null +++ b/node_modules/parse-json/readme.md @@ -0,0 +1,83 @@ +# parse-json [![Build Status](https://travis-ci.org/sindresorhus/parse-json.svg?branch=master)](https://travis-ci.org/sindresorhus/parse-json) + +> Parse JSON with more helpful errors + + +## Install + +``` +$ npm install --save parse-json +``` + + +## Usage + +```js +var parseJson = require('parse-json'); +var json = '{\n\t"foo": true,\n}'; + + +JSON.parse(json); +/* +undefined:3 +} +^ +SyntaxError: Unexpected token } +*/ + + +parseJson(json); +/* +JSONError: Trailing comma in object at 3:1 +} +^ +*/ + + +parseJson(json, 'foo.json'); +/* +JSONError: Trailing comma in object at 3:1 in foo.json +} +^ +*/ + + +// you can also add the filename at a later point +try { + parseJson(json); +} catch (err) { + err.fileName = 'foo.json'; + throw err; +} +/* +JSONError: Trailing comma in object at 3:1 in foo.json +} +^ +*/ +``` + +## API + +### parseJson(input, [reviver], [filename]) + +#### input + +Type: `string` + +#### reviver + +Type: `function` + +Prescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter +) for more. + +#### filename + +Type: `string` + +Filename displayed in the error message. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/parse-json/vendor/parse.js b/node_modules/parse-json/vendor/parse.js new file mode 100644 index 0000000..5f9fe99 --- /dev/null +++ b/node_modules/parse-json/vendor/parse.js @@ -0,0 +1,752 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +// RTFM: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf + +var Uni = require('./unicode') + +function isHexDigit(x) { + return (x >= '0' && x <= '9') + || (x >= 'A' && x <= 'F') + || (x >= 'a' && x <= 'f') +} + +function isOctDigit(x) { + return x >= '0' && x <= '7' +} + +function isDecDigit(x) { + return x >= '0' && x <= '9' +} + +var unescapeMap = { + '\'': '\'', + '"' : '"', + '\\': '\\', + 'b' : '\b', + 'f' : '\f', + 'n' : '\n', + 'r' : '\r', + 't' : '\t', + 'v' : '\v', + '/' : '/', +} + +function formatError(input, msg, position, lineno, column, json5) { + var result = msg + ' at ' + (lineno + 1) + ':' + (column + 1) + , tmppos = position - column - 1 + , srcline = '' + , underline = '' + + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON + + // output no more than 70 characters before the wrong ones + if (tmppos < position - 70) { + tmppos = position - 70 + } + + while (1) { + var chr = input[++tmppos] + + if (isLineTerminator(chr) || tmppos === input.length) { + if (position >= tmppos) { + // ending line error, so show it after the last char + underline += '^' + } + break + } + srcline += chr + + if (position === tmppos) { + underline += '^' + } else if (position > tmppos) { + underline += input[tmppos] === '\t' ? '\t' : ' ' + } + + // output no more than 78 characters on the string + if (srcline.length > 78) break + } + + return result + '\n' + srcline + '\n' + underline +} + +function parse(input, options) { + // parse as a standard JSON mode + var json5 = !(options.mode === 'json' || options.legacy) + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON + var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON + + var length = input.length + , lineno = 0 + , linestart = 0 + , position = 0 + , stack = [] + + var tokenStart = function() {} + var tokenEnd = function(v) {return v} + + /* tokenize({ + raw: '...', + type: 'whitespace'|'comment'|'key'|'literal'|'separator'|'newline', + value: 'number'|'string'|'whatever', + path: [...], + }) + */ + if (options._tokenize) { + ;(function() { + var start = null + tokenStart = function() { + if (start !== null) throw Error('internal error, token overlap') + start = position + } + + tokenEnd = function(v, type) { + if (start != position) { + var hash = { + raw: input.substr(start, position-start), + type: type, + stack: stack.slice(0), + } + if (v !== undefined) hash.value = v + options._tokenize.call(null, hash) + } + start = null + return v + } + })() + } + + function fail(msg) { + var column = position - linestart + + if (!msg) { + if (position < length) { + var token = '\'' + + JSON + .stringify(input[position]) + .replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + + '\'' + + if (!msg) msg = 'Unexpected token ' + token + } else { + if (!msg) msg = 'Unexpected end of input' + } + } + + var error = SyntaxError(formatError(input, msg, position, lineno, column, json5)) + error.row = lineno + 1 + error.column = column + 1 + throw error + } + + function newline(chr) { + // account for + if (chr === '\r' && input[position] === '\n') position++ + linestart = position + lineno++ + } + + function parseGeneric() { + var result + + while (position < length) { + tokenStart() + var chr = input[position++] + + if (chr === '"' || (chr === '\'' && json5)) { + return tokenEnd(parseString(chr), 'literal') + + } else if (chr === '{') { + tokenEnd(undefined, 'separator') + return parseObject() + + } else if (chr === '[') { + tokenEnd(undefined, 'separator') + return parseArray() + + } else if (chr === '-' + || chr === '.' + || isDecDigit(chr) + // + number Infinity NaN + || (json5 && (chr === '+' || chr === 'I' || chr === 'N')) + ) { + return tokenEnd(parseNumber(), 'literal') + + } else if (chr === 'n') { + parseKeyword('null') + return tokenEnd(null, 'literal') + + } else if (chr === 't') { + parseKeyword('true') + return tokenEnd(true, 'literal') + + } else if (chr === 'f') { + parseKeyword('false') + return tokenEnd(false, 'literal') + + } else { + position-- + return tokenEnd(undefined) + } + } + } + + function parseKey() { + var result + + while (position < length) { + tokenStart() + var chr = input[position++] + + if (chr === '"' || (chr === '\'' && json5)) { + return tokenEnd(parseString(chr), 'key') + + } else if (chr === '{') { + tokenEnd(undefined, 'separator') + return parseObject() + + } else if (chr === '[') { + tokenEnd(undefined, 'separator') + return parseArray() + + } else if (chr === '.' + || isDecDigit(chr) + ) { + return tokenEnd(parseNumber(true), 'key') + + } else if (json5 + && Uni.isIdentifierStart(chr) || (chr === '\\' && input[position] === 'u')) { + // unicode char or a unicode sequence + var rollback = position - 1 + var result = parseIdentifier() + + if (result === undefined) { + position = rollback + return tokenEnd(undefined) + } else { + return tokenEnd(result, 'key') + } + + } else { + position-- + return tokenEnd(undefined) + } + } + } + + function skipWhiteSpace() { + tokenStart() + while (position < length) { + var chr = input[position++] + + if (isLineTerminator(chr)) { + position-- + tokenEnd(undefined, 'whitespace') + tokenStart() + position++ + newline(chr) + tokenEnd(undefined, 'newline') + tokenStart() + + } else if (isWhiteSpace(chr)) { + // nothing + + } else if (chr === '/' + && json5 + && (input[position] === '/' || input[position] === '*') + ) { + position-- + tokenEnd(undefined, 'whitespace') + tokenStart() + position++ + skipComment(input[position++] === '*') + tokenEnd(undefined, 'comment') + tokenStart() + + } else { + position-- + break + } + } + return tokenEnd(undefined, 'whitespace') + } + + function skipComment(multi) { + while (position < length) { + var chr = input[position++] + + if (isLineTerminator(chr)) { + // LineTerminator is an end of singleline comment + if (!multi) { + // let parent function deal with newline + position-- + return + } + + newline(chr) + + } else if (chr === '*' && multi) { + // end of multiline comment + if (input[position] === '/') { + position++ + return + } + + } else { + // nothing + } + } + + if (multi) { + fail('Unclosed multiline comment') + } + } + + function parseKeyword(keyword) { + // keyword[0] is not checked because it should've checked earlier + var _pos = position + var len = keyword.length + for (var i=1; i= length || keyword[i] != input[position]) { + position = _pos-1 + fail() + } + position++ + } + } + + function parseObject() { + var result = options.null_prototype ? Object.create(null) : {} + , empty_object = {} + , is_non_empty = false + + while (position < length) { + skipWhiteSpace() + var item1 = parseKey() + skipWhiteSpace() + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (chr === '}' && item1 === undefined) { + if (!json5 && is_non_empty) { + position-- + fail('Trailing comma in object') + } + return result + + } else if (chr === ':' && item1 !== undefined) { + skipWhiteSpace() + stack.push(item1) + var item2 = parseGeneric() + stack.pop() + + if (item2 === undefined) fail('No value found for key ' + item1) + if (typeof(item1) !== 'string') { + if (!json5 || typeof(item1) !== 'number') { + fail('Wrong key type: ' + item1) + } + } + + if ((item1 in empty_object || empty_object[item1] != null) && options.reserved_keys !== 'replace') { + if (options.reserved_keys === 'throw') { + fail('Reserved key: ' + item1) + } else { + // silently ignore it + } + } else { + if (typeof(options.reviver) === 'function') { + item2 = options.reviver.call(null, item1, item2) + } + + if (item2 !== undefined) { + is_non_empty = true + Object.defineProperty(result, item1, { + value: item2, + enumerable: true, + configurable: true, + writable: true, + }) + } + } + + skipWhiteSpace() + + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (chr === ',') { + continue + + } else if (chr === '}') { + return result + + } else { + fail() + } + + } else { + position-- + fail() + } + } + + fail() + } + + function parseArray() { + var result = [] + + while (position < length) { + skipWhiteSpace() + stack.push(result.length) + var item = parseGeneric() + stack.pop() + skipWhiteSpace() + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (item !== undefined) { + if (typeof(options.reviver) === 'function') { + item = options.reviver.call(null, String(result.length), item) + } + if (item === undefined) { + result.length++ + item = true // hack for check below, not included into result + } else { + result.push(item) + } + } + + if (chr === ',') { + if (item === undefined) { + fail('Elisions are not supported') + } + + } else if (chr === ']') { + if (!json5 && item === undefined && result.length) { + position-- + fail('Trailing comma in array') + } + return result + + } else { + position-- + fail() + } + } + } + + function parseNumber() { + // rewind because we don't know first char + position-- + + var start = position + , chr = input[position++] + , t + + var to_num = function(is_octal) { + var str = input.substr(start, position - start) + + if (is_octal) { + var result = parseInt(str.replace(/^0o?/, ''), 8) + } else { + var result = Number(str) + } + + if (Number.isNaN(result)) { + position-- + fail('Bad numeric literal - "' + input.substr(start, position - start + 1) + '"') + } else if (!json5 && !str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i)) { + // additional restrictions imposed by json + position-- + fail('Non-json numeric literal - "' + input.substr(start, position - start + 1) + '"') + } else { + return result + } + } + + // ex: -5982475.249875e+29384 + // ^ skipping this + if (chr === '-' || (chr === '+' && json5)) chr = input[position++] + + if (chr === 'N' && json5) { + parseKeyword('NaN') + return NaN + } + + if (chr === 'I' && json5) { + parseKeyword('Infinity') + + // returning +inf or -inf + return to_num() + } + + if (chr >= '1' && chr <= '9') { + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + // special case for leading zero: 0.123456 + if (chr === '0') { + chr = input[position++] + + // new syntax, "0o777" old syntax, "0777" + var is_octal = chr === 'o' || chr === 'O' || isOctDigit(chr) + var is_hex = chr === 'x' || chr === 'X' + + if (json5 && (is_octal || is_hex)) { + while (position < length + && (is_hex ? isHexDigit : isOctDigit)( input[position] ) + ) position++ + + var sign = 1 + if (input[start] === '-') { + sign = -1 + start++ + } else if (input[start] === '+') { + start++ + } + + return sign * to_num(is_octal) + } + } + + if (chr === '.') { + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + if (chr === 'e' || chr === 'E') { + chr = input[position++] + if (chr === '-' || chr === '+') position++ + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + // we have char in the buffer, so count for it + position-- + return to_num() + } + + function parseIdentifier() { + // rewind because we don't know first char + position-- + + var result = '' + + while (position < length) { + var chr = input[position++] + + if (chr === '\\' + && input[position] === 'u' + && isHexDigit(input[position+1]) + && isHexDigit(input[position+2]) + && isHexDigit(input[position+3]) + && isHexDigit(input[position+4]) + ) { + // UnicodeEscapeSequence + chr = String.fromCharCode(parseInt(input.substr(position+1, 4), 16)) + position += 5 + } + + if (result.length) { + // identifier started + if (Uni.isIdentifierPart(chr)) { + result += chr + } else { + position-- + return result + } + + } else { + if (Uni.isIdentifierStart(chr)) { + result += chr + } else { + return undefined + } + } + } + + fail() + } + + function parseString(endChar) { + // 7.8.4 of ES262 spec + var result = '' + + while (position < length) { + var chr = input[position++] + + if (chr === endChar) { + return result + + } else if (chr === '\\') { + if (position >= length) fail() + chr = input[position++] + + if (unescapeMap[chr] && (json5 || (chr != 'v' && chr != "'"))) { + result += unescapeMap[chr] + + } else if (json5 && isLineTerminator(chr)) { + // line continuation + newline(chr) + + } else if (chr === 'u' || (chr === 'x' && json5)) { + // unicode/character escape sequence + var off = chr === 'u' ? 4 : 2 + + // validation for \uXXXX + for (var i=0; i= length) fail() + if (!isHexDigit(input[position])) fail('Bad escape sequence') + position++ + } + + result += String.fromCharCode(parseInt(input.substr(position-off, off), 16)) + } else if (json5 && isOctDigit(chr)) { + if (chr < '4' && isOctDigit(input[position]) && isOctDigit(input[position+1])) { + // three-digit octal + var digits = 3 + } else if (isOctDigit(input[position])) { + // two-digit octal + var digits = 2 + } else { + var digits = 1 + } + position += digits - 1 + result += String.fromCharCode(parseInt(input.substr(position-digits, digits), 8)) + /*if (!isOctDigit(input[position])) { + // \0 is allowed still + result += '\0' + } else { + fail('Octal literals are not supported') + }*/ + + } else if (json5) { + // \X -> x + result += chr + + } else { + position-- + fail() + } + + } else if (isLineTerminator(chr)) { + fail() + + } else { + if (!json5 && chr.charCodeAt(0) < 32) { + position-- + fail('Unexpected control character') + } + + // SourceCharacter but not one of " or \ or LineTerminator + result += chr + } + } + + fail() + } + + skipWhiteSpace() + var return_value = parseGeneric() + if (return_value !== undefined || position < length) { + skipWhiteSpace() + + if (position >= length) { + if (typeof(options.reviver) === 'function') { + return_value = options.reviver.call(null, '', return_value) + } + return return_value + } else { + fail() + } + + } else { + if (position) { + fail('No data, only a whitespace') + } else { + fail('No data, empty input') + } + } +} + +/* + * parse(text, options) + * or + * parse(text, reviver) + * + * where: + * text - string + * options - object + * reviver - function + */ +module.exports.parse = function parseJSON(input, options) { + // support legacy functions + if (typeof(options) === 'function') { + options = { + reviver: options + } + } + + if (input === undefined) { + // parse(stringify(x)) should be equal x + // with JSON functions it is not 'cause of undefined + // so we're fixing it + return undefined + } + + // JSON.parse compat + if (typeof(input) !== 'string') input = String(input) + if (options == null) options = {} + if (options.reserved_keys == null) options.reserved_keys = 'ignore' + + if (options.reserved_keys === 'throw' || options.reserved_keys === 'ignore') { + if (options.null_prototype == null) { + options.null_prototype = true + } + } + + try { + return parse(input, options) + } catch(err) { + // jju is a recursive parser, so JSON.parse("{{{{{{{") could blow up the stack + // + // this catch is used to skip all those internal calls + if (err instanceof SyntaxError && err.row != null && err.column != null) { + var old_err = err + err = SyntaxError(old_err.message) + err.column = old_err.column + err.row = old_err.row + } + throw err + } +} + +module.exports.tokenize = function tokenizeJSON(input, options) { + if (options == null) options = {} + + options._tokenize = function(smth) { + if (options._addstack) smth.stack.unshift.apply(smth.stack, options._addstack) + tokens.push(smth) + } + + var tokens = [] + tokens.data = module.exports.parse(input, options) + return tokens +} + diff --git a/node_modules/parse-json/vendor/unicode.js b/node_modules/parse-json/vendor/unicode.js new file mode 100644 index 0000000..1a29143 --- /dev/null +++ b/node_modules/parse-json/vendor/unicode.js @@ -0,0 +1,71 @@ + +// This is autogenerated with esprima tools, see: +// https://github.com/ariya/esprima/blob/master/esprima.js +// +// PS: oh God, I hate Unicode + +// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierStart: + +var Uni = module.exports + +module.exports.isWhiteSpace = function isWhiteSpace(x) { + // section 7.2, table 2 + return x === '\u0020' + || x === '\u00A0' + || x === '\uFEFF' // <-- this is not a Unicode WS, only a JS one + || (x >= '\u0009' && x <= '\u000D') // 9 A B C D + + // + whitespace characters from unicode, category Zs + || x === '\u1680' + || x === '\u180E' + || (x >= '\u2000' && x <= '\u200A') // 0 1 2 3 4 5 6 7 8 9 A + || x === '\u2028' + || x === '\u2029' + || x === '\u202F' + || x === '\u205F' + || x === '\u3000' +} + +module.exports.isWhiteSpaceJSON = function isWhiteSpaceJSON(x) { + return x === '\u0020' + || x === '\u0009' + || x === '\u000A' + || x === '\u000D' +} + +module.exports.isLineTerminator = function isLineTerminator(x) { + // ok, here is the part when JSON is wrong + // section 7.3, table 3 + return x === '\u000A' + || x === '\u000D' + || x === '\u2028' + || x === '\u2029' +} + +module.exports.isLineTerminatorJSON = function isLineTerminatorJSON(x) { + return x === '\u000A' + || x === '\u000D' +} + +module.exports.isIdentifierStart = function isIdentifierStart(x) { + return x === '$' + || x === '_' + || (x >= 'A' && x <= 'Z') + || (x >= 'a' && x <= 'z') + || (x >= '\u0080' && Uni.NonAsciiIdentifierStart.test(x)) +} + +module.exports.isIdentifierPart = function isIdentifierPart(x) { + return x === '$' + || x === '_' + || (x >= 'A' && x <= 'Z') + || (x >= 'a' && x <= 'z') + || (x >= '0' && x <= '9') // <-- addition to Start + || (x >= '\u0080' && Uni.NonAsciiIdentifierPart.test(x)) +} + +module.exports.NonAsciiIdentifierStart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\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\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\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\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-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\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 v6.3.0 NonAsciiIdentifierPart: + +module.exports.NonAsciiIdentifierPart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\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\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\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\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\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\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\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\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-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\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-\u191C\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\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\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-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\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-\uFE26\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]/ diff --git a/node_modules/path-exists/index.js b/node_modules/path-exists/index.js new file mode 100644 index 0000000..16ae60a --- /dev/null +++ b/node_modules/path-exists/index.js @@ -0,0 +1,17 @@ +'use strict'; +const fs = require('fs'); + +module.exports = fp => new Promise(resolve => { + fs.access(fp, err => { + resolve(!err); + }); +}); + +module.exports.sync = fp => { + try { + fs.accessSync(fp); + return true; + } catch (err) { + return false; + } +}; diff --git a/node_modules/path-exists/license b/node_modules/path-exists/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/path-exists/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-exists/package.json b/node_modules/path-exists/package.json new file mode 100644 index 0000000..cdeb31a --- /dev/null +++ b/node_modules/path-exists/package.json @@ -0,0 +1,72 @@ +{ + "_from": "path-exists@^3.0.0", + "_id": "path-exists@3.0.0", + "_inBundle": false, + "_integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "_location": "/path-exists", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-exists@^3.0.0", + "name": "path-exists", + "escapedName": "path-exists", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/locate-path" + ], + "_resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "_shasum": "ce0ebeaa5f78cb18925ea7d810d7b59b010fd515", + "_spec": "path-exists@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-exists/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a path exists", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-exists#readme", + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "license": "MIT", + "name": "path-exists", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-exists.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/path-exists/readme.md b/node_modules/path-exists/readme.md new file mode 100644 index 0000000..1b65fa7 --- /dev/null +++ b/node_modules/path-exists/readme.md @@ -0,0 +1,50 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install --save path-exists +``` + + +## Usage + +```js +// foo.js +const pathExists = require('path-exists'); + +pathExists('foo.js').then(exists => { + console.log(exists); + //=> true +}); +``` + + +## API + +### pathExists(path) + +Returns a promise for a boolean of whether the path exists. + +### pathExists.sync(path) + +Returns a boolean of whether the path exists. + + +## Related + +- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js new file mode 100644 index 0000000..22aa6c3 --- /dev/null +++ b/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json new file mode 100644 index 0000000..2ccfda1 --- /dev/null +++ b/node_modules/path-is-absolute/package.json @@ -0,0 +1,75 @@ +{ + "_from": "path-is-absolute@^1.0.0", + "_id": "path-is-absolute@1.0.1", + "_inBundle": false, + "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "_location": "/path-is-absolute", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-is-absolute@^1.0.0", + "name": "path-is-absolute", + "escapedName": "path-is-absolute", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "_spec": "path-is-absolute@^1.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/glob", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": { + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "path-is-absolute", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md new file mode 100644 index 0000000..8dbdf5f --- /dev/null +++ b/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-key/index.d.ts b/node_modules/path-key/index.d.ts new file mode 100644 index 0000000..7c575d1 --- /dev/null +++ b/node_modules/path-key/index.d.ts @@ -0,0 +1,40 @@ +/// + +declare namespace pathKey { + interface Options { + /** + Use a custom environment variables object. Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env). + */ + readonly env?: {[key: string]: string | undefined}; + + /** + Get the PATH key for a specific platform. Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform). + */ + readonly platform?: NodeJS.Platform; + } +} + +declare const pathKey: { + /** + Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform. + + @example + ``` + import pathKey = require('path-key'); + + const key = pathKey(); + //=> 'PATH' + + const PATH = process.env[key]; + //=> '/usr/local/bin:/usr/bin:/bin' + ``` + */ + (options?: pathKey.Options): string; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function pathKey(options?: pathKey.Options): string; + // export = pathKey; + default: typeof pathKey; +}; + +export = pathKey; diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js new file mode 100644 index 0000000..0cf6415 --- /dev/null +++ b/node_modules/path-key/index.js @@ -0,0 +1,16 @@ +'use strict'; + +const pathKey = (options = {}) => { + const environment = options.env || process.env; + const platform = options.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +}; + +module.exports = pathKey; +// TODO: Remove this for the next major release +module.exports.default = pathKey; diff --git a/node_modules/path-key/license b/node_modules/path-key/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/path-key/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json new file mode 100644 index 0000000..110e7b5 --- /dev/null +++ b/node_modules/path-key/package.json @@ -0,0 +1,71 @@ +{ + "_from": "path-key@^3.1.0", + "_id": "path-key@3.1.1", + "_inBundle": false, + "_integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "_location": "/path-key", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-key@^3.1.0", + "name": "path-key", + "escapedName": "path-key", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/cross-spawn" + ], + "_resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "_shasum": "581f6ade658cbba65a0d3380de7753295054f375", + "_spec": "path-key@^3.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/cross-spawn", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-key/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get the PATH environment variable key cross-platform", + "devDependencies": { + "@types/node": "^11.13.0", + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/path-key#readme", + "keywords": [ + "path", + "key", + "environment", + "env", + "variable", + "var", + "get", + "cross-platform", + "windows" + ], + "license": "MIT", + "name": "path-key", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-key.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "3.1.1" +} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md new file mode 100644 index 0000000..a9052d7 --- /dev/null +++ b/node_modules/path-key/readme.md @@ -0,0 +1,61 @@ +# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) + +> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform + +It's usually `PATH`, but on Windows it can be any casing like `Path`... + + +## Install + +``` +$ npm install path-key +``` + + +## Usage + +```js +const pathKey = require('path-key'); + +const key = pathKey(); +//=> 'PATH' + +const PATH = process.env[key]; +//=> '/usr/local/bin:/usr/bin:/bin' +``` + + +## API + +### pathKey(options?) + +#### options + +Type: `object` + +##### env + +Type: `object`
+Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) + +Use a custom environment variables object. + +#### platform + +Type: `string`
+Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) + +Get the PATH key for a specific platform. + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/path-parse/.travis.yml b/node_modules/path-parse/.travis.yml new file mode 100644 index 0000000..dae31da --- /dev/null +++ b/node_modules/path-parse/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "0.12" + - "0.11" + - "0.10" + - "0.10.12" + - "0.8" + - "0.6" + - "iojs" diff --git a/node_modules/path-parse/LICENSE b/node_modules/path-parse/LICENSE new file mode 100644 index 0000000..810f3db --- /dev/null +++ b/node_modules/path-parse/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Javier Blanco + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/path-parse/README.md b/node_modules/path-parse/README.md new file mode 100644 index 0000000..05097f8 --- /dev/null +++ b/node_modules/path-parse/README.md @@ -0,0 +1,42 @@ +# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) + +> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). + +## Install + +``` +$ npm install --save path-parse +``` + +## Usage + +```js +var pathParse = require('path-parse'); + +pathParse('/home/user/dir/file.txt'); +//=> { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +## API + +See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. + +### pathParse(path) + +### pathParse.posix(path) + +The Posix specific version. + +### pathParse.win32(path) + +The Windows specific version. + +## License + +MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js new file mode 100644 index 0000000..3b7601f --- /dev/null +++ b/node_modules/path-parse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json new file mode 100644 index 0000000..ed46e45 --- /dev/null +++ b/node_modules/path-parse/package.json @@ -0,0 +1,61 @@ +{ + "_from": "path-parse@^1.0.6", + "_id": "path-parse@1.0.6", + "_inBundle": false, + "_integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "_location": "/path-parse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-parse@^1.0.6", + "name": "path-parse", + "escapedName": "path-parse", + "rawSpec": "^1.0.6", + "saveSpec": null, + "fetchSpec": "^1.0.6" + }, + "_requiredBy": [ + "/resolve" + ], + "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "_shasum": "d62dbb5679405d72c4737ec58600e9ddcf06d24c", + "_spec": "path-parse@^1.0.6", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/resolve", + "author": { + "name": "Javier Blanco", + "email": "http://jbgutierrez.info" + }, + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js path.parse() ponyfill", + "homepage": "https://github.com/jbgutierrez/path-parse#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "parse", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim" + ], + "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" + }, + "version": "1.0.6" +} diff --git a/node_modules/path-parse/test.js b/node_modules/path-parse/test.js new file mode 100644 index 0000000..0b30c12 --- /dev/null +++ b/node_modules/path-parse/test.js @@ -0,0 +1,77 @@ +var assert = require('assert'); +var pathParse = require('./index'); + +var winParseTests = [ + [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'], + [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'], + [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'], + [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'], + + // unc + [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'], + [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'], + [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'], + [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share'] +]; + +var winSpecialCaseFormatTests = [ + [{dir: 'some\\dir'}, 'some\\dir\\'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var unixParseTests = [ + [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'], + [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'], + [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'], + [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'], + [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'], + [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo'] +]; + +var unixSpecialCaseFormatTests = [ + [{dir: 'some/dir'}, 'some/dir/'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var errors = [ + {input: null, message: /Parameter 'pathString' must be a string, not/}, + {input: {}, message: /Parameter 'pathString' must be a string, not object/}, + {input: true, message: /Parameter 'pathString' must be a string, not boolean/}, + {input: 1, message: /Parameter 'pathString' must be a string, not number/}, + {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/}, +]; + +checkParseFormat(pathParse.win32, winParseTests); +checkParseFormat(pathParse.posix, unixParseTests); +checkErrors(pathParse.win32); +checkErrors(pathParse.posix); + +function checkErrors(parse) { + errors.forEach(function(errorCase) { + try { + parse(errorCase.input); + } catch(err) { + assert.ok(err instanceof TypeError); + assert.ok( + errorCase.message.test(err.message), + 'expected ' + errorCase.message + ' to match ' + err.message + ); + return; + } + + assert.fail('should have thrown'); + }); +} + +function checkParseFormat(parse, testCases) { + testCases.forEach(function(testCase) { + assert.deepEqual(parse(testCase[1]), testCase[0]); + }); +} diff --git a/node_modules/path-type/index.js b/node_modules/path-type/index.js new file mode 100644 index 0000000..4ac9dd9 --- /dev/null +++ b/node_modules/path-type/index.js @@ -0,0 +1,26 @@ +'use strict'; +const fs = require('fs'); +const pify = require('pify'); + +function type(fn, fn2, fp) { + if (typeof fp !== 'string') { + return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`)); + } + + return pify(fs[fn])(fp).then(stats => stats[fn2]()); +} + +function typeSync(fn, fn2, fp) { + if (typeof fp !== 'string') { + throw new TypeError(`Expected a string, got ${typeof fp}`); + } + + return fs[fn](fp)[fn2](); +} + +exports.file = type.bind(null, 'stat', 'isFile'); +exports.dir = type.bind(null, 'stat', 'isDirectory'); +exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); +exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); +exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); +exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); diff --git a/node_modules/path-type/license b/node_modules/path-type/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/path-type/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-type/package.json b/node_modules/path-type/package.json new file mode 100644 index 0000000..1005def --- /dev/null +++ b/node_modules/path-type/package.json @@ -0,0 +1,80 @@ +{ + "_from": "path-type@^2.0.0", + "_id": "path-type@2.0.0", + "_inBundle": false, + "_integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "_location": "/path-type", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-type@^2.0.0", + "name": "path-type", + "escapedName": "path-type", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "_shasum": "f012ccb8415b7096fc2daa1054c3d72389594c73", + "_spec": "path-type@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-type/issues" + }, + "bundleDependencies": false, + "dependencies": { + "pify": "^2.0.0" + }, + "deprecated": false, + "description": "Check if a path is a file, directory, or symlink", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-type#readme", + "keywords": [ + "path", + "fs", + "type", + "is", + "check", + "directory", + "dir", + "file", + "filepath", + "symlink", + "symbolic", + "link", + "stat", + "stats", + "filesystem" + ], + "license": "MIT", + "name": "path-type", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-type.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/path-type/readme.md b/node_modules/path-type/readme.md new file mode 100644 index 0000000..b1ea61f --- /dev/null +++ b/node_modules/path-type/readme.md @@ -0,0 +1,42 @@ +# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type) + +> Check if a path is a file, directory, or symlink + + +## Install + +``` +$ npm install --save path-type +``` + + +## Usage + +```js +const pathType = require('path-type'); + +pathType.file('package.json').then(isFile => { + console.log(isFile); + //=> true +}) +``` + + +## API + +### .file(path) +### .dir(path) +### .symlink(path) + +Returns a `Promise` for a `boolean` of whether the path is the checked type. + +### .fileSync(path) +### .dirSync(path) +### .symlinkSync(path) + +Returns a `boolean` of whether the path is the checked type. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pify/index.js b/node_modules/pify/index.js new file mode 100644 index 0000000..7c720eb --- /dev/null +++ b/node_modules/pify/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; diff --git a/node_modules/pify/license b/node_modules/pify/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/pify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pify/package.json b/node_modules/pify/package.json new file mode 100644 index 0000000..84ab0cf --- /dev/null +++ b/node_modules/pify/package.json @@ -0,0 +1,81 @@ +{ + "_from": "pify@^2.0.0", + "_id": "pify@2.3.0", + "_inBundle": false, + "_integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "_location": "/pify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pify@^2.0.0", + "name": "pify", + "escapedName": "pify", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/load-json-file", + "/path-type" + ], + "_resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "_shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c", + "_spec": "pify@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/load-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Promisify a callback-style function", + "devDependencies": { + "ava": "*", + "pinkie-promise": "^1.0.0", + "v8-natives": "0.0.2", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pify#readme", + "keywords": [ + "promise", + "promises", + "promisify", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "es2015" + ], + "license": "MIT", + "name": "pify", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pify.git" + }, + "scripts": { + "optimization-test": "node --allow-natives-syntax optimization-test.js", + "test": "xo && ava && npm run optimization-test" + }, + "version": "2.3.0" +} diff --git a/node_modules/pify/readme.md b/node_modules/pify/readme.md new file mode 100644 index 0000000..c79ca8b --- /dev/null +++ b/node_modules/pify/readme.md @@ -0,0 +1,119 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// promisify a single function + +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// or promisify all methods in a module + +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [promiseModule], [options]) + +Returns a promise wrapped version of the supplied function or module. + +#### input + +Type: `function`, `object` + +Callback-style function or module whose methods you want to promisify. + +#### promiseModule + +Type: `function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + +#### options + +##### multiArgs + +Type: `boolean` +Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `array` of (`string`|`regex`) + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `array` of (`string`|`regex`) +Default: `[/.+Sync$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean` +Default: `false` + +By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(data, null); + }); +}; + +// promisify methods but not fn() +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/pkg-dir/index.js b/node_modules/pkg-dir/index.js new file mode 100644 index 0000000..f2fa201 --- /dev/null +++ b/node_modules/pkg-dir/index.js @@ -0,0 +1,10 @@ +'use strict'; +const path = require('path'); +const findUp = require('find-up'); + +module.exports = cwd => findUp('package.json', {cwd}).then(fp => fp ? path.dirname(fp) : null); + +module.exports.sync = cwd => { + const fp = findUp.sync('package.json', {cwd}); + return fp ? path.dirname(fp) : null; +}; diff --git a/node_modules/pkg-dir/license b/node_modules/pkg-dir/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/pkg-dir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pkg-dir/package.json b/node_modules/pkg-dir/package.json new file mode 100644 index 0000000..0525624 --- /dev/null +++ b/node_modules/pkg-dir/package.json @@ -0,0 +1,85 @@ +{ + "_from": "pkg-dir@^2.0.0", + "_id": "pkg-dir@2.0.0", + "_inBundle": false, + "_integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "_location": "/pkg-dir", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pkg-dir@^2.0.0", + "name": "pkg-dir", + "escapedName": "pkg-dir", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/eslint-module-utils" + ], + "_resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "_shasum": "f6d5d1109e19d63edf428e0bd57e12777615334b", + "_spec": "pkg-dir@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-module-utils", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pkg-dir/issues" + }, + "bundleDependencies": false, + "dependencies": { + "find-up": "^2.1.0" + }, + "deprecated": false, + "description": "Find the root directory of a Node.js project or npm package", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pkg-dir#readme", + "keywords": [ + "package", + "json", + "root", + "npm", + "entry", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "name": "pkg-dir", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pkg-dir.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0" +} diff --git a/node_modules/pkg-dir/readme.md b/node_modules/pkg-dir/readme.md new file mode 100644 index 0000000..3cab12e --- /dev/null +++ b/node_modules/pkg-dir/readme.md @@ -0,0 +1,64 @@ +# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir) + +> Find the root directory of a Node.js project or npm package + + +## Install + +``` +$ npm install --save pkg-dir +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + └── foo + ├── package.json + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +const pkgDir = require('pkg-dir'); + +pkgDir(__dirname).then(rootDir => { + console.log(rootDir); + //=> '/Users/sindresorhus/foo' +}); +``` + + +## API + +### pkgDir([cwd]) + +Returns a `Promise` for either the project root path or `null` if it couldn't be found. + +### pkgDir.sync([cwd]) + +Returns the project root path or `null`. + +#### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/prelude-ls/CHANGELOG.md b/node_modules/prelude-ls/CHANGELOG.md new file mode 100644 index 0000000..71b8a0f --- /dev/null +++ b/node_modules/prelude-ls/CHANGELOG.md @@ -0,0 +1,108 @@ +# 1.2.1 +- fix version + +# 1.2.0 +- add `List.remove` +- build with LiveScript 1.6.0 +- update dependencies +- remove coverage calculation + +# 1.1.2 +- add `Func.memoize` +- fix `zip-all` and `zip-with-all` corner case (no input) +- build with LiveScript 1.4.0 + +# 1.1.1 +- curry `unique-by`, `minimum-by` + +# 1.1.0 +- added `List` functions: `maximum-by`, `minimum-by`, `unique-by` +- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices` +- added `Str` functions: `capitalize`, `camelize`, `dasherize` +- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)`` +- exported `Str.repeat` through main `prelude` object +- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one +- fixed issue with `fix` +- improved code coverage + +# 1.0.3 +- build browser versions + +# 1.0.2 +- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects + +# 1.0.1 +- bug fixes for `drop-while` and `take-while` + +# 1.0.0 +* massive update - separated functions into separate modules +* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list +* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that +* browser version now using browserify - use `prelude = require('prelude-ls')` +* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply` +* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists` +* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs` +* removed `cons`, `append` - use the concat operator +* removed `compose` - use the compose operator +* removed `obj-to-func` - use partially applied access (eg. `(obj.)`) +* removed `length` - use `(.length)` +* `sort-by` renamed to `sort-with` +* added new `sort-by` +* removed `compare` - just use the new `sort-by` +* `break-it` renamed `break-list`, (`Str.break-str` for the string version) +* added `Str.repeat` which creates a new string by repeating the input n times +* `unfold` as alias to `unfoldr` is no longer used +* fixed up style and compiled with LiveScript 1.1.1 +* use Make instead of Slake +* greatly improved tests + +# 0.6.0 +* fixed various bugs +* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions +* added `unfoldr` (alias `unfold`) +* calling `replicate` with a string now returns a list of strings +* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying +* added `sort`, `sortBy`, and `compare` + +# 0.5.0 +* removed `lookup` - use (.prop) +* removed `call` - use (.func arg1, arg2) +* removed `pluck` - use map (.prop), xs +* fixed buys wtih `head` and `last` +* added non-minifed browser version, as `prelude-browser.js` +* renamed `prelude-min.js` to `prelude-browser-min.js` +* renamed `zip` to `zipAll` +* renamed `zipWith` to `zipAllWith` +* added `zip`, a curried zip that takes only two arguments +* added `zipWith`, a curried zipWith that takes only two arguments + +# 0.4.0 +* added `parition` function +* added `curry` function +* removed `elem` function (use `in`) +* removed `notElem` function (use `not in`) + +# 0.3.0 +* added `listToObject` +* added `unique` +* added `objToFunc` +* added support for using strings in map and the like +* added support for using objects in map and the like +* added ability to use objects instead of functions in certain cases +* removed `error` (just use throw) +* added `tau` constant +* added `join` +* added `values` +* added `keys` +* added `partial` +* renamed `log` to `ln` +* added alias to `head`: `first` +* added `installPrelude` helper + +# 0.2.0 +* removed functions that simply warp operators as you can now use operators as functions in LiveScript +* `min/max` are now curried and take only 2 arguments +* added `call` + +# 0.1.0 +* initial public release diff --git a/node_modules/prelude-ls/LICENSE b/node_modules/prelude-ls/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/prelude-ls/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/prelude-ls/README.md b/node_modules/prelude-ls/README.md new file mode 100644 index 0000000..fabc212 --- /dev/null +++ b/node_modules/prelude-ls/README.md @@ -0,0 +1,15 @@ +# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls) + +is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript. + +See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more. + +You can install via npm `npm install prelude-ls` + +### Development + +`make test` to test + +`make build` to build `lib` from `src` + +`make build-browser` to build browser versions diff --git a/node_modules/prelude-ls/lib/Func.js b/node_modules/prelude-ls/lib/Func.js new file mode 100644 index 0000000..09777a8 --- /dev/null +++ b/node_modules/prelude-ls/lib/Func.js @@ -0,0 +1,69 @@ +// Generated by LiveScript 1.6.0 +var apply, curry, flip, fix, over, memoize, toString$ = {}.toString; +apply = curry$(function(f, list){ + return f.apply(null, list); +}); +curry = function(f){ + return curry$(f); +}; +flip = curry$(function(f, x, y){ + return f(y, x); +}); +fix = function(f){ + return function(g){ + return function(){ + return f(g(g)).apply(null, arguments); + }; + }(function(g){ + return function(){ + return f(g(g)).apply(null, arguments); + }; + }); +}; +over = curry$(function(f, g, x, y){ + return f(g(x), g(y)); +}); +memoize = function(f){ + var memo; + memo = {}; + return function(){ + var args, res$, i$, to$, key, arg; + res$ = []; + for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + args = res$; + key = (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) { + arg = ref$[i$]; + results$.push(arg + toString$.call(arg).slice(8, -1)); + } + return results$; + }()).join(''); + return memo[key] = key in memo + ? memo[key] + : f.apply(null, args); + }; +}; +module.exports = { + curry: curry, + flip: flip, + fix: fix, + apply: apply, + over: over, + memoize: memoize +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/List.js b/node_modules/prelude-ls/lib/List.js new file mode 100644 index 0000000..d2e41ab --- /dev/null +++ b/node_modules/prelude-ls/lib/List.js @@ -0,0 +1,716 @@ +// Generated by LiveScript 1.6.0 +var each, map, compact, filter, reject, remove, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString; +each = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + f(x); + } + return xs; +}); +map = curry$(function(f, xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + results$.push(f(x)); + } + return results$; +}); +compact = function(xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (x) { + results$.push(x); + } + } + return results$; +}; +filter = curry$(function(f, xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (f(x)) { + results$.push(x); + } + } + return results$; +}); +reject = curry$(function(f, xs){ + var i$, len$, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!f(x)) { + results$.push(x); + } + } + return results$; +}); +remove = curry$(function(el, xs){ + var i, x$; + i = elemIndex(el, xs); + x$ = xs.slice(); + if (i != null) { + x$.splice(i, 1); + } + return x$; +}); +partition = curry$(function(f, xs){ + var passed, failed, i$, len$, x; + passed = []; + failed = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + (f(x) ? passed : failed).push(x); + } + return [passed, failed]; +}); +find = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (f(x)) { + return x; + } + } +}); +head = first = function(xs){ + return xs[0]; +}; +tail = function(xs){ + if (!xs.length) { + return; + } + return xs.slice(1); +}; +last = function(xs){ + return xs[xs.length - 1]; +}; +initial = function(xs){ + if (!xs.length) { + return; + } + return xs.slice(0, -1); +}; +empty = function(xs){ + return !xs.length; +}; +reverse = function(xs){ + return xs.concat().reverse(); +}; +unique = function(xs){ + var result, i$, len$, x; + result = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!in$(x, result)) { + result.push(x); + } + } + return result; +}; +uniqueBy = curry$(function(f, xs){ + var seen, i$, len$, x, val, results$ = []; + seen = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + val = f(x); + if (in$(val, seen)) { + continue; + } + seen.push(val); + results$.push(x); + } + return results$; +}); +fold = foldl = curry$(function(f, memo, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + memo = f(memo, x); + } + return memo; +}); +fold1 = foldl1 = curry$(function(f, xs){ + return fold(f, xs[0], xs.slice(1)); +}); +foldr = curry$(function(f, memo, xs){ + var i$, x; + for (i$ = xs.length - 1; i$ >= 0; --i$) { + x = xs[i$]; + memo = f(x, memo); + } + return memo; +}); +foldr1 = curry$(function(f, xs){ + return foldr(f, xs[xs.length - 1], xs.slice(0, -1)); +}); +unfoldr = curry$(function(f, b){ + var result, x, that; + result = []; + x = b; + while ((that = f(x)) != null) { + result.push(that[0]); + x = that[1]; + } + return result; +}); +concat = function(xss){ + return [].concat.apply([], xss); +}; +concatMap = curry$(function(f, xs){ + var x; + return [].concat.apply([], (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { + x = ref$[i$]; + results$.push(f(x)); + } + return results$; + }())); +}); +flatten = function(xs){ + var x; + return [].concat.apply([], (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (toString$.call(x).slice(8, -1) === 'Array') { + results$.push(flatten(x)); + } else { + results$.push(x); + } + } + return results$; + }())); +}; +difference = function(xs){ + var yss, res$, i$, to$, results, len$, x, j$, len1$, ys; + res$ = []; + for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + yss = res$; + results = []; + outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { + ys = yss[j$]; + if (in$(x, ys)) { + continue outer; + } + } + results.push(x); + } + return results; +}; +intersection = function(xs){ + var yss, res$, i$, to$, results, len$, x, j$, len1$, ys; + res$ = []; + for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + yss = res$; + results = []; + outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { + ys = yss[j$]; + if (!in$(x, ys)) { + continue outer; + } + } + results.push(x); + } + return results; +}; +union = function(){ + var xss, res$, i$, to$, results, len$, xs, j$, len1$, x; + res$ = []; + for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + xss = res$; + results = []; + for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { + xs = xss[i$]; + for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) { + x = xs[j$]; + if (!in$(x, results)) { + results.push(x); + } + } + } + return results; +}; +countBy = curry$(function(f, xs){ + var results, i$, len$, x, key; + results = {}; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + key = f(x); + if (key in results) { + results[key] += 1; + } else { + results[key] = 1; + } + } + return results; +}); +groupBy = curry$(function(f, xs){ + var results, i$, len$, x, key; + results = {}; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + key = f(x); + if (key in results) { + results[key].push(x); + } else { + results[key] = [x]; + } + } + return results; +}); +andList = function(xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!x) { + return false; + } + } + return true; +}; +orList = function(xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (x) { + return true; + } + } + return false; +}; +any = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (f(x)) { + return true; + } + } + return false; +}); +all = curry$(function(f, xs){ + var i$, len$, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + if (!f(x)) { + return false; + } + } + return true; +}); +sort = function(xs){ + return xs.concat().sort(function(x, y){ + if (x > y) { + return 1; + } else if (x < y) { + return -1; + } else { + return 0; + } + }); +}; +sortWith = curry$(function(f, xs){ + return xs.concat().sort(f); +}); +sortBy = curry$(function(f, xs){ + return xs.concat().sort(function(x, y){ + if (f(x) > f(y)) { + return 1; + } else if (f(x) < f(y)) { + return -1; + } else { + return 0; + } + }); +}); +sum = function(xs){ + var result, i$, len$, x; + result = 0; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + result += x; + } + return result; +}; +product = function(xs){ + var result, i$, len$, x; + result = 1; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + result *= x; + } + return result; +}; +mean = average = function(xs){ + var sum, i$, len$, x; + sum = 0; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + x = xs[i$]; + sum += x; + } + return sum / xs.length; +}; +maximum = function(xs){ + var max, i$, ref$, len$, x; + max = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (x > max) { + max = x; + } + } + return max; +}; +minimum = function(xs){ + var min, i$, ref$, len$, x; + min = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (x < min) { + min = x; + } + } + return min; +}; +maximumBy = curry$(function(f, xs){ + var max, i$, ref$, len$, x; + max = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (f(x) > f(max)) { + max = x; + } + } + return max; +}); +minimumBy = curry$(function(f, xs){ + var min, i$, ref$, len$, x; + min = xs[0]; + for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { + x = ref$[i$]; + if (f(x) < f(min)) { + min = x; + } + } + return min; +}); +scan = scanl = curry$(function(f, memo, xs){ + var last, x; + last = memo; + return [memo].concat((function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { + x = ref$[i$]; + results$.push(last = f(last, x)); + } + return results$; + }())); +}); +scan1 = scanl1 = curry$(function(f, xs){ + if (!xs.length) { + return; + } + return scan(f, xs[0], xs.slice(1)); +}); +scanr = curry$(function(f, memo, xs){ + xs = xs.concat().reverse(); + return scan(f, memo, xs).reverse(); +}); +scanr1 = curry$(function(f, xs){ + if (!xs.length) { + return; + } + xs = xs.concat().reverse(); + return scan(f, xs[0], xs.slice(1)).reverse(); +}); +slice = curry$(function(x, y, xs){ + return xs.slice(x, y); +}); +take = curry$(function(n, xs){ + if (n <= 0) { + return xs.slice(0, 0); + } else { + return xs.slice(0, n); + } +}); +drop = curry$(function(n, xs){ + if (n <= 0) { + return xs; + } else { + return xs.slice(n); + } +}); +splitAt = curry$(function(n, xs){ + return [take(n, xs), drop(n, xs)]; +}); +takeWhile = curry$(function(p, xs){ + var len, i; + len = xs.length; + if (!len) { + return xs; + } + i = 0; + while (i < len && p(xs[i])) { + i += 1; + } + return xs.slice(0, i); +}); +dropWhile = curry$(function(p, xs){ + var len, i; + len = xs.length; + if (!len) { + return xs; + } + i = 0; + while (i < len && p(xs[i])) { + i += 1; + } + return xs.slice(i); +}); +span = curry$(function(p, xs){ + return [takeWhile(p, xs), dropWhile(p, xs)]; +}); +breakList = curry$(function(p, xs){ + return span(compose$(p, not$), xs); +}); +zip = curry$(function(xs, ys){ + var result, len, i$, len$, i, x; + result = []; + len = ys.length; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (i === len) { + break; + } + result.push([x, ys[i]]); + } + return result; +}); +zipWith = curry$(function(f, xs, ys){ + var result, len, i$, len$, i, x; + result = []; + len = ys.length; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (i === len) { + break; + } + result.push(f(x, ys[i])); + } + return result; +}); +zipAll = function(){ + var xss, res$, i$, to$, minLength, len$, xs, ref$, i, lresult$, j$, results$ = []; + res$ = []; + for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + xss = res$; + minLength = undefined; + for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { + xs = xss[i$]; + minLength <= (ref$ = xs.length) || (minLength = ref$); + } + for (i$ = 0; i$ < minLength; ++i$) { + i = i$; + lresult$ = []; + for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) { + xs = xss[j$]; + lresult$.push(xs[i]); + } + results$.push(lresult$); + } + return results$; +}; +zipAllWith = function(f){ + var xss, res$, i$, to$, minLength, len$, xs, ref$, i, results$ = []; + res$ = []; + for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) { + res$.push(arguments[i$]); + } + xss = res$; + minLength = undefined; + for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { + xs = xss[i$]; + minLength <= (ref$ = xs.length) || (minLength = ref$); + } + for (i$ = 0; i$ < minLength; ++i$) { + i = i$; + results$.push(f.apply(null, (fn$()))); + } + return results$; + function fn$(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) { + xs = ref$[i$]; + results$.push(xs[i]); + } + return results$; + } +}; +at = curry$(function(n, xs){ + if (n < 0) { + return xs[xs.length + n]; + } else { + return xs[n]; + } +}); +elemIndex = curry$(function(el, xs){ + var i$, len$, i, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (x === el) { + return i; + } + } +}); +elemIndices = curry$(function(el, xs){ + var i$, len$, i, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (x === el) { + results$.push(i); + } + } + return results$; +}); +findIndex = curry$(function(f, xs){ + var i$, len$, i, x; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (f(x)) { + return i; + } + } +}); +findIndices = curry$(function(f, xs){ + var i$, len$, i, x, results$ = []; + for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { + i = i$; + x = xs[i$]; + if (f(x)) { + results$.push(i); + } + } + return results$; +}); +module.exports = { + each: each, + map: map, + filter: filter, + compact: compact, + reject: reject, + remove: remove, + partition: partition, + find: find, + head: head, + first: first, + tail: tail, + last: last, + initial: initial, + empty: empty, + reverse: reverse, + difference: difference, + intersection: intersection, + union: union, + countBy: countBy, + groupBy: groupBy, + fold: fold, + fold1: fold1, + foldl: foldl, + foldl1: foldl1, + foldr: foldr, + foldr1: foldr1, + unfoldr: unfoldr, + andList: andList, + orList: orList, + any: any, + all: all, + unique: unique, + uniqueBy: uniqueBy, + sort: sort, + sortWith: sortWith, + sortBy: sortBy, + sum: sum, + product: product, + mean: mean, + average: average, + concat: concat, + concatMap: concatMap, + flatten: flatten, + maximum: maximum, + minimum: minimum, + maximumBy: maximumBy, + minimumBy: minimumBy, + scan: scan, + scan1: scan1, + scanl: scanl, + scanl1: scanl1, + scanr: scanr, + scanr1: scanr1, + slice: slice, + take: take, + drop: drop, + splitAt: splitAt, + takeWhile: takeWhile, + dropWhile: dropWhile, + span: span, + breakList: breakList, + zip: zip, + zipWith: zipWith, + zipAll: zipAll, + zipAllWith: zipAllWith, + at: at, + elemIndex: elemIndex, + elemIndices: elemIndices, + findIndex: findIndex, + findIndices: findIndices +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} +function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; +} +function compose$() { + var functions = arguments; + return function() { + var i, result; + result = functions[0].apply(this, arguments); + for (i = 1; i < functions.length; ++i) { + result = functions[i](result); + } + return result; + }; +} +function not$(x){ return !x; } \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/Num.js b/node_modules/prelude-ls/lib/Num.js new file mode 100644 index 0000000..f6b5319 --- /dev/null +++ b/node_modules/prelude-ls/lib/Num.js @@ -0,0 +1,130 @@ +// Generated by LiveScript 1.6.0 +var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm; +max = curry$(function(x$, y$){ + return x$ > y$ ? x$ : y$; +}); +min = curry$(function(x$, y$){ + return x$ < y$ ? x$ : y$; +}); +negate = function(x){ + return -x; +}; +abs = Math.abs; +signum = function(x){ + if (x < 0) { + return -1; + } else if (x > 0) { + return 1; + } else { + return 0; + } +}; +quot = curry$(function(x, y){ + return ~~(x / y); +}); +rem = curry$(function(x$, y$){ + return x$ % y$; +}); +div = curry$(function(x, y){ + return Math.floor(x / y); +}); +mod = curry$(function(x$, y$){ + var ref$; + return ((x$) % (ref$ = y$) + ref$) % ref$; +}); +recip = (function(it){ + return 1 / it; +}); +pi = Math.PI; +tau = pi * 2; +exp = Math.exp; +sqrt = Math.sqrt; +ln = Math.log; +pow = curry$(function(x$, y$){ + return Math.pow(x$, y$); +}); +sin = Math.sin; +tan = Math.tan; +cos = Math.cos; +asin = Math.asin; +acos = Math.acos; +atan = Math.atan; +atan2 = curry$(function(x, y){ + return Math.atan2(x, y); +}); +truncate = function(x){ + return ~~x; +}; +round = Math.round; +ceiling = Math.ceil; +floor = Math.floor; +isItNaN = function(x){ + return x !== x; +}; +even = function(x){ + return x % 2 === 0; +}; +odd = function(x){ + return x % 2 !== 0; +}; +gcd = curry$(function(x, y){ + var z; + x = Math.abs(x); + y = Math.abs(y); + while (y !== 0) { + z = x % y; + x = y; + y = z; + } + return x; +}); +lcm = curry$(function(x, y){ + return Math.abs(Math.floor(x / gcd(x, y) * y)); +}); +module.exports = { + max: max, + min: min, + negate: negate, + abs: abs, + signum: signum, + quot: quot, + rem: rem, + div: div, + mod: mod, + recip: recip, + pi: pi, + tau: tau, + exp: exp, + sqrt: sqrt, + ln: ln, + pow: pow, + sin: sin, + tan: tan, + cos: cos, + acos: acos, + asin: asin, + atan: atan, + atan2: atan2, + truncate: truncate, + round: round, + ceiling: ceiling, + floor: floor, + isItNaN: isItNaN, + even: even, + odd: odd, + gcd: gcd, + lcm: lcm +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/Obj.js b/node_modules/prelude-ls/lib/Obj.js new file mode 100644 index 0000000..0b8d321 --- /dev/null +++ b/node_modules/prelude-ls/lib/Obj.js @@ -0,0 +1,154 @@ +// Generated by LiveScript 1.6.0 +var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find; +values = function(object){ + var i$, x, results$ = []; + for (i$ in object) { + x = object[i$]; + results$.push(x); + } + return results$; +}; +keys = function(object){ + var x, results$ = []; + for (x in object) { + results$.push(x); + } + return results$; +}; +pairsToObj = function(object){ + var i$, len$, x, resultObj$ = {}; + for (i$ = 0, len$ = object.length; i$ < len$; ++i$) { + x = object[i$]; + resultObj$[x[0]] = x[1]; + } + return resultObj$; +}; +objToPairs = function(object){ + var key, value, results$ = []; + for (key in object) { + value = object[key]; + results$.push([key, value]); + } + return results$; +}; +listsToObj = curry$(function(keys, values){ + var i$, len$, i, key, resultObj$ = {}; + for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) { + i = i$; + key = keys[i$]; + resultObj$[key] = values[i]; + } + return resultObj$; +}); +objToLists = function(object){ + var keys, values, key, value; + keys = []; + values = []; + for (key in object) { + value = object[key]; + keys.push(key); + values.push(value); + } + return [keys, values]; +}; +empty = function(object){ + var x; + for (x in object) { + return false; + } + return true; +}; +each = curry$(function(f, object){ + var i$, x; + for (i$ in object) { + x = object[i$]; + f(x); + } + return object; +}); +map = curry$(function(f, object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + resultObj$[k] = f(x); + } + return resultObj$; +}); +compact = function(object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + if (x) { + resultObj$[k] = x; + } + } + return resultObj$; +}; +filter = curry$(function(f, object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + if (f(x)) { + resultObj$[k] = x; + } + } + return resultObj$; +}); +reject = curry$(function(f, object){ + var k, x, resultObj$ = {}; + for (k in object) { + x = object[k]; + if (!f(x)) { + resultObj$[k] = x; + } + } + return resultObj$; +}); +partition = curry$(function(f, object){ + var passed, failed, k, x; + passed = {}; + failed = {}; + for (k in object) { + x = object[k]; + (f(x) ? passed : failed)[k] = x; + } + return [passed, failed]; +}); +find = curry$(function(f, object){ + var i$, x; + for (i$ in object) { + x = object[i$]; + if (f(x)) { + return x; + } + } +}); +module.exports = { + values: values, + keys: keys, + pairsToObj: pairsToObj, + objToPairs: objToPairs, + listsToObj: listsToObj, + objToLists: objToLists, + empty: empty, + each: each, + map: map, + filter: filter, + compact: compact, + reject: reject, + partition: partition, + find: find +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/Str.js b/node_modules/prelude-ls/lib/Str.js new file mode 100644 index 0000000..59406d6 --- /dev/null +++ b/node_modules/prelude-ls/lib/Str.js @@ -0,0 +1,92 @@ +// Generated by LiveScript 1.6.0 +var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize; +split = curry$(function(sep, str){ + return str.split(sep); +}); +join = curry$(function(sep, xs){ + return xs.join(sep); +}); +lines = function(str){ + if (!str.length) { + return []; + } + return str.split('\n'); +}; +unlines = function(it){ + return it.join('\n'); +}; +words = function(str){ + if (!str.length) { + return []; + } + return str.split(/[ ]+/); +}; +unwords = function(it){ + return it.join(' '); +}; +chars = function(it){ + return it.split(''); +}; +unchars = function(it){ + return it.join(''); +}; +reverse = function(str){ + return str.split('').reverse().join(''); +}; +repeat = curry$(function(n, str){ + var result, i$; + result = ''; + for (i$ = 0; i$ < n; ++i$) { + result += str; + } + return result; +}); +capitalize = function(str){ + return str.charAt(0).toUpperCase() + str.slice(1); +}; +camelize = function(it){ + return it.replace(/[-_]+(.)?/g, function(arg$, c){ + return (c != null ? c : '').toUpperCase(); + }); +}; +dasherize = function(str){ + return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){ + return lower + "-" + (upper.length > 1 + ? upper + : upper.toLowerCase()); + }).replace(/^([A-Z]+)/, function(arg$, upper){ + if (upper.length > 1) { + return upper + "-"; + } else { + return upper.toLowerCase(); + } + }); +}; +module.exports = { + split: split, + join: join, + lines: lines, + unlines: unlines, + words: words, + unwords: unwords, + chars: chars, + unchars: unchars, + reverse: reverse, + repeat: repeat, + capitalize: capitalize, + camelize: camelize, + dasherize: dasherize +}; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/lib/index.js b/node_modules/prelude-ls/lib/index.js new file mode 100644 index 0000000..9dcbed4 --- /dev/null +++ b/node_modules/prelude-ls/lib/index.js @@ -0,0 +1,178 @@ +// Generated by LiveScript 1.6.0 +var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString; +Func = require('./Func.js'); +List = require('./List.js'); +Obj = require('./Obj.js'); +Str = require('./Str.js'); +Num = require('./Num.js'); +id = function(x){ + return x; +}; +isType = curry$(function(type, x){ + return toString$.call(x).slice(8, -1) === type; +}); +replicate = curry$(function(n, x){ + var i$, results$ = []; + for (i$ = 0; i$ < n; ++i$) { + results$.push(x); + } + return results$; +}); +Str.empty = List.empty; +Str.slice = List.slice; +Str.take = List.take; +Str.drop = List.drop; +Str.splitAt = List.splitAt; +Str.takeWhile = List.takeWhile; +Str.dropWhile = List.dropWhile; +Str.span = List.span; +Str.breakStr = List.breakList; +prelude = { + Func: Func, + List: List, + Obj: Obj, + Str: Str, + Num: Num, + id: id, + isType: isType, + replicate: replicate +}; +prelude.each = List.each; +prelude.map = List.map; +prelude.filter = List.filter; +prelude.compact = List.compact; +prelude.reject = List.reject; +prelude.partition = List.partition; +prelude.find = List.find; +prelude.head = List.head; +prelude.first = List.first; +prelude.tail = List.tail; +prelude.last = List.last; +prelude.initial = List.initial; +prelude.empty = List.empty; +prelude.reverse = List.reverse; +prelude.difference = List.difference; +prelude.intersection = List.intersection; +prelude.union = List.union; +prelude.countBy = List.countBy; +prelude.groupBy = List.groupBy; +prelude.fold = List.fold; +prelude.foldl = List.foldl; +prelude.fold1 = List.fold1; +prelude.foldl1 = List.foldl1; +prelude.foldr = List.foldr; +prelude.foldr1 = List.foldr1; +prelude.unfoldr = List.unfoldr; +prelude.andList = List.andList; +prelude.orList = List.orList; +prelude.any = List.any; +prelude.all = List.all; +prelude.unique = List.unique; +prelude.uniqueBy = List.uniqueBy; +prelude.sort = List.sort; +prelude.sortWith = List.sortWith; +prelude.sortBy = List.sortBy; +prelude.sum = List.sum; +prelude.product = List.product; +prelude.mean = List.mean; +prelude.average = List.average; +prelude.concat = List.concat; +prelude.concatMap = List.concatMap; +prelude.flatten = List.flatten; +prelude.maximum = List.maximum; +prelude.minimum = List.minimum; +prelude.maximumBy = List.maximumBy; +prelude.minimumBy = List.minimumBy; +prelude.scan = List.scan; +prelude.scanl = List.scanl; +prelude.scan1 = List.scan1; +prelude.scanl1 = List.scanl1; +prelude.scanr = List.scanr; +prelude.scanr1 = List.scanr1; +prelude.slice = List.slice; +prelude.take = List.take; +prelude.drop = List.drop; +prelude.splitAt = List.splitAt; +prelude.takeWhile = List.takeWhile; +prelude.dropWhile = List.dropWhile; +prelude.span = List.span; +prelude.breakList = List.breakList; +prelude.zip = List.zip; +prelude.zipWith = List.zipWith; +prelude.zipAll = List.zipAll; +prelude.zipAllWith = List.zipAllWith; +prelude.at = List.at; +prelude.elemIndex = List.elemIndex; +prelude.elemIndices = List.elemIndices; +prelude.findIndex = List.findIndex; +prelude.findIndices = List.findIndices; +prelude.apply = Func.apply; +prelude.curry = Func.curry; +prelude.flip = Func.flip; +prelude.fix = Func.fix; +prelude.over = Func.over; +prelude.split = Str.split; +prelude.join = Str.join; +prelude.lines = Str.lines; +prelude.unlines = Str.unlines; +prelude.words = Str.words; +prelude.unwords = Str.unwords; +prelude.chars = Str.chars; +prelude.unchars = Str.unchars; +prelude.repeat = Str.repeat; +prelude.capitalize = Str.capitalize; +prelude.camelize = Str.camelize; +prelude.dasherize = Str.dasherize; +prelude.values = Obj.values; +prelude.keys = Obj.keys; +prelude.pairsToObj = Obj.pairsToObj; +prelude.objToPairs = Obj.objToPairs; +prelude.listsToObj = Obj.listsToObj; +prelude.objToLists = Obj.objToLists; +prelude.max = Num.max; +prelude.min = Num.min; +prelude.negate = Num.negate; +prelude.abs = Num.abs; +prelude.signum = Num.signum; +prelude.quot = Num.quot; +prelude.rem = Num.rem; +prelude.div = Num.div; +prelude.mod = Num.mod; +prelude.recip = Num.recip; +prelude.pi = Num.pi; +prelude.tau = Num.tau; +prelude.exp = Num.exp; +prelude.sqrt = Num.sqrt; +prelude.ln = Num.ln; +prelude.pow = Num.pow; +prelude.sin = Num.sin; +prelude.tan = Num.tan; +prelude.cos = Num.cos; +prelude.acos = Num.acos; +prelude.asin = Num.asin; +prelude.atan = Num.atan; +prelude.atan2 = Num.atan2; +prelude.truncate = Num.truncate; +prelude.round = Num.round; +prelude.ceiling = Num.ceiling; +prelude.floor = Num.floor; +prelude.isItNaN = Num.isItNaN; +prelude.even = Num.even; +prelude.odd = Num.odd; +prelude.gcd = Num.gcd; +prelude.lcm = Num.lcm; +prelude.VERSION = '1.2.1'; +module.exports = prelude; +function curry$(f, bound){ + var context, + _curry = function(args) { + return f.length > 1 ? function(){ + var params = args ? args.concat() : []; + context = bound ? context || this : this; + return params.push.apply(params, arguments) < + f.length && arguments.length ? + _curry.call(context, params) : f.apply(context, params); + } : f; + }; + return _curry(); +} \ No newline at end of file diff --git a/node_modules/prelude-ls/package.json b/node_modules/prelude-ls/package.json new file mode 100644 index 0000000..f00c830 --- /dev/null +++ b/node_modules/prelude-ls/package.json @@ -0,0 +1,78 @@ +{ + "_from": "prelude-ls@^1.2.1", + "_id": "prelude-ls@1.2.1", + "_inBundle": false, + "_integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "_location": "/prelude-ls", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "prelude-ls@^1.2.1", + "name": "prelude-ls", + "escapedName": "prelude-ls", + "rawSpec": "^1.2.1", + "saveSpec": null, + "fetchSpec": "^1.2.1" + }, + "_requiredBy": [ + "/levn", + "/optionator", + "/type-check" + ], + "_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "_shasum": "debc6489d7a6e6b0e7611888cec880337d316396", + "_spec": "prelude-ls@^1.2.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/levn", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/prelude-ls/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", + "devDependencies": { + "browserify": "^16.5.1", + "livescript": "^1.6.0", + "mocha": "^7.1.1", + "sinon": "~8.0.1", + "uglify-js": "^3.8.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib/", + "README.md", + "LICENSE" + ], + "homepage": "http://preludels.com", + "keywords": [ + "prelude", + "livescript", + "utility", + "ls", + "coffeescript", + "javascript", + "library", + "functional", + "array", + "list", + "object", + "string" + ], + "license": "MIT", + "main": "lib/", + "name": "prelude-ls", + "repository": { + "type": "git", + "url": "git://github.com/gkz/prelude-ls.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.2.1" +} diff --git a/node_modules/progress/CHANGELOG.md b/node_modules/progress/CHANGELOG.md new file mode 100644 index 0000000..d9be0aa --- /dev/null +++ b/node_modules/progress/CHANGELOG.md @@ -0,0 +1,115 @@ + +2.0.0 / 2017-04-04 +================== + + * Fix: check before using stream.clearLine to prevent crash in Docker + * Fix: fixed output multiline on windows cmd + * Fix: Bug with array length when window is too small + * Fix: Don't clear whole line every time; instead, clear everything after end of line + * Fix: Use `this.stream` instead of `console.log` when terminating a progress bar to ensure that, if a writable stream is provided, it uses that rather than process.stdout + * Fix: Bug causing potentially stale tokens on render + * Feature: configurable cursor + * Feature: feature to interrupt the bar and display a message + * Feature: Add rate reporting to progress bar + * Improvement: Add head option to specify head character + * Improvement: Rename tickTokens to tokens + * Improvement: Change default throttle time to 16ms + * Improvement: Rename renderDelay to renderThrottle + * Improvement: Add delay between render updates + * Docs: Add example and documentation for custom token usage + * Docs: Add head option to readme + * Docs: Updated README example for public use + * Docs: Add renderThrottle option to code documentation + +1.1.7 / 2014-06-30 +================== + + * fixed a bug that occurs when a progress bar attempts to draw itself + on a console with very few columns + +1.1.6 / 2014-06-16 +================== + + * now prevents progress bar from exceeding TTY width by limiting its width to + the with of the TTY + +1.1.5 / 2014-03-25 +================== + + * updated documentation and various other repo maintenance + * updated makefile to run examples with `make` + * removed dependency on readline module + +1.1.4 / 2014-03-14 +================== + + * now supports streams, for example output progress bar to stderr, while piping + stdout + * increases performance and flicker by remembering the last drawn progress bar + +1.1.3 / 2013-12-31 +================== + + * fixes a bug where bar would bug when initializing + * allows to pass updated tokens when ticking or updating the bar + * fixes a bug where the bar would throw if skipping to far + +1.1.2 / 2013-10-17 +================== + + * lets you pass an `fmt` and a `total` instead of an options object + +1.1.0 / 2013-09-18 +================== + + * eta and elapsed tokens default to 0.0 instead of ?.? + * better JSDocs + * added back and forth example + * added method to update the progress bar to a specific percentage + * added an option to hide the bar on completion + +1.0.1 / 2013-08-07 +================== + + * on os x readline now works, reverting the terminal hack + +1.0.0 / 2013-06-18 +================== + + * remove .version + * merge pull request #15 from davglass/readline-osx + * on OSX revert back to terminal hack to avoid a readline bug + +0.1.0 / 2012-09-19 +================== + + * fixed logic bug that caused bar to jump one extra space at the end [davglass] + * working with readline impl, even on Windows [davglass] + * using readline instead of the \r hack [davglass] + +0.0.5 / 2012-08-07 +================== + + * add ability to tick by zero chunks - tick(0) + * fix ETA. Closes #4 [lwille] + +0.0.4 / 2011-11-14 +================== + + * allow more recent versions of node + +0.0.3 / 2011-04-20 +================== + + * changed; erase the line when complete + +0.0.2 / 2011-04-20 +================== + + * added custom tokens support + * fixed; clear line before writing + +0.0.1 / 2010-01-03 +================== + + * initial release diff --git a/node_modules/progress/LICENSE b/node_modules/progress/LICENSE new file mode 100644 index 0000000..4608b39 --- /dev/null +++ b/node_modules/progress/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2017 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/progress/Makefile b/node_modules/progress/Makefile new file mode 100644 index 0000000..f933be1 --- /dev/null +++ b/node_modules/progress/Makefile @@ -0,0 +1,8 @@ + +EXAMPLES = $(foreach EXAMPLE, $(wildcard examples/*.js), $(EXAMPLE)) + +.PHONY: test +test: $(EXAMPLES) + +.PHONY: $(EXAMPLES) +$(EXAMPLES): ; node $@ && echo diff --git a/node_modules/progress/Readme.md b/node_modules/progress/Readme.md new file mode 100644 index 0000000..6d4271a --- /dev/null +++ b/node_modules/progress/Readme.md @@ -0,0 +1,146 @@ +Flexible ascii progress bar. + +## Installation + +```bash +$ npm install progress +``` + +## Usage + +First we create a `ProgressBar`, giving it a format string +as well as the `total`, telling the progress bar when it will +be considered complete. After that all we need to do is `tick()` appropriately. + +```javascript +var ProgressBar = require('progress'); + +var bar = new ProgressBar(':bar', { total: 10 }); +var timer = setInterval(function () { + bar.tick(); + if (bar.complete) { + console.log('\ncomplete\n'); + clearInterval(timer); + } +}, 100); +``` + +### Options + +These are keys in the options object you can pass to the progress bar along with +`total` as seen in the example above. + +- `curr` current completed index +- `total` total number of ticks to complete +- `width` the displayed width of the progress bar defaulting to total +- `stream` the output stream defaulting to stderr +- `head` head character defaulting to complete character +- `complete` completion character defaulting to "=" +- `incomplete` incomplete character defaulting to "-" +- `renderThrottle` minimum time between updates in milliseconds defaulting to 16 +- `clear` option to clear the bar on completion defaulting to false +- `callback` optional function to call when the progress bar completes + +### Tokens + +These are tokens you can use in the format of your progress bar. + +- `:bar` the progress bar itself +- `:current` current tick number +- `:total` total ticks +- `:elapsed` time elapsed in seconds +- `:percent` completion percentage +- `:eta` estimated completion time in seconds +- `:rate` rate of ticks per second + +### Custom Tokens + +You can define custom tokens by adding a `{'name': value}` object parameter to your method (`tick()`, `update()`, etc.) calls. + +```javascript +var bar = new ProgressBar(':current: :token1 :token2', { total: 3 }) +bar.tick({ + 'token1': "Hello", + 'token2': "World!\n" +}) +bar.tick(2, { + 'token1': "Goodbye", + 'token2': "World!" +}) +``` +The above example would result in the output below. + +``` +1: Hello World! +3: Goodbye World! +``` + +## Examples + +### Download + +In our download example each tick has a variable influence, so we pass the chunk +length which adjusts the progress bar appropriately relative to the total +length. + +```javascript +var ProgressBar = require('progress'); +var https = require('https'); + +var req = https.request({ + host: 'download.github.com', + port: 443, + path: '/visionmedia-node-jscoverage-0d4608a.zip' +}); + +req.on('response', function(res){ + var len = parseInt(res.headers['content-length'], 10); + + console.log(); + var bar = new ProgressBar(' downloading [:bar] :rate/bps :percent :etas', { + complete: '=', + incomplete: ' ', + width: 20, + total: len + }); + + res.on('data', function (chunk) { + bar.tick(chunk.length); + }); + + res.on('end', function () { + console.log('\n'); + }); +}); + +req.end(); +``` + +The above example result in a progress bar like the one below. + +``` +downloading [===== ] 39/bps 29% 3.7s +``` + +### Interrupt + +To display a message during progress bar execution, use `interrupt()` +```javascript +var ProgressBar = require('progress'); + +var bar = new ProgressBar(':bar :current/:total', { total: 10 }); +var timer = setInterval(function () { + bar.tick(); + if (bar.complete) { + clearInterval(timer); + } else if (bar.curr === 5) { + bar.interrupt('this message appears above the progress bar\ncurrent progress is ' + bar.curr + '/' + bar.total); + } +}, 1000); +``` + +You can see more examples in the `examples` folder. + +## License + +MIT diff --git a/node_modules/progress/index.js b/node_modules/progress/index.js new file mode 100644 index 0000000..4449dd3 --- /dev/null +++ b/node_modules/progress/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/node-progress'); diff --git a/node_modules/progress/lib/node-progress.js b/node_modules/progress/lib/node-progress.js new file mode 100644 index 0000000..8eb0740 --- /dev/null +++ b/node_modules/progress/lib/node-progress.js @@ -0,0 +1,236 @@ +/*! + * node-progress + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Expose `ProgressBar`. + */ + +exports = module.exports = ProgressBar; + +/** + * Initialize a `ProgressBar` with the given `fmt` string and `options` or + * `total`. + * + * Options: + * + * - `curr` current completed index + * - `total` total number of ticks to complete + * - `width` the displayed width of the progress bar defaulting to total + * - `stream` the output stream defaulting to stderr + * - `head` head character defaulting to complete character + * - `complete` completion character defaulting to "=" + * - `incomplete` incomplete character defaulting to "-" + * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 + * - `callback` optional function to call when the progress bar completes + * - `clear` will clear the progress bar upon termination + * + * Tokens: + * + * - `:bar` the progress bar itself + * - `:current` current tick number + * - `:total` total ticks + * - `:elapsed` time elapsed in seconds + * - `:percent` completion percentage + * - `:eta` eta in seconds + * - `:rate` rate of ticks per second + * + * @param {string} fmt + * @param {object|number} options or total + * @api public + */ + +function ProgressBar(fmt, options) { + this.stream = options.stream || process.stderr; + + if (typeof(options) == 'number') { + var total = options; + options = {}; + options.total = total; + } else { + options = options || {}; + if ('string' != typeof fmt) throw new Error('format required'); + if ('number' != typeof options.total) throw new Error('total required'); + } + + this.fmt = fmt; + this.curr = options.curr || 0; + this.total = options.total; + this.width = options.width || this.total; + this.clear = options.clear + this.chars = { + complete : options.complete || '=', + incomplete : options.incomplete || '-', + head : options.head || (options.complete || '=') + }; + this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0; + this.lastRender = -Infinity; + this.callback = options.callback || function () {}; + this.tokens = {}; + this.lastDraw = ''; +} + +/** + * "tick" the progress bar with optional `len` and optional `tokens`. + * + * @param {number|object} len or tokens + * @param {object} tokens + * @api public + */ + +ProgressBar.prototype.tick = function(len, tokens){ + if (len !== 0) + len = len || 1; + + // swap tokens + if ('object' == typeof len) tokens = len, len = 1; + if (tokens) this.tokens = tokens; + + // start time for eta + if (0 == this.curr) this.start = new Date; + + this.curr += len + + // try to render + this.render(); + + // progress complete + if (this.curr >= this.total) { + this.render(undefined, true); + this.complete = true; + this.terminate(); + this.callback(this); + return; + } +}; + +/** + * Method to render the progress bar with optional `tokens` to place in the + * progress bar's `fmt` field. + * + * @param {object} tokens + * @api public + */ + +ProgressBar.prototype.render = function (tokens, force) { + force = force !== undefined ? force : false; + if (tokens) this.tokens = tokens; + + if (!this.stream.isTTY) return; + + var now = Date.now(); + var delta = now - this.lastRender; + if (!force && (delta < this.renderThrottle)) { + return; + } else { + this.lastRender = now; + } + + var ratio = this.curr / this.total; + ratio = Math.min(Math.max(ratio, 0), 1); + + var percent = Math.floor(ratio * 100); + var incomplete, complete, completeLength; + var elapsed = new Date - this.start; + var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); + var rate = this.curr / (elapsed / 1000); + + /* populate the bar template with percentages and timestamps */ + var str = this.fmt + .replace(':current', this.curr) + .replace(':total', this.total) + .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) + .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) + .toFixed(1)) + .replace(':percent', percent.toFixed(0) + '%') + .replace(':rate', Math.round(rate)); + + /* compute the available space (non-zero) for the bar */ + var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); + if(availableSpace && process.platform === 'win32'){ + availableSpace = availableSpace - 1; + } + + var width = Math.min(this.width, availableSpace); + + /* TODO: the following assumes the user has one ':bar' token */ + completeLength = Math.round(width * ratio); + complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); + incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); + + /* add head to the complete string */ + if(completeLength > 0) + complete = complete.slice(0, -1) + this.chars.head; + + /* fill in the actual progress bar */ + str = str.replace(':bar', complete + incomplete); + + /* replace the extra tokens */ + if (this.tokens) for (var key in this.tokens) str = str.replace(':' + key, this.tokens[key]); + + if (this.lastDraw !== str) { + this.stream.cursorTo(0); + this.stream.write(str); + this.stream.clearLine(1); + this.lastDraw = str; + } +}; + +/** + * "update" the progress bar to represent an exact percentage. + * The ratio (between 0 and 1) specified will be multiplied by `total` and + * floored, representing the closest available "tick." For example, if a + * progress bar has a length of 3 and `update(0.5)` is called, the progress + * will be set to 1. + * + * A ratio of 0.5 will attempt to set the progress to halfway. + * + * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the + * overall completion to. + * @api public + */ + +ProgressBar.prototype.update = function (ratio, tokens) { + var goal = Math.floor(ratio * this.total); + var delta = goal - this.curr; + + this.tick(delta, tokens); +}; + +/** + * "interrupt" the progress bar and write a message above it. + * @param {string} message The message to write. + * @api public + */ + +ProgressBar.prototype.interrupt = function (message) { + // clear the current line + this.stream.clearLine(); + // move the cursor to the start of the line + this.stream.cursorTo(0); + // write the message text + this.stream.write(message); + // terminate the line after writing the message + this.stream.write('\n'); + // re-display the progress bar with its lastDraw + this.stream.write(this.lastDraw); +}; + +/** + * Terminates a progress bar. + * + * @api public + */ + +ProgressBar.prototype.terminate = function () { + if (this.clear) { + if (this.stream.clearLine) { + this.stream.clearLine(); + this.stream.cursorTo(0); + } + } else { + this.stream.write('\n'); + } +}; diff --git a/node_modules/progress/package.json b/node_modules/progress/package.json new file mode 100644 index 0000000..0f19e07 --- /dev/null +++ b/node_modules/progress/package.json @@ -0,0 +1,70 @@ +{ + "_from": "progress@^2.0.0", + "_id": "progress@2.0.3", + "_inBundle": false, + "_integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "_location": "/progress", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "progress@^2.0.0", + "name": "progress", + "escapedName": "progress", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "_shasum": "7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8", + "_spec": "progress@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-progress/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Christoffer Hallas", + "email": "christoffer.hallas@gmail.com" + }, + { + "name": "Jordan Scales", + "email": "scalesjordan@gmail.com" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + }, + { + "name": "Marco Brack", + "email": "PapstDonB@Googlemail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Flexible ascii progress bar", + "engines": { + "node": ">=0.4.0" + }, + "homepage": "https://github.com/visionmedia/node-progress#readme", + "keywords": [ + "cli", + "progress" + ], + "license": "MIT", + "main": "./index.js", + "name": "progress", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/node-progress.git" + }, + "version": "2.0.3" +} diff --git a/node_modules/read-pkg-up/index.js b/node_modules/read-pkg-up/index.js new file mode 100644 index 0000000..2607976 --- /dev/null +++ b/node_modules/read-pkg-up/index.js @@ -0,0 +1,26 @@ +'use strict'; +const findUp = require('find-up'); +const readPkg = require('read-pkg'); + +module.exports = opts => { + return findUp('package.json', opts).then(fp => { + if (!fp) { + return {}; + } + + return readPkg(fp, opts).then(pkg => ({pkg, path: fp})); + }); +}; + +module.exports.sync = opts => { + const fp = findUp.sync('package.json', opts); + + if (!fp) { + return {}; + } + + return { + pkg: readPkg.sync(fp, opts), + path: fp + }; +}; diff --git a/node_modules/read-pkg-up/license b/node_modules/read-pkg-up/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/read-pkg-up/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/read-pkg-up/package.json b/node_modules/read-pkg-up/package.json new file mode 100644 index 0000000..cdc5682 --- /dev/null +++ b/node_modules/read-pkg-up/package.json @@ -0,0 +1,94 @@ +{ + "_from": "read-pkg-up@^2.0.0", + "_id": "read-pkg-up@2.0.0", + "_inBundle": false, + "_integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "_location": "/read-pkg-up", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "read-pkg-up@^2.0.0", + "name": "read-pkg-up", + "escapedName": "read-pkg-up", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/eslint-plugin-import" + ], + "_resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "_shasum": "6b72a8048984e0c41e79510fd5e9fa99b3b549be", + "_spec": "read-pkg-up@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-plugin-import", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/read-pkg-up/issues" + }, + "bundleDependencies": false, + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "deprecated": false, + "description": "Read the closest package.json file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/read-pkg-up#readme", + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "pkg", + "package", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "name": "read-pkg-up", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/read-pkg-up.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/read-pkg-up/readme.md b/node_modules/read-pkg-up/readme.md new file mode 100644 index 0000000..ba18780 --- /dev/null +++ b/node_modules/read-pkg-up/readme.md @@ -0,0 +1,80 @@ +# read-pkg-up [![Build Status](https://travis-ci.org/sindresorhus/read-pkg-up.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg-up) + +> Read the closest package.json file + + +## Why + +- [Finds the closest package.json](https://github.com/sindresorhus/find-up) +- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs) +- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom) +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + + +## Install + +``` +$ npm install --save read-pkg-up +``` + + +## Usage + +```js +const readPkgUp = require('read-pkg-up'); + +readPkgUp().then(result => { + console.log(result); + /* + { + pkg: { + name: 'awesome-package', + version: '1.0.0', + ... + }, + path: '/Users/sindresorhus/dev/awesome-package/package.json' + } + */ +}); +``` + + +## API + +### readPkgUp([options]) + +Returns a `Promise` for the result object. + +### readPkgUp.sync([options]) + +Returns the result object. + +#### options + +##### cwd + +Type: `string`
+Default: `.` + +Directory to start looking for a package.json file. + +##### normalize + +Type: `boolean`
+Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + + +## Related + +- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories +- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/read-pkg/index.js b/node_modules/read-pkg/index.js new file mode 100644 index 0000000..dff948b --- /dev/null +++ b/node_modules/read-pkg/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const loadJsonFile = require('load-json-file'); +const pathType = require('path-type'); + +module.exports = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } + + opts = opts || {}; + + return pathType.dir(fp) + .then(isDir => { + if (isDir) { + fp = path.join(fp, 'package.json'); + } + + return loadJsonFile(fp); + }) + .then(x => { + if (opts.normalize !== false) { + require('normalize-package-data')(x); + } + + return x; + }); +}; + +module.exports.sync = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } + + opts = opts || {}; + fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; + + const x = loadJsonFile.sync(fp); + + if (opts.normalize !== false) { + require('normalize-package-data')(x); + } + + return x; +}; diff --git a/node_modules/read-pkg/license b/node_modules/read-pkg/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/read-pkg/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/read-pkg/package.json b/node_modules/read-pkg/package.json new file mode 100644 index 0000000..0ef28d1 --- /dev/null +++ b/node_modules/read-pkg/package.json @@ -0,0 +1,77 @@ +{ + "_from": "read-pkg@^2.0.0", + "_id": "read-pkg@2.0.0", + "_inBundle": false, + "_integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "_location": "/read-pkg", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "read-pkg@^2.0.0", + "name": "read-pkg", + "escapedName": "read-pkg", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/read-pkg-up" + ], + "_resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "_shasum": "8ef1c0623c6a6db0dc6713c4bfac46332b2368f8", + "_spec": "read-pkg@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/read-pkg-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/read-pkg/issues" + }, + "bundleDependencies": false, + "dependencies": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "deprecated": false, + "description": "Read a package.json file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/read-pkg#readme", + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "pkg", + "package", + "normalize" + ], + "license": "MIT", + "name": "read-pkg", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/read-pkg.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/read-pkg/readme.md b/node_modules/read-pkg/readme.md new file mode 100644 index 0000000..5796008 --- /dev/null +++ b/node_modules/read-pkg/readme.md @@ -0,0 +1,79 @@ +# read-pkg [![Build Status](https://travis-ci.org/sindresorhus/read-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg) + +> Read a package.json file + + +## Why + +- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs) +- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom) +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + + +## Install + +``` +$ npm install --save read-pkg +``` + + +## Usage + +```js +const readPkg = require('read-pkg'); + +readPkg().then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); + +readPkg(__dirname).then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); + +readPkg(path.join('unicorn', 'package.json')).then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); +``` + + +## API + +### readPkg([path], [options]) + +Returns a `Promise` for the parsed JSON. + +### readPkg.sync([path], [options]) + +Returns the parsed JSON. + +#### path + +Type: `string`
+Default: `.` + +Path to a `package.json` file or its directory. + +#### options + +##### normalize + +Type: `boolean`
+Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + + +## Related + +- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file +- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file +- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/regexpp/LICENSE b/node_modules/regexpp/LICENSE new file mode 100644 index 0000000..883ee1f --- /dev/null +++ b/node_modules/regexpp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Toru Nagashima + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/regexpp/README.md b/node_modules/regexpp/README.md new file mode 100644 index 0000000..a5e2e14 --- /dev/null +++ b/node_modules/regexpp/README.md @@ -0,0 +1,178 @@ +# regexpp + +[![npm version](https://img.shields.io/npm/v/regexpp.svg)](https://www.npmjs.com/package/regexpp) +[![Downloads/month](https://img.shields.io/npm/dm/regexpp.svg)](http://www.npmtrends.com/regexpp) +[![Build Status](https://github.com/mysticatea/regexpp/workflows/CI/badge.svg)](https://github.com/mysticatea/regexpp/actions) +[![codecov](https://codecov.io/gh/mysticatea/regexpp/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/regexpp) +[![Dependency Status](https://david-dm.org/mysticatea/regexpp.svg)](https://david-dm.org/mysticatea/regexpp) + +A regular expression parser for ECMAScript. + +## 💿 Installation + +```bash +$ npm install regexpp +``` + +- require Node.js 8 or newer. + +## 📖 Usage + +```ts +import { + AST, + RegExpParser, + RegExpValidator, + RegExpVisitor, + parseRegExpLiteral, + validateRegExpLiteral, + visitRegExpAST +} from "regexpp" +``` + +### parseRegExpLiteral(source, options?) + +Parse a given regular expression literal then make AST object. + +This is equivalent to `new RegExpParser(options).parseLiteral(source)`. + +- **Parameters:** + - `source` (`string | RegExp`) The source code to parse. + - `options?` ([`RegExpParser.Options`]) The options to parse. +- **Return:** + - The AST of the regular expression. + +### validateRegExpLiteral(source, options?) + +Validate a given regular expression literal. + +This is equivalent to `new RegExpValidator(options).validateLiteral(source)`. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `options?` ([`RegExpValidator.Options`]) The options to validate. + +### visitRegExpAST(ast, handlers) + +Visit each node of a given AST. + +This is equivalent to `new RegExpVisitor(handlers).visit(ast)`. + +- **Parameters:** + - `ast` ([`AST.Node`]) The AST to visit. + - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. + +### RegExpParser + +#### new RegExpParser(options?) + +- **Parameters:** + - `options?` ([`RegExpParser.Options`]) The options to parse. + +#### parser.parseLiteral(source, start?, end?) + +Parse a regular expression literal. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"/abc/g"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. +- **Return:** + - The AST of the regular expression. + +#### parser.parsePattern(source, start?, end?, uFlag?) + +Parse a regular expression pattern. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"abc"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + - `uFlag?` (`boolean`) The flag to enable Unicode mode. +- **Return:** + - The AST of the regular expression pattern. + +#### parser.parseFlags(source, start?, end?) + +Parse a regular expression flags. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"gim"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. +- **Return:** + - The AST of the regular expression flags. + +### RegExpValidator + +#### new RegExpValidator(options) + +- **Parameters:** + - `options` ([`RegExpValidator.Options`]) The options to validate. + +#### validator.validateLiteral(source, start, end) + +Validate a regular expression literal. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + +#### validator.validatePattern(source, start, end, uFlag) + +Validate a regular expression pattern. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + - `uFlag?` (`boolean`) The flag to enable Unicode mode. + +#### validator.validateFlags(source, start, end) + +Validate a regular expression flags. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + +### RegExpVisitor + +#### new RegExpVisitor(handlers) + +- **Parameters:** + - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. + +#### visitor.visit(ast) + +Validate a regular expression literal. + +- **Parameters:** + - `ast` ([`AST.Node`]) The AST to visit. + +## 📰 Changelog + +- [GitHub Releases](https://github.com/mysticatea/regexpp/releases) + +## 🍻 Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`. +- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`. +- `npm run lint` runs ESLint. +- `npm run update:test` updates test fixtures. +- `npm run update:ids` updates `src/unicode/ids.ts`. +- `npm run watch` runs tests with `--watch` option. + +[`AST.Node`]: src/ast.ts#L4 +[`RegExpParser.Options`]: src/parser.ts#L539 +[`RegExpValidator.Options`]: src/validator.ts#L127 +[`RegExpVisitor.Handlers`]: src/visitor.ts#L204 diff --git a/node_modules/regexpp/index.d.ts b/node_modules/regexpp/index.d.ts new file mode 100644 index 0000000..7943c63 --- /dev/null +++ b/node_modules/regexpp/index.d.ts @@ -0,0 +1,247 @@ +// Generated by dts-bundle v0.7.3 + +declare module 'regexpp' { + import * as AST from "regexpp/ast"; + import { RegExpParser } from "regexpp/parser"; + import { RegExpValidator } from "regexpp/validator"; + import { RegExpVisitor } from "regexpp/visitor"; + export { AST, RegExpParser, RegExpValidator }; + export function parseRegExpLiteral(source: string | RegExp, options?: RegExpParser.Options): AST.RegExpLiteral; + export function validateRegExpLiteral(source: string, options?: RegExpValidator.Options): void; + export function visitRegExpAST(node: AST.Node, handlers: RegExpVisitor.Handlers): void; +} + +declare module 'regexpp/ast' { + export type Node = BranchNode | LeafNode; + export type BranchNode = RegExpLiteral | Pattern | Alternative | Group | CapturingGroup | Quantifier | CharacterClass | LookaroundAssertion | CharacterClassRange; + export type LeafNode = BoundaryAssertion | CharacterSet | Character | Backreference | Flags; + export type Element = Assertion | Quantifier | QuantifiableElement; + export type QuantifiableElement = Group | CapturingGroup | CharacterClass | CharacterSet | Character | Backreference | LookaheadAssertion; + export type CharacterClassElement = EscapeCharacterSet | UnicodePropertyCharacterSet | Character | CharacterClassRange; + export interface NodeBase { + type: Node["type"]; + parent: Node["parent"]; + start: number; + end: number; + raw: string; + } + export interface RegExpLiteral extends NodeBase { + type: "RegExpLiteral"; + parent: null; + pattern: Pattern; + flags: Flags; + } + export interface Pattern extends NodeBase { + type: "Pattern"; + parent: RegExpLiteral | null; + alternatives: Alternative[]; + } + export interface Alternative extends NodeBase { + type: "Alternative"; + parent: Pattern | Group | CapturingGroup | LookaroundAssertion; + elements: Element[]; + } + export interface Group extends NodeBase { + type: "Group"; + parent: Alternative | Quantifier; + alternatives: Alternative[]; + } + export interface CapturingGroup extends NodeBase { + type: "CapturingGroup"; + parent: Alternative | Quantifier; + name: string | null; + alternatives: Alternative[]; + references: Backreference[]; + } + export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion; + export interface LookaheadAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative | Quantifier; + kind: "lookahead"; + negate: boolean; + alternatives: Alternative[]; + } + export interface LookbehindAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative; + kind: "lookbehind"; + negate: boolean; + alternatives: Alternative[]; + } + export interface Quantifier extends NodeBase { + type: "Quantifier"; + parent: Alternative; + min: number; + max: number; + greedy: boolean; + element: QuantifiableElement; + } + export interface CharacterClass extends NodeBase { + type: "CharacterClass"; + parent: Alternative | Quantifier; + negate: boolean; + elements: CharacterClassElement[]; + } + export interface CharacterClassRange extends NodeBase { + type: "CharacterClassRange"; + parent: CharacterClass; + min: Character; + max: Character; + } + export type Assertion = BoundaryAssertion | LookaroundAssertion; + export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion; + export interface EdgeAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative | Quantifier; + kind: "start" | "end"; + } + export interface WordBoundaryAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative | Quantifier; + kind: "word"; + negate: boolean; + } + export type CharacterSet = AnyCharacterSet | EscapeCharacterSet | UnicodePropertyCharacterSet; + export interface AnyCharacterSet extends NodeBase { + type: "CharacterSet"; + parent: Alternative | Quantifier; + kind: "any"; + } + export interface EscapeCharacterSet extends NodeBase { + type: "CharacterSet"; + parent: Alternative | Quantifier | CharacterClass; + kind: "digit" | "space" | "word"; + negate: boolean; + } + export interface UnicodePropertyCharacterSet extends NodeBase { + type: "CharacterSet"; + parent: Alternative | Quantifier | CharacterClass; + kind: "property"; + key: string; + value: string | null; + negate: boolean; + } + export interface Character extends NodeBase { + type: "Character"; + parent: Alternative | Quantifier | CharacterClass | CharacterClassRange; + value: number; + } + export interface Backreference extends NodeBase { + type: "Backreference"; + parent: Alternative | Quantifier; + ref: number | string; + resolved: CapturingGroup; + } + export interface Flags extends NodeBase { + type: "Flags"; + parent: RegExpLiteral | null; + dotAll: boolean; + global: boolean; + ignoreCase: boolean; + multiline: boolean; + sticky: boolean; + unicode: boolean; + } +} + +declare module 'regexpp/parser' { + import { Flags, RegExpLiteral, Pattern } from "regexpp/ast"; + import { EcmaVersion } from "regexpp/ecma-versions"; + export namespace RegExpParser { + interface Options { + strict?: boolean; + ecmaVersion?: EcmaVersion; + } + } + export class RegExpParser { + constructor(options?: RegExpParser.Options); + parseLiteral(source: string, start?: number, end?: number): RegExpLiteral; + parseFlags(source: string, start?: number, end?: number): Flags; + parsePattern(source: string, start?: number, end?: number, uFlag?: boolean): Pattern; + } +} + +declare module 'regexpp/validator' { + import { EcmaVersion } from "regexpp/ecma-versions"; + export namespace RegExpValidator { + interface Options { + strict?: boolean; + ecmaVersion?: EcmaVersion; + onLiteralEnter?(start: number): void; + onLiteralLeave?(start: number, end: number): void; + onFlags?(start: number, end: number, global: boolean, ignoreCase: boolean, multiline: boolean, unicode: boolean, sticky: boolean, dotAll: boolean): void; + onPatternEnter?(start: number): void; + onPatternLeave?(start: number, end: number): void; + onDisjunctionEnter?(start: number): void; + onDisjunctionLeave?(start: number, end: number): void; + onAlternativeEnter?(start: number, index: number): void; + onAlternativeLeave?(start: number, end: number, index: number): void; + onGroupEnter?(start: number): void; + onGroupLeave?(start: number, end: number): void; + onCapturingGroupEnter?(start: number, name: string | null): void; + onCapturingGroupLeave?(start: number, end: number, name: string | null): void; + onQuantifier?(start: number, end: number, min: number, max: number, greedy: boolean): void; + onLookaroundAssertionEnter?(start: number, kind: "lookahead" | "lookbehind", negate: boolean): void; + onLookaroundAssertionLeave?(start: number, end: number, kind: "lookahead" | "lookbehind", negate: boolean): void; + onEdgeAssertion?(start: number, end: number, kind: "start" | "end"): void; + onWordBoundaryAssertion?(start: number, end: number, kind: "word", negate: boolean): void; + onAnyCharacterSet?(start: number, end: number, kind: "any"): void; + onEscapeCharacterSet?(start: number, end: number, kind: "digit" | "space" | "word", negate: boolean): void; + onUnicodePropertyCharacterSet?(start: number, end: number, kind: "property", key: string, value: string | null, negate: boolean): void; + onCharacter?(start: number, end: number, value: number): void; + onBackreference?(start: number, end: number, ref: number | string): void; + onCharacterClassEnter?(start: number, negate: boolean): void; + onCharacterClassLeave?(start: number, end: number, negate: boolean): void; + onCharacterClassRange?(start: number, end: number, min: number, max: number): void; + } + } + export class RegExpValidator { + constructor(options?: RegExpValidator.Options); + validateLiteral(source: string, start?: number, end?: number): void; + validateFlags(source: string, start?: number, end?: number): void; + validatePattern(source: string, start?: number, end?: number, uFlag?: boolean): void; + } +} + +declare module 'regexpp/visitor' { + import { Alternative, Assertion, Backreference, CapturingGroup, Character, CharacterClass, CharacterClassRange, CharacterSet, Flags, Group, Node, Pattern, Quantifier, RegExpLiteral } from "regexpp/ast"; + export class RegExpVisitor { + constructor(handlers: RegExpVisitor.Handlers); + visit(node: Node): void; + } + export namespace RegExpVisitor { + interface Handlers { + onAlternativeEnter?(node: Alternative): void; + onAlternativeLeave?(node: Alternative): void; + onAssertionEnter?(node: Assertion): void; + onAssertionLeave?(node: Assertion): void; + onBackreferenceEnter?(node: Backreference): void; + onBackreferenceLeave?(node: Backreference): void; + onCapturingGroupEnter?(node: CapturingGroup): void; + onCapturingGroupLeave?(node: CapturingGroup): void; + onCharacterEnter?(node: Character): void; + onCharacterLeave?(node: Character): void; + onCharacterClassEnter?(node: CharacterClass): void; + onCharacterClassLeave?(node: CharacterClass): void; + onCharacterClassRangeEnter?(node: CharacterClassRange): void; + onCharacterClassRangeLeave?(node: CharacterClassRange): void; + onCharacterSetEnter?(node: CharacterSet): void; + onCharacterSetLeave?(node: CharacterSet): void; + onFlagsEnter?(node: Flags): void; + onFlagsLeave?(node: Flags): void; + onGroupEnter?(node: Group): void; + onGroupLeave?(node: Group): void; + onPatternEnter?(node: Pattern): void; + onPatternLeave?(node: Pattern): void; + onQuantifierEnter?(node: Quantifier): void; + onQuantifierLeave?(node: Quantifier): void; + onRegExpLiteralEnter?(node: RegExpLiteral): void; + onRegExpLiteralLeave?(node: RegExpLiteral): void; + } + } +} + +declare module 'regexpp/ecma-versions' { + export type EcmaVersion = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020; +} + diff --git a/node_modules/regexpp/index.js b/node_modules/regexpp/index.js new file mode 100644 index 0000000..12b4a5f --- /dev/null +++ b/node_modules/regexpp/index.js @@ -0,0 +1,2085 @@ +/*! @author Toru Nagashima */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + + + +var ast = /*#__PURE__*/Object.freeze({ + +}); + +let largeIdStartRanges = undefined; +let largeIdContinueRanges = undefined; +function isIdStart(cp) { + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp); +} +function isIdContinue(cp) { + if (cp < 0x30) + return false; + if (cp < 0x3a) + return true; + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp === 0x5f) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp) || isLargeIdContinue(cp); +} +function isLargeIdStart(cp) { + return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); +} +function isLargeIdContinue(cp) { + return isInRange(cp, largeIdContinueRanges || + (largeIdContinueRanges = initLargeIdContinueRanges())); +} +function initLargeIdStartRanges() { + return restoreRanges("170 0 11 0 5 0 6 22 2 30 2 457 5 11 15 4 8 0 2 0 130 4 2 1 3 3 2 0 7 0 2 2 2 0 2 19 2 82 2 138 9 165 2 37 3 0 7 40 72 26 5 3 46 42 36 1 2 98 2 0 16 1 8 1 11 2 3 0 17 0 2 29 30 88 12 0 25 32 10 1 5 0 6 21 5 0 10 0 4 0 24 24 8 10 54 20 2 17 61 53 4 0 19 0 8 9 16 15 5 7 3 1 3 21 2 6 2 0 4 3 4 0 17 0 14 1 2 2 15 1 11 0 9 5 5 1 3 21 2 6 2 1 2 1 2 1 32 3 2 0 20 2 17 8 2 2 2 21 2 6 2 1 2 4 4 0 19 0 16 1 24 0 12 7 3 1 3 21 2 6 2 1 2 4 4 0 31 1 2 2 16 0 18 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 11 23 0 53 7 2 2 2 22 2 15 4 0 27 2 6 1 31 0 5 7 2 2 2 22 2 9 2 4 4 0 33 0 2 1 16 1 18 8 2 2 2 40 3 0 17 0 6 2 9 2 25 5 6 17 4 23 2 8 2 0 3 6 59 47 2 1 13 6 59 1 2 0 2 4 2 23 2 0 2 9 2 1 10 0 3 4 2 0 22 3 33 0 64 7 2 35 28 4 116 42 21 0 17 5 5 3 4 0 4 1 8 2 5 12 13 0 18 37 2 0 6 0 3 42 2 332 2 3 3 6 2 0 2 3 3 40 2 3 3 32 2 3 3 6 2 0 2 3 3 14 2 56 2 3 3 66 38 15 17 85 3 5 4 619 3 16 2 25 6 74 4 10 8 12 2 3 15 17 15 17 15 12 2 2 16 51 36 0 5 0 68 88 8 40 2 0 6 69 11 30 50 29 3 4 12 43 5 25 55 22 10 52 83 0 94 46 18 6 56 29 14 1 11 43 27 35 42 2 11 35 3 8 8 42 3 2 42 3 2 5 2 1 4 0 6 191 65 277 3 5 3 37 3 5 3 7 2 0 2 0 2 0 2 30 3 52 2 6 2 0 4 2 2 6 4 3 3 5 5 12 6 2 2 6 117 0 14 0 17 12 102 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 15 3 3 6 4 5 0 18 40 2680 46 2 46 2 132 7 3 4 1 13 37 2 0 6 0 3 55 8 0 17 22 10 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 551 2 26 8 8 4 3 4 5 85 5 4 2 89 2 3 6 42 2 93 18 31 49 15 513 6591 65 20988 4 1164 68 45 3 268 4 15 11 1 21 46 17 30 3 79 40 8 3 102 3 52 3 8 43 12 2 2 2 3 2 22 30 51 15 49 63 5 4 0 2 1 12 27 11 22 26 28 8 46 29 0 17 4 2 9 11 4 2 40 24 2 2 7 21 22 4 0 4 49 2 0 4 1 3 4 3 0 2 0 25 2 3 10 8 2 13 5 3 5 3 5 10 6 2 6 2 42 2 13 7 114 30 11171 13 22 5 48 8453 365 3 105 39 6 13 4 6 0 2 9 2 12 2 4 2 0 2 1 2 1 2 107 34 362 19 63 3 53 41 11 117 4 2 134 37 25 7 25 12 88 4 5 3 5 3 5 3 2 36 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"); +} +function initLargeIdContinueRanges() { + return restoreRanges("183 0 585 111 24 0 252 4 266 44 2 0 2 1 2 1 2 0 73 10 49 30 7 0 102 6 3 5 3 1 2 3 3 9 24 0 31 26 92 10 16 9 34 8 10 0 25 3 2 8 2 2 2 4 44 2 120 14 2 32 55 2 2 17 2 6 11 1 3 9 18 2 57 0 2 6 3 1 3 2 10 0 11 1 3 9 15 0 3 2 57 0 2 4 5 1 3 2 4 0 21 11 4 0 12 2 57 0 2 7 2 2 2 2 21 1 3 9 11 5 2 2 57 0 2 6 3 1 3 2 8 2 11 1 3 9 19 0 60 4 4 2 2 3 10 0 15 9 17 4 58 6 2 2 2 3 8 1 12 1 3 9 18 2 57 0 2 6 2 2 2 3 8 1 12 1 3 9 17 3 56 1 2 6 2 2 2 3 10 0 11 1 3 9 18 2 71 0 5 5 2 0 2 7 7 9 3 1 62 0 3 6 13 7 2 9 88 0 3 8 12 5 3 9 63 1 7 9 12 0 2 0 2 0 5 1 50 19 2 1 6 10 2 35 10 0 101 19 2 9 13 3 5 2 2 2 3 6 4 3 14 11 2 14 704 2 10 8 929 2 30 2 30 1 31 1 65 31 10 0 3 9 34 2 3 9 144 0 119 11 5 11 11 9 129 10 61 4 58 9 2 28 3 10 7 9 23 13 2 1 64 4 48 16 12 9 18 8 13 2 31 12 3 9 45 13 49 19 9 9 7 9 119 2 2 20 5 0 7 0 3 2 199 57 2 4 576 1 20 0 124 12 5 0 4 11 3071 2 142 0 97 31 555 5 106 1 30086 9 70 0 5 9 33 1 81 1 273 0 4 0 5 0 24 4 5 0 84 1 51 17 11 9 7 17 14 10 29 7 26 12 45 3 48 13 16 9 12 0 11 9 48 13 13 0 9 1 3 9 34 2 51 0 2 2 3 1 6 1 2 0 42 4 6 1 237 7 2 1 3 9 20261 0 738 15 17 15 4 1 25 2 193 9 38 0 702 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 isInRange(cp, ranges) { + let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; + while (l < r) { + i = ((l + r) / 2) | 0; + min = ranges[2 * i]; + max = ranges[2 * i + 1]; + if (cp < min) { + r = i; + } + else if (cp > max) { + l = i + 1; + } + else { + return true; + } + } + return false; +} +function restoreRanges(data) { + let last = 0; + return data.split(" ").map(s => (last += parseInt(s, 10) | 0)); +} + +class DataSet { + constructor(raw2018, raw2019, raw2020) { + this._raw2018 = raw2018; + this._raw2019 = raw2019; + this._raw2020 = raw2020; + } + get es2018() { + return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); + } + get es2019() { + return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); + } + get es2020() { + return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); + } +} +const gcNameSet = new Set(["General_Category", "gc"]); +const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); +const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", ""); +const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho"); +const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", ""); +function isValidUnicodeProperty(version, name, value) { + if (gcNameSet.has(name)) { + return version >= 2018 && gcValueSets.es2018.has(value); + } + if (scNameSet.has(name)) { + return ((version >= 2018 && scValueSets.es2018.has(value)) || + (version >= 2019 && scValueSets.es2019.has(value)) || + (version >= 2020 && scValueSets.es2020.has(value))); + } + return false; +} +function isValidLoneUnicodeProperty(version, value) { + return ((version >= 2018 && binPropertySets.es2018.has(value)) || + (version >= 2019 && binPropertySets.es2019.has(value))); +} + +const Backspace = 0x08; +const CharacterTabulation = 0x09; +const LineFeed = 0x0a; +const LineTabulation = 0x0b; +const FormFeed = 0x0c; +const CarriageReturn = 0x0d; +const ExclamationMark = 0x21; +const DollarSign = 0x24; +const LeftParenthesis = 0x28; +const RightParenthesis = 0x29; +const Asterisk = 0x2a; +const PlusSign = 0x2b; +const Comma = 0x2c; +const HyphenMinus = 0x2d; +const FullStop = 0x2e; +const Solidus = 0x2f; +const DigitZero = 0x30; +const DigitOne = 0x31; +const DigitSeven = 0x37; +const DigitNine = 0x39; +const Colon = 0x3a; +const LessThanSign = 0x3c; +const EqualsSign = 0x3d; +const GreaterThanSign = 0x3e; +const QuestionMark = 0x3f; +const LatinCapitalLetterA = 0x41; +const LatinCapitalLetterB = 0x42; +const LatinCapitalLetterD = 0x44; +const LatinCapitalLetterF = 0x46; +const LatinCapitalLetterP = 0x50; +const LatinCapitalLetterS = 0x53; +const LatinCapitalLetterW = 0x57; +const LatinCapitalLetterZ = 0x5a; +const LowLine = 0x5f; +const LatinSmallLetterA = 0x61; +const LatinSmallLetterB = 0x62; +const LatinSmallLetterC = 0x63; +const LatinSmallLetterD = 0x64; +const LatinSmallLetterF = 0x66; +const LatinSmallLetterG = 0x67; +const LatinSmallLetterI = 0x69; +const LatinSmallLetterK = 0x6b; +const LatinSmallLetterM = 0x6d; +const LatinSmallLetterN = 0x6e; +const LatinSmallLetterP = 0x70; +const LatinSmallLetterR = 0x72; +const LatinSmallLetterS = 0x73; +const LatinSmallLetterT = 0x74; +const LatinSmallLetterU = 0x75; +const LatinSmallLetterV = 0x76; +const LatinSmallLetterW = 0x77; +const LatinSmallLetterX = 0x78; +const LatinSmallLetterY = 0x79; +const LatinSmallLetterZ = 0x7a; +const LeftSquareBracket = 0x5b; +const ReverseSolidus = 0x5c; +const RightSquareBracket = 0x5d; +const CircumflexAccent = 0x5e; +const LeftCurlyBracket = 0x7b; +const VerticalLine = 0x7c; +const RightCurlyBracket = 0x7d; +const ZeroWidthNonJoiner = 0x200c; +const ZeroWidthJoiner = 0x200d; +const LineSeparator = 0x2028; +const ParagraphSeparator = 0x2029; +const MinCodePoint = 0x00; +const MaxCodePoint = 0x10ffff; +function isLatinLetter(code) { + return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || + (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); +} +function isDecimalDigit(code) { + return code >= DigitZero && code <= DigitNine; +} +function isOctalDigit(code) { + return code >= DigitZero && code <= DigitSeven; +} +function isHexDigit(code) { + return ((code >= DigitZero && code <= DigitNine) || + (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || + (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); +} +function isLineTerminator(code) { + return (code === LineFeed || + code === CarriageReturn || + code === LineSeparator || + code === ParagraphSeparator); +} +function isValidUnicode(code) { + return code >= MinCodePoint && code <= MaxCodePoint; +} +function digitToInt(code) { + if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { + return code - LatinSmallLetterA + 10; + } + if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { + return code - LatinCapitalLetterA + 10; + } + return code - DigitZero; +} +function isLeadSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +function combineSurrogatePair(lead, trail) { + return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; +} + +const legacyImpl = { + at(s, end, i) { + return i < end ? s.charCodeAt(i) : -1; + }, + width(c) { + return 1; + }, +}; +const unicodeImpl = { + at(s, end, i) { + return i < end ? s.codePointAt(i) : -1; + }, + width(c) { + return c > 0xffff ? 2 : 1; + }, +}; +class Reader { + constructor() { + this._impl = legacyImpl; + this._s = ""; + this._i = 0; + this._end = 0; + this._cp1 = -1; + this._w1 = 1; + this._cp2 = -1; + this._w2 = 1; + this._cp3 = -1; + this._w3 = 1; + this._cp4 = -1; + } + get source() { + return this._s; + } + get index() { + return this._i; + } + get currentCodePoint() { + return this._cp1; + } + get nextCodePoint() { + return this._cp2; + } + get nextCodePoint2() { + return this._cp3; + } + get nextCodePoint3() { + return this._cp4; + } + reset(source, start, end, uFlag) { + this._impl = uFlag ? unicodeImpl : legacyImpl; + this._s = source; + this._end = end; + this.rewind(start); + } + rewind(index) { + const impl = this._impl; + this._i = index; + this._cp1 = impl.at(this._s, this._end, index); + this._w1 = impl.width(this._cp1); + this._cp2 = impl.at(this._s, this._end, index + this._w1); + this._w2 = impl.width(this._cp2); + this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); + } + advance() { + if (this._cp1 !== -1) { + const impl = this._impl; + this._i += this._w1; + this._cp1 = this._cp2; + this._w1 = this._w2; + this._cp2 = this._cp3; + this._w2 = impl.width(this._cp2); + this._cp3 = this._cp4; + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); + } + } + eat(cp) { + if (this._cp1 === cp) { + this.advance(); + return true; + } + return false; + } + eat2(cp1, cp2) { + if (this._cp1 === cp1 && this._cp2 === cp2) { + this.advance(); + this.advance(); + return true; + } + return false; + } + eat3(cp1, cp2, cp3) { + if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { + this.advance(); + this.advance(); + this.advance(); + return true; + } + return false; + } +} + +class RegExpSyntaxError extends SyntaxError { + constructor(source, uFlag, index, message) { + if (source) { + if (!source.startsWith("/")) { + source = `/${source}/${uFlag ? "u" : ""}`; + } + source = `: ${source}`; + } + super(`Invalid regular expression${source}: ${message}`); + this.index = index; + } +} + +function isSyntaxCharacter(cp) { + return (cp === CircumflexAccent || + cp === DollarSign || + cp === ReverseSolidus || + cp === FullStop || + cp === Asterisk || + cp === PlusSign || + cp === QuestionMark || + cp === LeftParenthesis || + cp === RightParenthesis || + cp === LeftSquareBracket || + cp === RightSquareBracket || + cp === LeftCurlyBracket || + cp === RightCurlyBracket || + cp === VerticalLine); +} +function isRegExpIdentifierStart(cp) { + return isIdStart(cp) || cp === DollarSign || cp === LowLine; +} +function isRegExpIdentifierPart(cp) { + return (isIdContinue(cp) || + cp === DollarSign || + cp === LowLine || + cp === ZeroWidthNonJoiner || + cp === ZeroWidthJoiner); +} +function isUnicodePropertyNameCharacter(cp) { + return isLatinLetter(cp) || cp === LowLine; +} +function isUnicodePropertyValueCharacter(cp) { + return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); +} +class RegExpValidator { + constructor(options) { + this._reader = new Reader(); + this._uFlag = false; + this._nFlag = false; + this._lastIntValue = 0; + this._lastMinValue = 0; + this._lastMaxValue = 0; + this._lastStrValue = ""; + this._lastKeyValue = ""; + this._lastValValue = ""; + this._lastAssertionIsQuantifiable = false; + this._numCapturingParens = 0; + this._groupNames = new Set(); + this._backreferenceNames = new Set(); + this._options = options || {}; + } + validateLiteral(source, start = 0, end = source.length) { + this._uFlag = this._nFlag = false; + this.reset(source, start, end); + this.onLiteralEnter(start); + if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { + const flagStart = this.index; + const uFlag = source.includes("u", flagStart); + this.validateFlags(source, flagStart, end); + this.validatePattern(source, start + 1, flagStart - 1, uFlag); + } + else if (start >= end) { + this.raise("Empty"); + } + else { + const c = String.fromCodePoint(this.currentCodePoint); + this.raise(`Unexpected character '${c}'`); + } + this.onLiteralLeave(start, end); + } + validateFlags(source, start = 0, end = source.length) { + const existingFlags = new Set(); + let global = false; + let ignoreCase = false; + let multiline = false; + let sticky = false; + let unicode = false; + let dotAll = false; + for (let i = start; i < end; ++i) { + const flag = source.charCodeAt(i); + if (existingFlags.has(flag)) { + this.raise(`Duplicated flag '${source[i]}'`); + } + existingFlags.add(flag); + if (flag === LatinSmallLetterG) { + global = true; + } + else if (flag === LatinSmallLetterI) { + ignoreCase = true; + } + else if (flag === LatinSmallLetterM) { + multiline = true; + } + else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { + unicode = true; + } + else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { + sticky = true; + } + else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { + dotAll = true; + } + else { + this.raise(`Invalid flag '${source[i]}'`); + } + } + this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + } + validatePattern(source, start = 0, end = source.length, uFlag = false) { + this._uFlag = uFlag && this.ecmaVersion >= 2015; + this._nFlag = uFlag && this.ecmaVersion >= 2018; + this.reset(source, start, end); + this.consumePattern(); + if (!this._nFlag && + this.ecmaVersion >= 2018 && + this._groupNames.size > 0) { + this._nFlag = true; + this.rewind(start); + this.consumePattern(); + } + } + get strict() { + return Boolean(this._options.strict || this._uFlag); + } + get ecmaVersion() { + return this._options.ecmaVersion || 2020; + } + onLiteralEnter(start) { + if (this._options.onLiteralEnter) { + this._options.onLiteralEnter(start); + } + } + onLiteralLeave(start, end) { + if (this._options.onLiteralLeave) { + this._options.onLiteralLeave(start, end); + } + } + onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + if (this._options.onFlags) { + this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + } + } + onPatternEnter(start) { + if (this._options.onPatternEnter) { + this._options.onPatternEnter(start); + } + } + onPatternLeave(start, end) { + if (this._options.onPatternLeave) { + this._options.onPatternLeave(start, end); + } + } + onDisjunctionEnter(start) { + if (this._options.onDisjunctionEnter) { + this._options.onDisjunctionEnter(start); + } + } + onDisjunctionLeave(start, end) { + if (this._options.onDisjunctionLeave) { + this._options.onDisjunctionLeave(start, end); + } + } + onAlternativeEnter(start, index) { + if (this._options.onAlternativeEnter) { + this._options.onAlternativeEnter(start, index); + } + } + onAlternativeLeave(start, end, index) { + if (this._options.onAlternativeLeave) { + this._options.onAlternativeLeave(start, end, index); + } + } + onGroupEnter(start) { + if (this._options.onGroupEnter) { + this._options.onGroupEnter(start); + } + } + onGroupLeave(start, end) { + if (this._options.onGroupLeave) { + this._options.onGroupLeave(start, end); + } + } + onCapturingGroupEnter(start, name) { + if (this._options.onCapturingGroupEnter) { + this._options.onCapturingGroupEnter(start, name); + } + } + onCapturingGroupLeave(start, end, name) { + if (this._options.onCapturingGroupLeave) { + this._options.onCapturingGroupLeave(start, end, name); + } + } + onQuantifier(start, end, min, max, greedy) { + if (this._options.onQuantifier) { + this._options.onQuantifier(start, end, min, max, greedy); + } + } + onLookaroundAssertionEnter(start, kind, negate) { + if (this._options.onLookaroundAssertionEnter) { + this._options.onLookaroundAssertionEnter(start, kind, negate); + } + } + onLookaroundAssertionLeave(start, end, kind, negate) { + if (this._options.onLookaroundAssertionLeave) { + this._options.onLookaroundAssertionLeave(start, end, kind, negate); + } + } + onEdgeAssertion(start, end, kind) { + if (this._options.onEdgeAssertion) { + this._options.onEdgeAssertion(start, end, kind); + } + } + onWordBoundaryAssertion(start, end, kind, negate) { + if (this._options.onWordBoundaryAssertion) { + this._options.onWordBoundaryAssertion(start, end, kind, negate); + } + } + onAnyCharacterSet(start, end, kind) { + if (this._options.onAnyCharacterSet) { + this._options.onAnyCharacterSet(start, end, kind); + } + } + onEscapeCharacterSet(start, end, kind, negate) { + if (this._options.onEscapeCharacterSet) { + this._options.onEscapeCharacterSet(start, end, kind, negate); + } + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { + if (this._options.onUnicodePropertyCharacterSet) { + this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate); + } + } + onCharacter(start, end, value) { + if (this._options.onCharacter) { + this._options.onCharacter(start, end, value); + } + } + onBackreference(start, end, ref) { + if (this._options.onBackreference) { + this._options.onBackreference(start, end, ref); + } + } + onCharacterClassEnter(start, negate) { + if (this._options.onCharacterClassEnter) { + this._options.onCharacterClassEnter(start, negate); + } + } + onCharacterClassLeave(start, end, negate) { + if (this._options.onCharacterClassLeave) { + this._options.onCharacterClassLeave(start, end, negate); + } + } + onCharacterClassRange(start, end, min, max) { + if (this._options.onCharacterClassRange) { + this._options.onCharacterClassRange(start, end, min, max); + } + } + get source() { + return this._reader.source; + } + get index() { + return this._reader.index; + } + get currentCodePoint() { + return this._reader.currentCodePoint; + } + get nextCodePoint() { + return this._reader.nextCodePoint; + } + get nextCodePoint2() { + return this._reader.nextCodePoint2; + } + get nextCodePoint3() { + return this._reader.nextCodePoint3; + } + reset(source, start, end) { + this._reader.reset(source, start, end, this._uFlag); + } + rewind(index) { + this._reader.rewind(index); + } + advance() { + this._reader.advance(); + } + eat(cp) { + return this._reader.eat(cp); + } + eat2(cp1, cp2) { + return this._reader.eat2(cp1, cp2); + } + eat3(cp1, cp2, cp3) { + return this._reader.eat3(cp1, cp2, cp3); + } + raise(message) { + throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message); + } + eatRegExpBody() { + const start = this.index; + let inClass = false; + let escaped = false; + for (;;) { + const cp = this.currentCodePoint; + if (cp === -1 || isLineTerminator(cp)) { + const kind = inClass ? "character class" : "regular expression"; + this.raise(`Unterminated ${kind}`); + } + if (escaped) { + escaped = false; + } + else if (cp === ReverseSolidus) { + escaped = true; + } + else if (cp === LeftSquareBracket) { + inClass = true; + } + else if (cp === RightSquareBracket) { + inClass = false; + } + else if ((cp === Solidus && !inClass) || + (cp === Asterisk && this.index === start)) { + break; + } + this.advance(); + } + return this.index !== start; + } + consumePattern() { + const start = this.index; + this._numCapturingParens = this.countCapturingParens(); + this._groupNames.clear(); + this._backreferenceNames.clear(); + this.onPatternEnter(start); + this.consumeDisjunction(); + const cp = this.currentCodePoint; + if (this.currentCodePoint !== -1) { + if (cp === RightParenthesis) { + this.raise("Unmatched ')'"); + } + if (cp === ReverseSolidus) { + this.raise("\\ at end of pattern"); + } + if (cp === RightSquareBracket || cp === RightCurlyBracket) { + this.raise("Lone quantifier brackets"); + } + const c = String.fromCodePoint(cp); + this.raise(`Unexpected character '${c}'`); + } + for (const name of this._backreferenceNames) { + if (!this._groupNames.has(name)) { + this.raise("Invalid named capture referenced"); + } + } + this.onPatternLeave(start, this.index); + } + countCapturingParens() { + const start = this.index; + let inClass = false; + let escaped = false; + let count = 0; + let cp = 0; + while ((cp = this.currentCodePoint) !== -1) { + if (escaped) { + escaped = false; + } + else if (cp === ReverseSolidus) { + escaped = true; + } + else if (cp === LeftSquareBracket) { + inClass = true; + } + else if (cp === RightSquareBracket) { + inClass = false; + } + else if (cp === LeftParenthesis && + !inClass && + (this.nextCodePoint !== QuestionMark || + (this.nextCodePoint2 === LessThanSign && + this.nextCodePoint3 !== EqualsSign && + this.nextCodePoint3 !== ExclamationMark))) { + count += 1; + } + this.advance(); + } + this.rewind(start); + return count; + } + consumeDisjunction() { + const start = this.index; + let i = 0; + this.onDisjunctionEnter(start); + do { + this.consumeAlternative(i++); + } while (this.eat(VerticalLine)); + if (this.consumeQuantifier(true)) { + this.raise("Nothing to repeat"); + } + if (this.eat(LeftCurlyBracket)) { + this.raise("Lone quantifier brackets"); + } + this.onDisjunctionLeave(start, this.index); + } + consumeAlternative(i) { + const start = this.index; + this.onAlternativeEnter(start, i); + while (this.currentCodePoint !== -1 && this.consumeTerm()) { + } + this.onAlternativeLeave(start, this.index, i); + } + consumeTerm() { + if (this._uFlag || this.strict) { + return (this.consumeAssertion() || + (this.consumeAtom() && this.consumeOptionalQuantifier())); + } + return ((this.consumeAssertion() && + (!this._lastAssertionIsQuantifiable || + this.consumeOptionalQuantifier())) || + (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); + } + consumeOptionalQuantifier() { + this.consumeQuantifier(); + return true; + } + consumeAssertion() { + const start = this.index; + this._lastAssertionIsQuantifiable = false; + if (this.eat(CircumflexAccent)) { + this.onEdgeAssertion(start, this.index, "start"); + return true; + } + if (this.eat(DollarSign)) { + this.onEdgeAssertion(start, this.index, "end"); + return true; + } + if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { + this.onWordBoundaryAssertion(start, this.index, "word", true); + return true; + } + if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { + this.onWordBoundaryAssertion(start, this.index, "word", false); + return true; + } + if (this.eat2(LeftParenthesis, QuestionMark)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); + let negate = false; + if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { + const kind = lookbehind ? "lookbehind" : "lookahead"; + this.onLookaroundAssertionEnter(start, kind, negate); + this.consumeDisjunction(); + if (!this.eat(RightParenthesis)) { + this.raise("Unterminated group"); + } + this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; + this.onLookaroundAssertionLeave(start, this.index, kind, negate); + return true; + } + this.rewind(start); + } + return false; + } + consumeQuantifier(noConsume = false) { + const start = this.index; + let min = 0; + let max = 0; + let greedy = false; + if (this.eat(Asterisk)) { + min = 0; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(PlusSign)) { + min = 1; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(QuestionMark)) { + min = 0; + max = 1; + } + else if (this.eatBracedQuantifier(noConsume)) { + min = this._lastMinValue; + max = this._lastMaxValue; + } + else { + return false; + } + greedy = !this.eat(QuestionMark); + if (!noConsume) { + this.onQuantifier(start, this.index, min, max, greedy); + } + return true; + } + eatBracedQuantifier(noError) { + const start = this.index; + if (this.eat(LeftCurlyBracket)) { + this._lastMinValue = 0; + this._lastMaxValue = Number.POSITIVE_INFINITY; + if (this.eatDecimalDigits()) { + this._lastMinValue = this._lastMaxValue = this._lastIntValue; + if (this.eat(Comma)) { + this._lastMaxValue = this.eatDecimalDigits() + ? this._lastIntValue + : Number.POSITIVE_INFINITY; + } + if (this.eat(RightCurlyBracket)) { + if (!noError && this._lastMaxValue < this._lastMinValue) { + this.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (!noError && (this._uFlag || this.strict)) { + this.raise("Incomplete quantifier"); + } + this.rewind(start); + } + return false; + } + consumeAtom() { + return (this.consumePatternCharacter() || + this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + this.consumeCharacterClass() || + this.consumeUncapturingGroup() || + this.consumeCapturingGroup()); + } + consumeDot() { + if (this.eat(FullStop)) { + this.onAnyCharacterSet(this.index - 1, this.index, "any"); + return true; + } + return false; + } + consumeReverseSolidusAtomEscape() { + const start = this.index; + if (this.eat(ReverseSolidus)) { + if (this.consumeAtomEscape()) { + return true; + } + this.rewind(start); + } + return false; + } + consumeUncapturingGroup() { + const start = this.index; + if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { + this.onGroupEnter(start); + this.consumeDisjunction(); + if (!this.eat(RightParenthesis)) { + this.raise("Unterminated group"); + } + this.onGroupLeave(start, this.index); + return true; + } + return false; + } + consumeCapturingGroup() { + const start = this.index; + if (this.eat(LeftParenthesis)) { + let name = null; + if (this.ecmaVersion >= 2018) { + if (this.consumeGroupSpecifier()) { + name = this._lastStrValue; + } + } + else if (this.currentCodePoint === QuestionMark) { + this.raise("Invalid group"); + } + this.onCapturingGroupEnter(start, name); + this.consumeDisjunction(); + if (!this.eat(RightParenthesis)) { + this.raise("Unterminated group"); + } + this.onCapturingGroupLeave(start, this.index, name); + return true; + } + return false; + } + consumeExtendedAtom() { + return (this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + this.consumeReverseSolidusFollowedByC() || + this.consumeCharacterClass() || + this.consumeUncapturingGroup() || + this.consumeCapturingGroup() || + this.consumeInvalidBracedQuantifier() || + this.consumeExtendedPatternCharacter()); + } + consumeReverseSolidusFollowedByC() { + const start = this.index; + if (this.currentCodePoint === ReverseSolidus && + this.nextCodePoint === LatinSmallLetterC) { + this._lastIntValue = this.currentCodePoint; + this.advance(); + this.onCharacter(start, this.index, ReverseSolidus); + return true; + } + return false; + } + consumeInvalidBracedQuantifier() { + if (this.eatBracedQuantifier(true)) { + this.raise("Nothing to repeat"); + } + return false; + } + consumePatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && !isSyntaxCharacter(cp)) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeExtendedPatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && + cp !== CircumflexAccent && + cp !== DollarSign && + cp !== ReverseSolidus && + cp !== FullStop && + cp !== Asterisk && + cp !== PlusSign && + cp !== QuestionMark && + cp !== LeftParenthesis && + cp !== RightParenthesis && + cp !== LeftSquareBracket && + cp !== VerticalLine) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeGroupSpecifier() { + if (this.eat(QuestionMark)) { + if (this.eatGroupName()) { + if (!this._groupNames.has(this._lastStrValue)) { + this._groupNames.add(this._lastStrValue); + return true; + } + this.raise("Duplicate capture group name"); + } + this.raise("Invalid group"); + } + return false; + } + consumeAtomEscape() { + if (this.consumeBackreference() || + this.consumeCharacterClassEscape() || + this.consumeCharacterEscape() || + (this._nFlag && this.consumeKGroupName())) { + return true; + } + if (this.strict || this._uFlag) { + this.raise("Invalid escape"); + } + return false; + } + consumeBackreference() { + const start = this.index; + if (this.eatDecimalEscape()) { + const n = this._lastIntValue; + if (n <= this._numCapturingParens) { + this.onBackreference(start - 1, this.index, n); + return true; + } + if (this.strict || this._uFlag) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeCharacterClassEscape() { + const start = this.index; + if (this.eat(LatinSmallLetterD)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", false); + return true; + } + if (this.eat(LatinCapitalLetterD)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", true); + return true; + } + if (this.eat(LatinSmallLetterS)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", false); + return true; + } + if (this.eat(LatinCapitalLetterS)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", true); + return true; + } + if (this.eat(LatinSmallLetterW)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", false); + return true; + } + if (this.eat(LatinCapitalLetterW)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", true); + return true; + } + let negate = false; + if (this._uFlag && + this.ecmaVersion >= 2018 && + (this.eat(LatinSmallLetterP) || + (negate = this.eat(LatinCapitalLetterP)))) { + this._lastIntValue = -1; + if (this.eat(LeftCurlyBracket) && + this.eatUnicodePropertyValueExpression() && + this.eat(RightCurlyBracket)) { + this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); + return true; + } + this.raise("Invalid property name"); + } + return false; + } + consumeCharacterEscape() { + const start = this.index; + if (this.eatControlEscape() || + this.eatCControlLetter() || + this.eatZero() || + this.eatHexEscapeSequence() || + this.eatRegExpUnicodeEscapeSequence() || + (!this.strict && + !this._uFlag && + this.eatLegacyOctalEscapeSequence()) || + this.eatIdentityEscape()) { + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return false; + } + consumeKGroupName() { + const start = this.index; + if (this.eat(LatinSmallLetterK)) { + if (this.eatGroupName()) { + const groupName = this._lastStrValue; + this._backreferenceNames.add(groupName); + this.onBackreference(start - 1, this.index, groupName); + return true; + } + this.raise("Invalid named reference"); + } + return false; + } + consumeCharacterClass() { + const start = this.index; + if (this.eat(LeftSquareBracket)) { + const negate = this.eat(CircumflexAccent); + this.onCharacterClassEnter(start, negate); + this.consumeClassRanges(); + if (!this.eat(RightSquareBracket)) { + this.raise("Unterminated character class"); + } + this.onCharacterClassLeave(start, this.index, negate); + return true; + } + return false; + } + consumeClassRanges() { + const strict = this.strict || this._uFlag; + for (;;) { + const rangeStart = this.index; + if (!this.consumeClassAtom()) { + break; + } + const min = this._lastIntValue; + if (!this.eat(HyphenMinus)) { + continue; + } + this.onCharacter(this.index - 1, this.index, HyphenMinus); + if (!this.consumeClassAtom()) { + break; + } + const max = this._lastIntValue; + if (min === -1 || max === -1) { + if (strict) { + this.raise("Invalid character class"); + } + continue; + } + if (min > max) { + this.raise("Range out of order in character class"); + } + this.onCharacterClassRange(rangeStart, this.index, min, max); + } + } + consumeClassAtom() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { + this.advance(); + this._lastIntValue = cp; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.eat(ReverseSolidus)) { + if (this.consumeClassEscape()) { + return true; + } + if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { + this._lastIntValue = ReverseSolidus; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.strict || this._uFlag) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeClassEscape() { + const start = this.index; + if (this.eat(LatinSmallLetterB)) { + this._lastIntValue = Backspace; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + if (this._uFlag && this.eat(HyphenMinus)) { + this._lastIntValue = HyphenMinus; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + let cp = 0; + if (!this.strict && + !this._uFlag && + this.currentCodePoint === LatinSmallLetterC && + (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) { + this.advance(); + this.advance(); + this._lastIntValue = cp % 0x20; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); + } + eatGroupName() { + if (this.eat(LessThanSign)) { + if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { + return true; + } + this.raise("Invalid capture group name"); + } + return false; + } + eatRegExpIdentifierName() { + if (this.eatRegExpIdentifierStart()) { + this._lastStrValue = String.fromCodePoint(this._lastIntValue); + while (this.eatRegExpIdentifierPart()) { + this._lastStrValue += String.fromCodePoint(this._lastIntValue); + } + return true; + } + return false; + } + eatRegExpIdentifierStart() { + const start = this.index; + const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === ReverseSolidus && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isRegExpIdentifierStart(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatRegExpIdentifierPart() { + const start = this.index; + const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === ReverseSolidus && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isRegExpIdentifierPart(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatCControlLetter() { + const start = this.index; + if (this.eat(LatinSmallLetterC)) { + if (this.eatControlLetter()) { + return true; + } + this.rewind(start); + } + return false; + } + eatZero() { + if (this.currentCodePoint === DigitZero && + !isDecimalDigit(this.nextCodePoint)) { + this._lastIntValue = 0; + this.advance(); + return true; + } + return false; + } + eatControlEscape() { + if (this.eat(LatinSmallLetterF)) { + this._lastIntValue = FormFeed; + return true; + } + if (this.eat(LatinSmallLetterN)) { + this._lastIntValue = LineFeed; + return true; + } + if (this.eat(LatinSmallLetterR)) { + this._lastIntValue = CarriageReturn; + return true; + } + if (this.eat(LatinSmallLetterT)) { + this._lastIntValue = CharacterTabulation; + return true; + } + if (this.eat(LatinSmallLetterV)) { + this._lastIntValue = LineTabulation; + return true; + } + return false; + } + eatControlLetter() { + const cp = this.currentCodePoint; + if (isLatinLetter(cp)) { + this.advance(); + this._lastIntValue = cp % 0x20; + return true; + } + return false; + } + eatRegExpUnicodeEscapeSequence(forceUFlag = false) { + const start = this.index; + const uFlag = forceUFlag || this._uFlag; + if (this.eat(LatinSmallLetterU)) { + if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || + this.eatFixedHexDigits(4) || + (uFlag && this.eatRegExpUnicodeCodePointEscape())) { + return true; + } + if (this.strict || uFlag) { + this.raise("Invalid unicode escape"); + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeSurrogatePairEscape() { + const start = this.index; + if (this.eatFixedHexDigits(4)) { + const lead = this._lastIntValue; + if (isLeadSurrogate(lead) && + this.eat(ReverseSolidus) && + this.eat(LatinSmallLetterU) && + this.eatFixedHexDigits(4)) { + const trail = this._lastIntValue; + if (isTrailSurrogate(trail)) { + this._lastIntValue = combineSurrogatePair(lead, trail); + return true; + } + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeCodePointEscape() { + const start = this.index; + if (this.eat(LeftCurlyBracket) && + this.eatHexDigits() && + this.eat(RightCurlyBracket) && + isValidUnicode(this._lastIntValue)) { + return true; + } + this.rewind(start); + return false; + } + eatIdentityEscape() { + const cp = this.currentCodePoint; + if (this.isValidIdentityEscape(cp)) { + this._lastIntValue = cp; + this.advance(); + return true; + } + return false; + } + isValidIdentityEscape(cp) { + if (cp === -1) { + return false; + } + if (this._uFlag) { + return isSyntaxCharacter(cp) || cp === Solidus; + } + if (this.strict) { + return !isIdContinue(cp); + } + if (this._nFlag) { + return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); + } + return cp !== LatinSmallLetterC; + } + eatDecimalEscape() { + this._lastIntValue = 0; + let cp = this.currentCodePoint; + if (cp >= DigitOne && cp <= DigitNine) { + do { + this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); + this.advance(); + } while ((cp = this.currentCodePoint) >= DigitZero && + cp <= DigitNine); + return true; + } + return false; + } + eatUnicodePropertyValueExpression() { + const start = this.index; + if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { + this._lastKeyValue = this._lastStrValue; + if (this.eatUnicodePropertyValue()) { + this._lastValValue = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, this._lastKeyValue, this._lastValValue)) { + return true; + } + this.raise("Invalid property name"); + } + } + this.rewind(start); + if (this.eatLoneUnicodePropertyNameOrValue()) { + const nameOrValue = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { + this._lastKeyValue = "General_Category"; + this._lastValValue = nameOrValue; + return true; + } + if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { + this._lastKeyValue = nameOrValue; + this._lastValValue = ""; + return true; + } + this.raise("Invalid property name"); + } + return false; + } + eatUnicodePropertyName() { + this._lastStrValue = ""; + while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatUnicodePropertyValue() { + this._lastStrValue = ""; + while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatLoneUnicodePropertyNameOrValue() { + return this.eatUnicodePropertyValue(); + } + eatHexEscapeSequence() { + const start = this.index; + if (this.eat(LatinSmallLetterX)) { + if (this.eatFixedHexDigits(2)) { + return true; + } + if (this._uFlag || this.strict) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + eatDecimalDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isDecimalDigit(this.currentCodePoint)) { + this._lastIntValue = + 10 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatHexDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isHexDigit(this.currentCodePoint)) { + this._lastIntValue = + 16 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatLegacyOctalEscapeSequence() { + if (this.eatOctalDigit()) { + const n1 = this._lastIntValue; + if (this.eatOctalDigit()) { + const n2 = this._lastIntValue; + if (n1 <= 3 && this.eatOctalDigit()) { + this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; + } + else { + this._lastIntValue = n1 * 8 + n2; + } + } + else { + this._lastIntValue = n1; + } + return true; + } + return false; + } + eatOctalDigit() { + const cp = this.currentCodePoint; + if (isOctalDigit(cp)) { + this.advance(); + this._lastIntValue = cp - DigitZero; + return true; + } + this._lastIntValue = 0; + return false; + } + eatFixedHexDigits(length) { + const start = this.index; + this._lastIntValue = 0; + for (let i = 0; i < length; ++i) { + const cp = this.currentCodePoint; + if (!isHexDigit(cp)) { + this.rewind(start); + return false; + } + this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); + this.advance(); + } + return true; + } +} + +const DummyPattern = {}; +const DummyFlags = {}; +const DummyCapturingGroup = {}; +class RegExpParserState { + constructor(options) { + this._node = DummyPattern; + this._flags = DummyFlags; + this._backreferences = []; + this._capturingGroups = []; + this.source = ""; + this.strict = Boolean(options && options.strict); + this.ecmaVersion = (options && options.ecmaVersion) || 2020; + } + get pattern() { + if (this._node.type !== "Pattern") { + throw new Error("UnknownError"); + } + return this._node; + } + get flags() { + if (this._flags.type !== "Flags") { + throw new Error("UnknownError"); + } + return this._flags; + } + onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + this._flags = { + type: "Flags", + parent: null, + start, + end, + raw: this.source.slice(start, end), + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + }; + } + onPatternEnter(start) { + this._node = { + type: "Pattern", + parent: null, + start, + end: start, + raw: "", + alternatives: [], + }; + this._backreferences.length = 0; + this._capturingGroups.length = 0; + } + onPatternLeave(start, end) { + this._node.end = end; + this._node.raw = this.source.slice(start, end); + for (const reference of this._backreferences) { + const ref = reference.ref; + const group = typeof ref === "number" + ? this._capturingGroups[ref - 1] + : this._capturingGroups.find(g => g.name === ref); + reference.resolved = group; + group.references.push(reference); + } + } + onAlternativeEnter(start) { + const parent = this._node; + if (parent.type !== "Assertion" && + parent.type !== "CapturingGroup" && + parent.type !== "Group" && + parent.type !== "Pattern") { + throw new Error("UnknownError"); + } + this._node = { + type: "Alternative", + parent, + start, + end: start, + raw: "", + elements: [], + }; + parent.alternatives.push(this._node); + } + onAlternativeLeave(start, end) { + const node = this._node; + if (node.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onGroupEnter(start) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "Group", + parent, + start, + end: start, + raw: "", + alternatives: [], + }; + parent.elements.push(this._node); + } + onGroupLeave(start, end) { + const node = this._node; + if (node.type !== "Group" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onCapturingGroupEnter(start, name) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "CapturingGroup", + parent, + start, + end: start, + raw: "", + name, + alternatives: [], + references: [], + }; + parent.elements.push(this._node); + this._capturingGroups.push(this._node); + } + onCapturingGroupLeave(start, end) { + const node = this._node; + if (node.type !== "CapturingGroup" || + node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onQuantifier(start, end, min, max, greedy) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const element = parent.elements.pop(); + if (element == null || + element.type === "Quantifier" || + (element.type === "Assertion" && element.kind !== "lookahead")) { + throw new Error("UnknownError"); + } + const node = { + type: "Quantifier", + parent, + start: element.start, + end, + raw: this.source.slice(element.start, end), + min, + max, + greedy, + element, + }; + parent.elements.push(node); + element.parent = node; + } + onLookaroundAssertionEnter(start, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = (this._node = { + type: "Assertion", + parent, + start, + end: start, + raw: "", + kind, + negate, + alternatives: [], + }); + parent.elements.push(node); + } + onLookaroundAssertionLeave(start, end) { + const node = this._node; + if (node.type !== "Assertion" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onEdgeAssertion(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onWordBoundaryAssertion(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onAnyCharacterSet(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onEscapeCharacterSet(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + key, + value, + negate, + }); + } + onCharacter(start, end, value) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Character", + parent, + start, + end, + raw: this.source.slice(start, end), + value, + }); + } + onBackreference(start, end, ref) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = { + type: "Backreference", + parent, + start, + end, + raw: this.source.slice(start, end), + ref, + resolved: DummyCapturingGroup, + }; + parent.elements.push(node); + this._backreferences.push(node); + } + onCharacterClassEnter(start, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "CharacterClass", + parent, + start, + end: start, + raw: "", + negate, + elements: [], + }; + parent.elements.push(this._node); + } + onCharacterClassLeave(start, end) { + const node = this._node; + if (node.type !== "CharacterClass" || + node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onCharacterClassRange(start, end) { + const parent = this._node; + if (parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + const elements = parent.elements; + const max = elements.pop(); + const hyphen = elements.pop(); + const min = elements.pop(); + if (!min || + !max || + !hyphen || + min.type !== "Character" || + max.type !== "Character" || + hyphen.type !== "Character" || + hyphen.value !== HyphenMinus) { + throw new Error("UnknownError"); + } + const node = { + type: "CharacterClassRange", + parent, + start, + end, + raw: this.source.slice(start, end), + min, + max, + }; + min.parent = node; + max.parent = node; + elements.push(node); + } +} +class RegExpParser { + constructor(options) { + this._state = new RegExpParserState(options); + this._validator = new RegExpValidator(this._state); + } + parseLiteral(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateLiteral(source, start, end); + const pattern = this._state.pattern; + const flags = this._state.flags; + const literal = { + type: "RegExpLiteral", + parent: null, + start, + end, + raw: source, + pattern, + flags, + }; + pattern.parent = literal; + flags.parent = literal; + return literal; + } + parseFlags(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateFlags(source, start, end); + return this._state.flags; + } + parsePattern(source, start = 0, end = source.length, uFlag = false) { + this._state.source = source; + this._validator.validatePattern(source, start, end, uFlag); + return this._state.pattern; + } +} + +class RegExpVisitor { + constructor(handlers) { + this._handlers = handlers; + } + visit(node) { + switch (node.type) { + case "Alternative": + this.visitAlternative(node); + break; + case "Assertion": + this.visitAssertion(node); + break; + case "Backreference": + this.visitBackreference(node); + break; + case "CapturingGroup": + this.visitCapturingGroup(node); + break; + case "Character": + this.visitCharacter(node); + break; + case "CharacterClass": + this.visitCharacterClass(node); + break; + case "CharacterClassRange": + this.visitCharacterClassRange(node); + break; + case "CharacterSet": + this.visitCharacterSet(node); + break; + case "Flags": + this.visitFlags(node); + break; + case "Group": + this.visitGroup(node); + break; + case "Pattern": + this.visitPattern(node); + break; + case "Quantifier": + this.visitQuantifier(node); + break; + case "RegExpLiteral": + this.visitRegExpLiteral(node); + break; + default: + throw new Error(`Unknown type: ${node.type}`); + } + } + visitAlternative(node) { + if (this._handlers.onAlternativeEnter) { + this._handlers.onAlternativeEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onAlternativeLeave) { + this._handlers.onAlternativeLeave(node); + } + } + visitAssertion(node) { + if (this._handlers.onAssertionEnter) { + this._handlers.onAssertionEnter(node); + } + if (node.kind === "lookahead" || node.kind === "lookbehind") { + node.alternatives.forEach(this.visit, this); + } + if (this._handlers.onAssertionLeave) { + this._handlers.onAssertionLeave(node); + } + } + visitBackreference(node) { + if (this._handlers.onBackreferenceEnter) { + this._handlers.onBackreferenceEnter(node); + } + if (this._handlers.onBackreferenceLeave) { + this._handlers.onBackreferenceLeave(node); + } + } + visitCapturingGroup(node) { + if (this._handlers.onCapturingGroupEnter) { + this._handlers.onCapturingGroupEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onCapturingGroupLeave) { + this._handlers.onCapturingGroupLeave(node); + } + } + visitCharacter(node) { + if (this._handlers.onCharacterEnter) { + this._handlers.onCharacterEnter(node); + } + if (this._handlers.onCharacterLeave) { + this._handlers.onCharacterLeave(node); + } + } + visitCharacterClass(node) { + if (this._handlers.onCharacterClassEnter) { + this._handlers.onCharacterClassEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onCharacterClassLeave) { + this._handlers.onCharacterClassLeave(node); + } + } + visitCharacterClassRange(node) { + if (this._handlers.onCharacterClassRangeEnter) { + this._handlers.onCharacterClassRangeEnter(node); + } + this.visitCharacter(node.min); + this.visitCharacter(node.max); + if (this._handlers.onCharacterClassRangeLeave) { + this._handlers.onCharacterClassRangeLeave(node); + } + } + visitCharacterSet(node) { + if (this._handlers.onCharacterSetEnter) { + this._handlers.onCharacterSetEnter(node); + } + if (this._handlers.onCharacterSetLeave) { + this._handlers.onCharacterSetLeave(node); + } + } + visitFlags(node) { + if (this._handlers.onFlagsEnter) { + this._handlers.onFlagsEnter(node); + } + if (this._handlers.onFlagsLeave) { + this._handlers.onFlagsLeave(node); + } + } + visitGroup(node) { + if (this._handlers.onGroupEnter) { + this._handlers.onGroupEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onGroupLeave) { + this._handlers.onGroupLeave(node); + } + } + visitPattern(node) { + if (this._handlers.onPatternEnter) { + this._handlers.onPatternEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onPatternLeave) { + this._handlers.onPatternLeave(node); + } + } + visitQuantifier(node) { + if (this._handlers.onQuantifierEnter) { + this._handlers.onQuantifierEnter(node); + } + this.visit(node.element); + if (this._handlers.onQuantifierLeave) { + this._handlers.onQuantifierLeave(node); + } + } + visitRegExpLiteral(node) { + if (this._handlers.onRegExpLiteralEnter) { + this._handlers.onRegExpLiteralEnter(node); + } + this.visitPattern(node.pattern); + this.visitFlags(node.flags); + if (this._handlers.onRegExpLiteralLeave) { + this._handlers.onRegExpLiteralLeave(node); + } + } +} + +function parseRegExpLiteral(source, options) { + return new RegExpParser(options).parseLiteral(String(source)); +} +function validateRegExpLiteral(source, options) { + return new RegExpValidator(options).validateLiteral(source); +} +function visitRegExpAST(node, handlers) { + new RegExpVisitor(handlers).visit(node); +} + +exports.AST = ast; +exports.RegExpParser = RegExpParser; +exports.RegExpValidator = RegExpValidator; +exports.parseRegExpLiteral = parseRegExpLiteral; +exports.validateRegExpLiteral = validateRegExpLiteral; +exports.visitRegExpAST = visitRegExpAST; +//# sourceMappingURL=index.js.map diff --git a/node_modules/regexpp/index.js.map b/node_modules/regexpp/index.js.map new file mode 100644 index 0000000..68fc68e --- /dev/null +++ b/node_modules/regexpp/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\index.ts"}],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAE3D,SAAgB,SAAS,CAAC,EAAU;IAChC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;CAC5B;AAED,SAAgB,YAAY,CAAC,EAAU;IACnC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC5B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAA;CACrD;AAED,SAAS,cAAc,CAAC,EAAU;IAC9B,OAAO,SAAS,CACZ,EAAE,EACF,kBAAkB,KAAK,kBAAkB,GAAG,sBAAsB,EAAE,CAAC,CACxE,CAAA;CACJ;AAED,SAAS,iBAAiB,CAAC,EAAU;IACjC,OAAO,SAAS,CACZ,EAAE,EACF,qBAAqB;SAChB,qBAAqB,GAAG,yBAAyB,EAAE,CAAC,CAC5D,CAAA;CACJ;AAED,SAAS,sBAAsB;IAC3B,OAAO,aAAa,CAChB,yhGAAyhG,CAC5hG,CAAA;CACJ;AAED,SAAS,yBAAyB;IAC9B,OAAO,aAAa,CAChB,utDAAutD,CAC1tD,CAAA;CACJ;AAED,SAAS,SAAS,CAAC,EAAU,EAAE,MAAgB;IAC3C,IAAI,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAC3B,CAAC,GAAG,CAAC,EACL,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,CAAC,CAAA;IACX,OAAO,CAAC,GAAG,CAAC,EAAE;QACV,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACnB,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACvB,IAAI,EAAE,GAAG,GAAG,EAAE;YACV,CAAC,GAAG,CAAC,CAAA;SACR;aAAM,IAAI,EAAE,GAAG,GAAG,EAAE;YACjB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;SACZ;aAAM;YACH,OAAO,IAAI,CAAA;SACd;KACJ;IACD,OAAO,KAAK,CAAA;CACf;AAED,SAAS,aAAa,CAAC,IAAY;IAC/B,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;CACjE;;AC3ED,MAAM,OAAO;IAOT,YAAmB,OAAe,EAAE,OAAe,EAAE,OAAe;QAChE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;KAC1B;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;CACJ;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAA;AACrD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AACvE,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,opBAAopB,EACppB,EAAE,EACF,EAAE,CACL,CAAA;AACD,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,48DAA48D,EAC58D,gHAAgH,EAChH,uEAAuE,CAC1E,CAAA;AACD,MAAM,eAAe,GAAG,IAAI,OAAO,CAC/B,69BAA69B,EAC79B,uBAAuB,EACvB,EAAE,CACL,CAAA;AAED,SAAgB,sBAAsB,CAClC,OAAe,EACf,IAAY,EACZ,KAAa;IAEb,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KAC1D;IACD,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrB,QACI,CAAC,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;aAChD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACjD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACrD;KACJ;IACD,OAAO,KAAK,CAAA;CACf;AAED,SAAgB,0BAA0B,CACtC,OAAe,EACf,KAAa;IAEb,QACI,CAAC,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;SACpD,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACzD;CACJ;;ACpEM,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,KAAK,GAAG,IAAI,CAAA;AACzB,AAAO,MAAM,WAAW,GAAG,IAAI,CAAA;AAC/B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,OAAO,GAAG,IAAI,CAAA;AAC3B,AAAO,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,KAAK,GAAG,IAAI,CAAA;AACzB,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,OAAO,GAAG,IAAI,CAAA;AAC3B,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,kBAAkB,GAAG,IAAI,CAAA;AACtC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,kBAAkB,GAAG,MAAM,CAAA;AACxC,AAAO,MAAM,eAAe,GAAG,MAAM,CAAA;AACrC,AAAO,MAAM,aAAa,GAAG,MAAM,CAAA;AACnC,AAAO,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,YAAY,GAAG,QAAQ,CAAA;AAEpC,SAAgB,aAAa,CAAC,IAAY;IACtC,QACI,CAAC,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB;SAC1D,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,EAC3D;CACJ;AAED,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,CAAA;CAChD;AAED,SAAgB,YAAY,CAAC,IAAY;IACrC,OAAO,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,UAAU,CAAA;CACjD;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,QACI,CAAC,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS;SACtC,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,CAAC;SAC3D,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,EAC3D;CACJ;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,QACI,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,cAAc;QACvB,IAAI,KAAK,aAAa;QACtB,IAAI,KAAK,kBAAkB,EAC9B;CACJ;AAED,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,YAAY,CAAA;CACtD;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,IAAI,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,EAAE;QACxD,OAAO,IAAI,GAAG,iBAAiB,GAAG,EAAE,CAAA;KACvC;IACD,IAAI,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,EAAE;QAC5D,OAAO,IAAI,GAAG,mBAAmB,GAAG,EAAE,CAAA;KACzC;IACD,OAAO,IAAI,GAAG,SAAS,CAAA;CAC1B;AAED,SAAgB,eAAe,CAAC,IAAY;IACxC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAA;CAC1C;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAA;CAC1C;AAED,SAAgB,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC5D,OAAO,CAAC,IAAI,GAAG,MAAM,IAAI,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO,CAAA;CAC9D;;ACpID,MAAM,UAAU,GAAG;IACf,EAAE,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;QAChC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;KACxC;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,CAAA;KACX;CACJ,CAAA;AACD,MAAM,WAAW,GAAG;IAChB,EAAE,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;QAChC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,CAAA;KAC1C;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAA;KAC5B;CACJ,CAAA;AAED,MAAa,MAAM;IAAnB;QACY,UAAK,GAAG,UAAU,CAAA;QAClB,OAAE,GAAG,EAAE,CAAA;QACP,OAAE,GAAG,CAAC,CAAA;QACN,SAAI,GAAG,CAAC,CAAA;QACR,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;KAkG5B;IAhGG,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,EAAE,CAAA;KACjB;IAED,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,EAAE,CAAA;KACjB;IAED,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAEM,KAAK,CACR,MAAc,EACd,KAAa,EACb,GAAW,EACX,KAAc;QAEd,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAA;QAC7C,IAAI,CAAC,EAAE,GAAG,MAAM,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KACrB;IAEM,MAAM,CAAC,KAAa;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAA;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC9C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACzD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACpE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,IAAI,EACT,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CACzC,CAAA;KACJ;IAEM,OAAO;QACV,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE;YAClB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;YACvB,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,CAAA;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAC3C,CAAA;SACJ;KACJ;IAEM,GAAG,CAAC,EAAU;QACjB,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAEM,IAAI,CAAC,GAAW,EAAE,GAAW;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;YACxC,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAEM,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;YAC7D,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;CACJ;;MC9HY,iBAAkB,SAAQ,WAAW;IAE9C,YACI,MAAc,EACd,KAAc,EACd,KAAa,EACb,OAAe;QAGf,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACzB,MAAM,GAAG,IAAI,MAAM,IAAI,KAAK,GAAG,GAAG,GAAG,EAAE,EAAE,CAAA;aAC5C;YACD,MAAM,GAAG,KAAK,MAAM,EAAE,CAAA;SACzB;QAGD,KAAK,CAAC,6BAA6B,MAAM,KAAK,OAAO,EAAE,CAAC,CAAA;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;KACrB;CACJ;;ACyDD,SAAS,iBAAiB,CAAC,EAAU;IACjC,QACI,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,UAAU;QACjB,EAAE,KAAK,cAAc;QACrB,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,YAAY;QACnB,EAAE,KAAK,eAAe;QACtB,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,iBAAiB;QACxB,EAAE,KAAK,kBAAkB;QACzB,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,iBAAiB;QACxB,EAAE,KAAK,YAAY,EACtB;CACJ;AAED,SAAS,uBAAuB,CAAC,EAAU;IACvC,OAAO,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,UAAU,IAAI,EAAE,KAAK,OAAO,CAAA;CAC9D;AAED,SAAS,sBAAsB,CAAC,EAAU;IACtC,QACI,YAAY,CAAC,EAAE,CAAC;QAChB,EAAE,KAAK,UAAU;QACjB,EAAE,KAAK,OAAO;QACd,EAAE,KAAK,kBAAkB;QACzB,EAAE,KAAK,eAAe,EACzB;CACJ;AAED,SAAS,8BAA8B,CAAC,EAAU;IAC9C,OAAO,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAA;CAC7C;AAED,SAAS,+BAA+B,CAAC,EAAU;IAC/C,OAAO,8BAA8B,CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,EAAE,CAAC,CAAA;CAClE;AAmSD,MAAa,eAAe;IAoBxB,YAAmB,OAAiC;QAlBnC,YAAO,GAAG,IAAI,MAAM,EAAE,CAAA;QAC/B,WAAM,GAAG,KAAK,CAAA;QACd,WAAM,GAAG,KAAK,CAAA;QACd,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,EAAE,CAAA;QAClB,kBAAa,GAAG,EAAE,CAAA;QAClB,kBAAa,GAAG,EAAE,CAAA;QAClB,iCAA4B,GAAG,KAAK,CAAA;QACpC,wBAAmB,GAAG,CAAC,CAAA;QACvB,gBAAW,GAAG,IAAI,GAAG,EAAU,CAAA;QAC/B,wBAAmB,GAAG,IAAI,GAAG,EAAU,CAAA;QAO3C,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAA;KAChC;IAQM,eAAe,CAClB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACjC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAE9B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAChE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAA;YAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YAC7C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAA;YAC1C,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;SAChE;aAAM,IAAI,KAAK,IAAI,GAAG,EAAE;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;SACtB;aAAM;YACH,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACrD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;KAClC;IAQM,aAAa,CAChB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAA;QACvC,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,UAAU,GAAG,KAAK,CAAA;QACtB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;YAEjC,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,oBAAoB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aAC/C;YACD,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEvB,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBAC5B,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBACnC,UAAU,GAAG,IAAI,CAAA;aACpB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBACnC,SAAS,GAAG,IAAI,CAAA;aACnB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM;gBACH,IAAI,CAAC,KAAK,CAAC,iBAAiB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aAC5C;SACJ;QACD,IAAI,CAAC,OAAO,CACR,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,CACT,CAAA;KACJ;IASM,eAAe,CAClB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM,EAC3B,KAAK,GAAG,KAAK;QAEb,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC/C,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC/C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAC9B,IAAI,CAAC,cAAc,EAAE,CAAA;QAErB,IACI,CAAC,IAAI,CAAC,MAAM;YACZ,IAAI,CAAC,WAAW,IAAI,IAAI;YACxB,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAC3B;YACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;YAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YAClB,IAAI,CAAC,cAAc,EAAE,CAAA;SACxB;KACJ;IAID,IAAY,MAAM;QACd,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;KACtD;IAED,IAAY,WAAW;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAA;KAC3C;IAEO,cAAc,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;SACtC;KACJ;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC3C;KACJ;IAEO,OAAO,CACX,KAAa,EACb,GAAW,EACX,MAAe,EACf,UAAmB,EACnB,SAAkB,EAClB,OAAgB,EAChB,MAAe,EACf,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACvB,IAAI,CAAC,QAAQ,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,CACT,CAAA;SACJ;KACJ;IAEO,cAAc,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;SACtC;KACJ;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC3C;KACJ;IAEO,kBAAkB,CAAC,KAAa;QACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;SAC1C;KACJ;IAEO,kBAAkB,CAAC,KAAa,EAAE,GAAW;QACjD,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC/C;KACJ;IAEO,kBAAkB,CAAC,KAAa,EAAE,KAAa;QACnD,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;SACjD;KACJ;IAEO,kBAAkB,CACtB,KAAa,EACb,GAAW,EACX,KAAa;QAEb,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;SACtD;KACJ;IAEO,YAAY,CAAC,KAAa;QAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;SACpC;KACJ;IAEO,YAAY,CAAC,KAAa,EAAE,GAAW;QAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SACzC;KACJ;IAEO,qBAAqB,CAAC,KAAa,EAAE,IAAmB;QAC5D,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;SACnD;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,IAAmB;QAEnB,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SACxD;KACJ;IAEO,YAAY,CAChB,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW,EACX,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SAC3D;KACJ;IAEO,0BAA0B,CAC9B,KAAa,EACb,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAChE;KACJ;IAEO,0BAA0B,CAC9B,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SACrE;KACJ;IAEO,eAAe,CACnB,KAAa,EACb,GAAW,EACX,IAAqB;QAErB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SAClD;KACJ;IAEO,uBAAuB,CAC3B,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE;YACvC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAClE;KACJ;IAEO,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,IAAW;QAC7D,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;YACjC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SACpD;KACJ;IAEO,oBAAoB,CACxB,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE;YACpC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAC/D;KACJ;IAEO,6BAA6B,CACjC,KAAa,EACb,GAAW,EACX,IAAgB,EAChB,GAAW,EACX,KAAoB,EACpB,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE;YAC7C,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CACvC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,CACT,CAAA;SACJ;KACJ;IAEO,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACzD,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;SAC/C;KACJ;IAEO,eAAe,CACnB,KAAa,EACb,GAAW,EACX,GAAoB;QAEpB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SACjD;KACJ;IAEO,qBAAqB,CAAC,KAAa,EAAE,MAAe;QACxD,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;SACrD;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SAC1D;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW;QAEX,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SAC5D;KACJ;IAMD,IAAY,MAAM;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;KAC7B;IAED,IAAY,KAAK;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;KAC5B;IAED,IAAY,gBAAgB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAA;KACvC;IAED,IAAY,aAAa;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAA;KACpC;IAED,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;KACrC;IAED,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;KACrC;IAEO,KAAK,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;QACpD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KACtD;IAEO,MAAM,CAAC,KAAa;QACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KAC7B;IAEO,OAAO;QACX,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;KACzB;IAEO,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;KAC9B;IAEO,IAAI,CAAC,GAAW,EAAE,GAAW;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KACrC;IAEO,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;KAC1C;IAIO,KAAK,CAAC,OAAe;QACzB,MAAM,IAAI,iBAAiB,CACvB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,EACV,OAAO,CACV,CAAA;KACJ;IAGO,aAAa;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,OAAO,GAAG,KAAK,CAAA;QAEnB,SAAS;YACL,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,gBAAgB,CAAC,EAAE,CAAC,EAAE;gBACnC,MAAM,IAAI,GAAG,OAAO,GAAG,iBAAiB,GAAG,oBAAoB,CAAA;gBAC/D,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAA;aACrC;YACD,IAAI,OAAO,EAAE;gBACT,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IAAI,EAAE,KAAK,cAAc,EAAE;gBAC9B,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACjC,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,kBAAkB,EAAE;gBAClC,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IACH,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,OAAO;iBAC1B,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,EAC3C;gBACE,MAAK;aACR;YACD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IASO,cAAc;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;QACtD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAA;QAEhC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,kBAAkB,EAAE,CAAA;QAEzB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC,EAAE;YAC9B,IAAI,EAAE,KAAK,gBAAgB,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;aAC9B;YACD,IAAI,EAAE,KAAK,cAAc,EAAE;gBACvB,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;aACrC;YACD,IAAI,EAAE,KAAK,kBAAkB,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACvD,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;aACzC;YACD,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;YAClC,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAA;SAC5C;QACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,mBAAmB,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;aACjD;SACJ;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IAMO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,KAAK,GAAG,CAAC,CAAA;QACb,IAAI,EAAE,GAAG,CAAC,CAAA;QAEV,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,gBAAgB,MAAM,CAAC,CAAC,EAAE;YACxC,IAAI,OAAO,EAAE;gBACT,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IAAI,EAAE,KAAK,cAAc,EAAE;gBAC9B,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACjC,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,kBAAkB,EAAE;gBAClC,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IACH,EAAE,KAAK,eAAe;gBACtB,CAAC,OAAO;iBACP,IAAI,CAAC,aAAa,KAAK,YAAY;qBAC/B,IAAI,CAAC,cAAc,KAAK,YAAY;wBACjC,IAAI,CAAC,cAAc,KAAK,UAAU;wBAClC,IAAI,CAAC,cAAc,KAAK,eAAe,CAAC,CAAC,EACnD;gBACE,KAAK,IAAI,CAAC,CAAA;aACb;YACD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClB,OAAO,KAAK,CAAA;KACf;IAUO,kBAAkB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,GAAG,CAAC,CAAA;QAET,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAC9B,GAAG;YACC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAA;SAC/B,QAAQ,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAC;QAEhC,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;SAClC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;SACzC;QACD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;KAC7C;IAUO,kBAAkB,CAAC,CAAS;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACjC,OAAO,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;SAE1D;QACD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;KAChD;IAmBO,WAAW;QACf,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,QACI,IAAI,CAAC,gBAAgB,EAAE;iBACtB,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC,EAC3D;SACJ;QACD,QACI,CAAC,IAAI,CAAC,gBAAgB,EAAE;aACnB,CAAC,IAAI,CAAC,4BAA4B;gBAC/B,IAAI,CAAC,yBAAyB,EAAE,CAAC;aACxC,IAAI,CAAC,mBAAmB,EAAE,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC,EACnE;KACJ;IACO,yBAAyB;QAC7B,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,OAAO,IAAI,CAAA;KACd;IAyBO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,4BAA4B,GAAG,KAAK,CAAA;QAGzC,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;YAChD,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACtB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YAC9C,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE;YAChD,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAE;YAC9C,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;YAC9D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE;YAC1C,MAAM,UAAU,GACZ,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;YACtD,IAAI,MAAM,GAAG,KAAK,CAAA;YAClB,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,EAAE;gBAC9D,MAAM,IAAI,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAA;gBACpD,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBACpD,IAAI,CAAC,kBAAkB,EAAE,CAAA;gBACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;oBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;iBACnC;gBACD,IAAI,CAAC,4BAA4B,GAAG,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;gBAC/D,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBAChE,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAmBO,iBAAiB,CAAC,SAAS,GAAG,KAAK;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,MAAM,GAAG,KAAK,CAAA;QAGlB,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpB,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;SACjC;aAAM,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;SACjC;aAAM,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC/B,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,CAAC,CAAA;SACV;aAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE;YAC5C,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YACxB,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;SAC3B;aAAM;YACH,OAAO,KAAK,CAAA;SACf;QAGD,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAEhC,IAAI,CAAC,SAAS,EAAE;YACZ,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SACzD;QACD,OAAO,IAAI,CAAA;KACd;IAaO,mBAAmB,CAAC,OAAgB;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;YACtB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAA;YAC7C,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBAC5D,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE;0BACtC,IAAI,CAAC,aAAa;0BAClB,MAAM,CAAC,iBAAiB,CAAA;iBACjC;gBACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;oBAC7B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE;wBACrD,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;qBACtD;oBACD,OAAO,IAAI,CAAA;iBACd;aACJ;YACD,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;gBAC1C,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;aACtC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAeO,WAAW;QACf,QACI,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,+BAA+B,EAAE;YACtC,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,qBAAqB,EAAE,EAC/B;KACJ;IASO,UAAU;QACd,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACzD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE;gBAC1B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IASO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE;YACjD,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YACxB,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;aACnC;YACD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,qBAAqB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;YAC3B,IAAI,IAAI,GAAkB,IAAI,CAAA;YAC9B,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC1B,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;oBAC9B,IAAI,GAAG,IAAI,CAAC,aAAa,CAAA;iBAC5B;aACJ;iBAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,YAAY,EAAE;gBAC/C,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;aAC9B;YAED,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACvC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;aACnC;YACD,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAEnD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,mBAAmB;QACvB,QACI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,+BAA+B,EAAE;YACtC,IAAI,CAAC,gCAAgC,EAAE;YACvC,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,8BAA8B,EAAE;YACrC,IAAI,CAAC,+BAA+B,EAAE,EACzC;KACJ;IASO,gCAAgC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IACI,IAAI,CAAC,gBAAgB,KAAK,cAAc;YACxC,IAAI,CAAC,aAAa,KAAK,iBAAiB,EAC1C;YACE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAC1C,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;YACnD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAaO,8BAA8B;QAClC,IAAI,IAAI,CAAC,mBAAmB,CAAgB,IAAI,CAAC,EAAE;YAC/C,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;SAClC;QACD,OAAO,KAAK,CAAA;KACf;IAWO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE;YACrC,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAWO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IACI,EAAE,KAAK,CAAC,CAAC;YACT,EAAE,KAAK,gBAAgB;YACvB,EAAE,KAAK,UAAU;YACjB,EAAE,KAAK,cAAc;YACrB,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,YAAY;YACnB,EAAE,KAAK,eAAe;YACtB,EAAE,KAAK,gBAAgB;YACvB,EAAE,KAAK,iBAAiB;YACxB,EAAE,KAAK,YAAY,EACrB;YACE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAYO,qBAAqB;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACxB,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;oBAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;oBACxC,OAAO,IAAI,CAAA;iBACd;gBACD,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;aAC7C;YACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;SAC9B;QACD,OAAO,KAAK,CAAA;KACf;IAiBO,iBAAiB;QACrB,IACI,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,2BAA2B,EAAE;YAClC,IAAI,CAAC,sBAAsB,EAAE;aAC5B,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAC3C;YACE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;SAC/B;QACD,OAAO,KAAK,CAAA;KACf;IAWO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;YACzB,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAA;YAC5B,IAAI,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC/B,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC9C,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAoBO,2BAA2B;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;YAChE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;YAChE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;YAC9D,OAAO,IAAI,CAAA;SACd;QAED,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IACI,IAAI,CAAC,MAAM;YACX,IAAI,CAAC,WAAW,IAAI,IAAI;aACvB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;iBACvB,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAC/C;YACE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IACI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;gBAC1B,IAAI,CAAC,iCAAiC,EAAE;gBACxC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAC7B;gBACE,IAAI,CAAC,6BAA6B,CAC9B,KAAK,GAAG,CAAC,EACT,IAAI,CAAC,KAAK,EACV,UAAU,EACV,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,aAAa,IAAI,IAAI,EAC1B,MAAM,CACT,CAAA;gBACD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACtC;QAED,OAAO,KAAK,CAAA;KACf;IAiBO,sBAAsB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IACI,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,8BAA8B,EAAE;aACpC,CAAC,IAAI,CAAC,MAAM;gBACT,CAAC,IAAI,CAAC,MAAM;gBACZ,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACxC,IAAI,CAAC,iBAAiB,EAAE,EAC1B;YACE,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,iBAAiB;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAA;gBACpC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;gBACvC,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;gBACtD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;SACxC;QACD,OAAO,KAAK,CAAA;KACf;IAYO,qBAAqB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;YACzC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACzC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;gBAC/B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;aAC7C;YACD,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACrD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,kBAAkB;QACtB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAA;QACzC,SAAS;YAEL,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAA;YAC7B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC1B,MAAK;aACR;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YAG9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;gBACxB,SAAQ;aACX;YACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;YAGzD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC1B,MAAK;aACR;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YAG9B,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;gBAC1B,IAAI,MAAM,EAAE;oBACR,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;iBACxC;gBACD,SAAQ;aACX;YACD,IAAI,GAAG,GAAG,GAAG,EAAE;gBACX,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;aACtD;YAED,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SAC/D;KACJ;IAiBO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAEhC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,cAAc,IAAI,EAAE,KAAK,kBAAkB,EAAE;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YACvD,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBAC3B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,iBAAiB,EAAE;gBAC7D,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;gBACnC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;gBACvD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAmBO,kBAAkB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAGxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAA;YAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACtC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;YAChC,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IACI,CAAC,IAAI,CAAC,MAAM;YACZ,CAAC,IAAI,CAAC,MAAM;YACZ,IAAI,CAAC,gBAAgB,KAAK,iBAAiB;aAC1C,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,EAC/D;YACE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;YAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAED,QACI,IAAI,CAAC,2BAA2B,EAAE,IAAI,IAAI,CAAC,sBAAsB,EAAE,EACtE;KACJ;IAWO,YAAY;QAChB,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACxB,IAAI,IAAI,CAAC,uBAAuB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;gBAC7D,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC3C;QACD,OAAO,KAAK,CAAA;KACf;IAaO,uBAAuB;QAC3B,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE;YACjC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAC,uBAAuB,EAAE,EAAE;gBACnC,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;aACjE;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAgBO,wBAAwB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC3D,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QAEd,IACI,EAAE,KAAK,cAAc;YACrB,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,EACjD;YACE,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;SAC1B;aAAM,IACH,UAAU;YACV,eAAe,CAAC,EAAE,CAAC;YACnB,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC;YACE,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,uBAAuB,CAAC,EAAE,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC3D,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QAEd,IACI,EAAE,KAAK,cAAc;YACrB,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,EACjD;YACE,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;SAC1B;aAAM,IACH,UAAU;YACV,eAAe,CAAC,EAAE,CAAC;YACnB,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC;YACE,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,sBAAsB,CAAC,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAUO,iBAAiB;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBACzB,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAUO,OAAO;QACX,IACI,IAAI,CAAC,gBAAgB,KAAK,SAAS;YACnC,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EACrC;YACE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;YACtB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAYO,gBAAgB;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAA;YAC7B,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAA;YAC7B,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAA;YACxC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAaO,gBAAgB;QACpB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,aAAa,CAAC,EAAE,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;YAC9B,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAiBO,8BAA8B,CAAC,UAAU,GAAG,KAAK;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,KAAK,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,CAAA;QAEvC,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IACI,CAAC,KAAK,IAAI,IAAI,CAAC,mCAAmC,EAAE;gBACpD,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;iBACxB,KAAK,IAAI,IAAI,CAAC,+BAA+B,EAAE,CAAC,EACnD;gBACE,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;gBACtB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;aACvC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAUO,mCAAmC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;YAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAA;YAC/B,IACI,eAAe,CAAC,IAAI,CAAC;gBACrB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;gBACxB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;gBAC3B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAC3B;gBACE,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAA;gBAChC,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;oBACzB,IAAI,CAAC,aAAa,GAAG,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;oBACtD,OAAO,IAAI,CAAA;iBACd;aACJ;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAUO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IACI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC1B,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;YAC3B,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EACpC;YACE,OAAO,IAAI,CAAA;SACd;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClB,OAAO,KAAK,CAAA;KACf;IAkBO,iBAAiB;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE;YAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IACO,qBAAqB,CAAC,EAAU;QACpC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YACX,OAAO,KAAK,CAAA;SACf;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAA;SACjD;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;SAC3B;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,EAAE,EAAE,KAAK,iBAAiB,IAAI,EAAE,KAAK,iBAAiB,CAAC,CAAA;SACjE;QACD,OAAO,EAAE,KAAK,iBAAiB,CAAA;KAClC;IAYO,gBAAgB;QACpB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,EAAE,IAAI,QAAQ,IAAI,EAAE,IAAI,SAAS,EAAE;YACnC,GAAG;gBACC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,IAAI,EAAE,GAAG,SAAS,CAAC,CAAA;gBAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;aACjB,QACG,CAAC,EAAE,GAAG,IAAI,CAAC,gBAAgB,KAAK,SAAS;gBACzC,EAAE,IAAI,SAAS,EAClB;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAcO,iCAAiC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAGxB,IAAI,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACvD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;YACvC,IAAI,IAAI,CAAC,uBAAuB,EAAE,EAAE;gBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBACvC,IACI,sBAAsB,CAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,aAAa,CACrB,EACH;oBACE,OAAO,IAAI,CAAA;iBACd;gBACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;aACtC;SACJ;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAGlB,IAAI,IAAI,CAAC,iCAAiC,EAAE,EAAE;YAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAA;YACtC,IACI,sBAAsB,CAClB,IAAI,CAAC,WAAW,EAChB,kBAAkB,EAClB,WAAW,CACd,EACH;gBACE,IAAI,CAAC,aAAa,GAAG,kBAAkB,CAAA;gBACvC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;gBAChC,OAAO,IAAI,CAAA;aACd;YACD,IAAI,0BAA0B,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;gBAC3D,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;gBAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;gBACvB,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACtC;QACD,OAAO,KAAK,CAAA;KACf;IAYO,sBAAsB;QAC1B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,OAAO,8BAA8B,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC1D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAA;KACnC;IAYO,uBAAuB;QAC3B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,OAAO,+BAA+B,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC3D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAA;KACnC;IAYO,iCAAiC;QACrC,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAA;KACxC;IAaO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;gBAC3B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAcO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC1C,IAAI,CAAC,aAAa;gBACd,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IAcO,YAAY;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YACtC,IAAI,CAAC,aAAa;gBACd,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IAoBO,4BAA4B;QAChC,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACtB,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;YAC7B,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;gBACtB,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;oBACjC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAA;iBAC7D;qBAAM;oBACH,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAA;iBACnC;aACJ;iBAAM;gBACH,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;aAC1B;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAWO,aAAa;QACjB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,SAAS,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,KAAK,CAAA;KACf;IAYO,iBAAiB,CAAC,MAAc;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAChC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;gBACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAClB,OAAO,KAAK,CAAA;aACf;YACD,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,EAAE,CAAC,CAAA;YAC7D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAA;KACd;CACJ;;ACv4ED,MAAM,YAAY,GAAY,EAAS,CAAA;AACvC,MAAM,UAAU,GAAU,EAAS,CAAA;AACnC,MAAM,mBAAmB,GAAmB,EAAS,CAAA;AAErD,MAAM,iBAAiB;IAUnB,YAAmB,OAA8B;QAPzC,UAAK,GAAmB,YAAY,CAAA;QACpC,WAAM,GAAU,UAAU,CAAA;QAC1B,oBAAe,GAAoB,EAAE,CAAA;QACrC,qBAAgB,GAAqB,EAAE,CAAA;QAExC,WAAM,GAAG,EAAE,CAAA;QAGd,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,CAAC,WAAW,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,CAAA;KAC9D;IAED,IAAW,OAAO;QACd,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QACD,OAAO,IAAI,CAAC,KAAK,CAAA;KACpB;IAED,IAAW,KAAK;QACZ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;KACrB;IAEM,OAAO,CACV,KAAa,EACb,GAAW,EACX,MAAe,EACf,UAAmB,EACnB,SAAkB,EAClB,OAAgB,EAChB,MAAe,EACf,MAAe;QAEf,IAAI,CAAC,MAAM,GAAG;YACV,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,MAAM;YACN,UAAU;YACV,SAAS;YACT,OAAO;YACP,MAAM;YACN,MAAM;SACT,CAAA;KACJ;IAEM,cAAc,CAAC,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,YAAY,EAAE,EAAE;SACnB,CAAA;QACD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAA;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAA;KACnC;IAEM,cAAc,CAAC,KAAa,EAAE,GAAW;QAC5C,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAE9C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE;YAC1C,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAA;YACzB,MAAM,KAAK,GACP,OAAO,GAAG,KAAK,QAAQ;kBACjB,IAAI,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,CAAC;kBAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAE,CAAA;YAC1D,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAA;YAC1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACnC;KACJ;IAEM,kBAAkB,CAAC,KAAa;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IACI,MAAM,CAAC,IAAI,KAAK,WAAW;YAC3B,MAAM,CAAC,IAAI,KAAK,gBAAgB;YAChC,MAAM,CAAC,IAAI,KAAK,OAAO;YACvB,MAAM,CAAC,IAAI,KAAK,SAAS,EAC3B;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,aAAa;YACnB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,EAAE;SACf,CAAA;QACD,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACvC;IAEM,kBAAkB,CAAC,KAAa,EAAE,GAAW;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,YAAY,CAAC,KAAa;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,OAAO;YACb,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,YAAY,EAAE,EAAE;SACnB,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACnC;IAEM,YAAY,CAAC,KAAa,EAAE,GAAW;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7D,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,qBAAqB,CAAC,KAAa,EAAE,IAAmB;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,gBAAgB;YACtB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,IAAI;YACJ,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE;SACjB,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAChC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EACpC;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,YAAY,CACf,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW,EACX,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAGD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;QACrC,IACI,OAAO,IAAI,IAAI;YACf,OAAO,CAAC,IAAI,KAAK,YAAY;aAC5B,OAAO,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,EAChE;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAe;YACrB,IAAI,EAAE,YAAY;YAClB,MAAM;YACN,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;YAC1C,GAAG;YACH,GAAG;YACH,MAAM;YACN,OAAO;SACV,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAA;KACxB;IAEM,0BAA0B,CAC7B,KAAa,EACb,IAAgC,EAChC,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,IAAyB,IAAI,CAAC,KAAK,GAAG;YAC5C,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,IAAI;YACJ,MAAM;YACN,YAAY,EAAE,EAAE;SACnB,CAAC,CAAA;QACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC7B;IAEM,0BAA0B,CAAC,KAAa,EAAE,GAAW;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,eAAe,CAClB,KAAa,EACb,GAAW,EACX,IAAqB;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;SACP,CAAC,CAAA;KACL;IAEM,uBAAuB,CAC1B,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,MAAM;SACT,CAAC,CAAA;KACL;IAEM,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,IAAW;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;SACP,CAAC,CAAA;KACL;IAEM,oBAAoB,CACvB,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,MAAM;SACT,CAAC,CAAA;KACL;IAEM,6BAA6B,CAChC,KAAa,EACb,GAAW,EACX,IAAgB,EAChB,GAAW,EACX,KAAoB,EACpB,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,GAAG;YACH,KAAK;YACL,MAAM;SACT,CAAC,CAAA;KACL;IAEM,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,KAAK;SACR,CAAC,CAAA;KACL;IAEM,eAAe,CAClB,KAAa,EACb,GAAW,EACX,GAAoB;QAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAkB;YACxB,IAAI,EAAE,eAAe;YACrB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,GAAG;YACH,QAAQ,EAAE,mBAAmB;SAChC,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAClC;IAEM,qBAAqB,CAAC,KAAa,EAAE,MAAe;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,gBAAgB;YACtB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,MAAM;YACN,QAAQ,EAAE,EAAE;SACf,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACnC;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EACpC;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAGD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,IACI,CAAC,GAAG;YACJ,CAAC,GAAG;YACJ,CAAC,MAAM;YACP,GAAG,CAAC,IAAI,KAAK,WAAW;YACxB,GAAG,CAAC,IAAI,KAAK,WAAW;YACxB,MAAM,CAAC,IAAI,KAAK,WAAW;YAC3B,MAAM,CAAC,KAAK,KAAK,WAAW,EAC9B;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAwB;YAC9B,IAAI,EAAE,qBAAqB;YAC3B,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,GAAG;YACH,GAAG;SACN,CAAA;QACD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAA;QACjB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAA;QACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KACtB;CACJ;AAuBD,MAAa,YAAY;IAQrB,YAAmB,OAA8B;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,UAAU,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACrD;IASM,YAAY,CACf,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;QAC/B,MAAM,OAAO,GAAkB;YAC3B,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG;YACH,GAAG,EAAE,MAAM;YACX,OAAO;YACP,KAAK;SACR,CAAA;QACD,OAAO,CAAC,MAAM,GAAG,OAAO,CAAA;QACxB,KAAK,CAAC,MAAM,GAAG,OAAO,CAAA;QACtB,OAAO,OAAO,CAAA;KACjB;IASM,UAAU,CACb,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;KAC3B;IAUM,YAAY,CACf,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM,EAC3B,KAAK,GAAG,KAAK;QAEb,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;KAC7B;CACJ;;MC5jBY,aAAa;IAOtB,YAAmB,QAAgC;QAC/C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;KAC5B;IAMM,KAAK,CAAC,IAAU;QACnB,QAAQ,IAAI,CAAC,IAAI;YACb,KAAK,aAAa;gBACd,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;gBAC3B,MAAK;YACT,KAAK,WAAW;gBACZ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;gBACzB,MAAK;YACT,KAAK,eAAe;gBAChB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBAC7B,MAAK;YACT,KAAK,gBAAgB;gBACjB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;gBAC9B,MAAK;YACT,KAAK,WAAW;gBACZ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;gBACzB,MAAK;YACT,KAAK,gBAAgB;gBACjB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;gBAC9B,MAAK;YACT,KAAK,qBAAqB;gBACtB,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;gBACnC,MAAK;YACT,KAAK,cAAc;gBACf,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;gBAC5B,MAAK;YACT,KAAK,OAAO;gBACR,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gBACrB,MAAK;YACT,KAAK,OAAO;gBACR,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gBACrB,MAAK;YACT,KAAK,SAAS;gBACV,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;gBACvB,MAAK;YACT,KAAK,YAAY;gBACb,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;gBAC1B,MAAK;YACT,KAAK,eAAe;gBAChB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBAC7B,MAAK;YACT;gBACI,MAAM,IAAI,KAAK,CAAC,iBAAkB,IAAY,CAAC,IAAI,EAAE,CAAC,CAAA;SAC7D;KACJ;IAEO,gBAAgB,CAAC,IAAiB;QACtC,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;SAC1C;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;SAC1C;KACJ;IACO,cAAc,CAAC,IAAe;QAClC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE;YACzD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;SAC9C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;KACJ;IACO,kBAAkB,CAAC,IAAmB;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;KACJ;IACO,mBAAmB,CAAC,IAAoB;QAC5C,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;QACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;KACJ;IACO,cAAc,CAAC,IAAe;QAClC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;KACJ;IACO,mBAAmB,CAAC,IAAoB;QAC5C,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;KACJ;IACO,wBAAwB,CAAC,IAAyB;QACtD,IAAI,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAA;SAClD;QACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAA;SAClD;KACJ;IACO,iBAAiB,CAAC,IAAkB;QACxC,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;SAC3C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;SAC3C;KACJ;IACO,UAAU,CAAC,IAAW;QAC1B,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;KACJ;IACO,UAAU,CAAC,IAAW;QAC1B,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;QACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;KACJ;IACO,YAAY,CAAC,IAAa;QAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;SACtC;QACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;SACtC;KACJ;IACO,eAAe,CAAC,IAAgB;QACpC,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;SACzC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;SACzC;KACJ;IACO,kBAAkB,CAAC,IAAmB;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;KACJ;CACJ;;SCzLe,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B;IAE9B,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;CAChE;AAOD,SAAgB,qBAAqB,CACjC,MAAc,EACd,OAAiC;IAEjC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;CAC9D;AAED,SAAgB,cAAc,CAC1B,IAAc,EACd,QAAgC;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;CAC1C;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/regexpp/index.mjs b/node_modules/regexpp/index.mjs new file mode 100644 index 0000000..d02491f --- /dev/null +++ b/node_modules/regexpp/index.mjs @@ -0,0 +1,2076 @@ +/*! @author Toru Nagashima */ + + +var ast = /*#__PURE__*/Object.freeze({ + +}); + +let largeIdStartRanges = undefined; +let largeIdContinueRanges = undefined; +function isIdStart(cp) { + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp); +} +function isIdContinue(cp) { + if (cp < 0x30) + return false; + if (cp < 0x3a) + return true; + if (cp < 0x41) + return false; + if (cp < 0x5b) + return true; + if (cp === 0x5f) + return true; + if (cp < 0x61) + return false; + if (cp < 0x7b) + return true; + return isLargeIdStart(cp) || isLargeIdContinue(cp); +} +function isLargeIdStart(cp) { + return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); +} +function isLargeIdContinue(cp) { + return isInRange(cp, largeIdContinueRanges || + (largeIdContinueRanges = initLargeIdContinueRanges())); +} +function initLargeIdStartRanges() { + return restoreRanges("170 0 11 0 5 0 6 22 2 30 2 457 5 11 15 4 8 0 2 0 130 4 2 1 3 3 2 0 7 0 2 2 2 0 2 19 2 82 2 138 9 165 2 37 3 0 7 40 72 26 5 3 46 42 36 1 2 98 2 0 16 1 8 1 11 2 3 0 17 0 2 29 30 88 12 0 25 32 10 1 5 0 6 21 5 0 10 0 4 0 24 24 8 10 54 20 2 17 61 53 4 0 19 0 8 9 16 15 5 7 3 1 3 21 2 6 2 0 4 3 4 0 17 0 14 1 2 2 15 1 11 0 9 5 5 1 3 21 2 6 2 1 2 1 2 1 32 3 2 0 20 2 17 8 2 2 2 21 2 6 2 1 2 4 4 0 19 0 16 1 24 0 12 7 3 1 3 21 2 6 2 1 2 4 4 0 31 1 2 2 16 0 18 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 11 23 0 53 7 2 2 2 22 2 15 4 0 27 2 6 1 31 0 5 7 2 2 2 22 2 9 2 4 4 0 33 0 2 1 16 1 18 8 2 2 2 40 3 0 17 0 6 2 9 2 25 5 6 17 4 23 2 8 2 0 3 6 59 47 2 1 13 6 59 1 2 0 2 4 2 23 2 0 2 9 2 1 10 0 3 4 2 0 22 3 33 0 64 7 2 35 28 4 116 42 21 0 17 5 5 3 4 0 4 1 8 2 5 12 13 0 18 37 2 0 6 0 3 42 2 332 2 3 3 6 2 0 2 3 3 40 2 3 3 32 2 3 3 6 2 0 2 3 3 14 2 56 2 3 3 66 38 15 17 85 3 5 4 619 3 16 2 25 6 74 4 10 8 12 2 3 15 17 15 17 15 12 2 2 16 51 36 0 5 0 68 88 8 40 2 0 6 69 11 30 50 29 3 4 12 43 5 25 55 22 10 52 83 0 94 46 18 6 56 29 14 1 11 43 27 35 42 2 11 35 3 8 8 42 3 2 42 3 2 5 2 1 4 0 6 191 65 277 3 5 3 37 3 5 3 7 2 0 2 0 2 0 2 30 3 52 2 6 2 0 4 2 2 6 4 3 3 5 5 12 6 2 2 6 117 0 14 0 17 12 102 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 15 3 3 6 4 5 0 18 40 2680 46 2 46 2 132 7 3 4 1 13 37 2 0 6 0 3 55 8 0 17 22 10 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 551 2 26 8 8 4 3 4 5 85 5 4 2 89 2 3 6 42 2 93 18 31 49 15 513 6591 65 20988 4 1164 68 45 3 268 4 15 11 1 21 46 17 30 3 79 40 8 3 102 3 52 3 8 43 12 2 2 2 3 2 22 30 51 15 49 63 5 4 0 2 1 12 27 11 22 26 28 8 46 29 0 17 4 2 9 11 4 2 40 24 2 2 7 21 22 4 0 4 49 2 0 4 1 3 4 3 0 2 0 25 2 3 10 8 2 13 5 3 5 3 5 10 6 2 6 2 42 2 13 7 114 30 11171 13 22 5 48 8453 365 3 105 39 6 13 4 6 0 2 9 2 12 2 4 2 0 2 1 2 1 2 107 34 362 19 63 3 53 41 11 117 4 2 134 37 25 7 25 12 88 4 5 3 5 3 5 3 2 36 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"); +} +function initLargeIdContinueRanges() { + return restoreRanges("183 0 585 111 24 0 252 4 266 44 2 0 2 1 2 1 2 0 73 10 49 30 7 0 102 6 3 5 3 1 2 3 3 9 24 0 31 26 92 10 16 9 34 8 10 0 25 3 2 8 2 2 2 4 44 2 120 14 2 32 55 2 2 17 2 6 11 1 3 9 18 2 57 0 2 6 3 1 3 2 10 0 11 1 3 9 15 0 3 2 57 0 2 4 5 1 3 2 4 0 21 11 4 0 12 2 57 0 2 7 2 2 2 2 21 1 3 9 11 5 2 2 57 0 2 6 3 1 3 2 8 2 11 1 3 9 19 0 60 4 4 2 2 3 10 0 15 9 17 4 58 6 2 2 2 3 8 1 12 1 3 9 18 2 57 0 2 6 2 2 2 3 8 1 12 1 3 9 17 3 56 1 2 6 2 2 2 3 10 0 11 1 3 9 18 2 71 0 5 5 2 0 2 7 7 9 3 1 62 0 3 6 13 7 2 9 88 0 3 8 12 5 3 9 63 1 7 9 12 0 2 0 2 0 5 1 50 19 2 1 6 10 2 35 10 0 101 19 2 9 13 3 5 2 2 2 3 6 4 3 14 11 2 14 704 2 10 8 929 2 30 2 30 1 31 1 65 31 10 0 3 9 34 2 3 9 144 0 119 11 5 11 11 9 129 10 61 4 58 9 2 28 3 10 7 9 23 13 2 1 64 4 48 16 12 9 18 8 13 2 31 12 3 9 45 13 49 19 9 9 7 9 119 2 2 20 5 0 7 0 3 2 199 57 2 4 576 1 20 0 124 12 5 0 4 11 3071 2 142 0 97 31 555 5 106 1 30086 9 70 0 5 9 33 1 81 1 273 0 4 0 5 0 24 4 5 0 84 1 51 17 11 9 7 17 14 10 29 7 26 12 45 3 48 13 16 9 12 0 11 9 48 13 13 0 9 1 3 9 34 2 51 0 2 2 3 1 6 1 2 0 42 4 6 1 237 7 2 1 3 9 20261 0 738 15 17 15 4 1 25 2 193 9 38 0 702 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 isInRange(cp, ranges) { + let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; + while (l < r) { + i = ((l + r) / 2) | 0; + min = ranges[2 * i]; + max = ranges[2 * i + 1]; + if (cp < min) { + r = i; + } + else if (cp > max) { + l = i + 1; + } + else { + return true; + } + } + return false; +} +function restoreRanges(data) { + let last = 0; + return data.split(" ").map(s => (last += parseInt(s, 10) | 0)); +} + +class DataSet { + constructor(raw2018, raw2019, raw2020) { + this._raw2018 = raw2018; + this._raw2019 = raw2019; + this._raw2020 = raw2020; + } + get es2018() { + return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); + } + get es2019() { + return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); + } + get es2020() { + return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); + } +} +const gcNameSet = new Set(["General_Category", "gc"]); +const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); +const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", ""); +const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho"); +const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", ""); +function isValidUnicodeProperty(version, name, value) { + if (gcNameSet.has(name)) { + return version >= 2018 && gcValueSets.es2018.has(value); + } + if (scNameSet.has(name)) { + return ((version >= 2018 && scValueSets.es2018.has(value)) || + (version >= 2019 && scValueSets.es2019.has(value)) || + (version >= 2020 && scValueSets.es2020.has(value))); + } + return false; +} +function isValidLoneUnicodeProperty(version, value) { + return ((version >= 2018 && binPropertySets.es2018.has(value)) || + (version >= 2019 && binPropertySets.es2019.has(value))); +} + +const Backspace = 0x08; +const CharacterTabulation = 0x09; +const LineFeed = 0x0a; +const LineTabulation = 0x0b; +const FormFeed = 0x0c; +const CarriageReturn = 0x0d; +const ExclamationMark = 0x21; +const DollarSign = 0x24; +const LeftParenthesis = 0x28; +const RightParenthesis = 0x29; +const Asterisk = 0x2a; +const PlusSign = 0x2b; +const Comma = 0x2c; +const HyphenMinus = 0x2d; +const FullStop = 0x2e; +const Solidus = 0x2f; +const DigitZero = 0x30; +const DigitOne = 0x31; +const DigitSeven = 0x37; +const DigitNine = 0x39; +const Colon = 0x3a; +const LessThanSign = 0x3c; +const EqualsSign = 0x3d; +const GreaterThanSign = 0x3e; +const QuestionMark = 0x3f; +const LatinCapitalLetterA = 0x41; +const LatinCapitalLetterB = 0x42; +const LatinCapitalLetterD = 0x44; +const LatinCapitalLetterF = 0x46; +const LatinCapitalLetterP = 0x50; +const LatinCapitalLetterS = 0x53; +const LatinCapitalLetterW = 0x57; +const LatinCapitalLetterZ = 0x5a; +const LowLine = 0x5f; +const LatinSmallLetterA = 0x61; +const LatinSmallLetterB = 0x62; +const LatinSmallLetterC = 0x63; +const LatinSmallLetterD = 0x64; +const LatinSmallLetterF = 0x66; +const LatinSmallLetterG = 0x67; +const LatinSmallLetterI = 0x69; +const LatinSmallLetterK = 0x6b; +const LatinSmallLetterM = 0x6d; +const LatinSmallLetterN = 0x6e; +const LatinSmallLetterP = 0x70; +const LatinSmallLetterR = 0x72; +const LatinSmallLetterS = 0x73; +const LatinSmallLetterT = 0x74; +const LatinSmallLetterU = 0x75; +const LatinSmallLetterV = 0x76; +const LatinSmallLetterW = 0x77; +const LatinSmallLetterX = 0x78; +const LatinSmallLetterY = 0x79; +const LatinSmallLetterZ = 0x7a; +const LeftSquareBracket = 0x5b; +const ReverseSolidus = 0x5c; +const RightSquareBracket = 0x5d; +const CircumflexAccent = 0x5e; +const LeftCurlyBracket = 0x7b; +const VerticalLine = 0x7c; +const RightCurlyBracket = 0x7d; +const ZeroWidthNonJoiner = 0x200c; +const ZeroWidthJoiner = 0x200d; +const LineSeparator = 0x2028; +const ParagraphSeparator = 0x2029; +const MinCodePoint = 0x00; +const MaxCodePoint = 0x10ffff; +function isLatinLetter(code) { + return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || + (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); +} +function isDecimalDigit(code) { + return code >= DigitZero && code <= DigitNine; +} +function isOctalDigit(code) { + return code >= DigitZero && code <= DigitSeven; +} +function isHexDigit(code) { + return ((code >= DigitZero && code <= DigitNine) || + (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || + (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); +} +function isLineTerminator(code) { + return (code === LineFeed || + code === CarriageReturn || + code === LineSeparator || + code === ParagraphSeparator); +} +function isValidUnicode(code) { + return code >= MinCodePoint && code <= MaxCodePoint; +} +function digitToInt(code) { + if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { + return code - LatinSmallLetterA + 10; + } + if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { + return code - LatinCapitalLetterA + 10; + } + return code - DigitZero; +} +function isLeadSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +function combineSurrogatePair(lead, trail) { + return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; +} + +const legacyImpl = { + at(s, end, i) { + return i < end ? s.charCodeAt(i) : -1; + }, + width(c) { + return 1; + }, +}; +const unicodeImpl = { + at(s, end, i) { + return i < end ? s.codePointAt(i) : -1; + }, + width(c) { + return c > 0xffff ? 2 : 1; + }, +}; +class Reader { + constructor() { + this._impl = legacyImpl; + this._s = ""; + this._i = 0; + this._end = 0; + this._cp1 = -1; + this._w1 = 1; + this._cp2 = -1; + this._w2 = 1; + this._cp3 = -1; + this._w3 = 1; + this._cp4 = -1; + } + get source() { + return this._s; + } + get index() { + return this._i; + } + get currentCodePoint() { + return this._cp1; + } + get nextCodePoint() { + return this._cp2; + } + get nextCodePoint2() { + return this._cp3; + } + get nextCodePoint3() { + return this._cp4; + } + reset(source, start, end, uFlag) { + this._impl = uFlag ? unicodeImpl : legacyImpl; + this._s = source; + this._end = end; + this.rewind(start); + } + rewind(index) { + const impl = this._impl; + this._i = index; + this._cp1 = impl.at(this._s, this._end, index); + this._w1 = impl.width(this._cp1); + this._cp2 = impl.at(this._s, this._end, index + this._w1); + this._w2 = impl.width(this._cp2); + this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); + } + advance() { + if (this._cp1 !== -1) { + const impl = this._impl; + this._i += this._w1; + this._cp1 = this._cp2; + this._w1 = this._w2; + this._cp2 = this._cp3; + this._w2 = impl.width(this._cp2); + this._cp3 = this._cp4; + this._w3 = impl.width(this._cp3); + this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); + } + } + eat(cp) { + if (this._cp1 === cp) { + this.advance(); + return true; + } + return false; + } + eat2(cp1, cp2) { + if (this._cp1 === cp1 && this._cp2 === cp2) { + this.advance(); + this.advance(); + return true; + } + return false; + } + eat3(cp1, cp2, cp3) { + if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { + this.advance(); + this.advance(); + this.advance(); + return true; + } + return false; + } +} + +class RegExpSyntaxError extends SyntaxError { + constructor(source, uFlag, index, message) { + if (source) { + if (!source.startsWith("/")) { + source = `/${source}/${uFlag ? "u" : ""}`; + } + source = `: ${source}`; + } + super(`Invalid regular expression${source}: ${message}`); + this.index = index; + } +} + +function isSyntaxCharacter(cp) { + return (cp === CircumflexAccent || + cp === DollarSign || + cp === ReverseSolidus || + cp === FullStop || + cp === Asterisk || + cp === PlusSign || + cp === QuestionMark || + cp === LeftParenthesis || + cp === RightParenthesis || + cp === LeftSquareBracket || + cp === RightSquareBracket || + cp === LeftCurlyBracket || + cp === RightCurlyBracket || + cp === VerticalLine); +} +function isRegExpIdentifierStart(cp) { + return isIdStart(cp) || cp === DollarSign || cp === LowLine; +} +function isRegExpIdentifierPart(cp) { + return (isIdContinue(cp) || + cp === DollarSign || + cp === LowLine || + cp === ZeroWidthNonJoiner || + cp === ZeroWidthJoiner); +} +function isUnicodePropertyNameCharacter(cp) { + return isLatinLetter(cp) || cp === LowLine; +} +function isUnicodePropertyValueCharacter(cp) { + return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); +} +class RegExpValidator { + constructor(options) { + this._reader = new Reader(); + this._uFlag = false; + this._nFlag = false; + this._lastIntValue = 0; + this._lastMinValue = 0; + this._lastMaxValue = 0; + this._lastStrValue = ""; + this._lastKeyValue = ""; + this._lastValValue = ""; + this._lastAssertionIsQuantifiable = false; + this._numCapturingParens = 0; + this._groupNames = new Set(); + this._backreferenceNames = new Set(); + this._options = options || {}; + } + validateLiteral(source, start = 0, end = source.length) { + this._uFlag = this._nFlag = false; + this.reset(source, start, end); + this.onLiteralEnter(start); + if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { + const flagStart = this.index; + const uFlag = source.includes("u", flagStart); + this.validateFlags(source, flagStart, end); + this.validatePattern(source, start + 1, flagStart - 1, uFlag); + } + else if (start >= end) { + this.raise("Empty"); + } + else { + const c = String.fromCodePoint(this.currentCodePoint); + this.raise(`Unexpected character '${c}'`); + } + this.onLiteralLeave(start, end); + } + validateFlags(source, start = 0, end = source.length) { + const existingFlags = new Set(); + let global = false; + let ignoreCase = false; + let multiline = false; + let sticky = false; + let unicode = false; + let dotAll = false; + for (let i = start; i < end; ++i) { + const flag = source.charCodeAt(i); + if (existingFlags.has(flag)) { + this.raise(`Duplicated flag '${source[i]}'`); + } + existingFlags.add(flag); + if (flag === LatinSmallLetterG) { + global = true; + } + else if (flag === LatinSmallLetterI) { + ignoreCase = true; + } + else if (flag === LatinSmallLetterM) { + multiline = true; + } + else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { + unicode = true; + } + else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { + sticky = true; + } + else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { + dotAll = true; + } + else { + this.raise(`Invalid flag '${source[i]}'`); + } + } + this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + } + validatePattern(source, start = 0, end = source.length, uFlag = false) { + this._uFlag = uFlag && this.ecmaVersion >= 2015; + this._nFlag = uFlag && this.ecmaVersion >= 2018; + this.reset(source, start, end); + this.consumePattern(); + if (!this._nFlag && + this.ecmaVersion >= 2018 && + this._groupNames.size > 0) { + this._nFlag = true; + this.rewind(start); + this.consumePattern(); + } + } + get strict() { + return Boolean(this._options.strict || this._uFlag); + } + get ecmaVersion() { + return this._options.ecmaVersion || 2020; + } + onLiteralEnter(start) { + if (this._options.onLiteralEnter) { + this._options.onLiteralEnter(start); + } + } + onLiteralLeave(start, end) { + if (this._options.onLiteralLeave) { + this._options.onLiteralLeave(start, end); + } + } + onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + if (this._options.onFlags) { + this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + } + } + onPatternEnter(start) { + if (this._options.onPatternEnter) { + this._options.onPatternEnter(start); + } + } + onPatternLeave(start, end) { + if (this._options.onPatternLeave) { + this._options.onPatternLeave(start, end); + } + } + onDisjunctionEnter(start) { + if (this._options.onDisjunctionEnter) { + this._options.onDisjunctionEnter(start); + } + } + onDisjunctionLeave(start, end) { + if (this._options.onDisjunctionLeave) { + this._options.onDisjunctionLeave(start, end); + } + } + onAlternativeEnter(start, index) { + if (this._options.onAlternativeEnter) { + this._options.onAlternativeEnter(start, index); + } + } + onAlternativeLeave(start, end, index) { + if (this._options.onAlternativeLeave) { + this._options.onAlternativeLeave(start, end, index); + } + } + onGroupEnter(start) { + if (this._options.onGroupEnter) { + this._options.onGroupEnter(start); + } + } + onGroupLeave(start, end) { + if (this._options.onGroupLeave) { + this._options.onGroupLeave(start, end); + } + } + onCapturingGroupEnter(start, name) { + if (this._options.onCapturingGroupEnter) { + this._options.onCapturingGroupEnter(start, name); + } + } + onCapturingGroupLeave(start, end, name) { + if (this._options.onCapturingGroupLeave) { + this._options.onCapturingGroupLeave(start, end, name); + } + } + onQuantifier(start, end, min, max, greedy) { + if (this._options.onQuantifier) { + this._options.onQuantifier(start, end, min, max, greedy); + } + } + onLookaroundAssertionEnter(start, kind, negate) { + if (this._options.onLookaroundAssertionEnter) { + this._options.onLookaroundAssertionEnter(start, kind, negate); + } + } + onLookaroundAssertionLeave(start, end, kind, negate) { + if (this._options.onLookaroundAssertionLeave) { + this._options.onLookaroundAssertionLeave(start, end, kind, negate); + } + } + onEdgeAssertion(start, end, kind) { + if (this._options.onEdgeAssertion) { + this._options.onEdgeAssertion(start, end, kind); + } + } + onWordBoundaryAssertion(start, end, kind, negate) { + if (this._options.onWordBoundaryAssertion) { + this._options.onWordBoundaryAssertion(start, end, kind, negate); + } + } + onAnyCharacterSet(start, end, kind) { + if (this._options.onAnyCharacterSet) { + this._options.onAnyCharacterSet(start, end, kind); + } + } + onEscapeCharacterSet(start, end, kind, negate) { + if (this._options.onEscapeCharacterSet) { + this._options.onEscapeCharacterSet(start, end, kind, negate); + } + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { + if (this._options.onUnicodePropertyCharacterSet) { + this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate); + } + } + onCharacter(start, end, value) { + if (this._options.onCharacter) { + this._options.onCharacter(start, end, value); + } + } + onBackreference(start, end, ref) { + if (this._options.onBackreference) { + this._options.onBackreference(start, end, ref); + } + } + onCharacterClassEnter(start, negate) { + if (this._options.onCharacterClassEnter) { + this._options.onCharacterClassEnter(start, negate); + } + } + onCharacterClassLeave(start, end, negate) { + if (this._options.onCharacterClassLeave) { + this._options.onCharacterClassLeave(start, end, negate); + } + } + onCharacterClassRange(start, end, min, max) { + if (this._options.onCharacterClassRange) { + this._options.onCharacterClassRange(start, end, min, max); + } + } + get source() { + return this._reader.source; + } + get index() { + return this._reader.index; + } + get currentCodePoint() { + return this._reader.currentCodePoint; + } + get nextCodePoint() { + return this._reader.nextCodePoint; + } + get nextCodePoint2() { + return this._reader.nextCodePoint2; + } + get nextCodePoint3() { + return this._reader.nextCodePoint3; + } + reset(source, start, end) { + this._reader.reset(source, start, end, this._uFlag); + } + rewind(index) { + this._reader.rewind(index); + } + advance() { + this._reader.advance(); + } + eat(cp) { + return this._reader.eat(cp); + } + eat2(cp1, cp2) { + return this._reader.eat2(cp1, cp2); + } + eat3(cp1, cp2, cp3) { + return this._reader.eat3(cp1, cp2, cp3); + } + raise(message) { + throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message); + } + eatRegExpBody() { + const start = this.index; + let inClass = false; + let escaped = false; + for (;;) { + const cp = this.currentCodePoint; + if (cp === -1 || isLineTerminator(cp)) { + const kind = inClass ? "character class" : "regular expression"; + this.raise(`Unterminated ${kind}`); + } + if (escaped) { + escaped = false; + } + else if (cp === ReverseSolidus) { + escaped = true; + } + else if (cp === LeftSquareBracket) { + inClass = true; + } + else if (cp === RightSquareBracket) { + inClass = false; + } + else if ((cp === Solidus && !inClass) || + (cp === Asterisk && this.index === start)) { + break; + } + this.advance(); + } + return this.index !== start; + } + consumePattern() { + const start = this.index; + this._numCapturingParens = this.countCapturingParens(); + this._groupNames.clear(); + this._backreferenceNames.clear(); + this.onPatternEnter(start); + this.consumeDisjunction(); + const cp = this.currentCodePoint; + if (this.currentCodePoint !== -1) { + if (cp === RightParenthesis) { + this.raise("Unmatched ')'"); + } + if (cp === ReverseSolidus) { + this.raise("\\ at end of pattern"); + } + if (cp === RightSquareBracket || cp === RightCurlyBracket) { + this.raise("Lone quantifier brackets"); + } + const c = String.fromCodePoint(cp); + this.raise(`Unexpected character '${c}'`); + } + for (const name of this._backreferenceNames) { + if (!this._groupNames.has(name)) { + this.raise("Invalid named capture referenced"); + } + } + this.onPatternLeave(start, this.index); + } + countCapturingParens() { + const start = this.index; + let inClass = false; + let escaped = false; + let count = 0; + let cp = 0; + while ((cp = this.currentCodePoint) !== -1) { + if (escaped) { + escaped = false; + } + else if (cp === ReverseSolidus) { + escaped = true; + } + else if (cp === LeftSquareBracket) { + inClass = true; + } + else if (cp === RightSquareBracket) { + inClass = false; + } + else if (cp === LeftParenthesis && + !inClass && + (this.nextCodePoint !== QuestionMark || + (this.nextCodePoint2 === LessThanSign && + this.nextCodePoint3 !== EqualsSign && + this.nextCodePoint3 !== ExclamationMark))) { + count += 1; + } + this.advance(); + } + this.rewind(start); + return count; + } + consumeDisjunction() { + const start = this.index; + let i = 0; + this.onDisjunctionEnter(start); + do { + this.consumeAlternative(i++); + } while (this.eat(VerticalLine)); + if (this.consumeQuantifier(true)) { + this.raise("Nothing to repeat"); + } + if (this.eat(LeftCurlyBracket)) { + this.raise("Lone quantifier brackets"); + } + this.onDisjunctionLeave(start, this.index); + } + consumeAlternative(i) { + const start = this.index; + this.onAlternativeEnter(start, i); + while (this.currentCodePoint !== -1 && this.consumeTerm()) { + } + this.onAlternativeLeave(start, this.index, i); + } + consumeTerm() { + if (this._uFlag || this.strict) { + return (this.consumeAssertion() || + (this.consumeAtom() && this.consumeOptionalQuantifier())); + } + return ((this.consumeAssertion() && + (!this._lastAssertionIsQuantifiable || + this.consumeOptionalQuantifier())) || + (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); + } + consumeOptionalQuantifier() { + this.consumeQuantifier(); + return true; + } + consumeAssertion() { + const start = this.index; + this._lastAssertionIsQuantifiable = false; + if (this.eat(CircumflexAccent)) { + this.onEdgeAssertion(start, this.index, "start"); + return true; + } + if (this.eat(DollarSign)) { + this.onEdgeAssertion(start, this.index, "end"); + return true; + } + if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { + this.onWordBoundaryAssertion(start, this.index, "word", true); + return true; + } + if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { + this.onWordBoundaryAssertion(start, this.index, "word", false); + return true; + } + if (this.eat2(LeftParenthesis, QuestionMark)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); + let negate = false; + if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { + const kind = lookbehind ? "lookbehind" : "lookahead"; + this.onLookaroundAssertionEnter(start, kind, negate); + this.consumeDisjunction(); + if (!this.eat(RightParenthesis)) { + this.raise("Unterminated group"); + } + this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; + this.onLookaroundAssertionLeave(start, this.index, kind, negate); + return true; + } + this.rewind(start); + } + return false; + } + consumeQuantifier(noConsume = false) { + const start = this.index; + let min = 0; + let max = 0; + let greedy = false; + if (this.eat(Asterisk)) { + min = 0; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(PlusSign)) { + min = 1; + max = Number.POSITIVE_INFINITY; + } + else if (this.eat(QuestionMark)) { + min = 0; + max = 1; + } + else if (this.eatBracedQuantifier(noConsume)) { + min = this._lastMinValue; + max = this._lastMaxValue; + } + else { + return false; + } + greedy = !this.eat(QuestionMark); + if (!noConsume) { + this.onQuantifier(start, this.index, min, max, greedy); + } + return true; + } + eatBracedQuantifier(noError) { + const start = this.index; + if (this.eat(LeftCurlyBracket)) { + this._lastMinValue = 0; + this._lastMaxValue = Number.POSITIVE_INFINITY; + if (this.eatDecimalDigits()) { + this._lastMinValue = this._lastMaxValue = this._lastIntValue; + if (this.eat(Comma)) { + this._lastMaxValue = this.eatDecimalDigits() + ? this._lastIntValue + : Number.POSITIVE_INFINITY; + } + if (this.eat(RightCurlyBracket)) { + if (!noError && this._lastMaxValue < this._lastMinValue) { + this.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (!noError && (this._uFlag || this.strict)) { + this.raise("Incomplete quantifier"); + } + this.rewind(start); + } + return false; + } + consumeAtom() { + return (this.consumePatternCharacter() || + this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + this.consumeCharacterClass() || + this.consumeUncapturingGroup() || + this.consumeCapturingGroup()); + } + consumeDot() { + if (this.eat(FullStop)) { + this.onAnyCharacterSet(this.index - 1, this.index, "any"); + return true; + } + return false; + } + consumeReverseSolidusAtomEscape() { + const start = this.index; + if (this.eat(ReverseSolidus)) { + if (this.consumeAtomEscape()) { + return true; + } + this.rewind(start); + } + return false; + } + consumeUncapturingGroup() { + const start = this.index; + if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { + this.onGroupEnter(start); + this.consumeDisjunction(); + if (!this.eat(RightParenthesis)) { + this.raise("Unterminated group"); + } + this.onGroupLeave(start, this.index); + return true; + } + return false; + } + consumeCapturingGroup() { + const start = this.index; + if (this.eat(LeftParenthesis)) { + let name = null; + if (this.ecmaVersion >= 2018) { + if (this.consumeGroupSpecifier()) { + name = this._lastStrValue; + } + } + else if (this.currentCodePoint === QuestionMark) { + this.raise("Invalid group"); + } + this.onCapturingGroupEnter(start, name); + this.consumeDisjunction(); + if (!this.eat(RightParenthesis)) { + this.raise("Unterminated group"); + } + this.onCapturingGroupLeave(start, this.index, name); + return true; + } + return false; + } + consumeExtendedAtom() { + return (this.consumeDot() || + this.consumeReverseSolidusAtomEscape() || + this.consumeReverseSolidusFollowedByC() || + this.consumeCharacterClass() || + this.consumeUncapturingGroup() || + this.consumeCapturingGroup() || + this.consumeInvalidBracedQuantifier() || + this.consumeExtendedPatternCharacter()); + } + consumeReverseSolidusFollowedByC() { + const start = this.index; + if (this.currentCodePoint === ReverseSolidus && + this.nextCodePoint === LatinSmallLetterC) { + this._lastIntValue = this.currentCodePoint; + this.advance(); + this.onCharacter(start, this.index, ReverseSolidus); + return true; + } + return false; + } + consumeInvalidBracedQuantifier() { + if (this.eatBracedQuantifier(true)) { + this.raise("Nothing to repeat"); + } + return false; + } + consumePatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && !isSyntaxCharacter(cp)) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeExtendedPatternCharacter() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && + cp !== CircumflexAccent && + cp !== DollarSign && + cp !== ReverseSolidus && + cp !== FullStop && + cp !== Asterisk && + cp !== PlusSign && + cp !== QuestionMark && + cp !== LeftParenthesis && + cp !== RightParenthesis && + cp !== LeftSquareBracket && + cp !== VerticalLine) { + this.advance(); + this.onCharacter(start, this.index, cp); + return true; + } + return false; + } + consumeGroupSpecifier() { + if (this.eat(QuestionMark)) { + if (this.eatGroupName()) { + if (!this._groupNames.has(this._lastStrValue)) { + this._groupNames.add(this._lastStrValue); + return true; + } + this.raise("Duplicate capture group name"); + } + this.raise("Invalid group"); + } + return false; + } + consumeAtomEscape() { + if (this.consumeBackreference() || + this.consumeCharacterClassEscape() || + this.consumeCharacterEscape() || + (this._nFlag && this.consumeKGroupName())) { + return true; + } + if (this.strict || this._uFlag) { + this.raise("Invalid escape"); + } + return false; + } + consumeBackreference() { + const start = this.index; + if (this.eatDecimalEscape()) { + const n = this._lastIntValue; + if (n <= this._numCapturingParens) { + this.onBackreference(start - 1, this.index, n); + return true; + } + if (this.strict || this._uFlag) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeCharacterClassEscape() { + const start = this.index; + if (this.eat(LatinSmallLetterD)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", false); + return true; + } + if (this.eat(LatinCapitalLetterD)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "digit", true); + return true; + } + if (this.eat(LatinSmallLetterS)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", false); + return true; + } + if (this.eat(LatinCapitalLetterS)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "space", true); + return true; + } + if (this.eat(LatinSmallLetterW)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", false); + return true; + } + if (this.eat(LatinCapitalLetterW)) { + this._lastIntValue = -1; + this.onEscapeCharacterSet(start - 1, this.index, "word", true); + return true; + } + let negate = false; + if (this._uFlag && + this.ecmaVersion >= 2018 && + (this.eat(LatinSmallLetterP) || + (negate = this.eat(LatinCapitalLetterP)))) { + this._lastIntValue = -1; + if (this.eat(LeftCurlyBracket) && + this.eatUnicodePropertyValueExpression() && + this.eat(RightCurlyBracket)) { + this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); + return true; + } + this.raise("Invalid property name"); + } + return false; + } + consumeCharacterEscape() { + const start = this.index; + if (this.eatControlEscape() || + this.eatCControlLetter() || + this.eatZero() || + this.eatHexEscapeSequence() || + this.eatRegExpUnicodeEscapeSequence() || + (!this.strict && + !this._uFlag && + this.eatLegacyOctalEscapeSequence()) || + this.eatIdentityEscape()) { + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return false; + } + consumeKGroupName() { + const start = this.index; + if (this.eat(LatinSmallLetterK)) { + if (this.eatGroupName()) { + const groupName = this._lastStrValue; + this._backreferenceNames.add(groupName); + this.onBackreference(start - 1, this.index, groupName); + return true; + } + this.raise("Invalid named reference"); + } + return false; + } + consumeCharacterClass() { + const start = this.index; + if (this.eat(LeftSquareBracket)) { + const negate = this.eat(CircumflexAccent); + this.onCharacterClassEnter(start, negate); + this.consumeClassRanges(); + if (!this.eat(RightSquareBracket)) { + this.raise("Unterminated character class"); + } + this.onCharacterClassLeave(start, this.index, negate); + return true; + } + return false; + } + consumeClassRanges() { + const strict = this.strict || this._uFlag; + for (;;) { + const rangeStart = this.index; + if (!this.consumeClassAtom()) { + break; + } + const min = this._lastIntValue; + if (!this.eat(HyphenMinus)) { + continue; + } + this.onCharacter(this.index - 1, this.index, HyphenMinus); + if (!this.consumeClassAtom()) { + break; + } + const max = this._lastIntValue; + if (min === -1 || max === -1) { + if (strict) { + this.raise("Invalid character class"); + } + continue; + } + if (min > max) { + this.raise("Range out of order in character class"); + } + this.onCharacterClassRange(rangeStart, this.index, min, max); + } + } + consumeClassAtom() { + const start = this.index; + const cp = this.currentCodePoint; + if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { + this.advance(); + this._lastIntValue = cp; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.eat(ReverseSolidus)) { + if (this.consumeClassEscape()) { + return true; + } + if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { + this._lastIntValue = ReverseSolidus; + this.onCharacter(start, this.index, this._lastIntValue); + return true; + } + if (this.strict || this._uFlag) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + consumeClassEscape() { + const start = this.index; + if (this.eat(LatinSmallLetterB)) { + this._lastIntValue = Backspace; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + if (this._uFlag && this.eat(HyphenMinus)) { + this._lastIntValue = HyphenMinus; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + let cp = 0; + if (!this.strict && + !this._uFlag && + this.currentCodePoint === LatinSmallLetterC && + (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) { + this.advance(); + this.advance(); + this._lastIntValue = cp % 0x20; + this.onCharacter(start - 1, this.index, this._lastIntValue); + return true; + } + return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); + } + eatGroupName() { + if (this.eat(LessThanSign)) { + if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { + return true; + } + this.raise("Invalid capture group name"); + } + return false; + } + eatRegExpIdentifierName() { + if (this.eatRegExpIdentifierStart()) { + this._lastStrValue = String.fromCodePoint(this._lastIntValue); + while (this.eatRegExpIdentifierPart()) { + this._lastStrValue += String.fromCodePoint(this._lastIntValue); + } + return true; + } + return false; + } + eatRegExpIdentifierStart() { + const start = this.index; + const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === ReverseSolidus && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isRegExpIdentifierStart(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatRegExpIdentifierPart() { + const start = this.index; + const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; + let cp = this.currentCodePoint; + this.advance(); + if (cp === ReverseSolidus && + this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { + cp = this._lastIntValue; + } + else if (forceUFlag && + isLeadSurrogate(cp) && + isTrailSurrogate(this.currentCodePoint)) { + cp = combineSurrogatePair(cp, this.currentCodePoint); + this.advance(); + } + if (isRegExpIdentifierPart(cp)) { + this._lastIntValue = cp; + return true; + } + if (this.index !== start) { + this.rewind(start); + } + return false; + } + eatCControlLetter() { + const start = this.index; + if (this.eat(LatinSmallLetterC)) { + if (this.eatControlLetter()) { + return true; + } + this.rewind(start); + } + return false; + } + eatZero() { + if (this.currentCodePoint === DigitZero && + !isDecimalDigit(this.nextCodePoint)) { + this._lastIntValue = 0; + this.advance(); + return true; + } + return false; + } + eatControlEscape() { + if (this.eat(LatinSmallLetterF)) { + this._lastIntValue = FormFeed; + return true; + } + if (this.eat(LatinSmallLetterN)) { + this._lastIntValue = LineFeed; + return true; + } + if (this.eat(LatinSmallLetterR)) { + this._lastIntValue = CarriageReturn; + return true; + } + if (this.eat(LatinSmallLetterT)) { + this._lastIntValue = CharacterTabulation; + return true; + } + if (this.eat(LatinSmallLetterV)) { + this._lastIntValue = LineTabulation; + return true; + } + return false; + } + eatControlLetter() { + const cp = this.currentCodePoint; + if (isLatinLetter(cp)) { + this.advance(); + this._lastIntValue = cp % 0x20; + return true; + } + return false; + } + eatRegExpUnicodeEscapeSequence(forceUFlag = false) { + const start = this.index; + const uFlag = forceUFlag || this._uFlag; + if (this.eat(LatinSmallLetterU)) { + if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || + this.eatFixedHexDigits(4) || + (uFlag && this.eatRegExpUnicodeCodePointEscape())) { + return true; + } + if (this.strict || uFlag) { + this.raise("Invalid unicode escape"); + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeSurrogatePairEscape() { + const start = this.index; + if (this.eatFixedHexDigits(4)) { + const lead = this._lastIntValue; + if (isLeadSurrogate(lead) && + this.eat(ReverseSolidus) && + this.eat(LatinSmallLetterU) && + this.eatFixedHexDigits(4)) { + const trail = this._lastIntValue; + if (isTrailSurrogate(trail)) { + this._lastIntValue = combineSurrogatePair(lead, trail); + return true; + } + } + this.rewind(start); + } + return false; + } + eatRegExpUnicodeCodePointEscape() { + const start = this.index; + if (this.eat(LeftCurlyBracket) && + this.eatHexDigits() && + this.eat(RightCurlyBracket) && + isValidUnicode(this._lastIntValue)) { + return true; + } + this.rewind(start); + return false; + } + eatIdentityEscape() { + const cp = this.currentCodePoint; + if (this.isValidIdentityEscape(cp)) { + this._lastIntValue = cp; + this.advance(); + return true; + } + return false; + } + isValidIdentityEscape(cp) { + if (cp === -1) { + return false; + } + if (this._uFlag) { + return isSyntaxCharacter(cp) || cp === Solidus; + } + if (this.strict) { + return !isIdContinue(cp); + } + if (this._nFlag) { + return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); + } + return cp !== LatinSmallLetterC; + } + eatDecimalEscape() { + this._lastIntValue = 0; + let cp = this.currentCodePoint; + if (cp >= DigitOne && cp <= DigitNine) { + do { + this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); + this.advance(); + } while ((cp = this.currentCodePoint) >= DigitZero && + cp <= DigitNine); + return true; + } + return false; + } + eatUnicodePropertyValueExpression() { + const start = this.index; + if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { + this._lastKeyValue = this._lastStrValue; + if (this.eatUnicodePropertyValue()) { + this._lastValValue = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, this._lastKeyValue, this._lastValValue)) { + return true; + } + this.raise("Invalid property name"); + } + } + this.rewind(start); + if (this.eatLoneUnicodePropertyNameOrValue()) { + const nameOrValue = this._lastStrValue; + if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { + this._lastKeyValue = "General_Category"; + this._lastValValue = nameOrValue; + return true; + } + if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { + this._lastKeyValue = nameOrValue; + this._lastValValue = ""; + return true; + } + this.raise("Invalid property name"); + } + return false; + } + eatUnicodePropertyName() { + this._lastStrValue = ""; + while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatUnicodePropertyValue() { + this._lastStrValue = ""; + while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { + this._lastStrValue += String.fromCodePoint(this.currentCodePoint); + this.advance(); + } + return this._lastStrValue !== ""; + } + eatLoneUnicodePropertyNameOrValue() { + return this.eatUnicodePropertyValue(); + } + eatHexEscapeSequence() { + const start = this.index; + if (this.eat(LatinSmallLetterX)) { + if (this.eatFixedHexDigits(2)) { + return true; + } + if (this._uFlag || this.strict) { + this.raise("Invalid escape"); + } + this.rewind(start); + } + return false; + } + eatDecimalDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isDecimalDigit(this.currentCodePoint)) { + this._lastIntValue = + 10 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatHexDigits() { + const start = this.index; + this._lastIntValue = 0; + while (isHexDigit(this.currentCodePoint)) { + this._lastIntValue = + 16 * this._lastIntValue + digitToInt(this.currentCodePoint); + this.advance(); + } + return this.index !== start; + } + eatLegacyOctalEscapeSequence() { + if (this.eatOctalDigit()) { + const n1 = this._lastIntValue; + if (this.eatOctalDigit()) { + const n2 = this._lastIntValue; + if (n1 <= 3 && this.eatOctalDigit()) { + this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; + } + else { + this._lastIntValue = n1 * 8 + n2; + } + } + else { + this._lastIntValue = n1; + } + return true; + } + return false; + } + eatOctalDigit() { + const cp = this.currentCodePoint; + if (isOctalDigit(cp)) { + this.advance(); + this._lastIntValue = cp - DigitZero; + return true; + } + this._lastIntValue = 0; + return false; + } + eatFixedHexDigits(length) { + const start = this.index; + this._lastIntValue = 0; + for (let i = 0; i < length; ++i) { + const cp = this.currentCodePoint; + if (!isHexDigit(cp)) { + this.rewind(start); + return false; + } + this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); + this.advance(); + } + return true; + } +} + +const DummyPattern = {}; +const DummyFlags = {}; +const DummyCapturingGroup = {}; +class RegExpParserState { + constructor(options) { + this._node = DummyPattern; + this._flags = DummyFlags; + this._backreferences = []; + this._capturingGroups = []; + this.source = ""; + this.strict = Boolean(options && options.strict); + this.ecmaVersion = (options && options.ecmaVersion) || 2020; + } + get pattern() { + if (this._node.type !== "Pattern") { + throw new Error("UnknownError"); + } + return this._node; + } + get flags() { + if (this._flags.type !== "Flags") { + throw new Error("UnknownError"); + } + return this._flags; + } + onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + this._flags = { + type: "Flags", + parent: null, + start, + end, + raw: this.source.slice(start, end), + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + }; + } + onPatternEnter(start) { + this._node = { + type: "Pattern", + parent: null, + start, + end: start, + raw: "", + alternatives: [], + }; + this._backreferences.length = 0; + this._capturingGroups.length = 0; + } + onPatternLeave(start, end) { + this._node.end = end; + this._node.raw = this.source.slice(start, end); + for (const reference of this._backreferences) { + const ref = reference.ref; + const group = typeof ref === "number" + ? this._capturingGroups[ref - 1] + : this._capturingGroups.find(g => g.name === ref); + reference.resolved = group; + group.references.push(reference); + } + } + onAlternativeEnter(start) { + const parent = this._node; + if (parent.type !== "Assertion" && + parent.type !== "CapturingGroup" && + parent.type !== "Group" && + parent.type !== "Pattern") { + throw new Error("UnknownError"); + } + this._node = { + type: "Alternative", + parent, + start, + end: start, + raw: "", + elements: [], + }; + parent.alternatives.push(this._node); + } + onAlternativeLeave(start, end) { + const node = this._node; + if (node.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onGroupEnter(start) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "Group", + parent, + start, + end: start, + raw: "", + alternatives: [], + }; + parent.elements.push(this._node); + } + onGroupLeave(start, end) { + const node = this._node; + if (node.type !== "Group" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onCapturingGroupEnter(start, name) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "CapturingGroup", + parent, + start, + end: start, + raw: "", + name, + alternatives: [], + references: [], + }; + parent.elements.push(this._node); + this._capturingGroups.push(this._node); + } + onCapturingGroupLeave(start, end) { + const node = this._node; + if (node.type !== "CapturingGroup" || + node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onQuantifier(start, end, min, max, greedy) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const element = parent.elements.pop(); + if (element == null || + element.type === "Quantifier" || + (element.type === "Assertion" && element.kind !== "lookahead")) { + throw new Error("UnknownError"); + } + const node = { + type: "Quantifier", + parent, + start: element.start, + end, + raw: this.source.slice(element.start, end), + min, + max, + greedy, + element, + }; + parent.elements.push(node); + element.parent = node; + } + onLookaroundAssertionEnter(start, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = (this._node = { + type: "Assertion", + parent, + start, + end: start, + raw: "", + kind, + negate, + alternatives: [], + }); + parent.elements.push(node); + } + onLookaroundAssertionLeave(start, end) { + const node = this._node; + if (node.type !== "Assertion" || node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onEdgeAssertion(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onWordBoundaryAssertion(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Assertion", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onAnyCharacterSet(start, end, kind) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + }); + } + onEscapeCharacterSet(start, end, kind, negate) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + negate, + }); + } + onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "CharacterSet", + parent, + start, + end, + raw: this.source.slice(start, end), + kind, + key, + value, + negate, + }); + } + onCharacter(start, end, value) { + const parent = this._node; + if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + parent.elements.push({ + type: "Character", + parent, + start, + end, + raw: this.source.slice(start, end), + value, + }); + } + onBackreference(start, end, ref) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + const node = { + type: "Backreference", + parent, + start, + end, + raw: this.source.slice(start, end), + ref, + resolved: DummyCapturingGroup, + }; + parent.elements.push(node); + this._backreferences.push(node); + } + onCharacterClassEnter(start, negate) { + const parent = this._node; + if (parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + this._node = { + type: "CharacterClass", + parent, + start, + end: start, + raw: "", + negate, + elements: [], + }; + parent.elements.push(this._node); + } + onCharacterClassLeave(start, end) { + const node = this._node; + if (node.type !== "CharacterClass" || + node.parent.type !== "Alternative") { + throw new Error("UnknownError"); + } + node.end = end; + node.raw = this.source.slice(start, end); + this._node = node.parent; + } + onCharacterClassRange(start, end) { + const parent = this._node; + if (parent.type !== "CharacterClass") { + throw new Error("UnknownError"); + } + const elements = parent.elements; + const max = elements.pop(); + const hyphen = elements.pop(); + const min = elements.pop(); + if (!min || + !max || + !hyphen || + min.type !== "Character" || + max.type !== "Character" || + hyphen.type !== "Character" || + hyphen.value !== HyphenMinus) { + throw new Error("UnknownError"); + } + const node = { + type: "CharacterClassRange", + parent, + start, + end, + raw: this.source.slice(start, end), + min, + max, + }; + min.parent = node; + max.parent = node; + elements.push(node); + } +} +class RegExpParser { + constructor(options) { + this._state = new RegExpParserState(options); + this._validator = new RegExpValidator(this._state); + } + parseLiteral(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateLiteral(source, start, end); + const pattern = this._state.pattern; + const flags = this._state.flags; + const literal = { + type: "RegExpLiteral", + parent: null, + start, + end, + raw: source, + pattern, + flags, + }; + pattern.parent = literal; + flags.parent = literal; + return literal; + } + parseFlags(source, start = 0, end = source.length) { + this._state.source = source; + this._validator.validateFlags(source, start, end); + return this._state.flags; + } + parsePattern(source, start = 0, end = source.length, uFlag = false) { + this._state.source = source; + this._validator.validatePattern(source, start, end, uFlag); + return this._state.pattern; + } +} + +class RegExpVisitor { + constructor(handlers) { + this._handlers = handlers; + } + visit(node) { + switch (node.type) { + case "Alternative": + this.visitAlternative(node); + break; + case "Assertion": + this.visitAssertion(node); + break; + case "Backreference": + this.visitBackreference(node); + break; + case "CapturingGroup": + this.visitCapturingGroup(node); + break; + case "Character": + this.visitCharacter(node); + break; + case "CharacterClass": + this.visitCharacterClass(node); + break; + case "CharacterClassRange": + this.visitCharacterClassRange(node); + break; + case "CharacterSet": + this.visitCharacterSet(node); + break; + case "Flags": + this.visitFlags(node); + break; + case "Group": + this.visitGroup(node); + break; + case "Pattern": + this.visitPattern(node); + break; + case "Quantifier": + this.visitQuantifier(node); + break; + case "RegExpLiteral": + this.visitRegExpLiteral(node); + break; + default: + throw new Error(`Unknown type: ${node.type}`); + } + } + visitAlternative(node) { + if (this._handlers.onAlternativeEnter) { + this._handlers.onAlternativeEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onAlternativeLeave) { + this._handlers.onAlternativeLeave(node); + } + } + visitAssertion(node) { + if (this._handlers.onAssertionEnter) { + this._handlers.onAssertionEnter(node); + } + if (node.kind === "lookahead" || node.kind === "lookbehind") { + node.alternatives.forEach(this.visit, this); + } + if (this._handlers.onAssertionLeave) { + this._handlers.onAssertionLeave(node); + } + } + visitBackreference(node) { + if (this._handlers.onBackreferenceEnter) { + this._handlers.onBackreferenceEnter(node); + } + if (this._handlers.onBackreferenceLeave) { + this._handlers.onBackreferenceLeave(node); + } + } + visitCapturingGroup(node) { + if (this._handlers.onCapturingGroupEnter) { + this._handlers.onCapturingGroupEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onCapturingGroupLeave) { + this._handlers.onCapturingGroupLeave(node); + } + } + visitCharacter(node) { + if (this._handlers.onCharacterEnter) { + this._handlers.onCharacterEnter(node); + } + if (this._handlers.onCharacterLeave) { + this._handlers.onCharacterLeave(node); + } + } + visitCharacterClass(node) { + if (this._handlers.onCharacterClassEnter) { + this._handlers.onCharacterClassEnter(node); + } + node.elements.forEach(this.visit, this); + if (this._handlers.onCharacterClassLeave) { + this._handlers.onCharacterClassLeave(node); + } + } + visitCharacterClassRange(node) { + if (this._handlers.onCharacterClassRangeEnter) { + this._handlers.onCharacterClassRangeEnter(node); + } + this.visitCharacter(node.min); + this.visitCharacter(node.max); + if (this._handlers.onCharacterClassRangeLeave) { + this._handlers.onCharacterClassRangeLeave(node); + } + } + visitCharacterSet(node) { + if (this._handlers.onCharacterSetEnter) { + this._handlers.onCharacterSetEnter(node); + } + if (this._handlers.onCharacterSetLeave) { + this._handlers.onCharacterSetLeave(node); + } + } + visitFlags(node) { + if (this._handlers.onFlagsEnter) { + this._handlers.onFlagsEnter(node); + } + if (this._handlers.onFlagsLeave) { + this._handlers.onFlagsLeave(node); + } + } + visitGroup(node) { + if (this._handlers.onGroupEnter) { + this._handlers.onGroupEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onGroupLeave) { + this._handlers.onGroupLeave(node); + } + } + visitPattern(node) { + if (this._handlers.onPatternEnter) { + this._handlers.onPatternEnter(node); + } + node.alternatives.forEach(this.visit, this); + if (this._handlers.onPatternLeave) { + this._handlers.onPatternLeave(node); + } + } + visitQuantifier(node) { + if (this._handlers.onQuantifierEnter) { + this._handlers.onQuantifierEnter(node); + } + this.visit(node.element); + if (this._handlers.onQuantifierLeave) { + this._handlers.onQuantifierLeave(node); + } + } + visitRegExpLiteral(node) { + if (this._handlers.onRegExpLiteralEnter) { + this._handlers.onRegExpLiteralEnter(node); + } + this.visitPattern(node.pattern); + this.visitFlags(node.flags); + if (this._handlers.onRegExpLiteralLeave) { + this._handlers.onRegExpLiteralLeave(node); + } + } +} + +function parseRegExpLiteral(source, options) { + return new RegExpParser(options).parseLiteral(String(source)); +} +function validateRegExpLiteral(source, options) { + return new RegExpValidator(options).validateLiteral(source); +} +function visitRegExpAST(node, handlers) { + new RegExpVisitor(handlers).visit(node); +} + +export { ast as AST, RegExpParser, RegExpValidator, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/regexpp/index.mjs.map b/node_modules/regexpp/index.mjs.map new file mode 100644 index 0000000..ee329be --- /dev/null +++ b/node_modules/regexpp/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\index.ts"}],"names":[],"mappings":";;;;;;;AAIA,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAE3D,SAAgB,SAAS,CAAC,EAAU;IAChC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;CAC5B;AAED,SAAgB,YAAY,CAAC,EAAU;IACnC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC5B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAA;CACrD;AAED,SAAS,cAAc,CAAC,EAAU;IAC9B,OAAO,SAAS,CACZ,EAAE,EACF,kBAAkB,KAAK,kBAAkB,GAAG,sBAAsB,EAAE,CAAC,CACxE,CAAA;CACJ;AAED,SAAS,iBAAiB,CAAC,EAAU;IACjC,OAAO,SAAS,CACZ,EAAE,EACF,qBAAqB;SAChB,qBAAqB,GAAG,yBAAyB,EAAE,CAAC,CAC5D,CAAA;CACJ;AAED,SAAS,sBAAsB;IAC3B,OAAO,aAAa,CAChB,yhGAAyhG,CAC5hG,CAAA;CACJ;AAED,SAAS,yBAAyB;IAC9B,OAAO,aAAa,CAChB,utDAAutD,CAC1tD,CAAA;CACJ;AAED,SAAS,SAAS,CAAC,EAAU,EAAE,MAAgB;IAC3C,IAAI,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAC3B,CAAC,GAAG,CAAC,EACL,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,CAAC,CAAA;IACX,OAAO,CAAC,GAAG,CAAC,EAAE;QACV,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACnB,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACvB,IAAI,EAAE,GAAG,GAAG,EAAE;YACV,CAAC,GAAG,CAAC,CAAA;SACR;aAAM,IAAI,EAAE,GAAG,GAAG,EAAE;YACjB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;SACZ;aAAM;YACH,OAAO,IAAI,CAAA;SACd;KACJ;IACD,OAAO,KAAK,CAAA;CACf;AAED,SAAS,aAAa,CAAC,IAAY;IAC/B,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;CACjE;;AC3ED,MAAM,OAAO;IAOT,YAAmB,OAAe,EAAE,OAAe,EAAE,OAAe;QAChE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;KAC1B;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;CACJ;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAA;AACrD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AACvE,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,opBAAopB,EACppB,EAAE,EACF,EAAE,CACL,CAAA;AACD,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,48DAA48D,EAC58D,gHAAgH,EAChH,uEAAuE,CAC1E,CAAA;AACD,MAAM,eAAe,GAAG,IAAI,OAAO,CAC/B,69BAA69B,EAC79B,uBAAuB,EACvB,EAAE,CACL,CAAA;AAED,SAAgB,sBAAsB,CAClC,OAAe,EACf,IAAY,EACZ,KAAa;IAEb,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KAC1D;IACD,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrB,QACI,CAAC,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;aAChD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACjD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACrD;KACJ;IACD,OAAO,KAAK,CAAA;CACf;AAED,SAAgB,0BAA0B,CACtC,OAAe,EACf,KAAa;IAEb,QACI,CAAC,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;SACpD,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACzD;CACJ;;ACpEM,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,KAAK,GAAG,IAAI,CAAA;AACzB,AAAO,MAAM,WAAW,GAAG,IAAI,CAAA;AAC/B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,OAAO,GAAG,IAAI,CAAA;AAC3B,AAAO,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,KAAK,GAAG,IAAI,CAAA;AACzB,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,OAAO,GAAG,IAAI,CAAA;AAC3B,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,kBAAkB,GAAG,IAAI,CAAA;AACtC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,kBAAkB,GAAG,MAAM,CAAA;AACxC,AAAO,MAAM,eAAe,GAAG,MAAM,CAAA;AACrC,AAAO,MAAM,aAAa,GAAG,MAAM,CAAA;AACnC,AAAO,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,YAAY,GAAG,QAAQ,CAAA;AAEpC,SAAgB,aAAa,CAAC,IAAY;IACtC,QACI,CAAC,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB;SAC1D,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,EAC3D;CACJ;AAED,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,CAAA;CAChD;AAED,SAAgB,YAAY,CAAC,IAAY;IACrC,OAAO,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,UAAU,CAAA;CACjD;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,QACI,CAAC,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS;SACtC,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,CAAC;SAC3D,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,EAC3D;CACJ;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,QACI,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,cAAc;QACvB,IAAI,KAAK,aAAa;QACtB,IAAI,KAAK,kBAAkB,EAC9B;CACJ;AAED,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,YAAY,CAAA;CACtD;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,IAAI,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,EAAE;QACxD,OAAO,IAAI,GAAG,iBAAiB,GAAG,EAAE,CAAA;KACvC;IACD,IAAI,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,EAAE;QAC5D,OAAO,IAAI,GAAG,mBAAmB,GAAG,EAAE,CAAA;KACzC;IACD,OAAO,IAAI,GAAG,SAAS,CAAA;CAC1B;AAED,SAAgB,eAAe,CAAC,IAAY;IACxC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAA;CAC1C;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAA;CAC1C;AAED,SAAgB,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC5D,OAAO,CAAC,IAAI,GAAG,MAAM,IAAI,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO,CAAA;CAC9D;;ACpID,MAAM,UAAU,GAAG;IACf,EAAE,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;QAChC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;KACxC;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,CAAA;KACX;CACJ,CAAA;AACD,MAAM,WAAW,GAAG;IAChB,EAAE,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;QAChC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,CAAA;KAC1C;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAA;KAC5B;CACJ,CAAA;AAED,MAAa,MAAM;IAAnB;QACY,UAAK,GAAG,UAAU,CAAA;QAClB,OAAE,GAAG,EAAE,CAAA;QACP,OAAE,GAAG,CAAC,CAAA;QACN,SAAI,GAAG,CAAC,CAAA;QACR,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;KAkG5B;IAhGG,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,EAAE,CAAA;KACjB;IAED,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,EAAE,CAAA;KACjB;IAED,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAEM,KAAK,CACR,MAAc,EACd,KAAa,EACb,GAAW,EACX,KAAc;QAEd,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAA;QAC7C,IAAI,CAAC,EAAE,GAAG,MAAM,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KACrB;IAEM,MAAM,CAAC,KAAa;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAA;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC9C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACzD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACpE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,IAAI,EACT,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CACzC,CAAA;KACJ;IAEM,OAAO;QACV,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE;YAClB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;YACvB,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,CAAA;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAC3C,CAAA;SACJ;KACJ;IAEM,GAAG,CAAC,EAAU;QACjB,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAEM,IAAI,CAAC,GAAW,EAAE,GAAW;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;YACxC,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAEM,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;YAC7D,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;CACJ;;MC9HY,iBAAkB,SAAQ,WAAW;IAE9C,YACI,MAAc,EACd,KAAc,EACd,KAAa,EACb,OAAe;QAGf,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACzB,MAAM,GAAG,IAAI,MAAM,IAAI,KAAK,GAAG,GAAG,GAAG,EAAE,EAAE,CAAA;aAC5C;YACD,MAAM,GAAG,KAAK,MAAM,EAAE,CAAA;SACzB;QAGD,KAAK,CAAC,6BAA6B,MAAM,KAAK,OAAO,EAAE,CAAC,CAAA;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;KACrB;CACJ;;ACyDD,SAAS,iBAAiB,CAAC,EAAU;IACjC,QACI,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,UAAU;QACjB,EAAE,KAAK,cAAc;QACrB,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,YAAY;QACnB,EAAE,KAAK,eAAe;QACtB,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,iBAAiB;QACxB,EAAE,KAAK,kBAAkB;QACzB,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,iBAAiB;QACxB,EAAE,KAAK,YAAY,EACtB;CACJ;AAED,SAAS,uBAAuB,CAAC,EAAU;IACvC,OAAO,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,UAAU,IAAI,EAAE,KAAK,OAAO,CAAA;CAC9D;AAED,SAAS,sBAAsB,CAAC,EAAU;IACtC,QACI,YAAY,CAAC,EAAE,CAAC;QAChB,EAAE,KAAK,UAAU;QACjB,EAAE,KAAK,OAAO;QACd,EAAE,KAAK,kBAAkB;QACzB,EAAE,KAAK,eAAe,EACzB;CACJ;AAED,SAAS,8BAA8B,CAAC,EAAU;IAC9C,OAAO,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAA;CAC7C;AAED,SAAS,+BAA+B,CAAC,EAAU;IAC/C,OAAO,8BAA8B,CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,EAAE,CAAC,CAAA;CAClE;AAmSD,MAAa,eAAe;IAoBxB,YAAmB,OAAiC;QAlBnC,YAAO,GAAG,IAAI,MAAM,EAAE,CAAA;QAC/B,WAAM,GAAG,KAAK,CAAA;QACd,WAAM,GAAG,KAAK,CAAA;QACd,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,EAAE,CAAA;QAClB,kBAAa,GAAG,EAAE,CAAA;QAClB,kBAAa,GAAG,EAAE,CAAA;QAClB,iCAA4B,GAAG,KAAK,CAAA;QACpC,wBAAmB,GAAG,CAAC,CAAA;QACvB,gBAAW,GAAG,IAAI,GAAG,EAAU,CAAA;QAC/B,wBAAmB,GAAG,IAAI,GAAG,EAAU,CAAA;QAO3C,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAA;KAChC;IAQM,eAAe,CAClB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACjC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAE9B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAChE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAA;YAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YAC7C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAA;YAC1C,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;SAChE;aAAM,IAAI,KAAK,IAAI,GAAG,EAAE;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;SACtB;aAAM;YACH,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACrD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;KAClC;IAQM,aAAa,CAChB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAA;QACvC,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,UAAU,GAAG,KAAK,CAAA;QACtB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;YAEjC,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,oBAAoB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aAC/C;YACD,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEvB,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBAC5B,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBACnC,UAAU,GAAG,IAAI,CAAA;aACpB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBACnC,SAAS,GAAG,IAAI,CAAA;aACnB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM;gBACH,IAAI,CAAC,KAAK,CAAC,iBAAiB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aAC5C;SACJ;QACD,IAAI,CAAC,OAAO,CACR,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,CACT,CAAA;KACJ;IASM,eAAe,CAClB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM,EAC3B,KAAK,GAAG,KAAK;QAEb,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC/C,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC/C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAC9B,IAAI,CAAC,cAAc,EAAE,CAAA;QAErB,IACI,CAAC,IAAI,CAAC,MAAM;YACZ,IAAI,CAAC,WAAW,IAAI,IAAI;YACxB,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAC3B;YACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;YAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YAClB,IAAI,CAAC,cAAc,EAAE,CAAA;SACxB;KACJ;IAID,IAAY,MAAM;QACd,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;KACtD;IAED,IAAY,WAAW;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAA;KAC3C;IAEO,cAAc,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;SACtC;KACJ;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC3C;KACJ;IAEO,OAAO,CACX,KAAa,EACb,GAAW,EACX,MAAe,EACf,UAAmB,EACnB,SAAkB,EAClB,OAAgB,EAChB,MAAe,EACf,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACvB,IAAI,CAAC,QAAQ,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,CACT,CAAA;SACJ;KACJ;IAEO,cAAc,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;SACtC;KACJ;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC3C;KACJ;IAEO,kBAAkB,CAAC,KAAa;QACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;SAC1C;KACJ;IAEO,kBAAkB,CAAC,KAAa,EAAE,GAAW;QACjD,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC/C;KACJ;IAEO,kBAAkB,CAAC,KAAa,EAAE,KAAa;QACnD,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;SACjD;KACJ;IAEO,kBAAkB,CACtB,KAAa,EACb,GAAW,EACX,KAAa;QAEb,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;SACtD;KACJ;IAEO,YAAY,CAAC,KAAa;QAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;SACpC;KACJ;IAEO,YAAY,CAAC,KAAa,EAAE,GAAW;QAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SACzC;KACJ;IAEO,qBAAqB,CAAC,KAAa,EAAE,IAAmB;QAC5D,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;SACnD;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,IAAmB;QAEnB,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SACxD;KACJ;IAEO,YAAY,CAChB,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW,EACX,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SAC3D;KACJ;IAEO,0BAA0B,CAC9B,KAAa,EACb,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAChE;KACJ;IAEO,0BAA0B,CAC9B,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SACrE;KACJ;IAEO,eAAe,CACnB,KAAa,EACb,GAAW,EACX,IAAqB;QAErB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SAClD;KACJ;IAEO,uBAAuB,CAC3B,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE;YACvC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAClE;KACJ;IAEO,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,IAAW;QAC7D,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;YACjC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SACpD;KACJ;IAEO,oBAAoB,CACxB,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE;YACpC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAC/D;KACJ;IAEO,6BAA6B,CACjC,KAAa,EACb,GAAW,EACX,IAAgB,EAChB,GAAW,EACX,KAAoB,EACpB,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE;YAC7C,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CACvC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,CACT,CAAA;SACJ;KACJ;IAEO,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACzD,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;SAC/C;KACJ;IAEO,eAAe,CACnB,KAAa,EACb,GAAW,EACX,GAAoB;QAEpB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SACjD;KACJ;IAEO,qBAAqB,CAAC,KAAa,EAAE,MAAe;QACxD,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;SACrD;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SAC1D;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW;QAEX,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SAC5D;KACJ;IAMD,IAAY,MAAM;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;KAC7B;IAED,IAAY,KAAK;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;KAC5B;IAED,IAAY,gBAAgB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAA;KACvC;IAED,IAAY,aAAa;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAA;KACpC;IAED,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;KACrC;IAED,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;KACrC;IAEO,KAAK,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;QACpD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KACtD;IAEO,MAAM,CAAC,KAAa;QACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KAC7B;IAEO,OAAO;QACX,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;KACzB;IAEO,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;KAC9B;IAEO,IAAI,CAAC,GAAW,EAAE,GAAW;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KACrC;IAEO,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;KAC1C;IAIO,KAAK,CAAC,OAAe;QACzB,MAAM,IAAI,iBAAiB,CACvB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,EACV,OAAO,CACV,CAAA;KACJ;IAGO,aAAa;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,OAAO,GAAG,KAAK,CAAA;QAEnB,SAAS;YACL,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,gBAAgB,CAAC,EAAE,CAAC,EAAE;gBACnC,MAAM,IAAI,GAAG,OAAO,GAAG,iBAAiB,GAAG,oBAAoB,CAAA;gBAC/D,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAA;aACrC;YACD,IAAI,OAAO,EAAE;gBACT,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IAAI,EAAE,KAAK,cAAc,EAAE;gBAC9B,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACjC,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,kBAAkB,EAAE;gBAClC,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IACH,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,OAAO;iBAC1B,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,EAC3C;gBACE,MAAK;aACR;YACD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IASO,cAAc;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;QACtD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAA;QAEhC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,kBAAkB,EAAE,CAAA;QAEzB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC,EAAE;YAC9B,IAAI,EAAE,KAAK,gBAAgB,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;aAC9B;YACD,IAAI,EAAE,KAAK,cAAc,EAAE;gBACvB,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;aACrC;YACD,IAAI,EAAE,KAAK,kBAAkB,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACvD,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;aACzC;YACD,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;YAClC,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAA;SAC5C;QACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,mBAAmB,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;aACjD;SACJ;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IAMO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,KAAK,GAAG,CAAC,CAAA;QACb,IAAI,EAAE,GAAG,CAAC,CAAA;QAEV,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,gBAAgB,MAAM,CAAC,CAAC,EAAE;YACxC,IAAI,OAAO,EAAE;gBACT,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IAAI,EAAE,KAAK,cAAc,EAAE;gBAC9B,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACjC,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,kBAAkB,EAAE;gBAClC,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IACH,EAAE,KAAK,eAAe;gBACtB,CAAC,OAAO;iBACP,IAAI,CAAC,aAAa,KAAK,YAAY;qBAC/B,IAAI,CAAC,cAAc,KAAK,YAAY;wBACjC,IAAI,CAAC,cAAc,KAAK,UAAU;wBAClC,IAAI,CAAC,cAAc,KAAK,eAAe,CAAC,CAAC,EACnD;gBACE,KAAK,IAAI,CAAC,CAAA;aACb;YACD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClB,OAAO,KAAK,CAAA;KACf;IAUO,kBAAkB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,GAAG,CAAC,CAAA;QAET,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAC9B,GAAG;YACC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAA;SAC/B,QAAQ,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAC;QAEhC,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;SAClC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;SACzC;QACD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;KAC7C;IAUO,kBAAkB,CAAC,CAAS;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACjC,OAAO,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;SAE1D;QACD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;KAChD;IAmBO,WAAW;QACf,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,QACI,IAAI,CAAC,gBAAgB,EAAE;iBACtB,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC,EAC3D;SACJ;QACD,QACI,CAAC,IAAI,CAAC,gBAAgB,EAAE;aACnB,CAAC,IAAI,CAAC,4BAA4B;gBAC/B,IAAI,CAAC,yBAAyB,EAAE,CAAC;aACxC,IAAI,CAAC,mBAAmB,EAAE,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC,EACnE;KACJ;IACO,yBAAyB;QAC7B,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,OAAO,IAAI,CAAA;KACd;IAyBO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,4BAA4B,GAAG,KAAK,CAAA;QAGzC,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;YAChD,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACtB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YAC9C,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE;YAChD,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAE;YAC9C,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;YAC9D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE;YAC1C,MAAM,UAAU,GACZ,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;YACtD,IAAI,MAAM,GAAG,KAAK,CAAA;YAClB,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,EAAE;gBAC9D,MAAM,IAAI,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAA;gBACpD,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBACpD,IAAI,CAAC,kBAAkB,EAAE,CAAA;gBACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;oBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;iBACnC;gBACD,IAAI,CAAC,4BAA4B,GAAG,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;gBAC/D,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBAChE,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAmBO,iBAAiB,CAAC,SAAS,GAAG,KAAK;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,MAAM,GAAG,KAAK,CAAA;QAGlB,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpB,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;SACjC;aAAM,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;SACjC;aAAM,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC/B,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,CAAC,CAAA;SACV;aAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE;YAC5C,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YACxB,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;SAC3B;aAAM;YACH,OAAO,KAAK,CAAA;SACf;QAGD,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAEhC,IAAI,CAAC,SAAS,EAAE;YACZ,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SACzD;QACD,OAAO,IAAI,CAAA;KACd;IAaO,mBAAmB,CAAC,OAAgB;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;YACtB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAA;YAC7C,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBAC5D,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE;0BACtC,IAAI,CAAC,aAAa;0BAClB,MAAM,CAAC,iBAAiB,CAAA;iBACjC;gBACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;oBAC7B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE;wBACrD,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;qBACtD;oBACD,OAAO,IAAI,CAAA;iBACd;aACJ;YACD,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;gBAC1C,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;aACtC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAeO,WAAW;QACf,QACI,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,+BAA+B,EAAE;YACtC,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,qBAAqB,EAAE,EAC/B;KACJ;IASO,UAAU;QACd,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACzD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE;gBAC1B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IASO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE;YACjD,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YACxB,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;aACnC;YACD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,qBAAqB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;YAC3B,IAAI,IAAI,GAAkB,IAAI,CAAA;YAC9B,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC1B,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;oBAC9B,IAAI,GAAG,IAAI,CAAC,aAAa,CAAA;iBAC5B;aACJ;iBAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,YAAY,EAAE;gBAC/C,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;aAC9B;YAED,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACvC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;aACnC;YACD,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAEnD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,mBAAmB;QACvB,QACI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,+BAA+B,EAAE;YACtC,IAAI,CAAC,gCAAgC,EAAE;YACvC,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,8BAA8B,EAAE;YACrC,IAAI,CAAC,+BAA+B,EAAE,EACzC;KACJ;IASO,gCAAgC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IACI,IAAI,CAAC,gBAAgB,KAAK,cAAc;YACxC,IAAI,CAAC,aAAa,KAAK,iBAAiB,EAC1C;YACE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAC1C,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;YACnD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAaO,8BAA8B;QAClC,IAAI,IAAI,CAAC,mBAAmB,CAAgB,IAAI,CAAC,EAAE;YAC/C,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;SAClC;QACD,OAAO,KAAK,CAAA;KACf;IAWO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE;YACrC,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAWO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IACI,EAAE,KAAK,CAAC,CAAC;YACT,EAAE,KAAK,gBAAgB;YACvB,EAAE,KAAK,UAAU;YACjB,EAAE,KAAK,cAAc;YACrB,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,YAAY;YACnB,EAAE,KAAK,eAAe;YACtB,EAAE,KAAK,gBAAgB;YACvB,EAAE,KAAK,iBAAiB;YACxB,EAAE,KAAK,YAAY,EACrB;YACE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAYO,qBAAqB;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACxB,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;oBAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;oBACxC,OAAO,IAAI,CAAA;iBACd;gBACD,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;aAC7C;YACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;SAC9B;QACD,OAAO,KAAK,CAAA;KACf;IAiBO,iBAAiB;QACrB,IACI,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,2BAA2B,EAAE;YAClC,IAAI,CAAC,sBAAsB,EAAE;aAC5B,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAC3C;YACE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;SAC/B;QACD,OAAO,KAAK,CAAA;KACf;IAWO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;YACzB,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAA;YAC5B,IAAI,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC/B,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC9C,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAoBO,2BAA2B;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;YAChE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;YAChE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;YAC9D,OAAO,IAAI,CAAA;SACd;QAED,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IACI,IAAI,CAAC,MAAM;YACX,IAAI,CAAC,WAAW,IAAI,IAAI;aACvB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;iBACvB,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAC/C;YACE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IACI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;gBAC1B,IAAI,CAAC,iCAAiC,EAAE;gBACxC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAC7B;gBACE,IAAI,CAAC,6BAA6B,CAC9B,KAAK,GAAG,CAAC,EACT,IAAI,CAAC,KAAK,EACV,UAAU,EACV,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,aAAa,IAAI,IAAI,EAC1B,MAAM,CACT,CAAA;gBACD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACtC;QAED,OAAO,KAAK,CAAA;KACf;IAiBO,sBAAsB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IACI,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,8BAA8B,EAAE;aACpC,CAAC,IAAI,CAAC,MAAM;gBACT,CAAC,IAAI,CAAC,MAAM;gBACZ,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACxC,IAAI,CAAC,iBAAiB,EAAE,EAC1B;YACE,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,iBAAiB;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAA;gBACpC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;gBACvC,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;gBACtD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;SACxC;QACD,OAAO,KAAK,CAAA;KACf;IAYO,qBAAqB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;YACzC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACzC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;gBAC/B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;aAC7C;YACD,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACrD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,kBAAkB;QACtB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAA;QACzC,SAAS;YAEL,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAA;YAC7B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC1B,MAAK;aACR;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YAG9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;gBACxB,SAAQ;aACX;YACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;YAGzD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC1B,MAAK;aACR;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YAG9B,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;gBAC1B,IAAI,MAAM,EAAE;oBACR,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;iBACxC;gBACD,SAAQ;aACX;YACD,IAAI,GAAG,GAAG,GAAG,EAAE;gBACX,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;aACtD;YAED,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SAC/D;KACJ;IAiBO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAEhC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,cAAc,IAAI,EAAE,KAAK,kBAAkB,EAAE;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YACvD,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBAC3B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,iBAAiB,EAAE;gBAC7D,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;gBACnC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;gBACvD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAmBO,kBAAkB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAGxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAA;YAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACtC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;YAChC,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IACI,CAAC,IAAI,CAAC,MAAM;YACZ,CAAC,IAAI,CAAC,MAAM;YACZ,IAAI,CAAC,gBAAgB,KAAK,iBAAiB;aAC1C,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,EAC/D;YACE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;YAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAED,QACI,IAAI,CAAC,2BAA2B,EAAE,IAAI,IAAI,CAAC,sBAAsB,EAAE,EACtE;KACJ;IAWO,YAAY;QAChB,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACxB,IAAI,IAAI,CAAC,uBAAuB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;gBAC7D,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC3C;QACD,OAAO,KAAK,CAAA;KACf;IAaO,uBAAuB;QAC3B,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE;YACjC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAC,uBAAuB,EAAE,EAAE;gBACnC,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;aACjE;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAgBO,wBAAwB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC3D,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QAEd,IACI,EAAE,KAAK,cAAc;YACrB,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,EACjD;YACE,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;SAC1B;aAAM,IACH,UAAU;YACV,eAAe,CAAC,EAAE,CAAC;YACnB,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC;YACE,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,uBAAuB,CAAC,EAAE,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC3D,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QAEd,IACI,EAAE,KAAK,cAAc;YACrB,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,EACjD;YACE,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;SAC1B;aAAM,IACH,UAAU;YACV,eAAe,CAAC,EAAE,CAAC;YACnB,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC;YACE,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,sBAAsB,CAAC,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAUO,iBAAiB;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBACzB,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAUO,OAAO;QACX,IACI,IAAI,CAAC,gBAAgB,KAAK,SAAS;YACnC,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EACrC;YACE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;YACtB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAYO,gBAAgB;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAA;YAC7B,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAA;YAC7B,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAA;YACxC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAaO,gBAAgB;QACpB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,aAAa,CAAC,EAAE,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;YAC9B,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAiBO,8BAA8B,CAAC,UAAU,GAAG,KAAK;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,KAAK,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,CAAA;QAEvC,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IACI,CAAC,KAAK,IAAI,IAAI,CAAC,mCAAmC,EAAE;gBACpD,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;iBACxB,KAAK,IAAI,IAAI,CAAC,+BAA+B,EAAE,CAAC,EACnD;gBACE,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;gBACtB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;aACvC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAUO,mCAAmC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;YAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAA;YAC/B,IACI,eAAe,CAAC,IAAI,CAAC;gBACrB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;gBACxB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;gBAC3B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAC3B;gBACE,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAA;gBAChC,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;oBACzB,IAAI,CAAC,aAAa,GAAG,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;oBACtD,OAAO,IAAI,CAAA;iBACd;aACJ;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAUO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IACI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC1B,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;YAC3B,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EACpC;YACE,OAAO,IAAI,CAAA;SACd;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClB,OAAO,KAAK,CAAA;KACf;IAkBO,iBAAiB;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE;YAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IACO,qBAAqB,CAAC,EAAU;QACpC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YACX,OAAO,KAAK,CAAA;SACf;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAA;SACjD;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;SAC3B;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,EAAE,EAAE,KAAK,iBAAiB,IAAI,EAAE,KAAK,iBAAiB,CAAC,CAAA;SACjE;QACD,OAAO,EAAE,KAAK,iBAAiB,CAAA;KAClC;IAYO,gBAAgB;QACpB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,EAAE,IAAI,QAAQ,IAAI,EAAE,IAAI,SAAS,EAAE;YACnC,GAAG;gBACC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,IAAI,EAAE,GAAG,SAAS,CAAC,CAAA;gBAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;aACjB,QACG,CAAC,EAAE,GAAG,IAAI,CAAC,gBAAgB,KAAK,SAAS;gBACzC,EAAE,IAAI,SAAS,EAClB;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAcO,iCAAiC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAGxB,IAAI,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACvD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;YACvC,IAAI,IAAI,CAAC,uBAAuB,EAAE,EAAE;gBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBACvC,IACI,sBAAsB,CAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,aAAa,CACrB,EACH;oBACE,OAAO,IAAI,CAAA;iBACd;gBACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;aACtC;SACJ;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAGlB,IAAI,IAAI,CAAC,iCAAiC,EAAE,EAAE;YAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAA;YACtC,IACI,sBAAsB,CAClB,IAAI,CAAC,WAAW,EAChB,kBAAkB,EAClB,WAAW,CACd,EACH;gBACE,IAAI,CAAC,aAAa,GAAG,kBAAkB,CAAA;gBACvC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;gBAChC,OAAO,IAAI,CAAA;aACd;YACD,IAAI,0BAA0B,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;gBAC3D,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;gBAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;gBACvB,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACtC;QACD,OAAO,KAAK,CAAA;KACf;IAYO,sBAAsB;QAC1B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,OAAO,8BAA8B,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC1D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAA;KACnC;IAYO,uBAAuB;QAC3B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,OAAO,+BAA+B,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC3D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAA;KACnC;IAYO,iCAAiC;QACrC,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAA;KACxC;IAaO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;gBAC3B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAcO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC1C,IAAI,CAAC,aAAa;gBACd,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IAcO,YAAY;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YACtC,IAAI,CAAC,aAAa;gBACd,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IAoBO,4BAA4B;QAChC,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACtB,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;YAC7B,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;gBACtB,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;oBACjC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAA;iBAC7D;qBAAM;oBACH,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAA;iBACnC;aACJ;iBAAM;gBACH,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;aAC1B;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAWO,aAAa;QACjB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,SAAS,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,KAAK,CAAA;KACf;IAYO,iBAAiB,CAAC,MAAc;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAChC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;gBACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAClB,OAAO,KAAK,CAAA;aACf;YACD,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,EAAE,CAAC,CAAA;YAC7D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAA;KACd;CACJ;;ACv4ED,MAAM,YAAY,GAAY,EAAS,CAAA;AACvC,MAAM,UAAU,GAAU,EAAS,CAAA;AACnC,MAAM,mBAAmB,GAAmB,EAAS,CAAA;AAErD,MAAM,iBAAiB;IAUnB,YAAmB,OAA8B;QAPzC,UAAK,GAAmB,YAAY,CAAA;QACpC,WAAM,GAAU,UAAU,CAAA;QAC1B,oBAAe,GAAoB,EAAE,CAAA;QACrC,qBAAgB,GAAqB,EAAE,CAAA;QAExC,WAAM,GAAG,EAAE,CAAA;QAGd,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,CAAC,WAAW,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,CAAA;KAC9D;IAED,IAAW,OAAO;QACd,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QACD,OAAO,IAAI,CAAC,KAAK,CAAA;KACpB;IAED,IAAW,KAAK;QACZ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;KACrB;IAEM,OAAO,CACV,KAAa,EACb,GAAW,EACX,MAAe,EACf,UAAmB,EACnB,SAAkB,EAClB,OAAgB,EAChB,MAAe,EACf,MAAe;QAEf,IAAI,CAAC,MAAM,GAAG;YACV,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,MAAM;YACN,UAAU;YACV,SAAS;YACT,OAAO;YACP,MAAM;YACN,MAAM;SACT,CAAA;KACJ;IAEM,cAAc,CAAC,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,YAAY,EAAE,EAAE;SACnB,CAAA;QACD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAA;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAA;KACnC;IAEM,cAAc,CAAC,KAAa,EAAE,GAAW;QAC5C,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAE9C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE;YAC1C,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAA;YACzB,MAAM,KAAK,GACP,OAAO,GAAG,KAAK,QAAQ;kBACjB,IAAI,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,CAAC;kBAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAE,CAAA;YAC1D,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAA;YAC1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACnC;KACJ;IAEM,kBAAkB,CAAC,KAAa;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IACI,MAAM,CAAC,IAAI,KAAK,WAAW;YAC3B,MAAM,CAAC,IAAI,KAAK,gBAAgB;YAChC,MAAM,CAAC,IAAI,KAAK,OAAO;YACvB,MAAM,CAAC,IAAI,KAAK,SAAS,EAC3B;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,aAAa;YACnB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,EAAE;SACf,CAAA;QACD,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACvC;IAEM,kBAAkB,CAAC,KAAa,EAAE,GAAW;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,YAAY,CAAC,KAAa;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,OAAO;YACb,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,YAAY,EAAE,EAAE;SACnB,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACnC;IAEM,YAAY,CAAC,KAAa,EAAE,GAAW;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7D,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,qBAAqB,CAAC,KAAa,EAAE,IAAmB;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,gBAAgB;YACtB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,IAAI;YACJ,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE;SACjB,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAChC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EACpC;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,YAAY,CACf,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW,EACX,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAGD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;QACrC,IACI,OAAO,IAAI,IAAI;YACf,OAAO,CAAC,IAAI,KAAK,YAAY;aAC5B,OAAO,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,EAChE;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAe;YACrB,IAAI,EAAE,YAAY;YAClB,MAAM;YACN,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;YAC1C,GAAG;YACH,GAAG;YACH,MAAM;YACN,OAAO;SACV,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAA;KACxB;IAEM,0BAA0B,CAC7B,KAAa,EACb,IAAgC,EAChC,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,IAAyB,IAAI,CAAC,KAAK,GAAG;YAC5C,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,IAAI;YACJ,MAAM;YACN,YAAY,EAAE,EAAE;SACnB,CAAC,CAAA;QACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC7B;IAEM,0BAA0B,CAAC,KAAa,EAAE,GAAW;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,eAAe,CAClB,KAAa,EACb,GAAW,EACX,IAAqB;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;SACP,CAAC,CAAA;KACL;IAEM,uBAAuB,CAC1B,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,MAAM;SACT,CAAC,CAAA;KACL;IAEM,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,IAAW;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;SACP,CAAC,CAAA;KACL;IAEM,oBAAoB,CACvB,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,MAAM;SACT,CAAC,CAAA;KACL;IAEM,6BAA6B,CAChC,KAAa,EACb,GAAW,EACX,IAAgB,EAChB,GAAW,EACX,KAAoB,EACpB,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,GAAG;YACH,KAAK;YACL,MAAM;SACT,CAAC,CAAA;KACL;IAEM,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,KAAK;SACR,CAAC,CAAA;KACL;IAEM,eAAe,CAClB,KAAa,EACb,GAAW,EACX,GAAoB;QAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAkB;YACxB,IAAI,EAAE,eAAe;YACrB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,GAAG;YACH,QAAQ,EAAE,mBAAmB;SAChC,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAClC;IAEM,qBAAqB,CAAC,KAAa,EAAE,MAAe;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,gBAAgB;YACtB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,MAAM;YACN,QAAQ,EAAE,EAAE;SACf,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACnC;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EACpC;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAGD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,IACI,CAAC,GAAG;YACJ,CAAC,GAAG;YACJ,CAAC,MAAM;YACP,GAAG,CAAC,IAAI,KAAK,WAAW;YACxB,GAAG,CAAC,IAAI,KAAK,WAAW;YACxB,MAAM,CAAC,IAAI,KAAK,WAAW;YAC3B,MAAM,CAAC,KAAK,KAAK,WAAW,EAC9B;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAwB;YAC9B,IAAI,EAAE,qBAAqB;YAC3B,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,GAAG;YACH,GAAG;SACN,CAAA;QACD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAA;QACjB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAA;QACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KACtB;CACJ;AAuBD,MAAa,YAAY;IAQrB,YAAmB,OAA8B;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,UAAU,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACrD;IASM,YAAY,CACf,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;QAC/B,MAAM,OAAO,GAAkB;YAC3B,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG;YACH,GAAG,EAAE,MAAM;YACX,OAAO;YACP,KAAK;SACR,CAAA;QACD,OAAO,CAAC,MAAM,GAAG,OAAO,CAAA;QACxB,KAAK,CAAC,MAAM,GAAG,OAAO,CAAA;QACtB,OAAO,OAAO,CAAA;KACjB;IASM,UAAU,CACb,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;KAC3B;IAUM,YAAY,CACf,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM,EAC3B,KAAK,GAAG,KAAK;QAEb,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;KAC7B;CACJ;;MC5jBY,aAAa;IAOtB,YAAmB,QAAgC;QAC/C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;KAC5B;IAMM,KAAK,CAAC,IAAU;QACnB,QAAQ,IAAI,CAAC,IAAI;YACb,KAAK,aAAa;gBACd,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;gBAC3B,MAAK;YACT,KAAK,WAAW;gBACZ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;gBACzB,MAAK;YACT,KAAK,eAAe;gBAChB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBAC7B,MAAK;YACT,KAAK,gBAAgB;gBACjB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;gBAC9B,MAAK;YACT,KAAK,WAAW;gBACZ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;gBACzB,MAAK;YACT,KAAK,gBAAgB;gBACjB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;gBAC9B,MAAK;YACT,KAAK,qBAAqB;gBACtB,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;gBACnC,MAAK;YACT,KAAK,cAAc;gBACf,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;gBAC5B,MAAK;YACT,KAAK,OAAO;gBACR,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gBACrB,MAAK;YACT,KAAK,OAAO;gBACR,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gBACrB,MAAK;YACT,KAAK,SAAS;gBACV,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;gBACvB,MAAK;YACT,KAAK,YAAY;gBACb,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;gBAC1B,MAAK;YACT,KAAK,eAAe;gBAChB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBAC7B,MAAK;YACT;gBACI,MAAM,IAAI,KAAK,CAAC,iBAAkB,IAAY,CAAC,IAAI,EAAE,CAAC,CAAA;SAC7D;KACJ;IAEO,gBAAgB,CAAC,IAAiB;QACtC,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;SAC1C;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;SAC1C;KACJ;IACO,cAAc,CAAC,IAAe;QAClC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE;YACzD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;SAC9C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;KACJ;IACO,kBAAkB,CAAC,IAAmB;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;KACJ;IACO,mBAAmB,CAAC,IAAoB;QAC5C,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;QACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;KACJ;IACO,cAAc,CAAC,IAAe;QAClC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACxC;KACJ;IACO,mBAAmB,CAAC,IAAoB;QAC5C,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;SAC7C;KACJ;IACO,wBAAwB,CAAC,IAAyB;QACtD,IAAI,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAA;SAClD;QACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAA;SAClD;KACJ;IACO,iBAAiB,CAAC,IAAkB;QACxC,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;SAC3C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;SAC3C;KACJ;IACO,UAAU,CAAC,IAAW;QAC1B,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;KACJ;IACO,UAAU,CAAC,IAAW;QAC1B,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;QACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;SACpC;KACJ;IACO,YAAY,CAAC,IAAa;QAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;SACtC;QACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;SACtC;KACJ;IACO,eAAe,CAAC,IAAgB;QACpC,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;SACzC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;SACzC;KACJ;IACO,kBAAkB,CAAC,IAAmB;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;KACJ;CACJ;;SCzLe,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B;IAE9B,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;CAChE;AAOD,SAAgB,qBAAqB,CACjC,MAAc,EACd,OAAiC;IAEjC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;CAC9D;AAED,SAAgB,cAAc,CAC1B,IAAc,EACd,QAAgC;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;CAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/regexpp/package.json b/node_modules/regexpp/package.json new file mode 100644 index 0000000..4753479 --- /dev/null +++ b/node_modules/regexpp/package.json @@ -0,0 +1,112 @@ +{ + "_from": "regexpp@^3.1.0", + "_id": "regexpp@3.1.0", + "_inBundle": false, + "_integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "_location": "/regexpp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "regexpp@^3.1.0", + "name": "regexpp", + "escapedName": "regexpp", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "_shasum": "206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2", + "_spec": "regexpp@^3.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Toru Nagashima", + "url": "https://github.com/mysticatea" + }, + "bugs": { + "url": "https://github.com/mysticatea/regexpp/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Regular expression parser for ECMAScript.", + "devDependencies": { + "@mysticatea/eslint-plugin": "^11.0.0", + "@types/eslint": "^4.16.2", + "@types/jsdom": "^12.2.4", + "@types/mocha": "^5.2.2", + "@types/node": "^12.6.8", + "codecov": "^3.5.0", + "dts-bundle": "^0.7.3", + "eslint": "^6.1.0", + "jsdom": "^15.1.1", + "mocha": "^6.2.0", + "npm-run-all": "^4.1.5", + "nyc": "^14.1.1", + "rimraf": "^2.6.2", + "rollup": "^1.17.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "ts-node": "^8.3.0", + "typescript": "^3.5.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.*" + ], + "funding": "https://github.com/sponsors/mysticatea", + "homepage": "https://github.com/mysticatea/regexpp#readme", + "keywords": [ + "regexp", + "regular", + "expression", + "parser", + "validator", + "ast", + "abstract", + "syntax", + "tree", + "ecmascript", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020", + "annexB" + ], + "license": "MIT", + "main": "index", + "name": "regexpp", + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/regexpp.git" + }, + "scripts": { + "build": "run-s build:*", + "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", + "build:rollup": "rollup -c", + "build:tsc": "tsc --module es2015", + "clean": "rimraf .temp index.*", + "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", + "lint": "eslint scripts src test --ext .ts", + "postversion": "git push && git push --tags", + "prebuild": "npm run -s clean", + "pretest": "run-s build lint", + "preversion": "npm test", + "prewatch": "npm run -s clean", + "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", + "update:test": "ts-node scripts/update-fixtures.ts", + "update:unicode": "run-s update:unicode:*", + "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", + "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", + "version": "npm run -s build", + "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" + }, + "version": "3.1.0" +} diff --git a/node_modules/resolve-from/index.js b/node_modules/resolve-from/index.js new file mode 100644 index 0000000..d092447 --- /dev/null +++ b/node_modules/resolve-from/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const Module = require('module'); +const fs = require('fs'); + +const resolveFrom = (fromDir, moduleId, silent) => { + if (typeof fromDir !== 'string') { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); + } + + if (typeof moduleId !== 'string') { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); + } + + try { + fromDir = fs.realpathSync(fromDir); + } catch (err) { + if (err.code === 'ENOENT') { + fromDir = path.resolve(fromDir); + } else if (silent) { + return null; + } else { + throw err; + } + } + + const fromFile = path.join(fromDir, 'noop.js'); + + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDir) + }); + + if (silent) { + try { + return resolveFileName(); + } catch (err) { + return null; + } + } + + return resolveFileName(); +}; + +module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); +module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); diff --git a/node_modules/resolve-from/license b/node_modules/resolve-from/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/resolve-from/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/resolve-from/package.json b/node_modules/resolve-from/package.json new file mode 100644 index 0000000..7d9f799 --- /dev/null +++ b/node_modules/resolve-from/package.json @@ -0,0 +1,66 @@ +{ + "_from": "resolve-from@^4.0.0", + "_id": "resolve-from@4.0.0", + "_inBundle": false, + "_integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "_location": "/resolve-from", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "resolve-from@^4.0.0", + "name": "resolve-from", + "escapedName": "resolve-from", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/import-fresh" + ], + "_resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "_shasum": "4abcd852ad32dd7baabfe9b40e00a36db5f392e6", + "_spec": "resolve-from@^4.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/import-fresh", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/resolve-from/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Resolve the path of a module like `require.resolve()` but from a given path", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/resolve-from#readme", + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "import" + ], + "license": "MIT", + "name": "resolve-from", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/resolve-from.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "4.0.0" +} diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md new file mode 100644 index 0000000..e539f85 --- /dev/null +++ b/node_modules/resolve-from/readme.md @@ -0,0 +1,72 @@ +# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) + +> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path + + +## Install + +``` +$ npm install resolve-from +``` + + +## Usage + +```js +const resolveFrom = require('resolve-from'); + +// There is a file at `./foo/bar.js` + +resolveFrom('foo', './bar'); +//=> '/Users/sindresorhus/dev/test/foo/bar.js' +``` + + +## API + +### resolveFrom(fromDir, moduleId) + +Like `require()`, throws when the module can't be found. + +### resolveFrom.silent(fromDir, moduleId) + +Returns `null` instead of throwing when the module can't be found. + +#### fromDir + +Type: `string` + +Directory to resolve from. + +#### moduleId + +Type: `string` + +What you would use in `require()`. + + +## Tip + +Create a partial using a bound function if you want to resolve from the same `fromDir` multiple times: + +```js +const resolveFromFoo = resolveFrom.bind(null, 'foo'); + +resolveFromFoo('./bar'); +resolveFromFoo('./baz'); +``` + + +## Related + +- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily +- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/resolve/.editorconfig b/node_modules/resolve/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/resolve/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/resolve/.eslintignore b/node_modules/resolve/.eslintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/resolve/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/resolve/.eslintrc b/node_modules/resolve/.eslintrc new file mode 100644 index 0000000..a22863c --- /dev/null +++ b/node_modules/resolve/.eslintrc @@ -0,0 +1,39 @@ +{ + "extends": "@ljharb", + "root": true, + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "indent": [2, 4], + "strict": 0, + "complexity": 0, + "consistent-return": 0, + "curly": 0, + "dot-notation": [2, { "allowKeywords": true }], + "func-name-matching": 0, + "func-style": 0, + "global-require": 0, + "id-length": [2, { "min": 1, "max": 30 }], + "max-lines-per-function": 0, + "max-nested-callbacks": 0, + "max-params": 0, + "max-statements-per-line": [2, { "max": 2 }], + "max-statements": 0, + "no-magic-numbers": 0, + "no-console": 0, + "no-shadow": 0, + "no-unused-vars": [2, { "vars": "all", "args": "none" }], + "no-use-before-define": 0, + "object-curly-newline": 0, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + "overrides": [ + { + "files": "test/resolver/nested_symlinks/mylib/*.js", + "rules": { + "no-throw-literal": 0, + }, + }, + ], +} diff --git a/node_modules/resolve/.travis.yml b/node_modules/resolve/.travis.yml new file mode 100644 index 0000000..5ed0fa5 --- /dev/null +++ b/node_modules/resolve/.travis.yml @@ -0,0 +1,8 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml diff --git a/node_modules/resolve/LICENSE b/node_modules/resolve/LICENSE new file mode 100644 index 0000000..ff4fce2 --- /dev/null +++ b/node_modules/resolve/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/resolve/appveyor.yml b/node_modules/resolve/appveyor.yml new file mode 100644 index 0000000..9458fb8 --- /dev/null +++ b/node_modules/resolve/appveyor.yml @@ -0,0 +1,54 @@ +version: 1.0.{build} +skip_branch_with_pr: true +build: off + +environment: + matrix: + - nodejs_version: "12" + - nodejs_version: "11" + - nodejs_version: "10" + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "7" + - nodejs_version: "6" + - nodejs_version: "5" + - nodejs_version: "4" + - nodejs_version: "3" + - nodejs_version: "2" + - nodejs_version: "1" + - nodejs_version: "0.12" + - nodejs_version: "0.10" + - nodejs_version: "0.8" + - nodejs_version: "0.6" +matrix: + # fast_finish: true + allow_failures: + - nodejs_version: "5" # due to windows npm bug, registry-side + - nodejs_version: "0.8" + - nodejs_version: "0.6" + +platform: + - x86 + - x64 + +# Install scripts. (runs after repo cloning) +install: + # Fix symlinks in working copy (see https://github.com/appveyor/ci/issues/650#issuecomment-186592582) / https://github.com/charleskorn/batect/commit/d08986802ec43086902958c4ee7e57ff3e71dbef + - git config core.symlinks true + - git reset --hard + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version $env:platform + - IF %nodejs_version% EQU 0.6 npm config set strict-ssl false && npm -g install npm@1.3 + - IF %nodejs_version% EQU 0.8 npm config set strict-ssl false && npm -g install npm@1.4.28 && npm install -g npm@4.5 + - set PATH=%APPDATA%\npm;%PATH% + #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm run tests-only diff --git a/node_modules/resolve/example/async.js b/node_modules/resolve/example/async.js new file mode 100644 index 0000000..20e65dc --- /dev/null +++ b/node_modules/resolve/example/async.js @@ -0,0 +1,5 @@ +var resolve = require('../'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); diff --git a/node_modules/resolve/example/sync.js b/node_modules/resolve/example/sync.js new file mode 100644 index 0000000..54b2cc1 --- /dev/null +++ b/node_modules/resolve/example/sync.js @@ -0,0 +1,3 @@ +var resolve = require('../'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); diff --git a/node_modules/resolve/index.js b/node_modules/resolve/index.js new file mode 100644 index 0000000..125d814 --- /dev/null +++ b/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/node_modules/resolve/lib/async.js b/node_modules/resolve/lib/async.js new file mode 100644 index 0000000..06aa458 --- /dev/null +++ b/node_modules/resolve/lib/async.js @@ -0,0 +1,298 @@ +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 isCore = require('./is-core'); + +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) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultIsDir = function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +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) { + 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; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + 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 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 = path.resolve(basedir); + + maybeRealpath( + realpath, + absoluteStart, + opts, + function (err, realStart) { + if (err) cb(err); + else init(realStart); + } + ); + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + 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 (isCore(x)) { + return cb(null, x); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) { + return maybeRealpath(realpath, n, opts, function (err, realN) { + if (err) { + cb(err); + } else { + cb(null, realN, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) { + maybeRealpath(realpath, d, opts, function (err, realD) { + if (err) { + cb(err); + } else { + cb(null, realD, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + 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) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + 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); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + 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 (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; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + isDirectory(path.dirname(dir), isdir); + + function isdir(err, isdir) { + if (err) return cb(err); + if (!isdir) return processDirs(cb, dirs.slice(1)); + loadAsFile(dir, opts.package, onfile); + } + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(dir, opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + processDirs( + cb, + packageIterator ? packageIterator(x, start, thunk, opts) : thunk() + ); + } +}; diff --git a/node_modules/resolve/lib/caller.js b/node_modules/resolve/lib/caller.js new file mode 100644 index 0000000..b14a280 --- /dev/null +++ b/node_modules/resolve/lib/caller.js @@ -0,0 +1,8 @@ +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; diff --git a/node_modules/resolve/lib/core.js b/node_modules/resolve/lib/core.js new file mode 100644 index 0000000..0877650 --- /dev/null +++ b/node_modules/resolve/lib/core.js @@ -0,0 +1,53 @@ +var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; + +function specifierIncluded(specifier) { + 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 = Number(current[i] || 0); + var ver = Number(versionParts[i] || 0); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } else if (op === '>=') { + return cur >= ver; + } else { + return false; + } + } + return op === '>='; +} + +function matchesRange(range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { return false; } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(specifiers[i])) { return false; } + } + return true; +} + +function versionIncluded(specifierValue) { + if (typeof specifierValue === 'boolean') { return specifierValue; } + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(specifierValue[i])) { return true; } + } + return false; + } + return matchesRange(specifierValue); +} + +var data = require('./core.json'); + +var core = {}; +for (var mod in data) { // eslint-disable-line no-restricted-syntax + if (Object.prototype.hasOwnProperty.call(data, mod)) { + core[mod] = versionIncluded(data[mod]); + } +} +module.exports = core; diff --git a/node_modules/resolve/lib/core.json b/node_modules/resolve/lib/core.json new file mode 100644 index 0000000..d51b70b --- /dev/null +++ b/node_modules/resolve/lib/core.json @@ -0,0 +1,75 @@ +{ + "assert": true, + "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, + "dns": true, + "domain": true, + "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, + "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, + "string_decoder": true, + "sys": true, + "timers": true, + "_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, + "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/node_modules/resolve/lib/is-core.js b/node_modules/resolve/lib/is-core.js new file mode 100644 index 0000000..48bc96c --- /dev/null +++ b/node_modules/resolve/lib/is-core.js @@ -0,0 +1,5 @@ +var core = require('./core'); + +module.exports = function isCore(x) { + return Object.prototype.hasOwnProperty.call(core, x); +}; diff --git a/node_modules/resolve/lib/node-modules-paths.js b/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 0000000..2b43813 --- /dev/null +++ b/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,42 @@ +var path = require('path'); +var parse = path.parse || require('path-parse'); + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.resolve(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; diff --git a/node_modules/resolve/lib/normalize-options.js b/node_modules/resolve/lib/normalize-options.js new file mode 100644 index 0000000..4b56904 --- /dev/null +++ b/node_modules/resolve/lib/normalize-options.js @@ -0,0 +1,10 @@ +module.exports = function (x, opts) { + /** + * This file is purposefully a passthrough. It's expected that third-party + * environments will override it at runtime in order to inject special logic + * into `resolve` (by manipulating the options). One such example is the PnP + * code path in Yarn. + */ + + return opts || {}; +}; diff --git a/node_modules/resolve/lib/sync.js b/node_modules/resolve/lib/sync.js new file mode 100644 index 0000000..da74e19 --- /dev/null +++ b/node_modules/resolve/lib/sync.js @@ -0,0 +1,191 @@ +var isCore = require('./is-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 realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); +}; + +var defaultIsDir = function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); +}; + +var defaultRealpathSync = function realpathSync(x) { + try { + return realpathFS(x); + } catch (realpathErr) { + if (realpathErr.code !== 'ENOENT') { + throw realpathErr; + } + } + return x; +}; + +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.'); + } + var opts = normalizeOptions(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 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 = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return maybeRealpathSync(realpathSync, m, opts); + } else if (isCore(x)) { + return x; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return maybeRealpathSync(realpathSync, n, opts); + } + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var body = readFileSync(pkgfile); + + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + // 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(maybeRealpathSync(realpathSync, x, opts), '/package.json'); + if (isFile(pkgfile)) { + try { + var body = readFileSync(pkgfile, 'UTF8'); + var pkg = JSON.parse(body); + } catch (e) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment + } + + 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'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + 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(path.dirname(dir))) { + var m = loadAsFileSync(dir); + if (m) return m; + var n = loadAsDirectorySync(dir); + if (n) return n; + } + } + } +}; diff --git a/node_modules/resolve/package.json b/node_modules/resolve/package.json new file mode 100644 index 0000000..116cbdc --- /dev/null +++ b/node_modules/resolve/package.json @@ -0,0 +1,78 @@ +{ + "_from": "resolve@^1.17.0", + "_id": "resolve@1.17.0", + "_inBundle": false, + "_integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "_location": "/resolve", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "resolve@^1.17.0", + "name": "resolve", + "escapedName": "resolve", + "rawSpec": "^1.17.0", + "saveSpec": null, + "fetchSpec": "^1.17.0" + }, + "_requiredBy": [ + "/eslint-import-resolver-node", + "/eslint-plugin-import", + "/normalize-package-data" + ], + "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "_shasum": "b25941b54968231cc2d1bb76a79cb7f2c0bf8444", + "_spec": "resolve@^1.17.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-plugin-import", + "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": "^16.0.0", + "array.prototype.map": "^1.0.2", + "eslint": "^6.8.0", + "object-keys": "^1.1.1", + "safe-publish-latest": "^1.1.4", + "tap": "0.4.13", + "tape": "^5.0.0-next.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "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.17.0" +} diff --git a/node_modules/resolve/readme.markdown b/node_modules/resolve/readme.markdown new file mode 100644 index 0000000..5e1aea3 --- /dev/null +++ b/node_modules/resolve/readme.markdown @@ -0,0 +1,242 @@ +# resolve + +implements the [node `require.resolve()` +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/resolve.png)](http://travis-ci.org/browserify/resolve) + +# example + +asynchronously resolve: + +```js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +```js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +```js +var resolve = require('resolve'); +``` + +## 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`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* 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.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 + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* 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. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFile: fs.readFile, + isFile: function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + isDirectory: function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + 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 +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* 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) + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* 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. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFileSync: fs.readFileSync, + isFile: function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); + }, + isDirectory: function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + 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: + +```sh +npm install resolve +``` + +# license + +MIT diff --git a/node_modules/resolve/test/.eslintrc b/node_modules/resolve/test/.eslintrc new file mode 100644 index 0000000..ddd262d --- /dev/null +++ b/node_modules/resolve/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "max-lines": 0 + } +} diff --git a/node_modules/resolve/test/core.js b/node_modules/resolve/test/core.js new file mode 100644 index 0000000..4c111e1 --- /dev/null +++ b/node_modules/resolve/test/core.js @@ -0,0 +1,85 @@ +var test = require('tape'); +var keys = require('object-keys'); +var resolve = require('../'); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(resolve.isCore('fs')); + st.ok(resolve.isCore('net')); + st.ok(resolve.isCore('http')); + + st.ok(!resolve.isCore('seq')); + st.ok(!resolve.isCore('../')); + + st.ok(!resolve.isCore('toString')); + + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(resolve.core); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + if (resolve.core[mod]) { + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' supported; requiring does not throw' + ); + } else { + st.throws( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' not supported; requiring throws' + ); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + var blacklist = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (blacklist.indexOf(mod) === -1) { + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + } + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/resolve/test/dotdot.js b/node_modules/resolve/test/dotdot.js new file mode 100644 index 0000000..3080665 --- /dev/null +++ b/node_modules/resolve/test/dotdot.js @@ -0,0 +1,29 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('dotdot', function (t) { + t.plan(4); + var dir = path.join(__dirname, '/dotdot/abc'); + + resolve('..', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'dotdot/index.js')); + }); + + resolve('.', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('dotdot sync', function (t) { + t.plan(2); + var dir = path.join(__dirname, '/dotdot/abc'); + + var a = resolve.sync('..', { basedir: dir }); + t.equal(a, path.join(__dirname, 'dotdot/index.js')); + + var b = resolve.sync('.', { basedir: dir }); + t.equal(b, path.join(dir, 'index.js')); +}); diff --git a/node_modules/resolve/test/dotdot/abc/index.js b/node_modules/resolve/test/dotdot/abc/index.js new file mode 100644 index 0000000..67f2534 --- /dev/null +++ b/node_modules/resolve/test/dotdot/abc/index.js @@ -0,0 +1,2 @@ +var x = require('..'); +console.log(x); diff --git a/node_modules/resolve/test/dotdot/index.js b/node_modules/resolve/test/dotdot/index.js new file mode 100644 index 0000000..643f9fc --- /dev/null +++ b/node_modules/resolve/test/dotdot/index.js @@ -0,0 +1 @@ +module.exports = 'whatever'; diff --git a/node_modules/resolve/test/faulty_basedir.js b/node_modules/resolve/test/faulty_basedir.js new file mode 100644 index 0000000..5f2141a --- /dev/null +++ b/node_modules/resolve/test/faulty_basedir.js @@ -0,0 +1,29 @@ +var test = require('tape'); +var path = require('path'); +var resolve = require('../'); + +test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { + t.plan(1); + + var resolverDir = 'C:\\a\\b\\c\\d'; + + resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { + t.equal(!!err, true); + }); +}); + +test('non-existent basedir should not throw when preserveSymlinks is false', function (t) { + t.plan(2); + + var opts = { + basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'), + preserveSymlinks: false + }; + + var module = './dotdot/abc'; + + resolve(module, opts, function (err, res) { + t.equal(err.code, 'MODULE_NOT_FOUND'); + t.equal(res, undefined); + }); +}); diff --git a/node_modules/resolve/test/filter.js b/node_modules/resolve/test/filter.js new file mode 100644 index 0000000..8f8cccd --- /dev/null +++ b/node_modules/resolve/test/filter.js @@ -0,0 +1,34 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + resolve('./baz', { + basedir: dir, + packageFilter: function (pkg, pkgfile) { + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = [pkg, pkgfile]; + return pkg; + } + }, function (err, res, pkg) { + if (err) t.fail(err); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + var packageFile = packageFilterArgs[1]; + t.equal( + packageFile, + path.join(dir, 'baz/package.json'), + 'second packageFilter argument is "pkgfile"' + ); + + t.end(); + }); +}); diff --git a/node_modules/resolve/test/filter_sync.js b/node_modules/resolve/test/filter_sync.js new file mode 100644 index 0000000..8a43b98 --- /dev/null +++ b/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,33 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + var res = resolve.sync('./baz', { + basedir: dir, + // NOTE: in v2.x, this will be `pkg, pkgfile, dir`, but must remain "broken" here in v1.x for compatibility + packageFilter: function (pkg, /*pkgfile,*/ dir) { // eslint-disable-line spaced-comment + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = 'is 1.x' ? [pkg, dir] : [pkg, pkgfile, dir]; // eslint-disable-line no-constant-condition, no-undef + return pkg; + } + }); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + if (!'is 1.x') { // eslint-disable-line no-constant-condition + var packageFile = packageFilterArgs[1]; + t.equal(packageFile, path.join(dir, 'baz', 'package.json'), 'package.json path is correct'); + } + + var packageDir = packageFilterArgs['is 1.x' ? 1 : 2]; // eslint-disable-line no-constant-condition + // eslint-disable-next-line no-constant-condition + t.equal(packageDir, path.join(dir, 'baz'), ('is 1.x' ? 'second' : 'third') + ' packageFilter argument is "dir"'); + + t.end(); +}); diff --git a/node_modules/resolve/test/mock.js b/node_modules/resolve/test/mock.js new file mode 100644 index 0000000..b9f17fe --- /dev/null +++ b/node_modules/resolve/test/mock.js @@ -0,0 +1,239 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock from package', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, file)); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[file]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('mock package from package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('symlinked', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + cb(null, resolved); + return; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + cb(null, path.join(dir, 'symlinked', base)); + } else { + cb(null, path.join(resolved, 'symlinked')); + } + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); +}); diff --git a/node_modules/resolve/test/mock_sync.js b/node_modules/resolve/test/mock_sync.js new file mode 100644 index 0000000..fcf8114 --- /dev/null +++ b/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,141 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('bar', opts('/foo')), + path.resolve('/foo/node_modules/bar/baz.js') + ); +}); + +test('symlinked', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + return resolved; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + return path.join(dir, 'symlinked', base); + } else { + return path.join(resolved, 'symlinked'); + } + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); +}); diff --git a/node_modules/resolve/test/module_dir.js b/node_modules/resolve/test/module_dir.js new file mode 100644 index 0000000..b50e5bb --- /dev/null +++ b/node_modules/resolve/test/module_dir.js @@ -0,0 +1,56 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('moduleDirectory strings', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'module_dir'); + var xopts = { + basedir: dir, + moduleDirectory: 'xmodules' + }; + resolve('aaa', xopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var yopts = { + basedir: dir, + moduleDirectory: 'ymodules' + }; + resolve('aaa', yopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); +}); + +test('moduleDirectory array', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'module_dir'); + var aopts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('aaa', aopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var bopts = { + basedir: dir, + moduleDirectory: ['zmodules', 'ymodules', 'xmodules'] + }; + resolve('aaa', bopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); + + var copts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('bbb', copts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/zmodules/bbb/main.js')); + }); +}); diff --git a/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/node_modules/resolve/test/module_dir/xmodules/aaa/index.js new file mode 100644 index 0000000..dd7cf7b --- /dev/null +++ b/node_modules/resolve/test/module_dir/xmodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x * 100; }; diff --git a/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/node_modules/resolve/test/module_dir/ymodules/aaa/index.js new file mode 100644 index 0000000..ef2d4d4 --- /dev/null +++ b/node_modules/resolve/test/module_dir/ymodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + 100; }; diff --git a/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/node_modules/resolve/test/module_dir/zmodules/bbb/main.js new file mode 100644 index 0000000..e8ba629 --- /dev/null +++ b/node_modules/resolve/test/module_dir/zmodules/bbb/main.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 111; }; diff --git a/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/node_modules/resolve/test/module_dir/zmodules/bbb/package.json new file mode 100644 index 0000000..c13b8cf --- /dev/null +++ b/node_modules/resolve/test/module_dir/zmodules/bbb/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} diff --git a/node_modules/resolve/test/node-modules-paths.js b/node_modules/resolve/test/node-modules-paths.js new file mode 100644 index 0000000..675441d --- /dev/null +++ b/node_modules/resolve/test/node-modules-paths.js @@ -0,0 +1,143 @@ +var test = require('tape'); +var path = require('path'); +var parse = path.parse || require('path-parse'); +var keys = require('object-keys'); + +var nodeModulesPaths = require('../lib/node-modules-paths'); + +var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { + var moduleDirs = [].concat(moduleDirectories || 'node_modules'); + if (paths) { + for (var k = 0; k < paths.length; ++k) { + moduleDirs.push(path.basename(paths[k])); + } + } + + var foundModuleDirs = {}; + var uniqueDirs = {}; + var parsedDirs = {}; + for (var i = 0; i < dirs.length; ++i) { + var parsed = parse(dirs[i]); + if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } + foundModuleDirs[parsed.base] += 1; + parsedDirs[parsed.dir] = true; + uniqueDirs[dirs[i]] = true; + } + t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); + var foundModuleDirNames = keys(foundModuleDirs); + t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); + t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); + + var counts = {}; + for (var j = 0; j < foundModuleDirNames.length; ++j) { + counts[foundModuleDirs[j]] = true; + } + t.equal(keys(counts).length, 1, 'all found module directories had the same count'); +}; + +test('node-modules-paths', function (t) { + t.test('no options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('empty options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, {}); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('with paths=array option', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var dirs = nodeModulesPaths(start, { paths: paths }); + + verifyDirs(t, start, dirs, null, paths); + + t.end(); + }); + + t.test('with paths=function option', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); + }; + + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); + + verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); + + t.end(); + }); + + t.test('with paths=function skipping node modules resolution', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return []; + }; + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }); + t.deepEqual(dirs, [], 'no node_modules was computed'); + t.end(); + }); + + t.test('with moduleDirectory option', function (t) { + var start = path.join(__dirname, 'resolver'); + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory); + + t.end(); + }); + + t.test('with 1 moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory, paths); + + t.end(); + }); + + t.test('with 1+ moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectories = ['not node modules', 'other modules']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + verifyDirs(t, start, dirs, moduleDirectories, paths); + + t.end(); + }); + + t.test('combine paths correctly on Windows', function (t) { + var start = 'C:\\Users\\username\\myProject\\src'; + var paths = []; + var moduleDirectories = ['node_modules', start]; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); + + t.test('combine paths correctly on non-Windows', { skip: process.platform === 'win32' }, function (t) { + var start = '/Users/username/git/myProject/src'; + var paths = []; + var moduleDirectories = ['node_modules', '/Users/username/git/myProject/src']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); +}); diff --git a/node_modules/resolve/test/node_path.js b/node_modules/resolve/test/node_path.js new file mode 100644 index 0000000..d06aa4e --- /dev/null +++ b/node_modules/resolve/test/node_path.js @@ -0,0 +1,70 @@ +var fs = require('fs'); +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('$NODE_PATH', function (t) { + t.plan(8); + + var isDir = function (dir, cb) { + if (dir === '/node_path' || dir === 'node_path/x') { + return cb(null, true); + } + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }; + + resolve('aaa', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves'); + }); + + resolve('bbb', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves'); + }); + + resolve('ccc', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves'); + }); + + // ensure that relative paths still resolve against the regular `node_modules` correctly + resolve('tap', { + paths: [ + 'node_path' + ], + basedir: path.join(__dirname, 'node_path/x'), + isDirectory: isDir + }, function (err, res) { + var root = require('tap/package.json').main; + t.error(err); + t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves'); + }); +}); diff --git a/node_modules/resolve/test/node_path/x/aaa/index.js b/node_modules/resolve/test/node_path/x/aaa/index.js new file mode 100644 index 0000000..ad70d0b --- /dev/null +++ b/node_modules/resolve/test/node_path/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'A'; diff --git a/node_modules/resolve/test/node_path/x/ccc/index.js b/node_modules/resolve/test/node_path/x/ccc/index.js new file mode 100644 index 0000000..a64132e --- /dev/null +++ b/node_modules/resolve/test/node_path/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'C'; diff --git a/node_modules/resolve/test/node_path/y/bbb/index.js b/node_modules/resolve/test/node_path/y/bbb/index.js new file mode 100644 index 0000000..4d0f32e --- /dev/null +++ b/node_modules/resolve/test/node_path/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'B'; diff --git a/node_modules/resolve/test/node_path/y/ccc/index.js b/node_modules/resolve/test/node_path/y/ccc/index.js new file mode 100644 index 0000000..793315e --- /dev/null +++ b/node_modules/resolve/test/node_path/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY'; diff --git a/node_modules/resolve/test/nonstring.js b/node_modules/resolve/test/nonstring.js new file mode 100644 index 0000000..ef63c40 --- /dev/null +++ b/node_modules/resolve/test/nonstring.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var resolve = require('../'); + +test('nonstring', function (t) { + t.plan(1); + resolve(555, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/resolve/test/pathfilter.js b/node_modules/resolve/test/pathfilter.js new file mode 100644 index 0000000..16519ae --- /dev/null +++ b/node_modules/resolve/test/pathfilter.js @@ -0,0 +1,75 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +var resolverDir = path.join(__dirname, '/pathfilter/deep_ref'); + +var pathFilterFactory = function (t) { + return function (pkg, x, remainder) { + t.equal(pkg.version, '1.2.3'); + t.equal(x, path.join(resolverDir, 'node_modules/deep/ref')); + t.equal(remainder, 'ref'); + return 'alt'; + }; +}; + +test('#62: deep module references and the pathFilter', function (t) { + t.test('deep/ref.js', function (st) { + st.plan(3); + + resolve('deep/ref', { basedir: resolverDir }, function (err, res, pkg) { + if (err) st.fail(err); + + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + var res = resolve.sync('deep/ref', { basedir: resolverDir }); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + t.test('deep/deeper/ref', function (st) { + st.plan(4); + + resolve( + 'deep/deeper/ref', + { basedir: resolverDir }, + function (err, res, pkg) { + if (err) t.fail(err); + st.notEqual(pkg, undefined); + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + } + ); + + var res = resolve.sync( + 'deep/deeper/ref', + { basedir: resolverDir } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + }); + + t.test('deep/ref alt', function (st) { + st.plan(8); + + var pathFilter = pathFilterFactory(st); + + var res = resolve.sync( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + + resolve( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter }, + function (err, res, pkg) { + if (err) st.fail(err); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + st.end(); + } + ); + }); + + t.end(); +}); diff --git a/node_modules/resolve/test/pathfilter/deep_ref/main.js b/node_modules/resolve/test/pathfilter/deep_ref/main.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/precedence.js b/node_modules/resolve/test/precedence.js new file mode 100644 index 0000000..2febb59 --- /dev/null +++ b/node_modules/resolve/test/precedence.js @@ -0,0 +1,23 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('precedence', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'precedence/aaa'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg.name, 'resolve'); + }); +}); + +test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string + t.plan(1); + var dir = path.join(__dirname, 'precedence/bbb'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/resolve/test/precedence/aaa.js b/node_modules/resolve/test/precedence/aaa.js new file mode 100644 index 0000000..b83a3e7 --- /dev/null +++ b/node_modules/resolve/test/precedence/aaa.js @@ -0,0 +1 @@ +module.exports = 'wtf'; diff --git a/node_modules/resolve/test/precedence/aaa/index.js b/node_modules/resolve/test/precedence/aaa/index.js new file mode 100644 index 0000000..e0f8f6a --- /dev/null +++ b/node_modules/resolve/test/precedence/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'okok'; diff --git a/node_modules/resolve/test/precedence/aaa/main.js b/node_modules/resolve/test/precedence/aaa/main.js new file mode 100644 index 0000000..93542a9 --- /dev/null +++ b/node_modules/resolve/test/precedence/aaa/main.js @@ -0,0 +1 @@ +console.log(require('./')); diff --git a/node_modules/resolve/test/precedence/bbb.js b/node_modules/resolve/test/precedence/bbb.js new file mode 100644 index 0000000..2298f47 --- /dev/null +++ b/node_modules/resolve/test/precedence/bbb.js @@ -0,0 +1 @@ +module.exports = '>_<'; diff --git a/node_modules/resolve/test/precedence/bbb/main.js b/node_modules/resolve/test/precedence/bbb/main.js new file mode 100644 index 0000000..716b81d --- /dev/null +++ b/node_modules/resolve/test/precedence/bbb/main.js @@ -0,0 +1 @@ +console.log(require('./')); // should throw diff --git a/node_modules/resolve/test/resolver.js b/node_modules/resolve/test/resolver.js new file mode 100644 index 0000000..aa36ee1 --- /dev/null +++ b/node_modules/resolve/test/resolver.js @@ -0,0 +1,450 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('async foo', function (t) { + t.plan(12); + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo.js', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.main, 'resolver'); + }); + + resolve('./foo.js', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg.main, 'resolver'); + }); + + resolve('./foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + }); + + resolve('foo', { basedir: dir }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.join(dir, 'baz.js') + "'"); + }); +}); + +test('bar', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'resolver'); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar', 'package': { main: 'bar' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg.main, 'bar'); + }); +}); + +test('baz', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + + resolve('./baz', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); + + resolve('./baz', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); +}); + +test('biz', function (t) { + t.plan(24); + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + + resolve('./grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('./grux', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'biz'); + }); + + resolve('./garply', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('./garply', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('tiv', { basedir: dir + '/grux' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/grux', 'package': { main: 'grux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, 'grux'); + }); + + resolve('tiv', { basedir: dir + '/garply' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/garply', 'package': { main: './lib' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('grux', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('grux', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'tiv'); + }); + + resolve('garply', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('garply', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); +}); + +test('quux', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/quux'); + + resolve('./foo', { basedir: dir, 'package': { main: 'quux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo/index.js')); + t.equal(pkg.main, 'quux'); + }); +}); + +test('normalize', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + + resolve('../grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg, undefined); + }); +}); + +test('cup', function (t) { + t.plan(5); + var dir = path.join(__dirname, 'resolver'); + + resolve('./cup', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup.coffee', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup', { basedir: dir, extensions: ['.js'] }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('./cup', { basedir: dir, extensions: ['.js'], filename: path.join(dir, 'cupboard.js') }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.join(dir, 'cupboard.js') + "'"); + }); +}); + +test('mug', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'resolver'); + + resolve('./mug', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'mug.js')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.coffee', '.js'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, '/mug.coffee')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + t.equal(res, path.join(dir, '/mug.js')); + }); +}); + +test('other path', function (t) { + t.plan(6); + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + resolve('root', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/root.js')); + }); + + resolve('lib/other-lib', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/lib/other-lib.js')); + }); + + resolve('root', { basedir: dir }, function (err, res) { + t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('zzz', { basedir: dir, paths: [otherDir] }, function (err, res) { + t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('path iterator', function (t) { + t.plan(2); + + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + resolve('baz', { packageIterator: exactIterator }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'baz/quux.js')); + t.equal(pkg && pkg.name, 'baz'); + }); +}); + +test('incorrect main', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + resolve('./incorrect_main', { basedir: resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('without basedir', function (t) { + t.plan(1); + + var dir = path.join(__dirname, 'resolver/without_basedir'); + var tester = require(path.join(dir, 'main.js')); + + tester(t, function (err, res, pkg) { + if (err) { + t.fail(err); + } else { + t.equal(res, path.join(dir, 'node_modules/mymodule.js')); + } + }); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo.js')); + }); + + resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); + + resolve('.', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('async: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.plan(1); + resolve('./' + testFile, function (err, res, pkg) { + if (err) t.fail(err); + st.equal(res, __filename, 'sanity check'); + }); + }); + + t.test('with a fake directory', function (st) { + st.plan(4); + + resolve('./' + testFile + '/blah', function (err, res, pkg) { + st.ok(err, 'there is an error'); + st.notOk(res, 'no result'); + + st.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + err && err.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + st.end(); + }); + }); + + t.end(); +}); + +test('async dot main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('async dot slash main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_slash_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('not a directory', function (t) { + t.plan(6); + var path = './foo'; + resolve(path, { basedir: __filename }, function (err, res, pkg) { + t.ok(err, 'a non-directory errors'); + t.equal(arguments.length, 1); + t.equal(res, undefined); + t.equal(pkg, undefined); + + t.equal(err && err.message, 'Cannot find module \'' + path + '\' from \'' + __filename + '\''); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('browser field in package.json', function (t) { + t.plan(3); + + var dir = path.join(__dirname, 'resolver'); + resolve( + './browser_field', + { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign + } + return pkg; + } + }, + function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.equal(pkg && pkg.main, 'b'); + t.equal(pkg && pkg.browser, undefined); + } + ); +}); diff --git a/node_modules/resolve/test/resolver/baz/doom.js b/node_modules/resolve/test/resolver/baz/doom.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/baz/package.json b/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 0000000..2f77720 --- /dev/null +++ b/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,4 @@ +{ + "name": "baz", + "main": "quux.js" +} diff --git a/node_modules/resolve/test/resolver/baz/quux.js b/node_modules/resolve/test/resolver/baz/quux.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/baz/quux.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/browser_field/a.js b/node_modules/resolve/test/resolver/browser_field/a.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/browser_field/b.js b/node_modules/resolve/test/resolver/browser_field/b.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/browser_field/package.json b/node_modules/resolve/test/resolver/browser_field/package.json new file mode 100644 index 0000000..bf406f0 --- /dev/null +++ b/node_modules/resolve/test/resolver/browser_field/package.json @@ -0,0 +1,5 @@ +{ + "name": "browser_field", + "main": "a", + "browser": "b" +} diff --git a/node_modules/resolve/test/resolver/cup.coffee b/node_modules/resolve/test/resolver/cup.coffee new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/node_modules/resolve/test/resolver/cup.coffee @@ -0,0 +1 @@ + diff --git a/node_modules/resolve/test/resolver/dot_main/index.js b/node_modules/resolve/test/resolver/dot_main/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/dot_main/package.json b/node_modules/resolve/test/resolver/dot_main/package.json new file mode 100644 index 0000000..d7f4fc8 --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "." +} diff --git a/node_modules/resolve/test/resolver/dot_slash_main/index.js b/node_modules/resolve/test/resolver/dot_slash_main/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_slash_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/dot_slash_main/package.json b/node_modules/resolve/test/resolver/dot_slash_main/package.json new file mode 100644 index 0000000..f51287b --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_slash_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "./" +} diff --git a/node_modules/resolve/test/resolver/foo.js b/node_modules/resolve/test/resolver/foo.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/foo.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/incorrect_main/index.js b/node_modules/resolve/test/resolver/incorrect_main/index.js new file mode 100644 index 0000000..bc1fb0a --- /dev/null +++ b/node_modules/resolve/test/resolver/incorrect_main/index.js @@ -0,0 +1,2 @@ +// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/incorrect_main/package.json b/node_modules/resolve/test/resolver/incorrect_main/package.json new file mode 100644 index 0000000..b718804 --- /dev/null +++ b/node_modules/resolve/test/resolver/incorrect_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "wrong.js" +} diff --git a/node_modules/resolve/test/resolver/invalid_main/package.json b/node_modules/resolve/test/resolver/invalid_main/package.json new file mode 100644 index 0000000..0cf8279 --- /dev/null +++ b/node_modules/resolve/test/resolver/invalid_main/package.json @@ -0,0 +1,7 @@ +{ + "name": "invalid main", + "main": [ + "why is this a thing", + "srsly omg wtf" + ] +} diff --git a/node_modules/resolve/test/resolver/mug.coffee b/node_modules/resolve/test/resolver/mug.coffee new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/mug.js b/node_modules/resolve/test/resolver/mug.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/multirepo/lerna.json b/node_modules/resolve/test/resolver/multirepo/lerna.json new file mode 100644 index 0000000..d6707ca --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "0.0.0" +} diff --git a/node_modules/resolve/test/resolver/multirepo/package.json b/node_modules/resolve/test/resolver/multirepo/package.json new file mode 100644 index 0000000..8508f9d --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/package.json @@ -0,0 +1,20 @@ +{ + "name": "monorepo-symlink-test", + "private": true, + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "postinstall": "lerna bootstrap", + "test": "node packages/package-a" + }, + "author": "", + "license": "MIT", + "dependencies": { + "jquery": "^3.3.1", + "resolve": "../../../" + }, + "devDependencies": { + "lerna": "^3.4.3" + } +} diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js b/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js new file mode 100644 index 0000000..8875a32 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var assert = require('assert'); +var path = require('path'); +var resolve = require('resolve'); + +var basedir = __dirname + '/node_modules/@my-scope/package-b'; + +var expected = path.join(__dirname, '../../node_modules/jquery/dist/jquery.js'); + +/* + * preserveSymlinks === false + * will search NPM package from + * - packages/package-b/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: false }), expected); +assert.equal(resolve.sync('../../node_modules/jquery', { basedir: basedir, preserveSymlinks: false }), expected); + +/* + * preserveSymlinks === true + * will search NPM package from + * - packages/package-a/node_modules/@my-scope/packages/package-b/node_modules + * - packages/package-a/node_modules/@my-scope/packages/node_modules + * - packages/package-a/node_modules/@my-scope/node_modules + * - packages/package-a/node_modules/node_modules + * - packages/package-a/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: true }), expected); +assert.equal(resolve.sync('../../../../../node_modules/jquery', { basedir: basedir, preserveSymlinks: true }), expected); + +console.log(' * all monorepo paths successfully resolved through symlinks'); diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json b/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json new file mode 100644 index 0000000..204de51 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-a", + "version": "0.0.0", + "private": true, + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-b": "^0.0.0" + } +} diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js b/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json b/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json new file mode 100644 index 0000000..f57c3b5 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-b", + "private": true, + "version": "0.0.0", + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-a": "^0.0.0" + } +} diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js b/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js new file mode 100644 index 0000000..9b4846a --- /dev/null +++ b/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js @@ -0,0 +1,26 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b; +var c; + +var test = function test() { + console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); + console.log(b, ': preserveSymlinks true'); + console.log(c, ': preserveSymlinks false'); + + if (a !== b && a !== c) { + throw 'async: no match'; + } + console.log('async: success! a matched either b or c\n'); +}; + +require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) { + if (err) { throw err; } + b = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); +require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) { + if (err) { throw err; } + c = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); + diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json b/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json new file mode 100644 index 0000000..acfe9e9 --- /dev/null +++ b/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json @@ -0,0 +1,15 @@ +{ + "name": "mylib", + "version": "0.0.0", + "description": "", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "buffer": "*" + } +} diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js b/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js new file mode 100644 index 0000000..3283efc --- /dev/null +++ b/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js @@ -0,0 +1,12 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD'); +var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD'); + +console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); +console.log(b, ': preserveSymlinks true'); +console.log(c, ': preserveSymlinks false'); + +if (a !== b && a !== c) { + throw 'sync: no match'; +} +console.log('sync: success! a matched either b or c\n'); diff --git a/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/node_modules/resolve/test/resolver/other_path/lib/other-lib.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/other_path/root.js b/node_modules/resolve/test/resolver/other_path/root.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/quux/foo/index.js b/node_modules/resolve/test/resolver/quux/foo/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/quux/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/same_names/foo.js b/node_modules/resolve/test/resolver/same_names/foo.js new file mode 100644 index 0000000..888cae3 --- /dev/null +++ b/node_modules/resolve/test/resolver/same_names/foo.js @@ -0,0 +1 @@ +module.exports = 42; diff --git a/node_modules/resolve/test/resolver/same_names/foo/index.js b/node_modules/resolve/test/resolver/same_names/foo/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/same_names/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js b/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/symlinked/package/bar.js b/node_modules/resolve/test/resolver/symlinked/package/bar.js new file mode 100644 index 0000000..cb1c2c0 --- /dev/null +++ b/node_modules/resolve/test/resolver/symlinked/package/bar.js @@ -0,0 +1 @@ +module.exports = 'bar'; diff --git a/node_modules/resolve/test/resolver/symlinked/package/package.json b/node_modules/resolve/test/resolver/symlinked/package/package.json new file mode 100644 index 0000000..8e1b585 --- /dev/null +++ b/node_modules/resolve/test/resolver/symlinked/package/package.json @@ -0,0 +1,3 @@ +{ + "main": "bar.js" +} \ No newline at end of file diff --git a/node_modules/resolve/test/resolver/without_basedir/main.js b/node_modules/resolve/test/resolver/without_basedir/main.js new file mode 100644 index 0000000..5b31975 --- /dev/null +++ b/node_modules/resolve/test/resolver/without_basedir/main.js @@ -0,0 +1,5 @@ +var resolve = require('../../../'); + +module.exports = function (t, cb) { + resolve('mymodule', null, cb); +}; diff --git a/node_modules/resolve/test/resolver_sync.js b/node_modules/resolve/test/resolver_sync.js new file mode 100644 index 0000000..3082c96 --- /dev/null +++ b/node_modules/resolve/test/resolver_sync.js @@ -0,0 +1,358 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('foo', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: dir }), + path.join(dir, 'foo.js') + ); + + t.equal( + resolve.sync('./foo.js', { basedir: dir }), + path.join(dir, 'foo.js') + ); + + t.equal( + resolve.sync('./foo.js', { basedir: dir, filename: path.join(dir, 'bar.js') }), + path.join(dir, 'foo.js') + ); + + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }); + + // Test that filename is reported as the "from" value when passed. + t.throws( + function () { + resolve.sync('foo', { basedir: dir, filename: path.join(dir, 'bar.js') }); + }, + { + name: 'Error', + message: "Cannot find module 'foo' from '" + path.join(dir, 'bar.js') + "'" + } + ); + + t.end(); +}); + +test('bar', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('foo', { basedir: path.join(dir, 'bar') }), + path.join(dir, 'bar/node_modules/foo/index.js') + ); + t.end(); +}); + +test('baz', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./baz', { basedir: dir }), + path.join(dir, 'baz/quux.js') + ); + t.end(); +}); + +test('biz', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + t.equal( + resolve.sync('./grux', { basedir: dir }), + path.join(dir, 'grux/index.js') + ); + + t.equal( + resolve.sync('tiv', { basedir: path.join(dir, 'grux') }), + path.join(dir, 'tiv/index.js') + ); + + t.equal( + resolve.sync('grux', { basedir: path.join(dir, 'tiv') }), + path.join(dir, 'grux/index.js') + ); + t.end(); +}); + +test('normalize', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + t.equal( + resolve.sync('../grux', { basedir: dir }), + path.join(dir, 'index.js') + ); + t.end(); +}); + +test('cup', function (t) { + var dir = path.join(__dirname, 'resolver'); + t.equal( + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'cup.coffee') + ); + + t.equal( + resolve.sync('./cup.coffee', { basedir: dir }), + path.join(dir, 'cup.coffee') + ); + + t.throws(function () { + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js'] + }); + }); + + t.end(); +}); + +test('mug', function (t) { + var dir = path.join(__dirname, 'resolver'); + t.equal( + resolve.sync('./mug', { basedir: dir }), + path.join(dir, 'mug.js') + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.coffee', '.js'] + }), + path.join(dir, 'mug.coffee') + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'mug.js') + ); + + t.end(); +}); + +test('other path', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + t.equal( + resolve.sync('root', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/root.js') + ); + + t.equal( + resolve.sync('lib/other-lib', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/lib/other-lib.js') + ); + + t.throws(function () { + resolve.sync('root', { basedir: dir }); + }); + + t.throws(function () { + resolve.sync('zzz', { + basedir: dir, + paths: [otherDir] + }); + }); + + t.end(); +}); + +test('path iterator', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + t.equal( + resolve.sync('baz', { packageIterator: exactIterator }), + path.join(resolverDir, 'baz/quux.js') + ); + + t.end(); +}); + +test('incorrect main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + t.equal( + resolve.sync('./incorrect_main', { basedir: resolverDir }), + path.join(dir, 'index.js') + ); + + t.end(); +}); + +var stubStatSync = function stubStatSync(fn) { + var fs = require('fs'); + var statSync = fs.statSync; + try { + fs.statSync = function () { + throw new EvalError('Unknown Error'); + }; + return fn(); + } finally { + fs.statSync = statSync; + } +}; + +test('#79 - re-throw non ENOENT errors from stat', function (t) { + var dir = path.join(__dirname, 'resolver'); + + stubStatSync(function () { + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }, /Unknown Error/); + }); + + t.end(); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: path.join(dir, 'same_names') }), + path.join(dir, 'same_names/foo.js') + ); + t.equal( + resolve.sync('./foo/', { basedir: path.join(dir, 'same_names') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.end(); +}); + +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./', { basedir: path.join(dir, 'same_names/foo') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.equal( + resolve.sync('.', { basedir: path.join(dir, 'same_names/foo') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.end(); +}); + +test('sync: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.equal( + resolve.sync('./' + testFile), + __filename, + 'sanity check' + ); + st.end(); + }); + + t.test('with a fake directory', function (st) { + function run() { return resolve.sync('./' + testFile + '/blah'); } + + st.throws(run, 'throws an error'); + + try { + run(); + } catch (e) { + st.equal(e.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + e.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + } + + st.end(); + }); + + t.end(); +}); + +test('sync dot main', function (t) { + var start = new Date(); + t.equal(resolve.sync('./resolver/dot_main'), path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync dot slash main', function (t) { + var start = new Date(); + t.equal(resolve.sync('./resolver/dot_slash_main'), path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('not a directory', function (t) { + var path = './foo'; + try { + resolve.sync(path, { basedir: __filename }); + t.fail(); + } catch (err) { + t.ok(err, 'a non-directory errors'); + t.equal(err && err.message, 'Cannot find module \'' + path + "' from '" + __filename + "'"); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('browser field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + var res = resolve.sync('./browser_field', { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign + } + return pkg; + } + }); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.end(); +}); diff --git a/node_modules/resolve/test/shadowed_core.js b/node_modules/resolve/test/shadowed_core.js new file mode 100644 index 0000000..98c52a7 --- /dev/null +++ b/node_modules/resolve/test/shadowed_core.js @@ -0,0 +1,38 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('shadowed core modules still return core module', function (t) { + t.plan(2); + + resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, 'util'); + }); +}); + +test('shadowed core modules still return core module [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, 'util'); +}); + +test('shadowed core modules return shadow when appending `/`', function (t) { + t.plan(2); + + resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); + }); +}); + +test('shadowed core modules return shadow when appending `/` [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); +}); + diff --git a/node_modules/resolve/test/shadowed_core/node_modules/util/index.js b/node_modules/resolve/test/shadowed_core/node_modules/util/index.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/subdirs.js b/node_modules/resolve/test/subdirs.js new file mode 100644 index 0000000..b7b8450 --- /dev/null +++ b/node_modules/resolve/test/subdirs.js @@ -0,0 +1,13 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('subdirs', function (t) { + t.plan(2); + + var dir = path.join(__dirname, '/subdirs'); + resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); + }); +}); diff --git a/node_modules/resolve/test/symlinks.js b/node_modules/resolve/test/symlinks.js new file mode 100644 index 0000000..152d14e --- /dev/null +++ b/node_modules/resolve/test/symlinks.js @@ -0,0 +1,173 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); +var map = require('array.prototype.map'); +var resolve = require('../'); + +var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); +var packageDir = path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'package'); +var modADir = path.join(__dirname, 'symlinks', 'source', 'node_modules', 'mod-a'); +var symlinkModADir = path.join(__dirname, 'symlinks', 'dest', 'node_modules', 'mod-a'); +try { + fs.unlinkSync(symlinkDir); +} catch (err) {} +try { + fs.unlinkSync(packageDir); +} catch (err) {} +try { + fs.unlinkSync(modADir); +} catch (err) {} +try { + fs.unlinkSync(symlinkModADir); +} catch (err) {} + +try { + fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); +} +try { + fs.symlinkSync('../../package', packageDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'package') + '\\', packageDir, 'junction'); +} +try { + fs.symlinkSync('../../source/node_modules/mod-a', symlinkModADir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'source', 'node_modules', 'mod-a') + '\\', symlinkModADir, 'junction'); +} + +test('symlink', function (t) { + t.plan(2); + + resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { + t.error(err); + t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.plan(4); + + resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { + t.ok(err, 'there is an error'); + t.notOk(res, 'no result'); + + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + t.equal( + err && err.message, + 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', + 'can not find nonexistent module' + ); + }); +}); + +test('sync symlink', function (t) { + var start = new Date(); + t.doesNotThrow(function () { + t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.throws(function () { + resolve.sync('foo', { basedir: symlinkDir }); + }, /Cannot find module 'foo'/); + t.end(); +}); + +test('sync symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + var fn = resolve.sync('package', { basedir: basedir, preserveSymlinks: false }); + + t.equal(fn, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + t.end(); +}); + +test('async symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + t.plan(2); + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + resolve('package', { basedir: basedir, preserveSymlinks: false }, function (err, result) { + t.notOk(err, 'no error'); + t.equal(result, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + }); +}); + +test('packageFilter', function (t) { + function relative(x) { + return path.relative(__dirname, x); + } + + function testPackageFilter(preserveSymlinks) { + return function (st) { + st.plan('is 1.x' ? 3 : 5); // eslint-disable-line no-constant-condition + + var destMain = 'symlinks/dest/node_modules/mod-a/index.js'; + var destPkg = 'symlinks/dest/node_modules/mod-a/package.json'; + var sourceMain = 'symlinks/source/node_modules/mod-a/index.js'; + var sourcePkg = 'symlinks/source/node_modules/mod-a/package.json'; + var destDir = path.join(__dirname, 'symlinks', 'dest'); + + /* eslint multiline-comment-style: 0 */ + /* v2.x will restore these tests + var packageFilterPath = []; + var actualPath = resolve.sync('mod-a', { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile, dir) { + packageFilterPath.push(pkgfile); + } + }); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'sync: actual path is correct' + ); + st.deepEqual( + map(packageFilterPath, relative), + map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize), + 'sync: packageFilter pkgfile arg is correct' + ); + */ + + var asyncPackageFilterPath = []; + resolve( + 'mod-a', + { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile) { + asyncPackageFilterPath.push(pkgfile); + } + }, + function (err, actualPath) { + st.error(err, 'no error'); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'async: actual path is correct' + ); + st.deepEqual( + map(asyncPackageFilterPath, relative), + map( + preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg], + path.normalize + ), + 'async: packageFilter pkgfile arg is correct' + ); + } + ); + }; + } + + t.test('preserveSymlinks: false', testPackageFilter(false)); + + t.test('preserveSymlinks: true', testPackageFilter(true)); + + t.end(); +}); diff --git a/node_modules/rimraf/LICENSE b/node_modules/rimraf/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/rimraf/README.md b/node_modules/rimraf/README.md new file mode 100644 index 0000000..423b8cf --- /dev/null +++ b/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js new file mode 100755 index 0000000..0d1e17b --- /dev/null +++ b/node_modules/rimraf/bin.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var noglob = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}) + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + var options = {} + if (noglob) + options = { glob: false } + rimraf(args[n], options, function (er) { + if (er) + throw er + go(n+1) + }) +} diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json new file mode 100644 index 0000000..b25f22a --- /dev/null +++ b/node_modules/rimraf/package.json @@ -0,0 +1,67 @@ +{ + "_from": "rimraf@2.6.3", + "_id": "rimraf@2.6.3", + "_inBundle": false, + "_integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "_location": "/rimraf", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "rimraf@2.6.3", + "name": "rimraf", + "escapedName": "rimraf", + "rawSpec": "2.6.3", + "saveSpec": null, + "fetchSpec": "2.6.3" + }, + "_requiredBy": [ + "/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "_shasum": "b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab", + "_spec": "rimraf@2.6.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/flat-cache", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bin": { + "rimraf": "bin.js" + }, + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "bundleDependencies": false, + "dependencies": { + "glob": "^7.1.3" + }, + "deprecated": false, + "description": "A deep deletion module for node (like `rm -rf`)", + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "homepage": "https://github.com/isaacs/rimraf#readme", + "license": "ISC", + "main": "rimraf.js", + "name": "rimraf", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js" + }, + "version": "2.6.3" +} diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js new file mode 100644 index 0000000..e80dd10 --- /dev/null +++ b/node_modules/rimraf/rimraf.js @@ -0,0 +1,364 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var assert = require("assert") +var path = require("path") +var fs = require("fs") +var glob = require("glob") +var _0666 = parseInt('666', 8) + +var defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +var timeout = 0 + +var isWindows = (process.platform === "win32") + +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + var busyTries = 0 + var errState = null + var n = 0 + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, function (er, stat) { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + + function next (er) { + errState = errState || er + if (--n === 0) + cb(errState) + } + + function afterGlob (er, results) { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(function (p) { + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + }) + }) + } +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, function (er, st) { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, _0666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, _0666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + var results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (var i = 0; i < results.length; i++) { + var p = results[i] + + try { + var st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + var retries = isWindows ? 100 : 1 + var i = 0 + do { + var threw = true + try { + var ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} diff --git a/node_modules/semver/CHANGELOG.md b/node_modules/semver/CHANGELOG.md new file mode 100644 index 0000000..220af17 --- /dev/null +++ b/node_modules/semver/CHANGELOG.md @@ -0,0 +1,111 @@ +# changes log + +## 7.3.0 + +* Add `subset(r1, r2)` method to determine if `r1` range is entirely + contained by `r2` range. + +## 7.2.3 + +* Fix handling of `includePrelease` mode where version ranges like `1.0.0 - + 2.0.0` would include `3.0.0-pre` and not `1.0.0-pre`. + +## 7.2.2 + +* Fix bug where `2.0.0-pre` would be included in `^1.0.0` if + `includePrerelease` was set to true. + +## 7.2.0 + +* Add `simplifyRange` method to attempt to generate a more human-readable + range expression that is equivalent to a supplied range, for a given set + of versions. + +## 7.1.2 + +* Remove fancy lazy-loading logic, as it was causing problems for webpack + users. + +## 7.1.0 + +* Add `require('semver/preload')` to load the entire module without using + lazy getter methods. + +## 7.0.0 + +* Refactor module into separate files for better tree-shaking +* Drop support for very old node versions, use const/let, `=>` functions, + and classes. + +## 6.3.0 + +* Expose the token enum on the exports + +## 6.2.0 + +* Coerce numbers to strings when passed to semver.coerce() +* Add `rtl` option to coerce from right to left + +## 6.1.3 + +* Handle X-ranges properly in includePrerelease mode + +## 6.1.2 + +* Do not throw when testing invalid version strings + +## 6.1.1 + +* Add options support for semver.coerce() +* Handle undefined version passed to Range.test + +## 6.1.0 + +* Add semver.compareBuild function +* Support `*` in semver.intersects + +## 6.0 + +* Fix `intersects` logic. + + This is technically a bug fix, but since it is also a change to behavior + that may require users updating their code, it is marked as a major + version increment. + +## 5.7 + +* Add `minVersion` method + +## 5.6 + +* Move boolean `loose` param to an options object, with + backwards-compatibility protection. +* Add ability to opt out of special prerelease version handling with + the `includePrerelease` option flag. + +## 5.5 + +* Add version coercion capabilities + +## 5.4 + +* Add intersection checking + +## 5.3 + +* Add `minSatisfying` method + +## 5.2 + +* Add `prerelease(v)` that returns prerelease components + +## 5.1 + +* Add Backus-Naur for ranges +* Remove excessively cute inspection methods + +## 5.0 + +* Remove AMD/Browserified build artifacts +* Fix ltr and gtr when using the `*` range +* Fix for range `*` with a prerelease identifier diff --git a/node_modules/semver/LICENSE b/node_modules/semver/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/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/node_modules/semver/README.md b/node_modules/semver/README.md new file mode 100644 index 0000000..9bef045 --- /dev/null +++ b/node_modules/semver/README.md @@ -0,0 +1,566 @@ +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' +``` + +You can also just load the module for the function that you care about, if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const simplifyRange = require('semver/ranges/simplify') +const rangeSubset = require('semver/ranges/subset') +``` + +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-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.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-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-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-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-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-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.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. + +#### 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` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.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-0` 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.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-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` +* `^0.x` := `>=0.0.0 <1.0.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 +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. + +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 `Number.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` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need, if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` diff --git a/node_modules/semver/bin/semver.js b/node_modules/semver/bin/semver.js new file mode 100755 index 0000000..73fe295 --- /dev/null +++ b/node_modules/semver/bin/semver.js @@ -0,0 +1,173 @@ +#!/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. + +const argv = process.argv.slice(2) + +let versions = [] + +const range = [] + +let inc = null + +const version = require('../package.json').version + +let loose = false + +let includePrerelease = false + +let coerce = false + +let rtl = false + +let identifier + +const semver = require('../') + +let reverse = false + +const options = {} + +const main = () => { + if (!argv.length) return help() + while (argv.length) { + let a = argv.shift() + const 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 + } + } + + const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map((v) => { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter((v) => { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (let i = 0, l = range.length; i < l; i++) { + versions = versions.filter((v) => { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + + +const failInc = () => { + console.error('--inc can only be used on a single version with no range') + fail() +} + +const fail = () => process.exit(1) + +const success = () => { + const compare = reverse ? 'rcompare' : 'compare' + versions.sort((a, b) => { + return semver[compare](a, b, options) + }).map((v) => { + return semver.clean(v, options) + }).map((v) => { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach((v, i, _) => { console.log(v) }) +} + +const 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.`) + +main() diff --git a/node_modules/semver/classes/comparator.js b/node_modules/semver/classes/comparator.js new file mode 100644 index 0000000..3595792 --- /dev/null +++ b/node_modules/semver/classes/comparator.js @@ -0,0 +1,139 @@ +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + constructor (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 + } + } + + 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) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const 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) + } + } + + toString () { + return this.value + } + + test (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) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + const sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + const sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + const sameSemVer = this.semver.version === comp.semver.version + const differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + const oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<') + const oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>') + + return ( + sameDirectionIncreasing || + sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || + oppositeDirectionsGreaterThan + ) + } +} + +module.exports = Comparator + +const {re, t} = require('../internal/re') +const cmp = require('../functions/cmp') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const Range = require('./range') diff --git a/node_modules/semver/classes/index.js b/node_modules/semver/classes/index.js new file mode 100644 index 0000000..198b84d --- /dev/null +++ b/node_modules/semver/classes/index.js @@ -0,0 +1,5 @@ +module.exports = { + SemVer: require('./semver.js'), + Range: require('./range.js'), + Comparator: require('./comparator.js') +} diff --git a/node_modules/semver/classes/range.js b/node_modules/semver/classes/range.js new file mode 100644 index 0000000..83f8967 --- /dev/null +++ b/node_modules/semver/classes/range.js @@ -0,0 +1,463 @@ +// hoisted class for cyclic dependency +class Range { + constructor (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) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } + + 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 the range to a 2d array of comparators + .map(range => this.parseRange(range.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${range}`) + } + + this.format() + } + + format () { + this.range = this.set + .map((comps) => { + return comps.join(' ').trim() + }) + .join('||') + .trim() + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + const loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + 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. + + const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + return range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + .map(comp => replaceGTE0(comp, this.options)) + // in loose mode, throw out any that are not valid comparators + .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) + .map(comp => new Comparator(comp, this.options)) + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} +module.exports = Range + +const Comparator = require('./comparator') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const { + re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace +} = require('../internal/re') + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const 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 +} + +const isX = id => !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-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +const replaceTildes = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceTilde(comp, options) + }).join(' ') + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +const replaceCarets = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceCaret(comp, options) + }).join(' ') + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map((comp) => { + return replaceXRange(comp, options) + }).join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const 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 + 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 + } + } + + if (gtlt === '<') + pr = '-0' + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-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. +const 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], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp.trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// 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-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($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${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return (`${from} ${to}`).trim() +} + +const testSet = (set, version, options) => { + for (let 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 (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const 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 +} diff --git a/node_modules/semver/classes/semver.js b/node_modules/semver/classes/semver.js new file mode 100644 index 0000000..73247ad --- /dev/null +++ b/node_modules/semver/classes/semver.js @@ -0,0 +1,290 @@ +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { re, t } = require('../internal/re') + +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + 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` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const 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((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (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) + ) + } + + comparePre (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 + } + + let i = 0 + do { + const a = this.prerelease[i] + const 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) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const 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. + inc (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 { + let 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 + } +} + +module.exports = SemVer diff --git a/node_modules/semver/functions/clean.js b/node_modules/semver/functions/clean.js new file mode 100644 index 0000000..811fe6b --- /dev/null +++ b/node_modules/semver/functions/clean.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean diff --git a/node_modules/semver/functions/cmp.js b/node_modules/semver/functions/cmp.js new file mode 100644 index 0000000..3b89db7 --- /dev/null +++ b/node_modules/semver/functions/cmp.js @@ -0,0 +1,48 @@ +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const 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}`) + } +} +module.exports = cmp diff --git a/node_modules/semver/functions/coerce.js b/node_modules/semver/functions/coerce.js new file mode 100644 index 0000000..106ca71 --- /dev/null +++ b/node_modules/semver/functions/coerce.js @@ -0,0 +1,51 @@ +const SemVer = require('../classes/semver') +const parse = require('./parse') +const {re, t} = require('../internal/re') + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let 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. + let 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) +} +module.exports = coerce diff --git a/node_modules/semver/functions/compare-build.js b/node_modules/semver/functions/compare-build.js new file mode 100644 index 0000000..9eb881b --- /dev/null +++ b/node_modules/semver/functions/compare-build.js @@ -0,0 +1,7 @@ +const SemVer = require('../classes/semver') +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild diff --git a/node_modules/semver/functions/compare-loose.js b/node_modules/semver/functions/compare-loose.js new file mode 100644 index 0000000..4881fbe --- /dev/null +++ b/node_modules/semver/functions/compare-loose.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose diff --git a/node_modules/semver/functions/compare.js b/node_modules/semver/functions/compare.js new file mode 100644 index 0000000..748b7af --- /dev/null +++ b/node_modules/semver/functions/compare.js @@ -0,0 +1,5 @@ +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/node_modules/semver/functions/diff.js b/node_modules/semver/functions/diff.js new file mode 100644 index 0000000..87200ef --- /dev/null +++ b/node_modules/semver/functions/diff.js @@ -0,0 +1,23 @@ +const parse = require('./parse') +const eq = require('./eq') + +const diff = (version1, version2) => { + if (eq(version1, version2)) { + return null + } else { + const v1 = parse(version1) + const v2 = parse(version2) + const hasPre = v1.prerelease.length || v2.prerelease.length + const prefix = hasPre ? 'pre' : '' + const defaultResult = hasPre ? 'prerelease' : '' + for (const key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} +module.exports = diff diff --git a/node_modules/semver/functions/eq.js b/node_modules/semver/functions/eq.js new file mode 100644 index 0000000..271fed9 --- /dev/null +++ b/node_modules/semver/functions/eq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq diff --git a/node_modules/semver/functions/gt.js b/node_modules/semver/functions/gt.js new file mode 100644 index 0000000..d9b2156 --- /dev/null +++ b/node_modules/semver/functions/gt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt diff --git a/node_modules/semver/functions/gte.js b/node_modules/semver/functions/gte.js new file mode 100644 index 0000000..5aeaa63 --- /dev/null +++ b/node_modules/semver/functions/gte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/node_modules/semver/functions/inc.js b/node_modules/semver/functions/inc.js new file mode 100644 index 0000000..aa4d83a --- /dev/null +++ b/node_modules/semver/functions/inc.js @@ -0,0 +1,15 @@ +const SemVer = require('../classes/semver') + +const inc = (version, release, options, identifier) => { + if (typeof (options) === 'string') { + identifier = options + options = undefined + } + + try { + return new SemVer(version, options).inc(release, identifier).version + } catch (er) { + return null + } +} +module.exports = inc diff --git a/node_modules/semver/functions/lt.js b/node_modules/semver/functions/lt.js new file mode 100644 index 0000000..b440ab7 --- /dev/null +++ b/node_modules/semver/functions/lt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/node_modules/semver/functions/lte.js b/node_modules/semver/functions/lte.js new file mode 100644 index 0000000..6dcc956 --- /dev/null +++ b/node_modules/semver/functions/lte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/node_modules/semver/functions/major.js b/node_modules/semver/functions/major.js new file mode 100644 index 0000000..4283165 --- /dev/null +++ b/node_modules/semver/functions/major.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major diff --git a/node_modules/semver/functions/minor.js b/node_modules/semver/functions/minor.js new file mode 100644 index 0000000..57b3455 --- /dev/null +++ b/node_modules/semver/functions/minor.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor diff --git a/node_modules/semver/functions/neq.js b/node_modules/semver/functions/neq.js new file mode 100644 index 0000000..f944c01 --- /dev/null +++ b/node_modules/semver/functions/neq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq diff --git a/node_modules/semver/functions/parse.js b/node_modules/semver/functions/parse.js new file mode 100644 index 0000000..457fee0 --- /dev/null +++ b/node_modules/semver/functions/parse.js @@ -0,0 +1,37 @@ +const {MAX_LENGTH} = require('../internal/constants') +const { re, t } = require('../internal/re') +const SemVer = require('../classes/semver') + +const 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 + } + + const 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 + } +} + +module.exports = parse diff --git a/node_modules/semver/functions/patch.js b/node_modules/semver/functions/patch.js new file mode 100644 index 0000000..63afca2 --- /dev/null +++ b/node_modules/semver/functions/patch.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch diff --git a/node_modules/semver/functions/prerelease.js b/node_modules/semver/functions/prerelease.js new file mode 100644 index 0000000..06aa132 --- /dev/null +++ b/node_modules/semver/functions/prerelease.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/node_modules/semver/functions/rcompare.js b/node_modules/semver/functions/rcompare.js new file mode 100644 index 0000000..0ac509e --- /dev/null +++ b/node_modules/semver/functions/rcompare.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare diff --git a/node_modules/semver/functions/rsort.js b/node_modules/semver/functions/rsort.js new file mode 100644 index 0000000..82404c5 --- /dev/null +++ b/node_modules/semver/functions/rsort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/node_modules/semver/functions/satisfies.js b/node_modules/semver/functions/satisfies.js new file mode 100644 index 0000000..50af1c1 --- /dev/null +++ b/node_modules/semver/functions/satisfies.js @@ -0,0 +1,10 @@ +const Range = require('../classes/range') +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies diff --git a/node_modules/semver/functions/sort.js b/node_modules/semver/functions/sort.js new file mode 100644 index 0000000..4d10917 --- /dev/null +++ b/node_modules/semver/functions/sort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/node_modules/semver/functions/valid.js b/node_modules/semver/functions/valid.js new file mode 100644 index 0000000..f27bae1 --- /dev/null +++ b/node_modules/semver/functions/valid.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/node_modules/semver/index.js b/node_modules/semver/index.js new file mode 100644 index 0000000..57e2ae6 --- /dev/null +++ b/node_modules/semver/index.js @@ -0,0 +1,48 @@ +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +module.exports = { + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, + SemVer: require('./classes/semver'), + compareIdentifiers: require('./internal/identifiers').compareIdentifiers, + rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, + parse: require('./functions/parse'), + valid: require('./functions/valid'), + clean: require('./functions/clean'), + inc: require('./functions/inc'), + diff: require('./functions/diff'), + major: require('./functions/major'), + minor: require('./functions/minor'), + patch: require('./functions/patch'), + prerelease: require('./functions/prerelease'), + compare: require('./functions/compare'), + rcompare: require('./functions/rcompare'), + compareLoose: require('./functions/compare-loose'), + compareBuild: require('./functions/compare-build'), + sort: require('./functions/sort'), + rsort: require('./functions/rsort'), + gt: require('./functions/gt'), + lt: require('./functions/lt'), + eq: require('./functions/eq'), + neq: require('./functions/neq'), + gte: require('./functions/gte'), + lte: require('./functions/lte'), + cmp: require('./functions/cmp'), + coerce: require('./functions/coerce'), + Comparator: require('./classes/comparator'), + Range: require('./classes/range'), + satisfies: require('./functions/satisfies'), + toComparators: require('./ranges/to-comparators'), + maxSatisfying: require('./ranges/max-satisfying'), + minSatisfying: require('./ranges/min-satisfying'), + minVersion: require('./ranges/min-version'), + validRange: require('./ranges/valid'), + outside: require('./ranges/outside'), + gtr: require('./ranges/gtr'), + ltr: require('./ranges/ltr'), + intersects: require('./ranges/intersects'), + simplifyRange: require('./ranges/simplify'), + subset: require('./ranges/subset'), +} diff --git a/node_modules/semver/internal/constants.js b/node_modules/semver/internal/constants.js new file mode 100644 index 0000000..49df215 --- /dev/null +++ b/node_modules/semver/internal/constants.js @@ -0,0 +1,17 @@ +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +module.exports = { + SEMVER_SPEC_VERSION, + MAX_LENGTH, + MAX_SAFE_INTEGER, + MAX_SAFE_COMPONENT_LENGTH +} diff --git a/node_modules/semver/internal/debug.js b/node_modules/semver/internal/debug.js new file mode 100644 index 0000000..1c00e13 --- /dev/null +++ b/node_modules/semver/internal/debug.js @@ -0,0 +1,9 @@ +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug diff --git a/node_modules/semver/internal/identifiers.js b/node_modules/semver/internal/identifiers.js new file mode 100644 index 0000000..ed13094 --- /dev/null +++ b/node_modules/semver/internal/identifiers.js @@ -0,0 +1,23 @@ +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const 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 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers +} diff --git a/node_modules/semver/internal/re.js b/node_modules/semver/internal/re.js new file mode 100644 index 0000000..54d4176 --- /dev/null +++ b/node_modules/semver/internal/re.js @@ -0,0 +1,182 @@ +const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') +const debug = require('./debug') +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const createToken = (name, value, isGlobal) => { + const index = R++ + debug(index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) +} + +// 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. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('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. + +createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('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. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('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. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('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. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('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` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.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. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json new file mode 100644 index 0000000..e2efe35 --- /dev/null +++ b/node_modules/semver/package.json @@ -0,0 +1,70 @@ +{ + "_from": "semver@^7.2.1", + "_id": "semver@7.3.2", + "_inBundle": false, + "_integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "_location": "/semver", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "semver@^7.2.1", + "name": "semver", + "escapedName": "semver", + "rawSpec": "^7.2.1", + "saveSpec": null, + "fetchSpec": "^7.2.1" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "_shasum": "604962b052b81ed0786aae84389ffba70ffd3938", + "_spec": "semver@^7.2.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "bin": { + "semver": "bin/semver.js" + }, + "bugs": { + "url": "https://github.com/npm/node-semver/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The semantic version parser used by npm.", + "devDependencies": { + "tap": "^14.10.7" + }, + "engines": { + "node": ">=10" + }, + "files": [ + "bin/**/*.js", + "range.bnf", + "classes/**/*.js", + "functions/**/*.js", + "internal/**/*.js", + "ranges/**/*.js", + "index.js", + "preload.js" + ], + "homepage": "https://github.com/npm/node-semver#readme", + "license": "ISC", + "main": "index.js", + "name": "semver", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "scripts": { + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "snap": "tap", + "test": "tap" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "version": "7.3.2" +} diff --git a/node_modules/semver/preload.js b/node_modules/semver/preload.js new file mode 100644 index 0000000..947cd4f --- /dev/null +++ b/node_modules/semver/preload.js @@ -0,0 +1,2 @@ +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/node_modules/semver/range.bnf b/node_modules/semver/range.bnf new file mode 100644 index 0000000..d4c6ae0 --- /dev/null +++ b/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/node_modules/semver/ranges/gtr.js b/node_modules/semver/ranges/gtr.js new file mode 100644 index 0000000..db7e355 --- /dev/null +++ b/node_modules/semver/ranges/gtr.js @@ -0,0 +1,4 @@ +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/node_modules/semver/ranges/intersects.js b/node_modules/semver/ranges/intersects.js new file mode 100644 index 0000000..3d1a6f3 --- /dev/null +++ b/node_modules/semver/ranges/intersects.js @@ -0,0 +1,7 @@ +const Range = require('../classes/range') +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} +module.exports = intersects diff --git a/node_modules/semver/ranges/ltr.js b/node_modules/semver/ranges/ltr.js new file mode 100644 index 0000000..528a885 --- /dev/null +++ b/node_modules/semver/ranges/ltr.js @@ -0,0 +1,4 @@ +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/node_modules/semver/ranges/max-satisfying.js b/node_modules/semver/ranges/max-satisfying.js new file mode 100644 index 0000000..6e3d993 --- /dev/null +++ b/node_modules/semver/ranges/max-satisfying.js @@ -0,0 +1,25 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((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 +} +module.exports = maxSatisfying diff --git a/node_modules/semver/ranges/min-satisfying.js b/node_modules/semver/ranges/min-satisfying.js new file mode 100644 index 0000000..9b60974 --- /dev/null +++ b/node_modules/semver/ranges/min-satisfying.js @@ -0,0 +1,24 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((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 +} +module.exports = minSatisfying diff --git a/node_modules/semver/ranges/min-version.js b/node_modules/semver/ranges/min-version.js new file mode 100644 index 0000000..7118d23 --- /dev/null +++ b/node_modules/semver/ranges/min-version.js @@ -0,0 +1,57 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const gt = require('../functions/gt') + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let 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 (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const 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 +} +module.exports = minVersion diff --git a/node_modules/semver/ranges/outside.js b/node_modules/semver/ranges/outside.js new file mode 100644 index 0000000..e35ed11 --- /dev/null +++ b/node_modules/semver/ranges/outside.js @@ -0,0 +1,80 @@ +const SemVer = require('../classes/semver') +const Comparator = require('../classes/comparator') +const {ANY} = Comparator +const Range = require('../classes/range') +const satisfies = require('../functions/satisfies') +const gt = require('../functions/gt') +const lt = require('../functions/lt') +const lte = require('../functions/lte') +const gte = require('../functions/gte') + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let 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 (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((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 +} + +module.exports = outside diff --git a/node_modules/semver/ranges/simplify.js b/node_modules/semver/ranges/simplify.js new file mode 100644 index 0000000..b792f97 --- /dev/null +++ b/node_modules/semver/ranges/simplify.js @@ -0,0 +1,44 @@ +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let min = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!min) + min = version + } else { + if (prev) { + set.push([min, prev]) + } + prev = null + min = null + } + } + if (min) + set.push([min, null]) + + const ranges = [] + for (const [min, max] of set) { + if (min === max) + ranges.push(min) + else if (!max && min === v[0]) + ranges.push('*') + else if (!max) + ranges.push(`>=${min}`) + else if (min === v[0]) + ranges.push(`<=${max}`) + else + ranges.push(`${min} - ${max}`) + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/node_modules/semver/ranges/subset.js b/node_modules/semver/ranges/subset.js new file mode 100644 index 0000000..6ae29a3 --- /dev/null +++ b/node_modules/semver/ranges/subset.js @@ -0,0 +1,155 @@ +const Range = require('../classes/range.js') +const { ANY } = require('../classes/comparator.js') +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else return false +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If LT +// - If LT.semver is greater than that of any > comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If any C is a = range, and GT or LT are set, return false +// - Else return true + +const subset = (sub, dom, options) => { + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) + continue OUTER + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) + return false + } + return true +} + +const simpleSubset = (sub, dom, options) => { + if (sub.length === 1 && sub[0].semver === ANY) + return dom.length === 1 && dom[0].semver === ANY + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') + gt = higherGT(gt, c, options) + else if (c.operator === '<' || c.operator === '<=') + lt = lowerLT(lt, c, options) + else + eqSet.add(c.semver) + } + + if (eqSet.size > 1) + return null + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) + return null + else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) + return null + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) + return null + + if (lt && !satisfies(eq, String(lt), options)) + return null + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) + return false + } + return true + } + + let higher, lower + let hasDomLT, hasDomGT + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c) + return false + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) + return false + } + if (lt) { + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c) + return false + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) + return false + } + if (!c.operator && (lt || gt) && gtltComp !== 0) + return false + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) + return false + + if (lt && hasDomGT && !gt && gtltComp !== 0) + return false + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/node_modules/semver/ranges/to-comparators.js b/node_modules/semver/ranges/to-comparators.js new file mode 100644 index 0000000..6c8bc7e --- /dev/null +++ b/node_modules/semver/ranges/to-comparators.js @@ -0,0 +1,8 @@ +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/node_modules/semver/ranges/valid.js b/node_modules/semver/ranges/valid.js new file mode 100644 index 0000000..365f356 --- /dev/null +++ b/node_modules/semver/ranges/valid.js @@ -0,0 +1,11 @@ +const Range = require('../classes/range') +const 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 + } +} +module.exports = validRange diff --git a/node_modules/shebang-command/index.js b/node_modules/shebang-command/index.js new file mode 100644 index 0000000..f35db30 --- /dev/null +++ b/node_modules/shebang-command/index.js @@ -0,0 +1,19 @@ +'use strict'; +const shebangRegex = require('shebang-regex'); + +module.exports = (string = '') => { + const match = string.match(shebangRegex); + + if (!match) { + return null; + } + + const [path, argument] = match[0].replace(/#! ?/, '').split(' '); + const binary = path.split('/').pop(); + + if (binary === 'env') { + return argument; + } + + return argument ? `${binary} ${argument}` : binary; +}; diff --git a/node_modules/shebang-command/license b/node_modules/shebang-command/license new file mode 100644 index 0000000..db6bc32 --- /dev/null +++ b/node_modules/shebang-command/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Kevin Mårtensson (github.com/kevva) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-command/package.json b/node_modules/shebang-command/package.json new file mode 100644 index 0000000..fa34ecb --- /dev/null +++ b/node_modules/shebang-command/package.json @@ -0,0 +1,66 @@ +{ + "_from": "shebang-command@^2.0.0", + "_id": "shebang-command@2.0.0", + "_inBundle": false, + "_integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "_location": "/shebang-command", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "shebang-command@^2.0.0", + "name": "shebang-command", + "escapedName": "shebang-command", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/cross-spawn" + ], + "_resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "_shasum": "ccd0af4f8835fbdc265b82461aaf0c36663f34ea", + "_spec": "shebang-command@^2.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/cross-spawn", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/shebang-command/issues" + }, + "bundleDependencies": false, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "deprecated": false, + "description": "Get the command from a shebang", + "devDependencies": { + "ava": "^2.3.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/kevva/shebang-command#readme", + "keywords": [ + "cmd", + "command", + "parse", + "shebang" + ], + "license": "MIT", + "name": "shebang-command", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/shebang-command.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0" +} diff --git a/node_modules/shebang-command/readme.md b/node_modules/shebang-command/readme.md new file mode 100644 index 0000000..84feb44 --- /dev/null +++ b/node_modules/shebang-command/readme.md @@ -0,0 +1,34 @@ +# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) + +> Get the command from a shebang + + +## Install + +``` +$ npm install shebang-command +``` + + +## Usage + +```js +const shebangCommand = require('shebang-command'); + +shebangCommand('#!/usr/bin/env node'); +//=> 'node' + +shebangCommand('#!/bin/bash'); +//=> 'bash' +``` + + +## API + +### shebangCommand(string) + +#### string + +Type: `string` + +String containing a shebang. diff --git a/node_modules/shebang-regex/index.d.ts b/node_modules/shebang-regex/index.d.ts new file mode 100644 index 0000000..61d034b --- /dev/null +++ b/node_modules/shebang-regex/index.d.ts @@ -0,0 +1,22 @@ +/** +Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line. + +@example +``` +import shebangRegex = require('shebang-regex'); + +const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; + +shebangRegex.test(string); +//=> true + +shebangRegex.exec(string)[0]; +//=> '#!/usr/bin/env node' + +shebangRegex.exec(string)[1]; +//=> '/usr/bin/env node' +``` +*/ +declare const shebangRegex: RegExp; + +export = shebangRegex; diff --git a/node_modules/shebang-regex/index.js b/node_modules/shebang-regex/index.js new file mode 100644 index 0000000..63fc4a0 --- /dev/null +++ b/node_modules/shebang-regex/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = /^#!(.*)/; diff --git a/node_modules/shebang-regex/license b/node_modules/shebang-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/shebang-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-regex/package.json b/node_modules/shebang-regex/package.json new file mode 100644 index 0000000..b9d2d1d --- /dev/null +++ b/node_modules/shebang-regex/package.json @@ -0,0 +1,67 @@ +{ + "_from": "shebang-regex@^3.0.0", + "_id": "shebang-regex@3.0.0", + "_inBundle": false, + "_integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "_location": "/shebang-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "shebang-regex@^3.0.0", + "name": "shebang-regex", + "escapedName": "shebang-regex", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/shebang-command" + ], + "_resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "_shasum": "ae16f1644d873ecad843b0307b143362d4c42172", + "_spec": "shebang-regex@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/shebang-command", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/shebang-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching a shebang line", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/shebang-regex#readme", + "keywords": [ + "regex", + "regexp", + "shebang", + "match", + "test", + "line" + ], + "license": "MIT", + "name": "shebang-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/shebang-regex.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "3.0.0" +} diff --git a/node_modules/shebang-regex/readme.md b/node_modules/shebang-regex/readme.md new file mode 100644 index 0000000..5ecf863 --- /dev/null +++ b/node_modules/shebang-regex/readme.md @@ -0,0 +1,33 @@ +# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) + +> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line + + +## Install + +``` +$ npm install shebang-regex +``` + + +## Usage + +```js +const shebangRegex = require('shebang-regex'); + +const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; + +shebangRegex.test(string); +//=> true + +shebangRegex.exec(string)[0]; +//=> '#!/usr/bin/env node' + +shebangRegex.exec(string)[1]; +//=> '/usr/bin/env node' +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/slice-ansi/index.js b/node_modules/slice-ansi/index.js new file mode 100755 index 0000000..a8765e1 --- /dev/null +++ b/node_modules/slice-ansi/index.js @@ -0,0 +1,59 @@ +'use strict'; +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const astralRegex = require('astral-regex'); +const ansiStyles = require('ansi-styles'); + +const ESCAPES = [ + '\u001B', + '\u009B' +]; + +const END_CODE = 39; + +const wrapAnsi = code => `${ESCAPES[0]}[${code}m`; + +module.exports = (str, begin, end) => { + const arr = [...str.normalize()]; + + end = typeof end === 'number' ? end : arr.length; + + let insideEscape = false; + let escapeCode = null; + let visible = 0; + let output = ''; + + for (const [i, x] of arr.entries()) { + let leftEscape = false; + + if (ESCAPES.includes(x)) { + insideEscape = true; + const code = /\d[^m]*/.exec(str.slice(i, i + 18)); + escapeCode = code === END_CODE ? null : code; + } else if (insideEscape && x === 'm') { + insideEscape = false; + leftEscape = true; + } + + if (!insideEscape && !leftEscape) { + ++visible; + } + + if (!astralRegex({exact: true}).test(x) && isFullwidthCodePoint(x.codePointAt())) { + ++visible; + } + + if (visible > begin && visible <= end) { + output += x; + } else if (visible === begin && !insideEscape && escapeCode !== null && escapeCode !== END_CODE) { + output += wrapAnsi(escapeCode); + } else if (visible >= end) { + if (escapeCode !== null) { + output += wrapAnsi(ansiStyles.codes.get(parseInt(escapeCode, 10)) || END_CODE); + } + + break; + } + } + + return output; +}; diff --git a/node_modules/slice-ansi/license b/node_modules/slice-ansi/license new file mode 100644 index 0000000..4d72633 --- /dev/null +++ b/node_modules/slice-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) DC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/slice-ansi/package.json b/node_modules/slice-ansi/package.json new file mode 100644 index 0000000..a6553de --- /dev/null +++ b/node_modules/slice-ansi/package.json @@ -0,0 +1,83 @@ +{ + "_from": "slice-ansi@^2.1.0", + "_id": "slice-ansi@2.1.0", + "_inBundle": false, + "_integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "_location": "/slice-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "slice-ansi@^2.1.0", + "name": "slice-ansi", + "escapedName": "slice-ansi", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/table" + ], + "_resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "_shasum": "cacd7693461a637a5788d92a7dd4fba068e81636", + "_spec": "slice-ansi@^2.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/table", + "bugs": { + "url": "https://github.com/chalk/slice-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "deprecated": false, + "description": "Slice a string with ANSI escape codes", + "devDependencies": { + "ava": "^1.1.0", + "chalk": "^2.4.2", + "random-item": "^1.0.0", + "strip-ansi": "^5.0.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/slice-ansi#readme", + "keywords": [ + "slice", + "string", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "slice-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/slice-ansi.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0" +} diff --git a/node_modules/slice-ansi/readme.md b/node_modules/slice-ansi/readme.md new file mode 100644 index 0000000..7e9243e --- /dev/null +++ b/node_modules/slice-ansi/readme.md @@ -0,0 +1,64 @@ +# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/xojs/xo) + +> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + + +## Install + +``` +$ npm install slice-ansi +``` + + +## Usage + +```js +const chalk = require('chalk'); +const sliceAnsi = require('slice-ansi'); + +const input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(sliceAnsi(input, 20, 30)); +``` + + +## API + +### sliceAnsi(input, beginSlice, [endSlice]) + +#### input + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). + +#### beginSlice + +Type: `number` + +Zero-based index at which to begin the slice. + +#### endSlice + +Type: `number` + +Zero-based index at which to end the slice. + + +## Related + +- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes +- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/spdx-correct/LICENSE b/node_modules/spdx-correct/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/spdx-correct/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/spdx-correct/README.md b/node_modules/spdx-correct/README.md new file mode 100644 index 0000000..ab388cf --- /dev/null +++ b/node_modules/spdx-correct/README.md @@ -0,0 +1,14 @@ +```javascript +var correct = require('spdx-correct') +var assert = require('assert') + +assert.equal(correct('mit'), 'MIT') + +assert.equal(correct('Apache 2'), 'Apache-2.0') + +assert(correct('No idea what license') === null) + +// disable upgrade option +assert(correct('GPL-3.0'), 'GPL-3.0-or-later') +assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0') +``` diff --git a/node_modules/spdx-correct/index.js b/node_modules/spdx-correct/index.js new file mode 100644 index 0000000..c51a79f --- /dev/null +++ b/node_modules/spdx-correct/index.js @@ -0,0 +1,364 @@ +/* +Copyright spdx-correct.js contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +var parse = require('spdx-expression-parse') +var spdxLicenseIds = require('spdx-license-ids') + +function valid (string) { + try { + parse(string) + return true + } catch (error) { + return false + } +} + +// Common transpositions of license identifier acronyms +var transpositions = [ + ['APGL', 'AGPL'], + ['Gpl', 'GPL'], + ['GLP', 'GPL'], + ['APL', 'Apache'], + ['ISD', 'ISC'], + ['GLP', 'GPL'], + ['IST', 'ISC'], + ['Claude', 'Clause'], + [' or later', '+'], + [' International', ''], + ['GNU', 'GPL'], + ['GUN', 'GPL'], + ['+', ''], + ['GNU GPL', 'GPL'], + ['GNU/GPL', 'GPL'], + ['GNU GLP', 'GPL'], + ['GNU General Public License', 'GPL'], + ['Gnu public license', 'GPL'], + ['GNU Public License', 'GPL'], + ['GNU GENERAL PUBLIC LICENSE', 'GPL'], + ['MTI', 'MIT'], + ['Mozilla Public License', 'MPL'], + ['Universal Permissive License', 'UPL'], + ['WTH', 'WTF'], + ['-License', ''] +] + +var TRANSPOSED = 0 +var CORRECT = 1 + +// Simple corrections to nearly valid identifiers. +var transforms = [ + // e.g. 'mit' + function (argument) { + return argument.toUpperCase() + }, + // e.g. 'MIT ' + function (argument) { + return argument.trim() + }, + // e.g. 'M.I.T.' + function (argument) { + return argument.replace(/\./g, '') + }, + // e.g. 'Apache- 2.0' + function (argument) { + return argument.replace(/\s+/g, '') + }, + // e.g. 'CC BY 4.0'' + function (argument) { + return argument.replace(/\s+/g, '-') + }, + // e.g. 'LGPLv2.1' + function (argument) { + return argument.replace('v', '-') + }, + // e.g. 'Apache 2.0' + function (argument) { + return argument.replace(/,?\s*(\d)/, '-$1') + }, + // e.g. 'GPL 2' + function (argument) { + return argument.replace(/,?\s*(\d)/, '-$1.0') + }, + // e.g. 'Apache Version 2.0' + function (argument) { + return argument + .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2') + }, + // e.g. 'Apache Version 2' + function (argument) { + return argument + .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0') + }, + // e.g. 'ZLIB' + function (argument) { + return argument[0].toUpperCase() + argument.slice(1) + }, + // e.g. 'MPL/2.0' + function (argument) { + return argument.replace('/', '-') + }, + // e.g. 'Apache 2' + function (argument) { + return argument + .replace(/\s*V\s*(\d)/, '-$1') + .replace(/(\d)$/, '$1.0') + }, + // e.g. 'GPL-2.0', 'GPL-3.0' + function (argument) { + if (argument.indexOf('3.0') !== -1) { + return argument + '-or-later' + } else { + return argument + '-only' + } + }, + // e.g. 'GPL-2.0-' + function (argument) { + return argument + 'only' + }, + // e.g. 'GPL2' + function (argument) { + return argument.replace(/(\d)$/, '-$1.0') + }, + // e.g. 'BSD 3' + function (argument) { + return argument.replace(/(-| )?(\d)$/, '-$2-Clause') + }, + // e.g. 'BSD clause 3' + function (argument) { + return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause') + }, + // e.g. 'New BSD license' + function (argument) { + return argument.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i, 'BSD-3-Clause') + }, + // e.g. 'Simplified BSD license' + function (argument) { + return argument.replace(/\bSimplified(-| )?BSD((-| )License)?/i, 'BSD-2-Clause') + }, + // e.g. 'Free BSD license' + function (argument) { + return argument.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i, 'BSD-2-Clause-$1BSD') + }, + // e.g. 'Clear BSD license' + function (argument) { + return argument.replace(/\bClear(-| )?BSD((-| )License)?/i, 'BSD-3-Clause-Clear') + }, + // e.g. 'Old BSD License' + function (argument) { + return argument.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i, 'BSD-4-Clause') + }, + // e.g. 'BY-NC-4.0' + function (argument) { + return 'CC-' + argument + }, + // e.g. 'BY-NC' + function (argument) { + return 'CC-' + argument + '-4.0' + }, + // e.g. 'Attribution-NonCommercial' + function (argument) { + return argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + }, + // e.g. 'Attribution-NonCommercial' + function (argument) { + return 'CC-' + + argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + + '-4.0' + } +] + +var licensesWithVersions = spdxLicenseIds + .map(function (id) { + var match = /^(.*)-\d+\.\d+$/.exec(id) + return match + ? [match[0], match[1]] + : [id, null] + }) + .reduce(function (objectMap, item) { + var key = item[1] + objectMap[key] = objectMap[key] || [] + objectMap[key].push(item[0]) + return objectMap + }, {}) + +var licensesWithOneVersion = Object.keys(licensesWithVersions) + .map(function makeEntries (key) { + return [key, licensesWithVersions[key]] + }) + .filter(function identifySoleVersions (item) { + return ( + // Licenses has just one valid version suffix. + item[1].length === 1 && + item[0] !== null && + // APL will be considered Apache, rather than APL-1.0 + item[0] !== 'APL' + ) + }) + .map(function createLastResorts (item) { + return [item[0], item[1][0]] + }) + +licensesWithVersions = undefined + +// If all else fails, guess that strings containing certain substrings +// meant to identify certain licenses. +var lastResorts = [ + ['UNLI', 'Unlicense'], + ['WTF', 'WTFPL'], + ['2 CLAUSE', 'BSD-2-Clause'], + ['2-CLAUSE', 'BSD-2-Clause'], + ['3 CLAUSE', 'BSD-3-Clause'], + ['3-CLAUSE', 'BSD-3-Clause'], + ['AFFERO', 'AGPL-3.0-or-later'], + ['AGPL', 'AGPL-3.0-or-later'], + ['APACHE', 'Apache-2.0'], + ['ARTISTIC', 'Artistic-2.0'], + ['Affero', 'AGPL-3.0-or-later'], + ['BEER', 'Beerware'], + ['BOOST', 'BSL-1.0'], + ['BSD', 'BSD-2-Clause'], + ['CDDL', 'CDDL-1.1'], + ['ECLIPSE', 'EPL-1.0'], + ['FUCK', 'WTFPL'], + ['GNU', 'GPL-3.0-or-later'], + ['LGPL', 'LGPL-3.0-or-later'], + ['GPLV1', 'GPL-1.0-only'], + ['GPL-1', 'GPL-1.0-only'], + ['GPLV2', 'GPL-2.0-only'], + ['GPL-2', 'GPL-2.0-only'], + ['GPL', 'GPL-3.0-or-later'], + ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'], + ['MIT', 'MIT'], + ['MPL', 'MPL-2.0'], + ['X11', 'X11'], + ['ZLIB', 'Zlib'] +].concat(licensesWithOneVersion) + +var SUBSTRING = 0 +var IDENTIFIER = 1 + +var validTransformation = function (identifier) { + for (var i = 0; i < transforms.length; i++) { + var transformed = transforms[i](identifier).trim() + if (transformed !== identifier && valid(transformed)) { + return transformed + } + } + return null +} + +var validLastResort = function (identifier) { + var upperCased = identifier.toUpperCase() + for (var i = 0; i < lastResorts.length; i++) { + var lastResort = lastResorts[i] + if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { + return lastResort[IDENTIFIER] + } + } + return null +} + +var anyCorrection = function (identifier, check) { + for (var i = 0; i < transpositions.length; i++) { + var transposition = transpositions[i] + var transposed = transposition[TRANSPOSED] + if (identifier.indexOf(transposed) > -1) { + var corrected = identifier.replace( + transposed, + transposition[CORRECT] + ) + var checked = check(corrected) + if (checked !== null) { + return checked + } + } + } + return null +} + +module.exports = function (identifier, options) { + options = options || {} + var upgrade = options.upgrade === undefined ? true : !!options.upgrade + function postprocess (value) { + return upgrade ? upgradeGPLs(value) : value + } + var validArugment = ( + typeof identifier === 'string' && + identifier.trim().length !== 0 + ) + if (!validArugment) { + throw Error('Invalid argument. Expected non-empty string.') + } + identifier = identifier.trim() + if (valid(identifier)) { + return postprocess(identifier) + } + var noPlus = identifier.replace(/\+$/, '').trim() + if (valid(noPlus)) { + return postprocess(noPlus) + } + var transformed = validTransformation(identifier) + if (transformed !== null) { + return postprocess(transformed) + } + transformed = anyCorrection(identifier, function (argument) { + if (valid(argument)) { + return argument + } + return validTransformation(argument) + }) + if (transformed !== null) { + return postprocess(transformed) + } + transformed = validLastResort(identifier) + if (transformed !== null) { + return postprocess(transformed) + } + transformed = anyCorrection(identifier, validLastResort) + if (transformed !== null) { + return postprocess(transformed) + } + return null +} + +function upgradeGPLs (value) { + if ([ + 'GPL-1.0', 'LGPL-1.0', 'AGPL-1.0', + 'GPL-2.0', 'LGPL-2.0', 'AGPL-2.0', + 'LGPL-2.1' + ].indexOf(value) !== -1) { + return value + '-only' + } else if ([ + 'GPL-1.0+', 'GPL-2.0+', 'GPL-3.0+', + 'LGPL-2.0+', 'LGPL-2.1+', 'LGPL-3.0+', + 'AGPL-1.0+', 'AGPL-3.0+' + ].indexOf(value) !== -1) { + return value.replace(/\+$/, '-or-later') + } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) { + return value + '-or-later' + } else { + return value + } +} diff --git a/node_modules/spdx-correct/package.json b/node_modules/spdx-correct/package.json new file mode 100644 index 0000000..5e3404b --- /dev/null +++ b/node_modules/spdx-correct/package.json @@ -0,0 +1,88 @@ +{ + "_from": "spdx-correct@^3.0.0", + "_id": "spdx-correct@3.1.1", + "_inBundle": false, + "_integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "_location": "/spdx-correct", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "spdx-correct@^3.0.0", + "name": "spdx-correct", + "escapedName": "spdx-correct", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/validate-npm-package-license" + ], + "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "_shasum": "dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9", + "_spec": "spdx-correct@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/validate-npm-package-license", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + "bugs": { + "url": "https://github.com/jslicense/spdx-correct.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + { + "name": "Christian Zommerfelds", + "email": "aero_super@yahoo.com" + }, + { + "name": "Tal Einat", + "email": "taleinat@gmail.com" + }, + { + "name": "Dan Butvinik", + "email": "butvinik@outlook.com" + } + ], + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + }, + "deprecated": false, + "description": "correct invalid SPDX expressions", + "devDependencies": { + "defence-cli": "^2.0.1", + "replace-require-self": "^1.0.0", + "standard": "^11.0.0", + "standard-markdown": "^4.0.2", + "tape": "^4.9.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jslicense/spdx-correct.js#readme", + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata" + ], + "license": "Apache-2.0", + "name": "spdx-correct", + "repository": { + "type": "git", + "url": "git+https://github.com/jslicense/spdx-correct.js.git" + }, + "scripts": { + "lint": "standard && standard-markdown README.md", + "test": "defence README.md | replace-require-self | node && node test.js" + }, + "version": "3.1.1" +} diff --git a/node_modules/spdx-exceptions/README.md b/node_modules/spdx-exceptions/README.md new file mode 100644 index 0000000..6c927ec --- /dev/null +++ b/node_modules/spdx-exceptions/README.md @@ -0,0 +1,36 @@ +The package exports an array of strings. Each string is an identifier +for a license exception under the [Software Package Data Exchange +(SPDX)][SPDX] software license metadata standard. + +[SPDX]: https://spdx.org + +## Copyright and Licensing + +### SPDX + +"SPDX" is a federally registered United States trademark of The Linux +Foundation Corporation. + +From version 2.0 of the [SPDX] specification: + +> Copyright © 2010-2015 Linux Foundation and its Contributors. Licensed +> under the Creative Commons Attribution License 3.0 Unported. All other +> rights are expressly reserved. + +The Linux Foundation and the SPDX working groups are good people. Only +they decide what "SPDX" means, as a standard and otherwise. I respect +their work and their rights. You should, too. + +### This Package + +> I created this package by copying exception identifiers out of the +> SPDX specification. That work was mechanical, routine, and required no +> creativity whatsoever. - Kyle Mitchell, package author + +United States users concerned about intellectual property may wish to +discuss the following Supreme Court decisions with their attorneys: + +- _Baker v. Selden_, 101 U.S. 99 (1879) + +- _Feist Publications, Inc., v. Rural Telephone Service Co._, + 499 U.S. 340 (1991) diff --git a/node_modules/spdx-exceptions/index.json b/node_modules/spdx-exceptions/index.json new file mode 100644 index 0000000..f88f088 --- /dev/null +++ b/node_modules/spdx-exceptions/index.json @@ -0,0 +1,40 @@ +[ + "389-exception", + "Autoconf-exception-2.0", + "Autoconf-exception-3.0", + "Bison-exception-2.2", + "Bootloader-exception", + "Classpath-exception-2.0", + "CLISP-exception-2.0", + "DigiRule-FOSS-exception", + "eCos-exception-2.0", + "Fawkes-Runtime-exception", + "FLTK-exception", + "Font-exception-2.0", + "freertos-exception-2.0", + "GCC-exception-2.0", + "GCC-exception-3.1", + "gnu-javamail-exception", + "GPL-3.0-linking-exception", + "GPL-3.0-linking-source-exception", + "GPL-CC-1.0", + "i2p-gpl-java-exception", + "Libtool-exception", + "Linux-syscall-note", + "LLVM-exception", + "LZMA-exception", + "mif-exception", + "Nokia-Qt-exception-1.1", + "OCaml-LGPL-linking-exception", + "OCCT-exception-1.0", + "OpenJDK-assembly-exception-1.0", + "openvpn-openssl-exception", + "PS-or-PDF-font-exception-20170817", + "Qt-GPL-exception-1.0", + "Qt-LGPL-exception-1.1", + "Qwt-exception-1.0", + "Swift-exception", + "u-boot-exception-2.0", + "Universal-FOSS-exception-1.0", + "WxWindows-exception-3.1" +] diff --git a/node_modules/spdx-exceptions/package.json b/node_modules/spdx-exceptions/package.json new file mode 100644 index 0000000..94b1929 --- /dev/null +++ b/node_modules/spdx-exceptions/package.json @@ -0,0 +1,55 @@ +{ + "_from": "spdx-exceptions@^2.1.0", + "_id": "spdx-exceptions@2.3.0", + "_inBundle": false, + "_integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "_location": "/spdx-exceptions", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "spdx-exceptions@^2.1.0", + "name": "spdx-exceptions", + "escapedName": "spdx-exceptions", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/spdx-expression-parse" + ], + "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "_shasum": "3f28ce1a77a00372683eade4a433183527a2163d", + "_spec": "spdx-exceptions@^2.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/spdx-expression-parse", + "author": { + "name": "The Linux Foundation" + }, + "bugs": { + "url": "https://github.com/kemitchell/spdx-exceptions.json/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com/" + } + ], + "deprecated": false, + "description": "list of SPDX standard license exceptions", + "files": [ + "index.json" + ], + "homepage": "https://github.com/kemitchell/spdx-exceptions.json#readme", + "license": "CC-BY-3.0", + "name": "spdx-exceptions", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-exceptions.json.git" + }, + "scripts": { + "build": "node build.js" + }, + "version": "2.3.0" +} diff --git a/node_modules/spdx-expression-parse/AUTHORS b/node_modules/spdx-expression-parse/AUTHORS new file mode 100644 index 0000000..257a76b --- /dev/null +++ b/node_modules/spdx-expression-parse/AUTHORS @@ -0,0 +1,4 @@ +C. Scott Ananian (http://cscott.net) +Kyle E. Mitchell (https://kemitchell.com) +Shinnosuke Watanabe +Antoine Motet diff --git a/node_modules/spdx-expression-parse/LICENSE b/node_modules/spdx-expression-parse/LICENSE new file mode 100644 index 0000000..831618e --- /dev/null +++ b/node_modules/spdx-expression-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2015 Kyle E. Mitchell & other authors listed in AUTHORS + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/spdx-expression-parse/README.md b/node_modules/spdx-expression-parse/README.md new file mode 100644 index 0000000..9406462 --- /dev/null +++ b/node_modules/spdx-expression-parse/README.md @@ -0,0 +1,91 @@ +This package parses [SPDX license expression](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) strings describing license terms, like [package.json license strings](https://docs.npmjs.com/files/package.json#license), into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools. + +In a nutshell: + +```javascript +var parse = require('spdx-expression-parse') +var assert = require('assert') + +assert.deepEqual( + // Licensed under the terms of the Two-Clause BSD License. + parse('BSD-2-Clause'), + {license: 'BSD-2-Clause'} +) + +assert.throws(function () { + // An invalid SPDX license expression. + // Should be `Apache-2.0`. + parse('Apache 2') +}) + +assert.deepEqual( + // Dual licensed under either: + // - LGPL 2.1 + // - a combination of Three-Clause BSD and MIT + parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'), + { + left: {license: 'LGPL-2.1'}, + conjunction: 'or', + right: { + left: {license: 'BSD-3-Clause'}, + conjunction: 'and', + right: {license: 'MIT'} + } + } +) +``` + +The syntax comes from the [Software Package Data eXchange (SPDX)](https://spdx.org/), a standard from the [Linux Foundation](https://www.linuxfoundation.org) for shareable data about software package license terms. SPDX aims to make sharing and auditing license data easy, especially for users of open-source software. + +The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard: + +1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-license-ids) and [spdx-exceptions](https://www.npmjs.com/package/spdx-exceptions) packages implement the license list. `spdx-expression-parse` depends on and `require()`s them. + + Any license identifier from the license list is a valid license expression: + + ```javascript + var identifiers = [] + .concat(require('spdx-license-ids')) + .concat(require('spdx-license-ids/deprecated')) + + identifiers.forEach(function (id) { + assert.deepEqual(parse(id), {license: id}) + }) + ``` + + So is any license identifier `WITH` a standardized license exception: + + ```javascript + identifiers.forEach(function (id) { + require('spdx-exceptions').forEach(function (e) { + assert.deepEqual( + parse(id + ' WITH ' + e), + {license: id, exception: e} + ) + }) + }) + ``` + +2. The license expression language, for describing simple and complex license terms, like `MIT` for MIT-licensed and `(GPL-2.0 OR Apache-2.0)` for dual-licensing under GPL 2.0 and Apache 2.0. `spdx-expression-parse` itself implements license expression language, exporting a parser. + + ```javascript + assert.deepEqual( + // Licensed under a combination of: + // - the MIT License AND + // - a combination of: + // - LGPL 2.1 (or a later version) AND + // - Three-Clause BSD + parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), + { + left: {license: 'MIT'}, + conjunction: 'and', + right: { + left: {license: 'LGPL-2.1', plus: true}, + conjunction: 'and', + right: {license: 'BSD-3-Clause'} + } + } + ) + ``` + +The Linux Foundation and its contributors license the SPDX standard under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. The authors of this package license their work under the terms of the MIT License. diff --git a/node_modules/spdx-expression-parse/index.js b/node_modules/spdx-expression-parse/index.js new file mode 100644 index 0000000..52fab56 --- /dev/null +++ b/node_modules/spdx-expression-parse/index.js @@ -0,0 +1,8 @@ +'use strict' + +var scan = require('./scan') +var parse = require('./parse') + +module.exports = function (source) { + return parse(scan(source)) +} diff --git a/node_modules/spdx-expression-parse/package.json b/node_modules/spdx-expression-parse/package.json new file mode 100644 index 0000000..6cb9b43 --- /dev/null +++ b/node_modules/spdx-expression-parse/package.json @@ -0,0 +1,96 @@ +{ + "_from": "spdx-expression-parse@^3.0.0", + "_id": "spdx-expression-parse@3.0.1", + "_inBundle": false, + "_integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "_location": "/spdx-expression-parse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "spdx-expression-parse@^3.0.0", + "name": "spdx-expression-parse", + "escapedName": "spdx-expression-parse", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/spdx-correct", + "/validate-npm-package-license" + ], + "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "_shasum": "cf70f50482eefdc98e3ce0a6833e4a53ceeba679", + "_spec": "spdx-expression-parse@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/validate-npm-package-license", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + "bugs": { + "url": "https://github.com/jslicense/spdx-expression-parse.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "C. Scott Ananian", + "email": "cscott@cscott.net", + "url": "http://cscott.net" + }, + { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + { + "name": "Shinnosuke Watanabe", + "email": "snnskwtnb@gmail.com" + }, + { + "name": "Antoine Motet", + "email": "antoine.motet@gmail.com" + } + ], + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + }, + "deprecated": false, + "description": "parse SPDX license expressions", + "devDependencies": { + "defence-cli": "^3.0.1", + "replace-require-self": "^1.0.0", + "standard": "^14.1.0" + }, + "files": [ + "AUTHORS", + "index.js", + "parse.js", + "scan.js" + ], + "homepage": "https://github.com/jslicense/spdx-expression-parse.js#readme", + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata", + "package", + "package.json", + "standards" + ], + "license": "MIT", + "name": "spdx-expression-parse", + "repository": { + "type": "git", + "url": "git+https://github.com/jslicense/spdx-expression-parse.js.git" + }, + "scripts": { + "lint": "standard", + "test": "npm run test:suite && npm run test:readme", + "test:readme": "defence -i javascript README.md | replace-require-self | node", + "test:suite": "node test.js" + }, + "version": "3.0.1" +} diff --git a/node_modules/spdx-expression-parse/parse.js b/node_modules/spdx-expression-parse/parse.js new file mode 100644 index 0000000..5a00b45 --- /dev/null +++ b/node_modules/spdx-expression-parse/parse.js @@ -0,0 +1,138 @@ +'use strict' + +// The ABNF grammar in the spec is totally ambiguous. +// +// This parser follows the operator precedence defined in the +// `Order of Precedence and Parentheses` section. + +module.exports = function (tokens) { + var index = 0 + + function hasMore () { + return index < tokens.length + } + + function token () { + return hasMore() ? tokens[index] : null + } + + function next () { + if (!hasMore()) { + throw new Error() + } + index++ + } + + function parseOperator (operator) { + var t = token() + if (t && t.type === 'OPERATOR' && operator === t.string) { + next() + return t.string + } + } + + function parseWith () { + if (parseOperator('WITH')) { + var t = token() + if (t && t.type === 'EXCEPTION') { + next() + return t.string + } + throw new Error('Expected exception after `WITH`') + } + } + + function parseLicenseRef () { + // TODO: Actually, everything is concatenated into one string + // for backward-compatibility but it could be better to return + // a nice structure. + var begin = index + var string = '' + var t = token() + if (t.type === 'DOCUMENTREF') { + next() + string += 'DocumentRef-' + t.string + ':' + if (!parseOperator(':')) { + throw new Error('Expected `:` after `DocumentRef-...`') + } + } + t = token() + if (t.type === 'LICENSEREF') { + next() + string += 'LicenseRef-' + t.string + return { license: string } + } + index = begin + } + + function parseLicense () { + var t = token() + if (t && t.type === 'LICENSE') { + next() + var node = { license: t.string } + if (parseOperator('+')) { + node.plus = true + } + var exception = parseWith() + if (exception) { + node.exception = exception + } + return node + } + } + + function parseParenthesizedExpression () { + var left = parseOperator('(') + if (!left) { + return + } + + var expr = parseExpression() + + if (!parseOperator(')')) { + throw new Error('Expected `)`') + } + + return expr + } + + function parseAtom () { + return ( + parseParenthesizedExpression() || + parseLicenseRef() || + parseLicense() + ) + } + + function makeBinaryOpParser (operator, nextParser) { + return function parseBinaryOp () { + var left = nextParser() + if (!left) { + return + } + + if (!parseOperator(operator)) { + return left + } + + var right = parseBinaryOp() + if (!right) { + throw new Error('Expected expression') + } + return { + left: left, + conjunction: operator.toLowerCase(), + right: right + } + } + } + + var parseAnd = makeBinaryOpParser('AND', parseAtom) + var parseExpression = makeBinaryOpParser('OR', parseAnd) + + var node = parseExpression() + if (!node || hasMore()) { + throw new Error('Syntax error') + } + return node +} diff --git a/node_modules/spdx-expression-parse/scan.js b/node_modules/spdx-expression-parse/scan.js new file mode 100644 index 0000000..b74fce2 --- /dev/null +++ b/node_modules/spdx-expression-parse/scan.js @@ -0,0 +1,131 @@ +'use strict' + +var licenses = [] + .concat(require('spdx-license-ids')) + .concat(require('spdx-license-ids/deprecated')) +var exceptions = require('spdx-exceptions') + +module.exports = function (source) { + var index = 0 + + function hasMore () { + return index < source.length + } + + // `value` can be a regexp or a string. + // If it is recognized, the matching source string is returned and + // the index is incremented. Otherwise `undefined` is returned. + function read (value) { + if (value instanceof RegExp) { + var chars = source.slice(index) + var match = chars.match(value) + if (match) { + index += match[0].length + return match[0] + } + } else { + if (source.indexOf(value, index) === index) { + index += value.length + return value + } + } + } + + function skipWhitespace () { + read(/[ ]*/) + } + + function operator () { + var string + var possibilities = ['WITH', 'AND', 'OR', '(', ')', ':', '+'] + for (var i = 0; i < possibilities.length; i++) { + string = read(possibilities[i]) + if (string) { + break + } + } + + if (string === '+' && index > 1 && source[index - 2] === ' ') { + throw new Error('Space before `+`') + } + + return string && { + type: 'OPERATOR', + string: string + } + } + + function idstring () { + return read(/[A-Za-z0-9-.]+/) + } + + function expectIdstring () { + var string = idstring() + if (!string) { + throw new Error('Expected idstring at offset ' + index) + } + return string + } + + function documentRef () { + if (read('DocumentRef-')) { + var string = expectIdstring() + return { type: 'DOCUMENTREF', string: string } + } + } + + function licenseRef () { + if (read('LicenseRef-')) { + var string = expectIdstring() + return { type: 'LICENSEREF', string: string } + } + } + + function identifier () { + var begin = index + var string = idstring() + + if (licenses.indexOf(string) !== -1) { + return { + type: 'LICENSE', + string: string + } + } else if (exceptions.indexOf(string) !== -1) { + return { + type: 'EXCEPTION', + string: string + } + } + + index = begin + } + + // Tries to read the next token. Returns `undefined` if no token is + // recognized. + function parseToken () { + // Ordering matters + return ( + operator() || + documentRef() || + licenseRef() || + identifier() + ) + } + + var tokens = [] + while (hasMore()) { + skipWhitespace() + if (!hasMore()) { + break + } + + var token = parseToken() + if (!token) { + throw new Error('Unexpected `' + source[index] + + '` at offset ' + index) + } + + tokens.push(token) + } + return tokens +} diff --git a/node_modules/spdx-license-ids/README.md b/node_modules/spdx-license-ids/README.md new file mode 100644 index 0000000..699514d --- /dev/null +++ b/node_modules/spdx-license-ids/README.md @@ -0,0 +1,52 @@ +# spdx-license-ids + +[![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids) +[![Github Actions](https://action-badges.now.sh/shinnn/spdx-license-ids)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/spdx-license-ids) + +A list of [SPDX license](https://spdx.org/licenses/) identifiers + +## Installation + +[Download JSON directly](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): + +``` +npm install spdx-license-ids +``` + +## [Node.js](https://nodejs.org/) API + +### require('spdx-license-ids') + +Type: `string[]` + +All license IDs except for the currently deprecated ones. + +```javascript +const ids = require('spdx-license-ids'); +//=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...] + +ids.includes('BSD-3-Clause'); //=> true +ids.includes('CC-BY-1.0'); //=> true + +ids.includes('GPL-3.0'); //=> false +``` + +### require('spdx-license-ids/deprecated') + +Type: `string[]` + +Deprecated license IDs. + +```javascript +const deprecatedIds = require('spdx-license-ids/deprecated'); +//=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...] + +deprecatedIds.includes('BSD-3-Clause'); //=> false +deprecatedIds.includes('CC-BY-1.0'); //=> false + +deprecatedIds.includes('GPL-3.0'); //=> true +``` + +## License + +[Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed) diff --git a/node_modules/spdx-license-ids/deprecated.json b/node_modules/spdx-license-ids/deprecated.json new file mode 100644 index 0000000..c7de098 --- /dev/null +++ b/node_modules/spdx-license-ids/deprecated.json @@ -0,0 +1,26 @@ +[ + "AGPL-1.0", + "AGPL-3.0", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", + "GFDL-1.1", + "GFDL-1.2", + "GFDL-1.3", + "GPL-1.0", + "GPL-2.0", + "GPL-2.0-with-GCC-exception", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-3.0", + "GPL-3.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "LGPL-2.0", + "LGPL-2.1", + "LGPL-3.0", + "Nunit", + "StandardML-NJ", + "eCos-2.0", + "wxWindows" +] diff --git a/node_modules/spdx-license-ids/index.json b/node_modules/spdx-license-ids/index.json new file mode 100644 index 0000000..de20473 --- /dev/null +++ b/node_modules/spdx-license-ids/index.json @@ -0,0 +1,414 @@ +[ + "0BSD", + "AAL", + "ADSL", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "AGPL-1.0-only", + "AGPL-1.0-or-later", + "AGPL-3.0-only", + "AGPL-3.0-or-later", + "AMDPLPA", + "AML", + "AMPAS", + "ANTLR-PD", + "APAFML", + "APL-1.0", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "Abstyles", + "Adobe-2006", + "Adobe-Glyph", + "Afmparse", + "Aladdin", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "Artistic-1.0", + "Artistic-1.0-Perl", + "Artistic-1.0-cl8", + "Artistic-2.0", + "BSD-1-Clause", + "BSD-2-Clause", + "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", + "BSD-3-Clause", + "BSD-3-Clause-Attribution", + "BSD-3-Clause-Clear", + "BSD-3-Clause-LBNL", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-License-2014", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-Open-MPI", + "BSD-4-Clause", + "BSD-4-Clause-UC", + "BSD-Protection", + "BSD-Source-Code", + "BSL-1.0", + "Bahyph", + "Barr", + "Beerware", + "BitTorrent-1.0", + "BitTorrent-1.1", + "BlueOak-1.0.0", + "Borceux", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", + "CATOSL-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-3.0", + "CC-BY-3.0-AT", + "CC-BY-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-IGO", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", + "CC-BY-SA-4.0", + "CC-PDDC", + "CC0-1.0", + "CDDL-1.0", + "CDDL-1.1", + "CDLA-Permissive-1.0", + "CDLA-Sharing-1.0", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "CPAL-1.0", + "CPL-1.0", + "CPOL-1.02", + "CUA-OPL-1.0", + "Caldera", + "ClArtistic", + "Condor-1.1", + "Crossword", + "CrystalStacker", + "Cube", + "D-FSL-1.0", + "DOC", + "DSDP", + "Dotseqn", + "ECL-1.0", + "ECL-2.0", + "EFL-1.0", + "EFL-2.0", + "EPICS", + "EPL-1.0", + "EPL-2.0", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "EUPL-1.2", + "Entessa", + "ErlPL-1.1", + "Eurosym", + "FSFAP", + "FSFUL", + "FSFULLR", + "FTL", + "Fair", + "Frameworx-1.0", + "FreeImage", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", + "GFDL-1.1-only", + "GFDL-1.1-or-later", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", + "GFDL-1.2-only", + "GFDL-1.2-or-later", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", + "GFDL-1.3-only", + "GFDL-1.3-or-later", + "GL2PS", + "GLWTPL", + "GPL-1.0-only", + "GPL-1.0-or-later", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-3.0-only", + "GPL-3.0-or-later", + "Giftware", + "Glide", + "Glulxe", + "HPND", + "HPND-sell-variant", + "HaskellReport", + "Hippocratic-2.1", + "IBM-pibs", + "ICU", + "IJG", + "IPA", + "IPL-1.0", + "ISC", + "ImageMagick", + "Imlib2", + "Info-ZIP", + "Intel", + "Intel-ACPI", + "Interbase-1.0", + "JPNIC", + "JSON", + "JasPer-2.0", + "LAL-1.2", + "LAL-1.3", + "LGPL-2.0-only", + "LGPL-2.0-or-later", + "LGPL-2.1-only", + "LGPL-2.1-or-later", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "LGPLLR", + "LPL-1.0", + "LPL-1.02", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "Latex2e", + "Leptonica", + "LiLiQ-P-1.1", + "LiLiQ-R-1.1", + "LiLiQ-Rplus-1.1", + "Libpng", + "Linux-OpenIB", + "MIT", + "MIT-0", + "MIT-CMU", + "MIT-advertising", + "MIT-enna", + "MIT-feh", + "MITNFA", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "MS-PL", + "MS-RL", + "MTLL", + "MakeIndex", + "MirOS", + "Motosoto", + "MulanPSL-1.0", + "MulanPSL-2.0", + "Multics", + "Mup", + "NASA-1.3", + "NBPL-1.0", + "NCGL-UK-2.0", + "NCSA", + "NGPL", + "NIST-PD", + "NIST-PD-fallback", + "NLOD-1.0", + "NLPL", + "NOSL", + "NPL-1.0", + "NPL-1.1", + "NPOSL-3.0", + "NRL", + "NTP", + "NTP-0", + "Naumen", + "Net-SNMP", + "NetCDF", + "Newsletr", + "Nokia", + "Noweb", + "O-UDA-1.0", + "OCCT-PL", + "OCLC-2.0", + "ODC-By-1.0", + "ODbL-1.0", + "OFL-1.0", + "OFL-1.0-RFN", + "OFL-1.0-no-RFN", + "OFL-1.1", + "OFL-1.1-RFN", + "OFL-1.1-no-RFN", + "OGC-1.0", + "OGL-Canada-2.0", + "OGL-UK-1.0", + "OGL-UK-2.0", + "OGL-UK-3.0", + "OGTSL", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.2.2", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OML", + "OPL-1.0", + "OSET-PL-2.1", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "OpenSSL", + "PDDL-1.0", + "PHP-3.0", + "PHP-3.01", + "PSF-2.0", + "Parity-6.0.0", + "Parity-7.0.0", + "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", + "PostgreSQL", + "Python-2.0", + "QPL-1.0", + "Qhull", + "RHeCos-1.1", + "RPL-1.1", + "RPL-1.5", + "RPSL-1.0", + "RSA-MD", + "RSCPL", + "Rdisc", + "Ruby", + "SAX-PD", + "SCEA", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "SHL-0.5", + "SHL-0.51", + "SISSL", + "SISSL-1.2", + "SMLNJ", + "SMPPL", + "SNIA", + "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", + "SSPL-1.0", + "SWL", + "Saxpath", + "Sendmail", + "Sendmail-8.23", + "SimPL-2.0", + "Sleepycat", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "SugarCRM-1.1.3", + "TAPR-OHL-1.0", + "TCL", + "TCP-wrappers", + "TMate", + "TORQUE-1.1", + "TOSL", + "TU-Berlin-1.0", + "TU-Berlin-2.0", + "UCL-1.0", + "UPL-1.0", + "Unicode-DFS-2015", + "Unicode-DFS-2016", + "Unicode-TOU", + "Unlicense", + "VOSTROM", + "VSL-1.0", + "Vim", + "W3C", + "W3C-19980720", + "W3C-20150513", + "WTFPL", + "Watcom-1.0", + "Wsuipa", + "X11", + "XFree86-1.1", + "XSkat", + "Xerox", + "Xnet", + "YPL-1.0", + "YPL-1.1", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1", + "Zed", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "blessing", + "bzip2-1.0.5", + "bzip2-1.0.6", + "copyleft-next-0.3.0", + "copyleft-next-0.3.1", + "curl", + "diffmark", + "dvipdfm", + "eGenix", + "etalab-2.0", + "gSOAP-1.3b", + "gnuplot", + "iMatix", + "libpng-2.0", + "libselinux-1.0", + "libtiff", + "mpich2", + "psfrag", + "psutils", + "xinetd", + "xpp", + "zlib-acknowledgement" +] diff --git a/node_modules/spdx-license-ids/package.json b/node_modules/spdx-license-ids/package.json new file mode 100644 index 0000000..c2642cb --- /dev/null +++ b/node_modules/spdx-license-ids/package.json @@ -0,0 +1,75 @@ +{ + "_from": "spdx-license-ids@^3.0.0", + "_id": "spdx-license-ids@3.0.6", + "_inBundle": false, + "_integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "_location": "/spdx-license-ids", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "spdx-license-ids@^3.0.0", + "name": "spdx-license-ids", + "escapedName": "spdx-license-ids", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/spdx-correct", + "/spdx-expression-parse" + ], + "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "_shasum": "c80757383c28abf7296744998cbc106ae8b854ce", + "_spec": "spdx-license-ids@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/spdx-correct", + "author": { + "name": "Shinnosuke Watanabe", + "url": "https://github.com/shinnn" + }, + "bugs": { + "url": "https://github.com/jslicense/spdx-license-ids/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A list of SPDX license identifiers", + "devDependencies": { + "@shinnn/eslint-config": "^6.8.7", + "chalk": "^2.4.1", + "eslint": "^5.10.0", + "get-spdx-license-ids": "^2.1.0", + "rmfr": "^2.0.0", + "tape": "^4.9.1" + }, + "eslintConfig": { + "extends": "@shinnn" + }, + "files": [ + "deprecated.json", + "index.json" + ], + "homepage": "https://github.com/jslicense/spdx-license-ids#readme", + "keywords": [ + "spdx", + "license", + "licenses", + "id", + "identifier", + "identifiers", + "json", + "array", + "oss" + ], + "license": "CC0-1.0", + "name": "spdx-license-ids", + "repository": { + "type": "git", + "url": "git+https://github.com/jslicense/spdx-license-ids.git" + }, + "scripts": { + "build": "node build.js", + "pretest": "eslint .", + "test": "node test.js" + }, + "version": "3.0.6" +} diff --git a/node_modules/sprintf-js/.npmignore b/node_modules/sprintf-js/.npmignore new file mode 100644 index 0000000..096746c --- /dev/null +++ b/node_modules/sprintf-js/.npmignore @@ -0,0 +1 @@ +/node_modules/ \ No newline at end of file diff --git a/node_modules/sprintf-js/LICENSE b/node_modules/sprintf-js/LICENSE new file mode 100644 index 0000000..663ac52 --- /dev/null +++ b/node_modules/sprintf-js/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2007-2014, Alexandru Marasteanu +All rights reserved. + +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. +* Neither the name of this software nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +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 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/sprintf-js/README.md b/node_modules/sprintf-js/README.md new file mode 100644 index 0000000..8386356 --- /dev/null +++ b/node_modules/sprintf-js/README.md @@ -0,0 +1,88 @@ +# sprintf.js +**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. + +Its prototype is simple: + + string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) + +The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: + +* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. +* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. +* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. +* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. +* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. +* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. +* A type specifier that can be any of: + * `%` — yields a literal `%` character + * `b` — yields an integer as a binary number + * `c` — yields an integer as the character with that ASCII value + * `d` or `i` — yields an integer as a signed decimal number + * `e` — yields a float using scientific notation + * `u` — yields an integer as an unsigned decimal number + * `f` — yields a float as is; see notes on precision above + * `g` — yields a float as is; see notes on precision above + * `o` — yields an integer as an octal number + * `s` — yields a string as is + * `x` — yields an integer as a hexadecimal number (lower-case) + * `X` — yields an integer as a hexadecimal number (upper-case) + * `j` — yields a JavaScript object or array as a JSON encoded string + +## JavaScript `vsprintf` +`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: + + vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) + +## Argument swapping +You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: + + sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") +And, of course, you can repeat the placeholders without having to increase the number of arguments. + +## Named arguments +Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: + + var user = { + name: "Dolly" + } + sprintf("Hello %(name)s", user) // Hello Dolly +Keywords in replacement fields can be optionally followed by any number of keywords or indexes: + + var users = [ + {name: "Dolly"}, + {name: "Molly"}, + {name: "Polly"} + ] + sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly +Note: mixing positional and named placeholders is not (yet) supported + +## Computed values +You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. + + sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 + sprintf("Current date and time: %s", function() { return new Date().toString() }) + +# AngularJS +You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. + +# Installation + +## Via Bower + + bower install sprintf + +## Or as a node.js module + + npm install sprintf-js + +### Usage + + var sprintf = require("sprintf-js").sprintf, + vsprintf = require("sprintf-js").vsprintf + + sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") + vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) + +# License + +**sprintf.js** is licensed under the terms of the 3-clause BSD license. diff --git a/node_modules/sprintf-js/bower.json b/node_modules/sprintf-js/bower.json new file mode 100644 index 0000000..d90a759 --- /dev/null +++ b/node_modules/sprintf-js/bower.json @@ -0,0 +1,14 @@ +{ + "name": "sprintf", + "description": "JavaScript sprintf implementation", + "version": "1.0.3", + "main": "src/sprintf.js", + "license": "BSD-3-Clause-Clear", + "keywords": ["sprintf", "string", "formatting"], + "authors": ["Alexandru Marasteanu (http://alexei.ro/)"], + "homepage": "https://github.com/alexei/sprintf.js", + "repository": { + "type": "git", + "url": "git://github.com/alexei/sprintf.js.git" + } +} diff --git a/node_modules/sprintf-js/demo/angular.html b/node_modules/sprintf-js/demo/angular.html new file mode 100644 index 0000000..3559efd --- /dev/null +++ b/node_modules/sprintf-js/demo/angular.html @@ -0,0 +1,20 @@ + + + + + + + + +
{{ "%+010d"|sprintf:-123 }}
+
{{ "%+010d"|vsprintf:[-123] }}
+
{{ "%+010d"|fmt:-123 }}
+
{{ "%+010d"|vfmt:[-123] }}
+
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
+
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
+ + + + diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js b/node_modules/sprintf-js/dist/angular-sprintf.min.js new file mode 100644 index 0000000..dbaf744 --- /dev/null +++ b/node_modules/sprintf-js/dist/angular-sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); +//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/node_modules/sprintf-js/dist/angular-sprintf.min.js.map new file mode 100644 index 0000000..055964c --- /dev/null +++ b/node_modules/sprintf-js/dist/angular-sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.map b/node_modules/sprintf-js/dist/angular-sprintf.min.map new file mode 100644 index 0000000..055964c --- /dev/null +++ b/node_modules/sprintf-js/dist/angular-sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js b/node_modules/sprintf-js/dist/sprintf.min.js new file mode 100644 index 0000000..dc61e51 --- /dev/null +++ b/node_modules/sprintf-js/dist/sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); +//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js.map b/node_modules/sprintf-js/dist/sprintf.min.js.map new file mode 100644 index 0000000..369dbaf --- /dev/null +++ b/node_modules/sprintf-js/dist/sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIyB,UAAU,EAAGtB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAI+C,cAG3BvC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWgD,QAAQxC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGyB,OAAO,GAAK,IACzEtB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASyD,GAErB,IADA,GAAIC,GAAOD,EAAK1B,KAAYL,KAAiBiC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC3B,EAAQhB,EAAGK,KAAKwC,KAAKF,IACtBhC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOuC,KAAKF,IAC7BhC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYsC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI9B,EAAM,GAAI,CACV4B,GAAa,CACb,IAAIG,MAAiBC,EAAoBhC,EAAM,GAAIiC,IACnD,IAAuD,QAAlDA,EAAcjD,EAAGnB,IAAIgE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWzB,QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.map b/node_modules/sprintf-js/dist/sprintf.min.map new file mode 100644 index 0000000..ee011aa --- /dev/null +++ b/node_modules/sprintf-js/dist/sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKyB,YAAYtB,EAAM,IAAMoB,WAAWvB,EACxE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAI0B,UAAU,EAAGvB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAIgD,cAG3BxC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWiD,QAAQzC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAG0B,OAAO,GAAK,IACzEvB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAAS0D,GAErB,IADA,GAAIC,GAAOD,EAAK3B,KAAYL,KAAiBkC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC5B,EAAQhB,EAAGK,KAAKyC,KAAKF,IACtBjC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOwC,KAAKF,IAC7BjC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYuC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI/B,EAAM,GAAI,CACV6B,GAAa,CACb,IAAIG,MAAiBC,EAAoBjC,EAAM,GAAIkC,IACnD,IAAuD,QAAlDA,EAAclD,EAAGnB,IAAIiE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAW1B,QAAU4B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG5B,UACnE,GAA8D,QAAzD4B,EAAclD,EAAGQ,WAAWsC,KAAKG,IAClCD,EAAWA,EAAW1B,QAAU4B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/gruntfile.js b/node_modules/sprintf-js/gruntfile.js new file mode 100644 index 0000000..246e1c3 --- /dev/null +++ b/node_modules/sprintf-js/gruntfile.js @@ -0,0 +1,36 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + + uglify: { + options: { + banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", + sourceMap: true + }, + build: { + files: [ + { + src: "src/sprintf.js", + dest: "dist/sprintf.min.js" + }, + { + src: "src/angular-sprintf.js", + dest: "dist/angular-sprintf.min.js" + } + ] + } + }, + + watch: { + js: { + files: "src/*.js", + tasks: ["uglify"] + } + } + }) + + grunt.loadNpmTasks("grunt-contrib-uglify") + grunt.loadNpmTasks("grunt-contrib-watch") + + grunt.registerTask("default", ["uglify", "watch"]) +} diff --git a/node_modules/sprintf-js/package.json b/node_modules/sprintf-js/package.json new file mode 100644 index 0000000..c9f78e2 --- /dev/null +++ b/node_modules/sprintf-js/package.json @@ -0,0 +1,54 @@ +{ + "_from": "sprintf-js@~1.0.2", + "_id": "sprintf-js@1.0.3", + "_inBundle": false, + "_integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "_location": "/sprintf-js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "sprintf-js@~1.0.2", + "name": "sprintf-js", + "escapedName": "sprintf-js", + "rawSpec": "~1.0.2", + "saveSpec": null, + "fetchSpec": "~1.0.2" + }, + "_requiredBy": [ + "/argparse" + ], + "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "_shasum": "04e6926f662895354f3dd015203633b857297e2c", + "_spec": "sprintf-js@~1.0.2", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/argparse", + "author": { + "name": "Alexandru Marasteanu", + "email": "hello@alexei.ro", + "url": "http://alexei.ro/" + }, + "bugs": { + "url": "https://github.com/alexei/sprintf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "JavaScript sprintf implementation", + "devDependencies": { + "grunt": "*", + "grunt-contrib-uglify": "*", + "grunt-contrib-watch": "*", + "mocha": "*" + }, + "homepage": "https://github.com/alexei/sprintf.js#readme", + "license": "BSD-3-Clause", + "main": "src/sprintf.js", + "name": "sprintf-js", + "repository": { + "type": "git", + "url": "git+https://github.com/alexei/sprintf.js.git" + }, + "scripts": { + "test": "mocha test/test.js" + }, + "version": "1.0.3" +} diff --git a/node_modules/sprintf-js/src/angular-sprintf.js b/node_modules/sprintf-js/src/angular-sprintf.js new file mode 100644 index 0000000..9c69123 --- /dev/null +++ b/node_modules/sprintf-js/src/angular-sprintf.js @@ -0,0 +1,18 @@ +angular. + module("sprintf", []). + filter("sprintf", function() { + return function() { + return sprintf.apply(null, arguments) + } + }). + filter("fmt", ["$filter", function($filter) { + return $filter("sprintf") + }]). + filter("vsprintf", function() { + return function(format, argv) { + return vsprintf(format, argv) + } + }). + filter("vfmt", ["$filter", function($filter) { + return $filter("vsprintf") + }]) diff --git a/node_modules/sprintf-js/src/sprintf.js b/node_modules/sprintf-js/src/sprintf.js new file mode 100644 index 0000000..c0fc7c0 --- /dev/null +++ b/node_modules/sprintf-js/src/sprintf.js @@ -0,0 +1,208 @@ +(function(window) { + var re = { + not_string: /[^s]/, + number: /[diefg]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[\+\-]/ + } + + function sprintf() { + var key = arguments[0], cache = sprintf.cache + if (!(cache[key] && cache.hasOwnProperty(key))) { + cache[key] = sprintf.parse(key) + } + return sprintf.format.call(null, cache[key], arguments) + } + + sprintf.format = function(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" + for (i = 0; i < tree_length; i++) { + node_type = get_type(parse_tree[i]) + if (node_type === "string") { + output[output.length] = parse_tree[i] + } + else if (node_type === "array") { + match = parse_tree[i] // convenience purposes only + if (match[2]) { // keyword argument + arg = argv[cursor] + for (k = 0; k < match[2].length; k++) { + if (!arg.hasOwnProperty(match[2][k])) { + throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) + } + arg = arg[match[2][k]] + } + } + else if (match[1]) { // positional argument (explicit) + arg = argv[match[1]] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (get_type(arg) == "function") { + arg = arg() + } + + if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { + throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) + } + + if (re.number.test(match[8])) { + is_positive = arg >= 0 + } + + switch (match[8]) { + case "b": + arg = arg.toString(2) + break + case "c": + arg = String.fromCharCode(arg) + break + case "d": + case "i": + arg = parseInt(arg, 10) + break + case "j": + arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) + break + case "e": + arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() + break + case "f": + arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) + break + case "g": + arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) + break + case "o": + arg = arg.toString(8) + break + case "s": + arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) + break + case "u": + arg = arg >>> 0 + break + case "x": + arg = arg.toString(16) + break + case "X": + arg = arg.toString(16).toUpperCase() + break + } + if (re.json.test(match[8])) { + output[output.length] = arg + } + else { + if (re.number.test(match[8]) && (!is_positive || match[3])) { + sign = is_positive ? "+" : "-" + arg = arg.toString().replace(re.sign, "") + } + else { + sign = "" + } + pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " + pad_length = match[6] - (sign + arg).length + pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" + output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) + } + } + } + return output.join("") + } + + sprintf.cache = {} + + sprintf.parse = function(fmt) { + var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree[parse_tree.length] = match[0] + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree[parse_tree.length] = "%" + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + var field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + } + else { + throw new SyntaxError("[sprintf] failed to parse named argument key") + } + } + } + else { + throw new SyntaxError("[sprintf] failed to parse named argument key") + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") + } + parse_tree[parse_tree.length] = match + } + else { + throw new SyntaxError("[sprintf] unexpected placeholder") + } + _fmt = _fmt.substring(match[0].length) + } + return parse_tree + } + + var vsprintf = function(fmt, argv, _argv) { + _argv = (argv || []).slice(0) + _argv.splice(0, 0, fmt) + return sprintf.apply(null, _argv) + } + + /** + * helpers + */ + function get_type(variable) { + return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() + } + + function str_repeat(input, multiplier) { + return Array(multiplier + 1).join(input) + } + + /** + * export to either browser or node.js + */ + if (typeof exports !== "undefined") { + exports.sprintf = sprintf + exports.vsprintf = vsprintf + } + else { + window.sprintf = sprintf + window.vsprintf = vsprintf + + if (typeof define === "function" && define.amd) { + define(function() { + return { + sprintf: sprintf, + vsprintf: vsprintf + } + }) + } + } +})(typeof window === "undefined" ? this : window); diff --git a/node_modules/sprintf-js/test/test.js b/node_modules/sprintf-js/test/test.js new file mode 100644 index 0000000..6f57b25 --- /dev/null +++ b/node_modules/sprintf-js/test/test.js @@ -0,0 +1,82 @@ +var assert = require("assert"), + sprintfjs = require("../src/sprintf.js"), + sprintf = sprintfjs.sprintf, + vsprintf = sprintfjs.vsprintf + +describe("sprintfjs", function() { + var pi = 3.141592653589793 + + it("should return formated strings for simple placeholders", function() { + assert.equal("%", sprintf("%%")) + assert.equal("10", sprintf("%b", 2)) + assert.equal("A", sprintf("%c", 65)) + assert.equal("2", sprintf("%d", 2)) + assert.equal("2", sprintf("%i", 2)) + assert.equal("2", sprintf("%d", "2")) + assert.equal("2", sprintf("%i", "2")) + assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) + assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) + assert.equal("2e+0", sprintf("%e", 2)) + assert.equal("2", sprintf("%u", 2)) + assert.equal("4294967294", sprintf("%u", -2)) + assert.equal("2.2", sprintf("%f", 2.2)) + assert.equal("3.141592653589793", sprintf("%g", pi)) + assert.equal("10", sprintf("%o", 8)) + assert.equal("%s", sprintf("%s", "%s")) + assert.equal("ff", sprintf("%x", 255)) + assert.equal("FF", sprintf("%X", 255)) + assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) + assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) + }) + + it("should return formated strings for complex placeholders", function() { + // sign + assert.equal("2", sprintf("%d", 2)) + assert.equal("-2", sprintf("%d", -2)) + assert.equal("+2", sprintf("%+d", 2)) + assert.equal("-2", sprintf("%+d", -2)) + assert.equal("2", sprintf("%i", 2)) + assert.equal("-2", sprintf("%i", -2)) + assert.equal("+2", sprintf("%+i", 2)) + assert.equal("-2", sprintf("%+i", -2)) + assert.equal("2.2", sprintf("%f", 2.2)) + assert.equal("-2.2", sprintf("%f", -2.2)) + assert.equal("+2.2", sprintf("%+f", 2.2)) + assert.equal("-2.2", sprintf("%+f", -2.2)) + assert.equal("-2.3", sprintf("%+.1f", -2.34)) + assert.equal("-0.0", sprintf("%+.1f", -0.01)) + assert.equal("3.14159", sprintf("%.6g", pi)) + assert.equal("3.14", sprintf("%.3g", pi)) + assert.equal("3", sprintf("%.1g", pi)) + assert.equal("-000000123", sprintf("%+010d", -123)) + assert.equal("______-123", sprintf("%+'_10d", -123)) + assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) + + // padding + assert.equal("-0002", sprintf("%05d", -2)) + assert.equal("-0002", sprintf("%05i", -2)) + assert.equal(" <", sprintf("%5s", "<")) + assert.equal("0000<", sprintf("%05s", "<")) + assert.equal("____<", sprintf("%'_5s", "<")) + assert.equal("> ", sprintf("%-5s", ">")) + assert.equal(">0000", sprintf("%0-5s", ">")) + assert.equal(">____", sprintf("%'_-5s", ">")) + assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) + assert.equal("1234", sprintf("%02u", 1234)) + assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) + assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) + assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) + assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) + + // precision + assert.equal("2.3", sprintf("%.1f", 2.345)) + assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) + assert.equal(" x", sprintf("%5.1s", "xxxxxx")) + + }) + + it("should return formated strings for callbacks", function() { + assert.equal("foobar", sprintf("%s", function() { return "foobar" })) + assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... + }) +}) diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js new file mode 100644 index 0000000..33c9d6c --- /dev/null +++ b/node_modules/string-width/index.js @@ -0,0 +1,39 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex')(); + +module.exports = input => { + input = input.replace(emojiRegex, ' '); + + if (typeof input !== 'string' || input.length === 0) { + return 0; + } + + input = stripAnsi(input); + + let width = 0; + + for (let i = 0; i < input.length; i++) { + const code = input.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; diff --git a/node_modules/string-width/license b/node_modules/string-width/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width/node_modules/ansi-regex/index.js b/node_modules/string-width/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..c254480 --- /dev/null +++ b/node_modules/string-width/node_modules/ansi-regex/index.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/string-width/node_modules/ansi-regex/license b/node_modules/string-width/node_modules/ansi-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/string-width/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width/node_modules/ansi-regex/package.json b/node_modules/string-width/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..970fa00 --- /dev/null +++ b/node_modules/string-width/node_modules/ansi-regex/package.json @@ -0,0 +1,85 @@ +{ + "_from": "ansi-regex@^4.1.0", + "_id": "ansi-regex@4.1.0", + "_inBundle": false, + "_integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "_location": "/string-width/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^4.1.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/string-width/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "_shasum": "8b9f8f08cf1acb843756a839ca8c7e3168c51997", + "_spec": "ansi-regex@^4.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/string-width/node_modules/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "^0.25.0", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "4.1.0" +} diff --git a/node_modules/string-width/node_modules/ansi-regex/readme.md b/node_modules/string-width/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..d19c446 --- /dev/null +++ b/node_modules/string-width/node_modules/ansi-regex/readme.md @@ -0,0 +1,87 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/string-width/node_modules/strip-ansi/index.d.ts b/node_modules/string-width/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..44e954d --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,15 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +export default function stripAnsi(string: string): string; diff --git a/node_modules/string-width/node_modules/strip-ansi/index.js b/node_modules/string-width/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..9788c96 --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/index.js @@ -0,0 +1,7 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; + +module.exports = stripAnsi; +module.exports.default = stripAnsi; diff --git a/node_modules/string-width/node_modules/strip-ansi/license b/node_modules/string-width/node_modules/strip-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width/node_modules/strip-ansi/package.json b/node_modules/string-width/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..baa288c --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/package.json @@ -0,0 +1,86 @@ +{ + "_from": "strip-ansi@^5.1.0", + "_id": "strip-ansi@5.2.0", + "_inBundle": false, + "_integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "_location": "/string-width/strip-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-ansi@^5.1.0", + "name": "strip-ansi", + "escapedName": "strip-ansi", + "rawSpec": "^5.1.0", + "saveSpec": null, + "fetchSpec": "^5.1.0" + }, + "_requiredBy": [ + "/string-width" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "_shasum": "8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae", + "_spec": "strip-ansi@^5.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes from a string", + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "version": "5.2.0" +} diff --git a/node_modules/string-width/node_modules/strip-ansi/readme.md b/node_modules/string-width/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..8681fe8 --- /dev/null +++ b/node_modules/string-width/node_modules/strip-ansi/readme.md @@ -0,0 +1,61 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + +--- + +
+ + Get professional support for 'strip-ansi' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json new file mode 100644 index 0000000..86c41e1 --- /dev/null +++ b/node_modules/string-width/package.json @@ -0,0 +1,88 @@ +{ + "_from": "string-width@^3.0.0", + "_id": "string-width@3.1.0", + "_inBundle": false, + "_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "_location": "/string-width", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string-width@^3.0.0", + "name": "string-width", + "escapedName": "string-width", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/table" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "_shasum": "22767be21b62af1081574306f69ac51b62203961", + "_spec": "string-width@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/table", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "bundleDependencies": false, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "deprecated": false, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "^1.0.1", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "name": "string-width", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.1.0" +} diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md new file mode 100644 index 0000000..d39d95f --- /dev/null +++ b/node_modules/string-width/readme.md @@ -0,0 +1,45 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 + +stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +// => 5 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/string.prototype.trimend/.editorconfig b/node_modules/string.prototype.trimend/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/string.prototype.trimend/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/string.prototype.trimend/.eslintrc b/node_modules/string.prototype.trimend/.eslintrc new file mode 100644 index 0000000..54af451 --- /dev/null +++ b/node_modules/string.prototype.trimend/.eslintrc @@ -0,0 +1,15 @@ +{ + "root": true, + + "extends": "@ljharb", + + "overrides": [ + { + "files": "test/**", + "rules": { + "id-length": 0, + "no-invalid-this": 1, + }, + }, + ], +} diff --git a/node_modules/string.prototype.trimend/.github/workflows/rebase.yml b/node_modules/string.prototype.trimend/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/string.prototype.trimend/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/string.prototype.trimend/.travis.yml b/node_modules/string.prototype.trimend/.travis.yml new file mode 100644 index 0000000..5ed0fa5 --- /dev/null +++ b/node_modules/string.prototype.trimend/.travis.yml @@ -0,0 +1,8 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml diff --git a/node_modules/string.prototype.trimend/CHANGELOG.md b/node_modules/string.prototype.trimend/CHANGELOG.md new file mode 100644 index 0000000..7b2512d --- /dev/null +++ b/node_modules/string.prototype.trimend/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.1](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.0...v1.0.1) - 2020-04-09 + +### Commits + +- [meta] add some missing repo metadata [`6abe248`](https://github.com/es-shims/String.prototype.trimEnd/commit/6abe248ba0b57a8b0e16bbe01de07a4d37c421bc) +- [Dev Deps] update `auto-changelog` [`e2eaab2`](https://github.com/es-shims/String.prototype.trimEnd/commit/e2eaab2fd1bc27a3d224b3d76db16190c1dd6d08) + +## [v1.0.0](https://github.com/es-shims/String.prototype.trimEnd/compare/v0.1.0...v1.0.0) - 2020-03-30 + +### Commits + +- [Breaking] convert to es-shim API [`2c6ef13`](https://github.com/es-shims/String.prototype.trimEnd/commit/2c6ef13d3f0b07a9bc55e367b311dbb731780405) +- [meta] add `auto-changelog` [`6f1fcc1`](https://github.com/es-shims/String.prototype.trimEnd/commit/6f1fcc1739de1e9541bd603b659807646a13dd7f) +- [meta] update readme [`ed4ce0d`](https://github.com/es-shims/String.prototype.trimEnd/commit/ed4ce0d84d53e626b48375c5959be20332464eaf) +- [Tests] add `npm run lint` [`eadaf2c`](https://github.com/es-shims/String.prototype.trimEnd/commit/eadaf2c83f2d791b54d80d7b30a9961ebc0f246f) +- Only apps should have lockfiles [`44d355f`](https://github.com/es-shims/String.prototype.trimEnd/commit/44d355f7dafcb0b51c5001824b07f7a2b9f1d06e) +- [actions] add automatic rebasing / merge commit blocking [`e78bf8e`](https://github.com/es-shims/String.prototype.trimEnd/commit/e78bf8e5fc04fcb3379dd1c98360d7df4f9ea7d6) +- [Tests] use shared travis-ci configs [`983c563`](https://github.com/es-shims/String.prototype.trimEnd/commit/983c5639efca2c9bb8b93ebbb917fbcb2561b94c) +- [meta] add `funding` field [`35139d6`](https://github.com/es-shims/String.prototype.trimEnd/commit/35139d6236ceacfc1501d08fb196d18a936ee583) +- [meta] fix non-updated version number [`a2d308b`](https://github.com/es-shims/String.prototype.trimEnd/commit/a2d308b99967ca427936c54747175794ca7336e1) + +## [v0.1.0](https://github.com/es-shims/String.prototype.trimEnd/compare/v0.0.1...v0.1.0) - 2017-12-19 + +### Commits + +- updated README [`f1c71a0`](https://github.com/es-shims/String.prototype.trimEnd/commit/f1c71a0a882e89e1c207ed2b316d91670be2b075) + +## v0.0.1 - 2017-12-19 + +### Commits + +- finished polyfill [`e58d550`](https://github.com/es-shims/String.prototype.trimEnd/commit/e58d550ab8695924ff4221ebe91f00f29801aa4b) +- created README file [`f78628a`](https://github.com/es-shims/String.prototype.trimEnd/commit/f78628ab123171f8b7759bba331d6a589702584f) +- Initial commit [`9199478`](https://github.com/es-shims/String.prototype.trimEnd/commit/9199478256da953e2f5bddfc4d82a161f4537e85) +- typo [`d1f4558`](https://github.com/es-shims/String.prototype.trimEnd/commit/d1f4558a51157833f14d8a424426d038d06576ce) diff --git a/node_modules/string.prototype.trimend/LICENSE b/node_modules/string.prototype.trimend/LICENSE new file mode 100644 index 0000000..e48a1b5 --- /dev/null +++ b/node_modules/string.prototype.trimend/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Khaled Al-Ansari + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/string.prototype.trimend/README.md b/node_modules/string.prototype.trimend/README.md new file mode 100644 index 0000000..4549d61 --- /dev/null +++ b/node_modules/string.prototype.trimend/README.md @@ -0,0 +1,47 @@ +String.prototype.trimEnd [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +An ES2019-spec-compliant `String.prototype.trimEnd` shim. Invoke its "shim" method to shim `String.prototype.trimEnd` if it is unavailable. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s. + +Most common usage: +```js +var trimEnd = require('string.prototype.trimend'); + +assert(trimEnd(' \t\na \t\n') === 'a \t\n'); + +if (!String.prototype.trimEnd) { + trimEnd.shim(); +} + +assert(trimEnd(' \t\na \t\n ') === ' \t\na \t\n '.trimEnd()); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.com/package/string.prototype.trimend +[npm-version-svg]: http://vb.teelaun.ch/es-shims/String.prototype.trimEnd.svg +[travis-svg]: https://travis-ci.org/es-shims/String.prototype.trimEnd.svg +[travis-url]: https://travis-ci.org/es-shims/String.prototype.trimEnd +[deps-svg]: https://david-dm.org/es-shims/String.prototype.trimEnd.svg +[deps-url]: https://david-dm.org/es-shims/String.prototype.trimEnd +[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimEnd/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimEnd#info=devDependencies +[testling-svg]: https://ci.testling.com/es-shims/String.prototype.trimEnd.png +[testling-url]: https://ci.testling.com/es-shims/String.prototype.trimEnd +[npm-badge-png]: https://nodei.co/npm/string.prototype.trimend.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/string.prototype.trimend.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/string.prototype.trimend.svg +[downloads-url]: http://npm-stat.com/charts.html?package=string.prototype.trimend diff --git a/node_modules/string.prototype.trimend/auto.js b/node_modules/string.prototype.trimend/auto.js new file mode 100644 index 0000000..8ebf606 --- /dev/null +++ b/node_modules/string.prototype.trimend/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/string.prototype.trimend/implementation.js b/node_modules/string.prototype.trimend/implementation.js new file mode 100644 index 0000000..4591e1e --- /dev/null +++ b/node_modules/string.prototype.trimend/implementation.js @@ -0,0 +1,12 @@ +'use strict'; + +var callBound = require('es-abstract/helpers/callBound'); +var $replace = callBound('String.prototype.replace'); + +/* eslint-disable no-control-regex */ +var endWhitespace = /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/; +/* eslint-enable no-control-regex */ + +module.exports = function trimEnd() { + return $replace(this, endWhitespace, ''); +}; diff --git a/node_modules/string.prototype.trimend/index.js b/node_modules/string.prototype.trimend/index.js new file mode 100644 index 0000000..3232160 --- /dev/null +++ b/node_modules/string.prototype.trimend/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBind = require('es-abstract/helpers/callBind'); +var define = require('define-properties'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var bound = callBind(getPolyfill()); + +define(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.editorconfig b/node_modules/string.prototype.trimend/node_modules/es-abstract/.editorconfig new file mode 100644 index 0000000..eaa2141 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintignore b/node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintrc b/node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintrc new file mode 100644 index 0000000..1bac5b7 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.eslintrc @@ -0,0 +1,66 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + }, + + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 4], + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "new-cap": 0, + "no-extra-parens": 1, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "operations/*", + "rules": { + "max-lines": 0, + }, + }, + { + "files": "operations/*.js", + "parserOptions": { + "ecmaVersion": 2020, + }, + "rules": { + "no-console": 0, + "no-multi-str": 0, + }, + }, + { + "files": "operations/getOps.js", + "rules": { + "no-console": 0, + "no-process-exit": 0, + }, + }, + { + "files": "test/**", + "rules": { + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": 0, + "max-statements-per-line": [2, { "max": 3 }], + "max-statements": 0, + "no-implicit-coercion": 0, + "no-invalid-this": 1, + "object-curly-newline": 0, + "prefer-regex-literals": 0, + }, + }, + ], +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.gitattributes b/node_modules/string.prototype.trimend/node_modules/es-abstract/.gitattributes new file mode 100644 index 0000000..0b600dc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.gitattributes @@ -0,0 +1,472 @@ +2015/AbstractRelationalComparison.js spackled linguist-generated=true +2015/DateFromTime.js spackled linguist-generated=true +2015/Day.js spackled linguist-generated=true +2015/DayFromYear.js spackled linguist-generated=true +2015/DayWithinYear.js spackled linguist-generated=true +2015/DaysInYear.js spackled linguist-generated=true +2015/HourFromTime.js spackled linguist-generated=true +2015/InLeapYear.js spackled linguist-generated=true +2015/IsCallable.js spackled linguist-generated=true +2015/IsPropertyDescriptor.js spackled linguist-generated=true +2015/MakeDate.js spackled linguist-generated=true +2015/MakeDay.js spackled linguist-generated=true +2015/MakeTime.js spackled linguist-generated=true +2015/MinFromTime.js spackled linguist-generated=true +2015/MonthFromTime.js spackled linguist-generated=true +2015/SameValue.js spackled linguist-generated=true +2015/SecFromTime.js spackled linguist-generated=true +2015/StrictEqualityComparison.js spackled linguist-generated=true +2015/TimeClip.js spackled linguist-generated=true +2015/TimeFromYear.js spackled linguist-generated=true +2015/TimeWithinDay.js spackled linguist-generated=true +2015/ToBoolean.js spackled linguist-generated=true +2015/ToInt32.js spackled linguist-generated=true +2015/ToPropertyDescriptor.js spackled linguist-generated=true +2015/ToUint16.js spackled linguist-generated=true +2015/ToUint32.js spackled linguist-generated=true +2015/WeekDay.js spackled linguist-generated=true +2015/YearFromTime.js spackled linguist-generated=true +2015/modulo.js spackled linguist-generated=true +2015/msFromTime.js spackled linguist-generated=true +2016/AbstractEqualityComparison.js spackled linguist-generated=true +2016/AbstractRelationalComparison.js spackled linguist-generated=true +2016/AdvanceStringIndex.js spackled linguist-generated=true +2016/ArrayCreate.js spackled linguist-generated=true +2016/ArraySetLength.js spackled linguist-generated=true +2016/ArraySpeciesCreate.js spackled linguist-generated=true +2016/Call.js spackled linguist-generated=true +2016/CanonicalNumericIndexString.js spackled linguist-generated=true +2016/CompletePropertyDescriptor.js spackled linguist-generated=true +2016/CreateDataProperty.js spackled linguist-generated=true +2016/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2016/CreateHTML.js spackled linguist-generated=true +2016/CreateIterResultObject.js spackled linguist-generated=true +2016/CreateListFromArrayLike.js spackled linguist-generated=true +2016/CreateMethodProperty.js spackled linguist-generated=true +2016/DateFromTime.js spackled linguist-generated=true +2016/Day.js spackled linguist-generated=true +2016/DayFromYear.js spackled linguist-generated=true +2016/DayWithinYear.js spackled linguist-generated=true +2016/DaysInYear.js spackled linguist-generated=true +2016/DefinePropertyOrThrow.js spackled linguist-generated=true +2016/DeletePropertyOrThrow.js spackled linguist-generated=true +2016/EnumerableOwnNames.js spackled linguist-generated=true +2016/FromPropertyDescriptor.js spackled linguist-generated=true +2016/Get.js spackled linguist-generated=true +2016/GetIterator.js spackled linguist-generated=true +2016/GetMethod.js spackled linguist-generated=true +2016/GetOwnPropertyKeys.js spackled linguist-generated=true +2016/GetPrototypeFromConstructor.js spackled linguist-generated=true +2016/GetSubstitution.js spackled linguist-generated=true +2016/GetV.js spackled linguist-generated=true +2016/HasOwnProperty.js spackled linguist-generated=true +2016/HasProperty.js spackled linguist-generated=true +2016/HourFromTime.js spackled linguist-generated=true +2016/InLeapYear.js spackled linguist-generated=true +2016/InstanceofOperator.js spackled linguist-generated=true +2016/Invoke.js spackled linguist-generated=true +2016/IsAccessorDescriptor.js spackled linguist-generated=true +2016/IsArray.js spackled linguist-generated=true +2016/IsCallable.js spackled linguist-generated=true +2016/IsConcatSpreadable.js spackled linguist-generated=true +2016/IsConstructor.js spackled linguist-generated=true +2016/IsDataDescriptor.js spackled linguist-generated=true +2016/IsExtensible.js spackled linguist-generated=true +2016/IsGenericDescriptor.js spackled linguist-generated=true +2016/IsInteger.js spackled linguist-generated=true +2016/IsPromise.js spackled linguist-generated=true +2016/IsPropertyDescriptor.js spackled linguist-generated=true +2016/IsPropertyKey.js spackled linguist-generated=true +2016/IsRegExp.js spackled linguist-generated=true +2016/IteratorClose.js spackled linguist-generated=true +2016/IteratorComplete.js spackled linguist-generated=true +2016/IteratorNext.js spackled linguist-generated=true +2016/IteratorStep.js spackled linguist-generated=true +2016/IteratorValue.js spackled linguist-generated=true +2016/MakeDate.js spackled linguist-generated=true +2016/MakeDay.js spackled linguist-generated=true +2016/MakeTime.js spackled linguist-generated=true +2016/MinFromTime.js spackled linguist-generated=true +2016/MonthFromTime.js spackled linguist-generated=true +2016/ObjectCreate.js spackled linguist-generated=true +2016/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2016/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2016/OrdinaryHasInstance.js spackled linguist-generated=true +2016/OrdinaryHasProperty.js spackled linguist-generated=true +2016/RegExpExec.js spackled linguist-generated=true +2016/RequireObjectCoercible.js spackled linguist-generated=true +2016/SameValue.js spackled linguist-generated=true +2016/SameValueZero.js spackled linguist-generated=true +2016/SecFromTime.js spackled linguist-generated=true +2016/Set.js spackled linguist-generated=true +2016/SetFunctionName.js spackled linguist-generated=true +2016/SetIntegrityLevel.js spackled linguist-generated=true +2016/SpeciesConstructor.js spackled linguist-generated=true +2016/StrictEqualityComparison.js spackled linguist-generated=true +2016/SymbolDescriptiveString.js spackled linguist-generated=true +2016/TestIntegrityLevel.js spackled linguist-generated=true +2016/TimeClip.js spackled linguist-generated=true +2016/TimeFromYear.js spackled linguist-generated=true +2016/TimeWithinDay.js spackled linguist-generated=true +2016/ToBoolean.js spackled linguist-generated=true +2016/ToDateString.js spackled linguist-generated=true +2016/ToInt16.js spackled linguist-generated=true +2016/ToInt32.js spackled linguist-generated=true +2016/ToInt8.js spackled linguist-generated=true +2016/ToInteger.js spackled linguist-generated=true +2016/ToLength.js spackled linguist-generated=true +2016/ToNumber.js spackled linguist-generated=true +2016/ToObject.js spackled linguist-generated=true +2016/ToPrimitive.js spackled linguist-generated=true +2016/ToPropertyDescriptor.js spackled linguist-generated=true +2016/ToPropertyKey.js spackled linguist-generated=true +2016/ToString.js spackled linguist-generated=true +2016/ToUint16.js spackled linguist-generated=true +2016/ToUint32.js spackled linguist-generated=true +2016/ToUint8.js spackled linguist-generated=true +2016/ToUint8Clamp.js spackled linguist-generated=true +2016/Type.js spackled linguist-generated=true +2016/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2016/WeekDay.js spackled linguist-generated=true +2016/YearFromTime.js spackled linguist-generated=true +2016/modulo.js spackled linguist-generated=true +2016/msFromTime.js spackled linguist-generated=true +2016/thisBooleanValue.js spackled linguist-generated=true +2016/thisNumberValue.js spackled linguist-generated=true +2016/thisStringValue.js spackled linguist-generated=true +2016/thisTimeValue.js spackled linguist-generated=true +2017/AbstractEqualityComparison.js spackled linguist-generated=true +2017/AbstractRelationalComparison.js spackled linguist-generated=true +2017/AdvanceStringIndex.js spackled linguist-generated=true +2017/ArrayCreate.js spackled linguist-generated=true +2017/ArraySetLength.js spackled linguist-generated=true +2017/ArraySpeciesCreate.js spackled linguist-generated=true +2017/Call.js spackled linguist-generated=true +2017/CanonicalNumericIndexString.js spackled linguist-generated=true +2017/CompletePropertyDescriptor.js spackled linguist-generated=true +2017/CreateDataProperty.js spackled linguist-generated=true +2017/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2017/CreateHTML.js spackled linguist-generated=true +2017/CreateIterResultObject.js spackled linguist-generated=true +2017/CreateListFromArrayLike.js spackled linguist-generated=true +2017/CreateMethodProperty.js spackled linguist-generated=true +2017/DateFromTime.js spackled linguist-generated=true +2017/Day.js spackled linguist-generated=true +2017/DayFromYear.js spackled linguist-generated=true +2017/DayWithinYear.js spackled linguist-generated=true +2017/DaysInYear.js spackled linguist-generated=true +2017/DefinePropertyOrThrow.js spackled linguist-generated=true +2017/DeletePropertyOrThrow.js spackled linguist-generated=true +2017/FromPropertyDescriptor.js spackled linguist-generated=true +2017/Get.js spackled linguist-generated=true +2017/GetIterator.js spackled linguist-generated=true +2017/GetMethod.js spackled linguist-generated=true +2017/GetOwnPropertyKeys.js spackled linguist-generated=true +2017/GetPrototypeFromConstructor.js spackled linguist-generated=true +2017/GetSubstitution.js spackled linguist-generated=true +2017/GetV.js spackled linguist-generated=true +2017/HasOwnProperty.js spackled linguist-generated=true +2017/HasProperty.js spackled linguist-generated=true +2017/HourFromTime.js spackled linguist-generated=true +2017/InLeapYear.js spackled linguist-generated=true +2017/InstanceofOperator.js spackled linguist-generated=true +2017/Invoke.js spackled linguist-generated=true +2017/IsAccessorDescriptor.js spackled linguist-generated=true +2017/IsArray.js spackled linguist-generated=true +2017/IsCallable.js spackled linguist-generated=true +2017/IsConcatSpreadable.js spackled linguist-generated=true +2017/IsConstructor.js spackled linguist-generated=true +2017/IsDataDescriptor.js spackled linguist-generated=true +2017/IsExtensible.js spackled linguist-generated=true +2017/IsGenericDescriptor.js spackled linguist-generated=true +2017/IsInteger.js spackled linguist-generated=true +2017/IsPromise.js spackled linguist-generated=true +2017/IsPropertyDescriptor.js spackled linguist-generated=true +2017/IsPropertyKey.js spackled linguist-generated=true +2017/IsRegExp.js spackled linguist-generated=true +2017/IteratorClose.js spackled linguist-generated=true +2017/IteratorComplete.js spackled linguist-generated=true +2017/IteratorNext.js spackled linguist-generated=true +2017/IteratorStep.js spackled linguist-generated=true +2017/IteratorValue.js spackled linguist-generated=true +2017/MakeDate.js spackled linguist-generated=true +2017/MakeDay.js spackled linguist-generated=true +2017/MakeTime.js spackled linguist-generated=true +2017/MinFromTime.js spackled linguist-generated=true +2017/MonthFromTime.js spackled linguist-generated=true +2017/ObjectCreate.js spackled linguist-generated=true +2017/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2017/OrdinaryHasInstance.js spackled linguist-generated=true +2017/OrdinaryHasProperty.js spackled linguist-generated=true +2017/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2017/RegExpExec.js spackled linguist-generated=true +2017/RequireObjectCoercible.js spackled linguist-generated=true +2017/SameValue.js spackled linguist-generated=true +2017/SameValueNonNumber.js spackled linguist-generated=true +2017/SameValueZero.js spackled linguist-generated=true +2017/SecFromTime.js spackled linguist-generated=true +2017/Set.js spackled linguist-generated=true +2017/SetFunctionName.js spackled linguist-generated=true +2017/SetIntegrityLevel.js spackled linguist-generated=true +2017/SpeciesConstructor.js spackled linguist-generated=true +2017/StrictEqualityComparison.js spackled linguist-generated=true +2017/SymbolDescriptiveString.js spackled linguist-generated=true +2017/TestIntegrityLevel.js spackled linguist-generated=true +2017/TimeClip.js spackled linguist-generated=true +2017/TimeFromYear.js spackled linguist-generated=true +2017/TimeWithinDay.js spackled linguist-generated=true +2017/ToBoolean.js spackled linguist-generated=true +2017/ToDateString.js spackled linguist-generated=true +2017/ToInt16.js spackled linguist-generated=true +2017/ToInt32.js spackled linguist-generated=true +2017/ToInt8.js spackled linguist-generated=true +2017/ToInteger.js spackled linguist-generated=true +2017/ToLength.js spackled linguist-generated=true +2017/ToNumber.js spackled linguist-generated=true +2017/ToObject.js spackled linguist-generated=true +2017/ToPrimitive.js spackled linguist-generated=true +2017/ToPropertyDescriptor.js spackled linguist-generated=true +2017/ToPropertyKey.js spackled linguist-generated=true +2017/ToString.js spackled linguist-generated=true +2017/ToUint16.js spackled linguist-generated=true +2017/ToUint32.js spackled linguist-generated=true +2017/ToUint8.js spackled linguist-generated=true +2017/ToUint8Clamp.js spackled linguist-generated=true +2017/Type.js spackled linguist-generated=true +2017/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2017/WeekDay.js spackled linguist-generated=true +2017/YearFromTime.js spackled linguist-generated=true +2017/modulo.js spackled linguist-generated=true +2017/msFromTime.js spackled linguist-generated=true +2017/thisBooleanValue.js spackled linguist-generated=true +2017/thisNumberValue.js spackled linguist-generated=true +2017/thisStringValue.js spackled linguist-generated=true +2017/thisTimeValue.js spackled linguist-generated=true +2018/AbstractEqualityComparison.js spackled linguist-generated=true +2018/AbstractRelationalComparison.js spackled linguist-generated=true +2018/AdvanceStringIndex.js spackled linguist-generated=true +2018/ArrayCreate.js spackled linguist-generated=true +2018/ArraySetLength.js spackled linguist-generated=true +2018/ArraySpeciesCreate.js spackled linguist-generated=true +2018/Call.js spackled linguist-generated=true +2018/CanonicalNumericIndexString.js spackled linguist-generated=true +2018/CompletePropertyDescriptor.js spackled linguist-generated=true +2018/CreateDataProperty.js spackled linguist-generated=true +2018/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2018/CreateHTML.js spackled linguist-generated=true +2018/CreateIterResultObject.js spackled linguist-generated=true +2018/CreateListFromArrayLike.js spackled linguist-generated=true +2018/CreateMethodProperty.js spackled linguist-generated=true +2018/DateFromTime.js spackled linguist-generated=true +2018/Day.js spackled linguist-generated=true +2018/DayFromYear.js spackled linguist-generated=true +2018/DayWithinYear.js spackled linguist-generated=true +2018/DaysInYear.js spackled linguist-generated=true +2018/DefinePropertyOrThrow.js spackled linguist-generated=true +2018/DeletePropertyOrThrow.js spackled linguist-generated=true +2018/FromPropertyDescriptor.js spackled linguist-generated=true +2018/Get.js spackled linguist-generated=true +2018/GetIterator.js spackled linguist-generated=true +2018/GetMethod.js spackled linguist-generated=true +2018/GetOwnPropertyKeys.js spackled linguist-generated=true +2018/GetPrototypeFromConstructor.js spackled linguist-generated=true +2018/GetV.js spackled linguist-generated=true +2018/HasOwnProperty.js spackled linguist-generated=true +2018/HasProperty.js spackled linguist-generated=true +2018/HourFromTime.js spackled linguist-generated=true +2018/InLeapYear.js spackled linguist-generated=true +2018/InstanceofOperator.js spackled linguist-generated=true +2018/Invoke.js spackled linguist-generated=true +2018/IsAccessorDescriptor.js spackled linguist-generated=true +2018/IsArray.js spackled linguist-generated=true +2018/IsCallable.js spackled linguist-generated=true +2018/IsConcatSpreadable.js spackled linguist-generated=true +2018/IsConstructor.js spackled linguist-generated=true +2018/IsDataDescriptor.js spackled linguist-generated=true +2018/IsExtensible.js spackled linguist-generated=true +2018/IsGenericDescriptor.js spackled linguist-generated=true +2018/IsInteger.js spackled linguist-generated=true +2018/IsPromise.js spackled linguist-generated=true +2018/IsPropertyKey.js spackled linguist-generated=true +2018/IsRegExp.js spackled linguist-generated=true +2018/IterableToList.js spackled linguist-generated=true +2018/IteratorClose.js spackled linguist-generated=true +2018/IteratorComplete.js spackled linguist-generated=true +2018/IteratorNext.js spackled linguist-generated=true +2018/IteratorStep.js spackled linguist-generated=true +2018/IteratorValue.js spackled linguist-generated=true +2018/MakeDate.js spackled linguist-generated=true +2018/MakeDay.js spackled linguist-generated=true +2018/MakeTime.js spackled linguist-generated=true +2018/MinFromTime.js spackled linguist-generated=true +2018/MonthFromTime.js spackled linguist-generated=true +2018/ObjectCreate.js spackled linguist-generated=true +2018/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2018/OrdinaryHasInstance.js spackled linguist-generated=true +2018/OrdinaryHasProperty.js spackled linguist-generated=true +2018/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2018/RegExpExec.js spackled linguist-generated=true +2018/RequireObjectCoercible.js spackled linguist-generated=true +2018/SameValue.js spackled linguist-generated=true +2018/SameValueNonNumber.js spackled linguist-generated=true +2018/SameValueZero.js spackled linguist-generated=true +2018/SecFromTime.js spackled linguist-generated=true +2018/Set.js spackled linguist-generated=true +2018/SetFunctionName.js spackled linguist-generated=true +2018/SetIntegrityLevel.js spackled linguist-generated=true +2018/SpeciesConstructor.js spackled linguist-generated=true +2018/StrictEqualityComparison.js spackled linguist-generated=true +2018/SymbolDescriptiveString.js spackled linguist-generated=true +2018/TestIntegrityLevel.js spackled linguist-generated=true +2018/TimeClip.js spackled linguist-generated=true +2018/TimeFromYear.js spackled linguist-generated=true +2018/TimeWithinDay.js spackled linguist-generated=true +2018/ToBoolean.js spackled linguist-generated=true +2018/ToDateString.js spackled linguist-generated=true +2018/ToIndex.js spackled linguist-generated=true +2018/ToInt16.js spackled linguist-generated=true +2018/ToInt32.js spackled linguist-generated=true +2018/ToInt8.js spackled linguist-generated=true +2018/ToInteger.js spackled linguist-generated=true +2018/ToLength.js spackled linguist-generated=true +2018/ToNumber.js spackled linguist-generated=true +2018/ToObject.js spackled linguist-generated=true +2018/ToPrimitive.js spackled linguist-generated=true +2018/ToPropertyDescriptor.js spackled linguist-generated=true +2018/ToPropertyKey.js spackled linguist-generated=true +2018/ToString.js spackled linguist-generated=true +2018/ToUint16.js spackled linguist-generated=true +2018/ToUint32.js spackled linguist-generated=true +2018/ToUint8.js spackled linguist-generated=true +2018/ToUint8Clamp.js spackled linguist-generated=true +2018/Type.js spackled linguist-generated=true +2018/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2018/WeekDay.js spackled linguist-generated=true +2018/YearFromTime.js spackled linguist-generated=true +2018/modulo.js spackled linguist-generated=true +2018/msFromTime.js spackled linguist-generated=true +2018/thisBooleanValue.js spackled linguist-generated=true +2018/thisNumberValue.js spackled linguist-generated=true +2018/thisStringValue.js spackled linguist-generated=true +2018/thisTimeValue.js spackled linguist-generated=true +2019/AbstractEqualityComparison.js spackled linguist-generated=true +2019/AbstractRelationalComparison.js spackled linguist-generated=true +2019/AdvanceStringIndex.js spackled linguist-generated=true +2019/ArrayCreate.js spackled linguist-generated=true +2019/ArraySetLength.js spackled linguist-generated=true +2019/ArraySpeciesCreate.js spackled linguist-generated=true +2019/Call.js spackled linguist-generated=true +2019/CanonicalNumericIndexString.js spackled linguist-generated=true +2019/CompletePropertyDescriptor.js spackled linguist-generated=true +2019/CopyDataProperties.js spackled linguist-generated=true +2019/CreateDataProperty.js spackled linguist-generated=true +2019/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2019/CreateHTML.js spackled linguist-generated=true +2019/CreateIterResultObject.js spackled linguist-generated=true +2019/CreateListFromArrayLike.js spackled linguist-generated=true +2019/CreateMethodProperty.js spackled linguist-generated=true +2019/DateFromTime.js spackled linguist-generated=true +2019/DateString.js spackled linguist-generated=true +2019/Day.js spackled linguist-generated=true +2019/DayFromYear.js spackled linguist-generated=true +2019/DayWithinYear.js spackled linguist-generated=true +2019/DaysInYear.js spackled linguist-generated=true +2019/DefinePropertyOrThrow.js spackled linguist-generated=true +2019/DeletePropertyOrThrow.js spackled linguist-generated=true +2019/EnumerableOwnPropertyNames.js spackled linguist-generated=true +2019/FromPropertyDescriptor.js spackled linguist-generated=true +2019/Get.js spackled linguist-generated=true +2019/GetIterator.js spackled linguist-generated=true +2019/GetMethod.js spackled linguist-generated=true +2019/GetOwnPropertyKeys.js spackled linguist-generated=true +2019/GetPrototypeFromConstructor.js spackled linguist-generated=true +2019/GetSubstitution.js spackled linguist-generated=true +2019/GetV.js spackled linguist-generated=true +2019/HasOwnProperty.js spackled linguist-generated=true +2019/HasProperty.js spackled linguist-generated=true +2019/HourFromTime.js spackled linguist-generated=true +2019/InLeapYear.js spackled linguist-generated=true +2019/InstanceofOperator.js spackled linguist-generated=true +2019/Invoke.js spackled linguist-generated=true +2019/IsAccessorDescriptor.js spackled linguist-generated=true +2019/IsArray.js spackled linguist-generated=true +2019/IsCallable.js spackled linguist-generated=true +2019/IsConcatSpreadable.js spackled linguist-generated=true +2019/IsConstructor.js spackled linguist-generated=true +2019/IsDataDescriptor.js spackled linguist-generated=true +2019/IsExtensible.js spackled linguist-generated=true +2019/IsGenericDescriptor.js spackled linguist-generated=true +2019/IsInteger.js spackled linguist-generated=true +2019/IsPromise.js spackled linguist-generated=true +2019/IsPropertyKey.js spackled linguist-generated=true +2019/IsRegExp.js spackled linguist-generated=true +2019/IsStringPrefix.js spackled linguist-generated=true +2019/IterableToList.js spackled linguist-generated=true +2019/IteratorClose.js spackled linguist-generated=true +2019/IteratorComplete.js spackled linguist-generated=true +2019/IteratorNext.js spackled linguist-generated=true +2019/IteratorStep.js spackled linguist-generated=true +2019/IteratorValue.js spackled linguist-generated=true +2019/MakeDate.js spackled linguist-generated=true +2019/MakeDay.js spackled linguist-generated=true +2019/MakeTime.js spackled linguist-generated=true +2019/MinFromTime.js spackled linguist-generated=true +2019/MonthFromTime.js spackled linguist-generated=true +2019/NumberToString.js spackled linguist-generated=true +2019/ObjectCreate.js spackled linguist-generated=true +2019/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2019/OrdinaryHasInstance.js spackled linguist-generated=true +2019/OrdinaryHasProperty.js spackled linguist-generated=true +2019/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2019/PromiseResolve.js spackled linguist-generated=true +2019/RegExpExec.js spackled linguist-generated=true +2019/RequireObjectCoercible.js spackled linguist-generated=true +2019/SameValue.js spackled linguist-generated=true +2019/SameValueNonNumber.js spackled linguist-generated=true +2019/SameValueZero.js spackled linguist-generated=true +2019/SecFromTime.js spackled linguist-generated=true +2019/Set.js spackled linguist-generated=true +2019/SetFunctionName.js spackled linguist-generated=true +2019/SetIntegrityLevel.js spackled linguist-generated=true +2019/SpeciesConstructor.js spackled linguist-generated=true +2019/StrictEqualityComparison.js spackled linguist-generated=true +2019/SymbolDescriptiveString.js spackled linguist-generated=true +2019/TestIntegrityLevel.js spackled linguist-generated=true +2019/TimeClip.js spackled linguist-generated=true +2019/TimeFromYear.js spackled linguist-generated=true +2019/TimeString.js spackled linguist-generated=true +2019/TimeWithinDay.js spackled linguist-generated=true +2019/ToBoolean.js spackled linguist-generated=true +2019/ToDateString.js spackled linguist-generated=true +2019/ToIndex.js spackled linguist-generated=true +2019/ToInt16.js spackled linguist-generated=true +2019/ToInt32.js spackled linguist-generated=true +2019/ToInt8.js spackled linguist-generated=true +2019/ToInteger.js spackled linguist-generated=true +2019/ToLength.js spackled linguist-generated=true +2019/ToNumber.js spackled linguist-generated=true +2019/ToObject.js spackled linguist-generated=true +2019/ToPrimitive.js spackled linguist-generated=true +2019/ToPropertyDescriptor.js spackled linguist-generated=true +2019/ToPropertyKey.js spackled linguist-generated=true +2019/ToString.js spackled linguist-generated=true +2019/ToUint16.js spackled linguist-generated=true +2019/ToUint32.js spackled linguist-generated=true +2019/ToUint8.js spackled linguist-generated=true +2019/ToUint8Clamp.js spackled linguist-generated=true +2019/Type.js spackled linguist-generated=true +2019/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2019/WeekDay.js spackled linguist-generated=true +2019/YearFromTime.js spackled linguist-generated=true +2019/modulo.js spackled linguist-generated=true +2019/msFromTime.js spackled linguist-generated=true +2019/thisBooleanValue.js spackled linguist-generated=true +2019/thisNumberValue.js spackled linguist-generated=true +2019/thisStringValue.js spackled linguist-generated=true +2019/thisSymbolValue.js spackled linguist-generated=true \ No newline at end of file diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/FUNDING.yml b/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/FUNDING.yml new file mode 100644 index 0000000..beeb7a2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-abstract +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/codeql-analysis.yml b/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..e77ad6a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/codeql-analysis.yml @@ -0,0 +1,52 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 17 * * 4' + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/rebase.yml b/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.nycrc b/node_modules/string.prototype.trimend/node_modules/es-abstract/.nycrc new file mode 100644 index 0000000..d316b4d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.nycrc @@ -0,0 +1,14 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "operations", + "test" + ] +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/.travis.yml b/node_modules/string.prototype.trimend/node_modules/es-abstract/.travis.yml new file mode 100644 index 0000000..5c34024 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/.travis.yml @@ -0,0 +1,32 @@ +version: ~> 1.0 +language: node_js +os: + - linux +cache: + directories: + - "$HOME/.npm" + - "$(nvm cache dir)" + - "$(nvm_version_path $(nvm_version_remote 0.4))" + - "$(nvm_version_path $(nvm_version_remote 0.6))" + - "$(nvm_version_path $(nvm_version_remote 0.10))" +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml +script: + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi' +matrix: + include: + - node_js: "8" + env: COVERAGE=true + - node_js: "4" + env: COVERAGE=true + - node_js: "0.12" + env: COVERAGE=true + - node_js: "0.8" + env: COVERAGE=true + exclude: + - node_js: "0.12" + env: TEST=true + - node_js: "0.8" + env: TEST=true diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractRelationalComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AdvanceStringIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArrayCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySetLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySpeciesCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Call.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateHTML.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateIterResultObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateListFromArrayLike.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateMethodProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DateFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Day.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayWithinYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DaysInYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/EnumerableOwnNames.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/FromPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Get.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetIterator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetMethod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetSubstitution.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetV.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HourFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InLeapYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InstanceofOperator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Invoke.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsAccessorDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsArray.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsCallable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConcatSpreadable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsDataDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsExtensible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsGenericDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPromise.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsRegExp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorClose.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorComplete.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorNext.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorStep.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MinFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MonthFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ObjectCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasInstance.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RegExpExec.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RequireObjectCoercible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValueZero.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SecFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Set.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetFunctionName.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SpeciesConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/StrictEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SymbolDescriptiveString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TestIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeClip.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeWithinDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToBoolean.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToDateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8Clamp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Type.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/WeekDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/YearFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/modulo.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/msFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisBooleanValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisNumberValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisStringValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisTimeValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2015/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractRelationalComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AdvanceStringIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArrayCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySetLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySpeciesCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Call.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateHTML.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateIterResultObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateListFromArrayLike.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateMethodProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DateFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Day.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayWithinYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DaysInYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/EnumerableOwnNames.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/FromPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Get.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetIterator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetMethod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetSubstitution.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetV.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HourFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InLeapYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InstanceofOperator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Invoke.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsAccessorDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsArray.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsCallable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConcatSpreadable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsDataDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsExtensible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsGenericDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPromise.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsRegExp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IterableToArrayLike.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IterableToArrayLike.js new file mode 100644 index 0000000..885cade --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IterableToArrayLike.js @@ -0,0 +1,56 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var GetIterator = require('./GetIterator'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); +var ES = { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type +}; + +// https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike +/** + * 1. Let usingIterator be ? GetMethod(items, @@iterator). + * 2. If usingIterator is not undefined, then + * 1. Let iterator be ? GetIterator(items, usingIterator). + * 2. Let values be a new empty List. + * 3. Let next be true. + * 4. Repeat, while next is not false + * 1. Let next be ? IteratorStep(iterator). + * 2. If next is not false, then + * 1. Let nextValue be ? IteratorValue(next). + * 2. Append nextValue to the end of the List values. + * 5. Return CreateArrayFromList(values). + * 3. NOTE: items is not an Iterable so assume it is already an array-like object. + * 4. Return ! ToObject(items). + */ + +module.exports = function IterableToArrayLike(items) { + var usingIterator = getIteratorMethod(ES, items); + if (typeof usingIterator !== 'undefined') { + var iterator = GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return ToObject(items); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorClose.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorComplete.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorNext.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorStep.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MinFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MonthFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ObjectCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasInstance.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RegExpExec.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RequireObjectCoercible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueNonNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueZero.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SecFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Set.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetFunctionName.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SpeciesConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/StrictEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SymbolDescriptiveString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TestIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeClip.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeWithinDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToBoolean.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToDateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8Clamp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Type.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/WeekDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/YearFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/modulo.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/msFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisBooleanValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisNumberValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisStringValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisTimeValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2016/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractRelationalComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AdvanceStringIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArrayCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySetLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySpeciesCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Call.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateHTML.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateIterResultObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateListFromArrayLike.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateMethodProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DateFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Day.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayWithinYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DaysInYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/EnumerableOwnProperties.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/EnumerableOwnProperties.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/EnumerableOwnProperties.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/FromPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Get.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetIterator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetMethod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetSubstitution.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetV.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HourFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InLeapYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InstanceofOperator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Invoke.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsAccessorDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsArray.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsCallable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConcatSpreadable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsDataDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsExtensible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsGenericDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPromise.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsRegExp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IterableToList.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorClose.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorComplete.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorNext.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorStep.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MinFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MonthFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ObjectCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasInstance.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RegExpExec.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RequireObjectCoercible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueNonNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueZero.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SecFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Set.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetFunctionName.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SpeciesConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/StrictEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SymbolDescriptiveString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TestIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeClip.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeWithinDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToBoolean.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToDateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8Clamp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Type.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/WeekDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/YearFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/modulo.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/msFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisBooleanValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisNumberValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisStringValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisTimeValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2017/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractRelationalComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AdvanceStringIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArrayCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySetLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySpeciesCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Call.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CopyDataProperties.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateHTML.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateIterResultObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateListFromArrayLike.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateMethodProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Day.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayWithinYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DaysInYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/FromPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Get.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetIterator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetMethod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetSubstitution.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetV.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HourFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InLeapYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InstanceofOperator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Invoke.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsAccessorDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsArray.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsCallable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConcatSpreadable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsDataDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsExtensible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsGenericDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPromise.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsRegExp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsStringPrefix.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IterableToList.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorClose.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorComplete.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorNext.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorStep.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MinFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MonthFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/NumberToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ObjectCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasInstance.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/PromiseResolve.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RegExpExec.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RequireObjectCoercible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueNonNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueZero.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SecFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Set.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetFunctionName.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SpeciesConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/StrictEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SymbolDescriptiveString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TestIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeClip.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeWithinDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToBoolean.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToDateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8Clamp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Type.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/WeekDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/YearFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/modulo.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/msFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisBooleanValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisNumberValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisStringValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisSymbolValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisTimeValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2018/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractRelationalComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AddEntriesFromIterable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AddEntriesFromIterable.js new file mode 100644 index 0000000..5aed447 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AddEntriesFromIterable.js @@ -0,0 +1,52 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var Get = require('./Get'); +var GetIterator = require('./GetIterator'); +var IsCallable = require('./IsCallable'); +var IteratorClose = require('./IteratorClose'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var Type = require('./Type'); + +// https://tc39.es/ecma262/#sec-add-entries-from-iterable + +module.exports = function AddEntriesFromIterable(target, iterable, adder) { + if (!IsCallable(adder)) { + throw new $TypeError('Assertion failed: `adder` is not callable'); + } + if (iterable == null) { + throw new $TypeError('Assertion failed: `iterable` is present, and not nullish'); + } + var iteratorRecord = GetIterator(iterable); + while (true) { // eslint-disable-line no-constant-condition + var next = IteratorStep(iteratorRecord); + if (!next) { + return target; + } + var nextItem = IteratorValue(next); + if (Type(nextItem) !== 'Object') { + var error = new $TypeError('iterator next must return an Object, got ' + inspect(nextItem)); + return IteratorClose( + iteratorRecord, + function () { throw error; } // eslint-disable-line no-loop-func + ); + } + try { + var k = Get(nextItem, '0'); + var v = Get(nextItem, '1'); + Call(adder, target, [k, v]); + } catch (e) { + return IteratorClose( + iteratorRecord, + function () { throw e; } + ); + } + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AdvanceStringIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArrayCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySetLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySpeciesCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Call.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CopyDataProperties.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateHTML.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateIterResultObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateListFromArrayLike.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateMethodProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Day.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayWithinYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DaysInYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FlattenIntoArray.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FlattenIntoArray.js new file mode 100644 index 0000000..313a6ed --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FlattenIntoArray.js @@ -0,0 +1,58 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray + +// eslint-disable-next-line max-params, max-statements +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = ToLength(Get(element, 'length')); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FromPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Get.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetIterator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetMethod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetSubstitution.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetV.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HourFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InLeapYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InstanceofOperator.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Invoke.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsAccessorDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsArray.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsCallable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConcatSpreadable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsDataDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsExtensible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsGenericDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPromise.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsRegExp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsStringPrefix.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IterableToList.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorClose.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorComplete.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorNext.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorStep.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MinFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MonthFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/NumberToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ObjectCreate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasInstance.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/PromiseResolve.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RegExpExec.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RequireObjectCoercible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueNonNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueZero.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SecFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Set.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetFunctionName.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SpeciesConstructor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/StrictEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SymbolDescriptiveString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TestIntegrityLevel.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeClip.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeWithinDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToBoolean.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToDateString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToIndex.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToLength.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyKey.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8Clamp.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TrimString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TrimString.js new file mode 100644 index 0000000..b27112c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/TrimString.js @@ -0,0 +1,29 @@ +'use strict'; + +var trimStart = require('string.prototype.trimstart'); +var trimEnd = require('string.prototype.trimend'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-trimstring + +module.exports = function TrimString(string, where) { + var str = RequireObjectCoercible(string); + var S = ToString(str); + var T; + if (where === 'start') { + T = trimStart(S); + } else if (where === 'end') { + T = trimEnd(S); + } else if (where === 'start+end') { + T = trimStart(trimEnd(S)); + } else { + throw new $TypeError('Assertion failed: invalid `where` value; must be "start", "end", or "start+end"'); + } + return T; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Type.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/WeekDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/YearFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/modulo.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/msFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisBooleanValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisNumberValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisStringValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisSymbolValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisTimeValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisTimeValue.js new file mode 100644 index 0000000..a9a47ac --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/2019/thisTimeValue.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../2018/thisTimeValue'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractEqualityComparison.js new file mode 100644 index 0000000..e55c764 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractRelationalComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/CheckObjectCoercible.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/CheckObjectCoercible.js new file mode 100644 index 0000000..f02b289 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/CheckObjectCoercible.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 + +module.exports = function CheckObjectCoercible(value, optMessage) { + if (value == null) { + throw new $TypeError(optMessage || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DateFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/Day.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayWithinYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DaysInYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/FromPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/FromPropertyDescriptor.js new file mode 100644 index 0000000..a3cefbe --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/FromPropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/HourFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/InLeapYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsAccessorDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsAccessorDescriptor.js new file mode 100644 index 0000000..561382a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsCallable.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsDataDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsDataDescriptor.js new file mode 100644 index 0000000..783e2dc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsGenericDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsGenericDescriptor.js new file mode 100644 index 0000000..93340e9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDate.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MinFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MonthFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/SameValue.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/SecFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/StrictEqualityComparison.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeClip.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeFromYear.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeWithinDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToBoolean.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInt32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInteger.js new file mode 100644 index 0000000..a95265b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToInteger.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4 + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return $sign(number) * $floor($abs(number)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToNumber.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToNumber.js new file mode 100644 index 0000000..4a7a3b8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToNumber.js @@ -0,0 +1,7 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 + +module.exports = function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToObject.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToObject.js new file mode 100644 index 0000000..1d27a13 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var CheckObjectCoercible = require('./CheckObjectCoercible'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.9 + +module.exports = function ToObject(value) { + CheckObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPrimitive.js new file mode 100644 index 0000000..071df70 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.1 + +module.exports = require('es-to-primitive/es5'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToString.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToString.js new file mode 100644 index 0000000..80ece42 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToString.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.8 + +module.exports = function ToString(value) { + return $String(value); +}; + diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint16.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint32.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/Type.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/Type.js new file mode 100644 index 0000000..9cc750c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/Type.js @@ -0,0 +1,24 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/5.1/#sec-8 + +module.exports = function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/WeekDay.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/YearFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/modulo.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/5/msFromTime.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/5/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/CHANGELOG.md b/node_modules/string.prototype.trimend/node_modules/es-abstract/CHANGELOG.md new file mode 100644 index 0000000..584b7cd --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/CHANGELOG.md @@ -0,0 +1,395 @@ +1.18.0-next.1 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [eslint] fix warning + * [Tests] temporarily allow SES tests to fail (#115) + * [Tests] ses-compat - initialize module after ses lockdown (#113) + * [Tests] [Refactor] use defineProperty helper rather than assignment + * [Tests] [Refactor] clean up defineProperty test helper + +1.18.0-next.0 / 2020-08-14 +================= + * [New] add `ES2020` + * [New] `GetIntrinsic`: add `%AggregateError%`, `%FinalizationRegistry%`, and `%WeakRef%` + * [New] `ES5`+: add `abs`, `floor`; use `modulo` consistently + * [New] `GetIntrinsic`: Cache accessed intrinsics (#98) + * [New] `GetIntrinsic`: Add ES201x function intrinsics (#97) + * [New] `ES2015`+: add `QuoteJSONString`, `OrdinaryCreateFromConstructor` + * [New] `ES2017`+: add `StringGetOwnProperty` + * [New] `ES2016`+: add `UTF16Encoding` + * [New] `ES2018`+: add `SetFunctionLength`, `UnicodeEscape` + * [New] add `isLeadingSurrogate`/`isTrailingSurrogate` helpers + * [Fix] `ES5`+: `ToPropertyDescriptor`: use intrinsic TypeError + * [Fix] `ES2018+`: `CopyDataProperties`/`NumberToString`: use intrinsic TypeError + * [Deps] update `is-regex`, `object-inspect` + * [Dev Deps] update `eslint` + +1.17.7 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `is-regex`, `object-inspect`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + +1.17.6 / 2020-06-13 +================= + * [Fix] `helpers/getSymbolDescription`: use the global Symbol registry when available (#92) + * [Fix] `ES2015+`: `IsConstructor`: when `Reflect.construct` is available, be spec-accurate (#93) + * [Fix] `ES2015+`: `Set`: Always return boolean value (#101) + * [Fix] `ES2015+`: `Set`: ensure exceptions are thrown in IE 9 when requested + * [Fix] Use `Reflect.apply(…)` if available (#99) + * [Fix] `helpers/floor`: module-cache `Math.floor` + * [Fix] `helpers/getSymbolDescription`: Prefer bound `description` getter when present + * [Fix] `2016`: Use `getIteratorMethod` in `IterableToArrayLike` (#94) + * [Fix] `helpers/OwnPropertyKeys`: Use `Reflect.ownKeys(…)` if available (#91) + * [Fix] `2018+`: Fix `CopyDataProperties` depending on `this` (#95) + * [meta] mark spackled files as autogenerated + * [meta] `Type`: fix spec URL + * [meta] `ES2015`: complete ops list + * [Deps] update `is‑callable`, `is‑regex` + * [Deps] switch from `string.prototype.trimleft`/`string.prototype.trimright` to `string.prototype.trimstart`/`string.prototype.trimend` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `in-publish`, `object-is`, `tape`; add `aud` + * [eslint] `helpers/isPropertyDescriptor`: fix indentation + * [Tests] `helpers/getSymbolDescription`: add test cases; some envs have `Symbol.for` but can not infer a name (#92) + * [Tests] try out CodeQL analysis + * [Tests] reformat expected missing ops + * [Tests] Run tests with `undefined` this (#96) + +1.17.5 / 2020-03-22 +================= + * [Fix] `CreateDataProperty`: update an existing property + * [Fix] run missing spackle from cd7504701879ddea0f5981e99cbcf93bfea9171d + * [Dev Deps] update `make-arrow-function`, `tape`, `@ljharb/eslint-config` + +1.17.4 / 2020-01-21 +================= + * [Fix] `2015+`: add code to handle IE 8’s problems + * [Tests] fix tests for IE 8 + +1.17.3 / 2020-01-19 +================= + * [Fix] `ObjectCreate` `2015+`: Fall back to `__proto__` and normal `new` in older browsers + * [Fix] `GetIntrinsic`: ensure the `allowMissing` property actually works on dotted intrinsics + +1.17.2 / 2020-01-14 +================= + * [Fix] `helpers/OwnPropertyKeys`: include non-enumerables too + +1.17.1 / 2020-01-14 +================= + * [Refactor] add `OwnPropertyKeys` helper, use it in `CopyDataProperties` + * [Refactor] `IteratorClose`: remove useless assignment + * [Dev Deps] update `eslint`, `tape`, `diff` + +1.17.0 / 2019-12-20 +================= + * [New] Split up each operation into its own file (prereleased) + * [Fix] `GetIntrinsic`: IE 8 has a broken `Object.getOwnPropertyDescriptor` + * [Fix] `object.assign` is a runtime dep (prereleased) + * [Refactor] `GetIntrinsic`: remove the internal property salts, since % already handles that + * [Refactor] `GetIntrinsic`: further simplification + * [Deps] update `is-callable`, `string.prototype.trimleft`, `string.prototype.trimright`, `is-regex` + * [Dev Deps] update `@ljharb/eslint-config`, `object-is`, `object.fromentries`, `tape` + * [Tests] add `.eslintignore` + * [meta] remove unused Makefile and associated utils + * [meta] only run spackle script in publish (#78) (prereleased) + +1.17.0-next.1 / 2019-12-11 +================= + * [Fix] `object.assign` is a runtime dep + * [meta] only run spackle script in publish (#78) + +1.17.0-next.0 / 2019-12-11 +================= + * [New] Split up each operation into its own file + +1.16.3 / 2019-12-04 +================= + * [Fix] `GetIntrinsic`: when given a path to a getter, return the actual getter + * [Dev Deps] update `eslint` + +1.16.2 / 2019-11-24 +================= + * [Fix] IE 6-7 lack JSON + * [Fix] IE 6-8 strings can’t use array slice, they need string slice + * [Dev Deps] update `eslint` + +1.16.1 / 2019-11-24 +================= + * [Fix] `GetIntrinsics`: turns out IE 8 throws when `Object.getOwnPropertyDescriptor(arguments);`, and does not throw on `callee` anyways + * [Deps] update `es-to-primitive`, `has-symbols`, `object-inspect` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + * [meta] re-include year files inside `operations` + * [meta] add `funding` field + * [actions] add Automatic Rebase github action + * [Tests] use shared travis-ci config + * [Tests] disable `check-coverage`, and let codecov do it + +1.16.0 / 2019-10-18 +================= + * [New] `ES2015+`: add `SetFunctionName` + * [New] `ES2015+`: add `GetPrototypeFromConstructor`, with caveats + * [New] `ES2015+`: add `CreateListFromArrayLike` + * [New] `ES2016+`: add `OrdinarySetPrototypeOf` + * [New] `ES2016+`: add `OrdinaryGetPrototypeOf` + * [New] add `getSymbolDescription` and `getInferredName` helpers + * [Fix] `GetIterator`: add fallback for pre-Symbol environments, tests + * [Dev Deps] update `object.fromentries` + * [Tests] add `node` `v12.2` + +1.15.0 / 2019-10-02 +================= + * [New] `ES2018`+: add `DateString`, `TimeString` + * [New] `ES2015`+: add `ToDateString` + * [New] `ES5`+: add `msFromTime`, `SecFromTime`, `MinFromTime`, `HourFromTime`, `TimeWithinDay`, `Day`, `DayFromYear`, `TimeFromYear`, `YearFromTime`, `WeekDay`, `DaysInYear`, `InLeapYear`, `DayWithinYear`, `MonthFromTime`, `DateFromTime`, `MakeDay`, `MakeDate`, `MakeTime`, `TimeClip`, `modulo` + * [New] add `regexTester` helper + * [New] add `callBound` helper + * [New] add ES2020’s intrinsic dot notation + * [New] add `isPrefixOf` helper + * [New] add `maxSafeInteger` helper + * [Deps] update `string.prototype.trimleft`, `string.prototype.trimright` + * [Dev Deps] update `eslint` + * [Tests] on `node` `v12.11` + * [meta] npmignore operations scripts; add "deltas" + +1.14.2 / 2019-09-08 +================= + * [Fix] `ES2016`: `IterableToArrayLike`: add proper fallback for strings, pre-Symbols + * [Tests] on `node` `v12.10` + +1.14.1 / 2019-09-03 +================= + * [meta] republish with some extra files removed + +1.14.0 / 2019-09-02 +================= + * [New] add ES2019 + * [New] `ES2017+`: add `IterableToList` + * [New] `ES2016`: add `IterableToArrayLike` + * [New] `ES2015+`: add `ArrayCreate`, `ArraySetLength`, `OrdinaryDefineOwnProperty`, `OrdinaryGetOwnProperty`, `OrdinaryHasProperty`, `CreateHTML`, `GetOwnPropertyKeys`, `InstanceofOperator`, `SymbolDescriptiveString`, `GetSubstitution`, `ValidateAndApplyPropertyDescriptor`, `IsPromise`, `OrdinaryHasInstance`, `TestIntegrityLevel`, `SetIntegrityLevel` + * [New] add `callBind` helper, and use it + * [New] add helpers: `isPropertyDescriptor`, `every` + * [New] ES5+: add `Abstract Relational Comparison` + * [New] ES5+: add `Abstract Equality Comparison`, `Strict Equality Comparison` + * [Fix] `ES2015+`: `GetIterator`: only require native Symbols when `method` is omitted + * [Fix] `ES2015`: `Call`: error message now properly displays Symbols using `object-inspect` + * [Fix] `ES2015+`: `ValidateAndApplyPropertyDescriptor`: use ES2017 logic to bypass spec bugs + * [Fix] `ES2015+`: `CreateDataProperty`, `DefinePropertyOrThrow`, `ValidateAndApplyPropertyDescriptor`: add fallbacks for ES3 + * [Fix] `ES2015+`: `FromPropertyDescriptor`: no longer requires a fully complete Property Descriptor + * [Fix] `ES5`: `IsPropertyDescriptor`: call into `IsDataDescriptor` and `IsAccessorDescriptor` + * [Refactor] use `has-symbols` for Symbol detection + * [Fix] `helpers/assertRecord`: remove `console.log` + * [Deps] update `object-keys` + * [readme] add security note + * [meta] change http URLs to https + * [meta] linter cleanup + * [meta] fix getOps script + * [meta] add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `replace`, `cheerio`, `tape` + * [Tests] up to `node` `v12.9`, `v11.15`, `v10.16`, `v8.16`, `v6.17` + * [Tests] temporarily allow node 0.6 to fail; segfaulting in travis + * [Tests] use the values helper more in es5 tests + * [Tests] fix linting to apply to all files + * [Tests] run `npx aud` only on prod deps + * [Tests] add v.descriptors helpers + * [Tests] use `npx aud` instead of `npm audit` with hoops + * [Tests] use `eclint` instead of `editorconfig-tools` + * [Tests] some intrinsic cleanup + * [Tests] migrate es5 tests to use values helper + * [Tests] add some missing ES2015 ops + +1.13.0 / 2019-01-02 +================= + * [New] add ES2018 + * [New] add ES2015/ES2016: EnumerableOwnNames; ES2017: EnumerableOwnProperties + * [New] `ES2015+`: add `thisBooleanValue`, `thisNumberValue`, `thisStringValue`, `thisTimeValue` + * [New] `ES2015+`: add `DefinePropertyOrThrow`, `DeletePropertyOrThrow`, `CreateMethodProperty` + * [New] add `assertRecord` helper + * [Deps] update `is-callable`, `has`, `object-keys`, `es-to-primitive` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `semver`, `safe-publish-latest`, `replace` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + * [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` + * [Tests] move descriptor factories to `values` helper + * [Tests] add `getOps` to programmatically fetch abstract operation names + +1.12.0 / 2018-05-31 +================= + * [New] add `GetIntrinsic` entry point + * [New] `ES2015`+: add `ObjectCreate` + * [Robustness]: `ES2015+`: ensure `Math.{abs,floor}` and `Function.call` are cached + +1.11.0 / 2018-03-21 +================= + * [New] `ES2015+`: add iterator abstract ops + * [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape` + * [Tests] up to `node` `v9.8`, `v8.10`, `v6.13` + +1.10.0 / 2017-11-24 +================= + * [New] ES2015+: `AdvanceStringIndex` + * [Dev Deps] update `eslint`, `nsp` + * [Tests] require node 0.6 to pass again + * [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS + +1.9.0 / 2017-09-30 +================= + * [New] `es2015+`: add `ArraySpeciesCreate` + * [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow` + * [Tests] consolidate duplicated tests + * [Tests] increase coverage + * [Dev Deps] update `nsp`, `eslint` + +1.8.2 / 2017-09-03 +================= + * [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27) + * [Dev Deps] update `eslint` + +1.8.1 / 2017-08-30 +================= + * [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26) + * [Deps] update `function-bind` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [Docs] github broke markdown parsing + +1.8.0 / 2017-08-04 +================= + * [New] add ES2017 + * [New] move es6+ to es2015+; leave es6/es7 as aliases + * [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor` + * [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec` + * [Fix] es7/es2016: do not mutate ES6 + * [Fix] assign helper only supports one source + * [Deps] update `is-regex` + * [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` + * [Tests] add tests for missing and excess operations + * [Tests] add codecov for coverage + * [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node + * [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same + * [Tests] ES2015: add ToNumber symbol tests + * [Tests] switch to `nyc` for code coverage + * [Tests] make IsRegExp tests consistent across editions + +1.7.0 / 2017-01-22 +================= + * [New] ES6: Add `GetMethod` (#16) + * [New] ES6: Add `GetV` (#16) + * [New] ES6: Add `Get` (#17) + * [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix + * [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + +1.6.1 / 2016-08-21 +================= + * [Fix] ES6: IsConstructor should return true for `class` constructors. + +1.6.0 / 2016-08-20 +================= + * [New] ES5 / ES6: add `Type` + * [New] ES6: `SpeciesConstructor` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest` + * [Tests] up to `node` `v6.4`, `v5.12`, `v4.5` + +1.5.1 / 2016-05-30 +================= + * [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument + * [Refactor] create `isNaN` helper + * [Deps] update `is-callable`, `function-bind` + * [Deps] update `es-to-primitive`, fix ES5 tests + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp` + * [Tests] up to `node` `v6.2`, `v5.11`, `v4.4` + * [Tests] use pretest/posttest for linting/security + +1.5.0 / 2015-12-27 +================= + * [New] adds `Symbol.toPrimitive` support via `es-to-primitive` + * [Deps] update `is-callable`, `es-to-primitive` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape` + * [Tests] up to `node` `v5.3` + +1.4.3 / 2015-11-04 +================= + * [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4) + * [Refactor] `ES6.ToNumber`: No need to double-trim + * [Refactor] group tests better + * [Tests] should still pass on `node` `v0.8` + +1.4.2 / 2015-11-02 +================= + * [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3) + +1.4.1 / 2015-10-31 +================= + * [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2) + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v5.0` + * [Tests] fix npm upgrades for older node versions + * package.json: use object form of "authors", add "contributors" + +1.4.0 / 2015-09-26 +================= + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v4.2` + * [New] Add `SameValueNonNumber` to ES7 + +1.3.2 / 2015-09-26 +================= + * [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` + +1.3.1 / 2015-08-15 +================= + * [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly + +1.3.0 / 2015-08-15 +================= + * [New] ES6’s ToNumber now supports binary and octal literals. + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] up to `io.js` `v3.0` + +1.2.2 / 2015-07-28 +================= + * [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw. + * [Tests] Test on latest `io.js` versions. + * [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp` + +1.2.1 / 2015-03-20 +================= + * Fix `isFinite` helper. + +1.2.0 / 2015-03-19 +================= + * Use `es-to-primitive` for ToPrimitive methods. + * Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions. + +1.1.2 / 2015-03-20 +================= + * Fix isFinite helper. + +1.1.1 / 2015-03-19 +================= + * Fix isPrimitive check for functions + * Update `eslint`, `editorconfig-tools`, `semver`, `nsp` + +1.1.0 / 2015-02-17 +================= + * Add ES7 export (non-default). + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Test on `iojs-v1.2`. + +1.0.1 / 2015-01-30 +================= + * Use `is-callable` instead of an internal function. + * Update `tape`, `jscs`, `nsp`, `eslint` + +1.0.0 / 2015-01-10 +================= + * v1.0.0 diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/GetIntrinsic.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/GetIntrinsic.js new file mode 100644 index 0000000..5d38e1f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/GetIntrinsic.js @@ -0,0 +1,225 @@ +'use strict'; + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; + +var $TypeError = TypeError; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayPrototype%': Array.prototype, + '%ArrayProto_entries%': Array.prototype.entries, + '%ArrayProto_forEach%': Array.prototype.forEach, + '%ArrayProto_keys%': Array.prototype.keys, + '%ArrayProto_values%': Array.prototype.values, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': asyncFunction, + '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%Boolean%': Boolean, + '%BooleanPrototype%': Boolean.prototype, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '%Date%': Date, + '%DatePrototype%': Date.prototype, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%ErrorPrototype%': Error.prototype, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%EvalErrorPrototype%': EvalError.prototype, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '%Function%': Function, + '%FunctionPrototype%': Function.prototype, + '%Generator%': generator ? getProto(generator()) : undefined, + '%GeneratorFunction%': generatorFunction, + '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '%Math%': Math, + '%Number%': Number, + '%NumberPrototype%': Number.prototype, + '%Object%': Object, + '%ObjectPrototype%': Object.prototype, + '%ObjProto_toString%': Object.prototype.toString, + '%ObjProto_valueOf%': Object.prototype.valueOf, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%RangeErrorPrototype%': RangeError.prototype, + '%ReferenceError%': ReferenceError, + '%ReferenceErrorPrototype%': ReferenceError.prototype, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%RegExpPrototype%': RegExp.prototype, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringPrototype%': String.prototype, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '%SyntaxError%': SyntaxError, + '%SyntaxErrorPrototype%': SyntaxError.prototype, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '%TypeError%': $TypeError, + '%TypeErrorPrototype%': $TypeError.prototype, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '%URIError%': URIError, + '%URIErrorPrototype%': URIError.prototype, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +var bind = require('function-bind'); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + if (!(name in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[name]; +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, parts[i]); + if (!allowMissing && !(parts[i] in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]]; + } else { + value = value[parts[i]]; + } + } + } + return value; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/LICENSE b/node_modules/string.prototype.trimend/node_modules/es-abstract/LICENSE new file mode 100644 index 0000000..8c271c1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/README.md b/node_modules/string.prototype.trimend/node_modules/es-abstract/README.md new file mode 100644 index 0000000..20342d1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/README.md @@ -0,0 +1,48 @@ +# es-abstract [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +ECMAScript spec abstract operations. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +All abstract operations will also be available under an `es5`/`es2015`/`es2016`/`es2017`/`es2018`/`es2019` entry point, and exported property, if you require a specific version. + +## Example + +```js +var ES = require('es-abstract'); +var assert = require('assert'); + +assert(ES.isCallable(function () {})); +assert(!ES.isCallable(/a/g)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-abstract +[npm-version-svg]: http://versionbadg.es/ljharb/es-abstract.svg +[travis-svg]: https://travis-ci.org/ljharb/es-abstract.svg +[travis-url]: https://travis-ci.org/ljharb/es-abstract +[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg +[deps-url]: https://david-dm.org/ljharb/es-abstract +[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/es-abstract.png +[testling-url]: https://ci.testling.com/ljharb/es-abstract +[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-abstract.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-abstract.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-abstract diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es2015.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2015.js new file mode 100644 index 0000000..dc02ca4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2015.js @@ -0,0 +1,115 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-operations +var ES6 = { + 'Abstract Equality Comparison': require('./2015/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2015/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2015/StrictEqualityComparison'), + AdvanceStringIndex: require('./2015/AdvanceStringIndex'), + ArrayCreate: require('./2015/ArrayCreate'), + ArraySetLength: require('./2015/ArraySetLength'), + ArraySpeciesCreate: require('./2015/ArraySpeciesCreate'), + Call: require('./2015/Call'), + CanonicalNumericIndexString: require('./2015/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2015/CompletePropertyDescriptor'), + CreateDataProperty: require('./2015/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2015/CreateDataPropertyOrThrow'), + CreateHTML: require('./2015/CreateHTML'), + CreateIterResultObject: require('./2015/CreateIterResultObject'), + CreateListFromArrayLike: require('./2015/CreateListFromArrayLike'), + CreateMethodProperty: require('./2015/CreateMethodProperty'), + DateFromTime: require('./2015/DateFromTime'), + Day: require('./2015/Day'), + DayFromYear: require('./2015/DayFromYear'), + DaysInYear: require('./2015/DaysInYear'), + DayWithinYear: require('./2015/DayWithinYear'), + DefinePropertyOrThrow: require('./2015/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2015/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2015/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2015/FromPropertyDescriptor'), + Get: require('./2015/Get'), + GetIterator: require('./2015/GetIterator'), + GetMethod: require('./2015/GetMethod'), + GetOwnPropertyKeys: require('./2015/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2015/GetPrototypeFromConstructor'), + GetSubstitution: require('./2015/GetSubstitution'), + GetV: require('./2015/GetV'), + HasOwnProperty: require('./2015/HasOwnProperty'), + HasProperty: require('./2015/HasProperty'), + HourFromTime: require('./2015/HourFromTime'), + InLeapYear: require('./2015/InLeapYear'), + InstanceofOperator: require('./2015/InstanceofOperator'), + Invoke: require('./2015/Invoke'), + IsAccessorDescriptor: require('./2015/IsAccessorDescriptor'), + IsArray: require('./2015/IsArray'), + IsCallable: require('./2015/IsCallable'), + IsConcatSpreadable: require('./2015/IsConcatSpreadable'), + IsConstructor: require('./2015/IsConstructor'), + IsDataDescriptor: require('./2015/IsDataDescriptor'), + IsExtensible: require('./2015/IsExtensible'), + IsGenericDescriptor: require('./2015/IsGenericDescriptor'), + IsInteger: require('./2015/IsInteger'), + IsPromise: require('./2015/IsPromise'), + IsPropertyDescriptor: require('./2015/IsPropertyDescriptor'), + IsPropertyKey: require('./2015/IsPropertyKey'), + IsRegExp: require('./2015/IsRegExp'), + IteratorClose: require('./2015/IteratorClose'), + IteratorComplete: require('./2015/IteratorComplete'), + IteratorNext: require('./2015/IteratorNext'), + IteratorStep: require('./2015/IteratorStep'), + IteratorValue: require('./2015/IteratorValue'), + MakeDate: require('./2015/MakeDate'), + MakeDay: require('./2015/MakeDay'), + MakeTime: require('./2015/MakeTime'), + MinFromTime: require('./2015/MinFromTime'), + modulo: require('./2015/modulo'), + MonthFromTime: require('./2015/MonthFromTime'), + msFromTime: require('./2015/msFromTime'), + ObjectCreate: require('./2015/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2015/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2015/OrdinaryGetOwnProperty'), + OrdinaryHasInstance: require('./2015/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2015/OrdinaryHasProperty'), + RegExpExec: require('./2015/RegExpExec'), + RequireObjectCoercible: require('./2015/RequireObjectCoercible'), + SameValue: require('./2015/SameValue'), + SameValueZero: require('./2015/SameValueZero'), + SecFromTime: require('./2015/SecFromTime'), + Set: require('./2015/Set'), + SetFunctionName: require('./2015/SetFunctionName'), + SetIntegrityLevel: require('./2015/SetIntegrityLevel'), + SpeciesConstructor: require('./2015/SpeciesConstructor'), + SymbolDescriptiveString: require('./2015/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2015/TestIntegrityLevel'), + thisBooleanValue: require('./2015/thisBooleanValue'), + thisNumberValue: require('./2015/thisNumberValue'), + thisStringValue: require('./2015/thisStringValue'), + thisTimeValue: require('./2015/thisTimeValue'), + TimeClip: require('./2015/TimeClip'), + TimeFromYear: require('./2015/TimeFromYear'), + TimeWithinDay: require('./2015/TimeWithinDay'), + ToBoolean: require('./2015/ToBoolean'), + ToDateString: require('./2015/ToDateString'), + ToInt16: require('./2015/ToInt16'), + ToInt32: require('./2015/ToInt32'), + ToInt8: require('./2015/ToInt8'), + ToInteger: require('./2015/ToInteger'), + ToLength: require('./2015/ToLength'), + ToNumber: require('./2015/ToNumber'), + ToObject: require('./2015/ToObject'), + ToPrimitive: require('./2015/ToPrimitive'), + ToPropertyDescriptor: require('./2015/ToPropertyDescriptor'), + ToPropertyKey: require('./2015/ToPropertyKey'), + ToString: require('./2015/ToString'), + ToUint16: require('./2015/ToUint16'), + ToUint32: require('./2015/ToUint32'), + ToUint8: require('./2015/ToUint8'), + ToUint8Clamp: require('./2015/ToUint8Clamp'), + Type: require('./2015/Type'), + ValidateAndApplyPropertyDescriptor: require('./2015/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2015/WeekDay'), + YearFromTime: require('./2015/YearFromTime') +}; + +module.exports = ES6; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es2016.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2016.js new file mode 100644 index 0000000..9e72e82 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2016.js @@ -0,0 +1,119 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/7.0/#sec-abstract-operations +var ES2016 = { + 'Abstract Equality Comparison': require('./2016/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2016/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2016/StrictEqualityComparison'), + AdvanceStringIndex: require('./2016/AdvanceStringIndex'), + ArrayCreate: require('./2016/ArrayCreate'), + ArraySetLength: require('./2016/ArraySetLength'), + ArraySpeciesCreate: require('./2016/ArraySpeciesCreate'), + Call: require('./2016/Call'), + CanonicalNumericIndexString: require('./2016/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2016/CompletePropertyDescriptor'), + CreateDataProperty: require('./2016/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2016/CreateDataPropertyOrThrow'), + CreateHTML: require('./2016/CreateHTML'), + CreateIterResultObject: require('./2016/CreateIterResultObject'), + CreateListFromArrayLike: require('./2016/CreateListFromArrayLike'), + CreateMethodProperty: require('./2016/CreateMethodProperty'), + DateFromTime: require('./2016/DateFromTime'), + Day: require('./2016/Day'), + DayFromYear: require('./2016/DayFromYear'), + DaysInYear: require('./2016/DaysInYear'), + DayWithinYear: require('./2016/DayWithinYear'), + DefinePropertyOrThrow: require('./2016/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2016/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2016/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2016/FromPropertyDescriptor'), + Get: require('./2016/Get'), + GetIterator: require('./2016/GetIterator'), + GetMethod: require('./2016/GetMethod'), + GetOwnPropertyKeys: require('./2016/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2016/GetPrototypeFromConstructor'), + GetSubstitution: require('./2016/GetSubstitution'), + GetV: require('./2016/GetV'), + HasOwnProperty: require('./2016/HasOwnProperty'), + HasProperty: require('./2016/HasProperty'), + HourFromTime: require('./2016/HourFromTime'), + InLeapYear: require('./2016/InLeapYear'), + InstanceofOperator: require('./2016/InstanceofOperator'), + Invoke: require('./2016/Invoke'), + IsAccessorDescriptor: require('./2016/IsAccessorDescriptor'), + IsArray: require('./2016/IsArray'), + IsCallable: require('./2016/IsCallable'), + IsConcatSpreadable: require('./2016/IsConcatSpreadable'), + IsConstructor: require('./2016/IsConstructor'), + IsDataDescriptor: require('./2016/IsDataDescriptor'), + IsExtensible: require('./2016/IsExtensible'), + IsGenericDescriptor: require('./2016/IsGenericDescriptor'), + IsInteger: require('./2016/IsInteger'), + IsPromise: require('./2016/IsPromise'), + IsPropertyDescriptor: require('./2016/IsPropertyDescriptor'), + IsPropertyKey: require('./2016/IsPropertyKey'), + IsRegExp: require('./2016/IsRegExp'), + IterableToArrayLike: require('./2016/IterableToArrayLike'), + IteratorClose: require('./2016/IteratorClose'), + IteratorComplete: require('./2016/IteratorComplete'), + IteratorNext: require('./2016/IteratorNext'), + IteratorStep: require('./2016/IteratorStep'), + IteratorValue: require('./2016/IteratorValue'), + MakeDate: require('./2016/MakeDate'), + MakeDay: require('./2016/MakeDay'), + MakeTime: require('./2016/MakeTime'), + MinFromTime: require('./2016/MinFromTime'), + modulo: require('./2016/modulo'), + MonthFromTime: require('./2016/MonthFromTime'), + msFromTime: require('./2016/msFromTime'), + ObjectCreate: require('./2016/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2016/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2016/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2016/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2016/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2016/OrdinaryHasProperty'), + RegExpExec: require('./2016/RegExpExec'), + RequireObjectCoercible: require('./2016/RequireObjectCoercible'), + SameValue: require('./2016/SameValue'), + SameValueNonNumber: require('./2016/SameValueNonNumber'), + SameValueZero: require('./2016/SameValueZero'), + SecFromTime: require('./2016/SecFromTime'), + Set: require('./2016/Set'), + SetFunctionName: require('./2016/SetFunctionName'), + SetIntegrityLevel: require('./2016/SetIntegrityLevel'), + SpeciesConstructor: require('./2016/SpeciesConstructor'), + SymbolDescriptiveString: require('./2016/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2016/TestIntegrityLevel'), + thisBooleanValue: require('./2016/thisBooleanValue'), + thisNumberValue: require('./2016/thisNumberValue'), + thisStringValue: require('./2016/thisStringValue'), + thisTimeValue: require('./2016/thisTimeValue'), + TimeClip: require('./2016/TimeClip'), + TimeFromYear: require('./2016/TimeFromYear'), + TimeWithinDay: require('./2016/TimeWithinDay'), + ToBoolean: require('./2016/ToBoolean'), + ToDateString: require('./2016/ToDateString'), + ToInt16: require('./2016/ToInt16'), + ToInt32: require('./2016/ToInt32'), + ToInt8: require('./2016/ToInt8'), + ToInteger: require('./2016/ToInteger'), + ToLength: require('./2016/ToLength'), + ToNumber: require('./2016/ToNumber'), + ToObject: require('./2016/ToObject'), + ToPrimitive: require('./2016/ToPrimitive'), + ToPropertyDescriptor: require('./2016/ToPropertyDescriptor'), + ToPropertyKey: require('./2016/ToPropertyKey'), + ToString: require('./2016/ToString'), + ToUint16: require('./2016/ToUint16'), + ToUint32: require('./2016/ToUint32'), + ToUint8: require('./2016/ToUint8'), + ToUint8Clamp: require('./2016/ToUint8Clamp'), + Type: require('./2016/Type'), + ValidateAndApplyPropertyDescriptor: require('./2016/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2016/WeekDay'), + YearFromTime: require('./2016/YearFromTime') +}; + +module.exports = ES2016; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es2017.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2017.js new file mode 100644 index 0000000..5f317b7 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2017.js @@ -0,0 +1,120 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/8.0/#sec-abstract-operations +var ES2017 = { + 'Abstract Equality Comparison': require('./2017/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2017/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2017/StrictEqualityComparison'), + AdvanceStringIndex: require('./2017/AdvanceStringIndex'), + ArrayCreate: require('./2017/ArrayCreate'), + ArraySetLength: require('./2017/ArraySetLength'), + ArraySpeciesCreate: require('./2017/ArraySpeciesCreate'), + Call: require('./2017/Call'), + CanonicalNumericIndexString: require('./2017/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2017/CompletePropertyDescriptor'), + CreateDataProperty: require('./2017/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2017/CreateDataPropertyOrThrow'), + CreateHTML: require('./2017/CreateHTML'), + CreateIterResultObject: require('./2017/CreateIterResultObject'), + CreateListFromArrayLike: require('./2017/CreateListFromArrayLike'), + CreateMethodProperty: require('./2017/CreateMethodProperty'), + DateFromTime: require('./2017/DateFromTime'), + Day: require('./2017/Day'), + DayFromYear: require('./2017/DayFromYear'), + DaysInYear: require('./2017/DaysInYear'), + DayWithinYear: require('./2017/DayWithinYear'), + DefinePropertyOrThrow: require('./2017/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2017/DeletePropertyOrThrow'), + EnumerableOwnProperties: require('./2017/EnumerableOwnProperties'), + FromPropertyDescriptor: require('./2017/FromPropertyDescriptor'), + Get: require('./2017/Get'), + GetIterator: require('./2017/GetIterator'), + GetMethod: require('./2017/GetMethod'), + GetOwnPropertyKeys: require('./2017/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2017/GetPrototypeFromConstructor'), + GetSubstitution: require('./2017/GetSubstitution'), + GetV: require('./2017/GetV'), + HasOwnProperty: require('./2017/HasOwnProperty'), + HasProperty: require('./2017/HasProperty'), + HourFromTime: require('./2017/HourFromTime'), + InLeapYear: require('./2017/InLeapYear'), + InstanceofOperator: require('./2017/InstanceofOperator'), + Invoke: require('./2017/Invoke'), + IsAccessorDescriptor: require('./2017/IsAccessorDescriptor'), + IsArray: require('./2017/IsArray'), + IsCallable: require('./2017/IsCallable'), + IsConcatSpreadable: require('./2017/IsConcatSpreadable'), + IsConstructor: require('./2017/IsConstructor'), + IsDataDescriptor: require('./2017/IsDataDescriptor'), + IsExtensible: require('./2017/IsExtensible'), + IsGenericDescriptor: require('./2017/IsGenericDescriptor'), + IsInteger: require('./2017/IsInteger'), + IsPromise: require('./2017/IsPromise'), + IsPropertyDescriptor: require('./2017/IsPropertyDescriptor'), + IsPropertyKey: require('./2017/IsPropertyKey'), + IsRegExp: require('./2017/IsRegExp'), + IterableToList: require('./2017/IterableToList'), + IteratorClose: require('./2017/IteratorClose'), + IteratorComplete: require('./2017/IteratorComplete'), + IteratorNext: require('./2017/IteratorNext'), + IteratorStep: require('./2017/IteratorStep'), + IteratorValue: require('./2017/IteratorValue'), + MakeDate: require('./2017/MakeDate'), + MakeDay: require('./2017/MakeDay'), + MakeTime: require('./2017/MakeTime'), + MinFromTime: require('./2017/MinFromTime'), + modulo: require('./2017/modulo'), + MonthFromTime: require('./2017/MonthFromTime'), + msFromTime: require('./2017/msFromTime'), + ObjectCreate: require('./2017/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2017/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2017/OrdinaryGetOwnProperty'), + OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), + OrdinaryGetPrototypeOf: require('./2017/OrdinaryGetPrototypeOf'), + OrdinaryHasInstance: require('./2017/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2017/OrdinaryHasProperty'), + RegExpExec: require('./2017/RegExpExec'), + RequireObjectCoercible: require('./2017/RequireObjectCoercible'), + SameValue: require('./2017/SameValue'), + SameValueNonNumber: require('./2017/SameValueNonNumber'), + SameValueZero: require('./2017/SameValueZero'), + SecFromTime: require('./2017/SecFromTime'), + Set: require('./2017/Set'), + SetFunctionName: require('./2017/SetFunctionName'), + SetIntegrityLevel: require('./2017/SetIntegrityLevel'), + SpeciesConstructor: require('./2017/SpeciesConstructor'), + SymbolDescriptiveString: require('./2017/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2017/TestIntegrityLevel'), + thisBooleanValue: require('./2017/thisBooleanValue'), + thisNumberValue: require('./2017/thisNumberValue'), + thisStringValue: require('./2017/thisStringValue'), + thisTimeValue: require('./2017/thisTimeValue'), + TimeClip: require('./2017/TimeClip'), + TimeFromYear: require('./2017/TimeFromYear'), + TimeWithinDay: require('./2017/TimeWithinDay'), + ToBoolean: require('./2017/ToBoolean'), + ToDateString: require('./2017/ToDateString'), + ToIndex: require('./2017/ToIndex'), + ToInt16: require('./2017/ToInt16'), + ToInt32: require('./2017/ToInt32'), + ToInt8: require('./2017/ToInt8'), + ToInteger: require('./2017/ToInteger'), + ToLength: require('./2017/ToLength'), + ToNumber: require('./2017/ToNumber'), + ToObject: require('./2017/ToObject'), + ToPrimitive: require('./2017/ToPrimitive'), + ToPropertyDescriptor: require('./2017/ToPropertyDescriptor'), + ToPropertyKey: require('./2017/ToPropertyKey'), + ToString: require('./2017/ToString'), + ToUint16: require('./2017/ToUint16'), + ToUint32: require('./2017/ToUint32'), + ToUint8: require('./2017/ToUint8'), + ToUint8Clamp: require('./2017/ToUint8Clamp'), + Type: require('./2017/Type'), + ValidateAndApplyPropertyDescriptor: require('./2017/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2017/WeekDay'), + YearFromTime: require('./2017/YearFromTime') +}; + +module.exports = ES2017; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es2018.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2018.js new file mode 100644 index 0000000..e68910b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2018.js @@ -0,0 +1,126 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/9.0/#sec-abstract-operations +var ES2018 = { + 'Abstract Equality Comparison': require('./2018/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2018/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2018/StrictEqualityComparison'), + AdvanceStringIndex: require('./2018/AdvanceStringIndex'), + ArrayCreate: require('./2018/ArrayCreate'), + ArraySetLength: require('./2018/ArraySetLength'), + ArraySpeciesCreate: require('./2018/ArraySpeciesCreate'), + Call: require('./2018/Call'), + CanonicalNumericIndexString: require('./2018/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2018/CompletePropertyDescriptor'), + CopyDataProperties: require('./2018/CopyDataProperties'), + CreateDataProperty: require('./2018/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2018/CreateDataPropertyOrThrow'), + CreateHTML: require('./2018/CreateHTML'), + CreateIterResultObject: require('./2018/CreateIterResultObject'), + CreateListFromArrayLike: require('./2018/CreateListFromArrayLike'), + CreateMethodProperty: require('./2018/CreateMethodProperty'), + DateFromTime: require('./2018/DateFromTime'), + DateString: require('./2018/DateString'), + Day: require('./2018/Day'), + DayFromYear: require('./2018/DayFromYear'), + DaysInYear: require('./2018/DaysInYear'), + DayWithinYear: require('./2018/DayWithinYear'), + DefinePropertyOrThrow: require('./2018/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2018/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'), + FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'), + Get: require('./2018/Get'), + GetIterator: require('./2018/GetIterator'), + GetMethod: require('./2018/GetMethod'), + GetOwnPropertyKeys: require('./2018/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2018/GetPrototypeFromConstructor'), + GetSubstitution: require('./2018/GetSubstitution'), + GetV: require('./2018/GetV'), + HasOwnProperty: require('./2018/HasOwnProperty'), + HasProperty: require('./2018/HasProperty'), + HourFromTime: require('./2018/HourFromTime'), + InLeapYear: require('./2018/InLeapYear'), + InstanceofOperator: require('./2018/InstanceofOperator'), + Invoke: require('./2018/Invoke'), + IsAccessorDescriptor: require('./2018/IsAccessorDescriptor'), + IsArray: require('./2018/IsArray'), + IsCallable: require('./2018/IsCallable'), + IsConcatSpreadable: require('./2018/IsConcatSpreadable'), + IsConstructor: require('./2018/IsConstructor'), + IsDataDescriptor: require('./2018/IsDataDescriptor'), + IsExtensible: require('./2018/IsExtensible'), + IsGenericDescriptor: require('./2018/IsGenericDescriptor'), + IsInteger: require('./2018/IsInteger'), + IsPromise: require('./2018/IsPromise'), + IsPropertyKey: require('./2018/IsPropertyKey'), + IsRegExp: require('./2018/IsRegExp'), + IsStringPrefix: require('./2018/IsStringPrefix'), + IterableToList: require('./2018/IterableToList'), + IteratorClose: require('./2018/IteratorClose'), + IteratorComplete: require('./2018/IteratorComplete'), + IteratorNext: require('./2018/IteratorNext'), + IteratorStep: require('./2018/IteratorStep'), + IteratorValue: require('./2018/IteratorValue'), + MakeDate: require('./2018/MakeDate'), + MakeDay: require('./2018/MakeDay'), + MakeTime: require('./2018/MakeTime'), + MinFromTime: require('./2018/MinFromTime'), + modulo: require('./2018/modulo'), + MonthFromTime: require('./2018/MonthFromTime'), + msFromTime: require('./2018/msFromTime'), + NumberToString: require('./2018/NumberToString'), + ObjectCreate: require('./2018/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'), + PromiseResolve: require('./2018/PromiseResolve'), + RegExpExec: require('./2018/RegExpExec'), + RequireObjectCoercible: require('./2018/RequireObjectCoercible'), + SameValue: require('./2018/SameValue'), + SameValueNonNumber: require('./2018/SameValueNonNumber'), + SameValueZero: require('./2018/SameValueZero'), + SecFromTime: require('./2018/SecFromTime'), + Set: require('./2018/Set'), + SetFunctionName: require('./2018/SetFunctionName'), + SetIntegrityLevel: require('./2018/SetIntegrityLevel'), + SpeciesConstructor: require('./2018/SpeciesConstructor'), + SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2018/TestIntegrityLevel'), + thisBooleanValue: require('./2018/thisBooleanValue'), + thisNumberValue: require('./2018/thisNumberValue'), + thisStringValue: require('./2018/thisStringValue'), + thisSymbolValue: require('./2018/thisSymbolValue'), + thisTimeValue: require('./2018/thisTimeValue'), + TimeClip: require('./2018/TimeClip'), + TimeFromYear: require('./2018/TimeFromYear'), + TimeString: require('./2018/TimeString'), + TimeWithinDay: require('./2018/TimeWithinDay'), + ToBoolean: require('./2018/ToBoolean'), + ToDateString: require('./2018/ToDateString'), + ToIndex: require('./2018/ToIndex'), + ToInt16: require('./2018/ToInt16'), + ToInt32: require('./2018/ToInt32'), + ToInt8: require('./2018/ToInt8'), + ToInteger: require('./2018/ToInteger'), + ToLength: require('./2018/ToLength'), + ToNumber: require('./2018/ToNumber'), + ToObject: require('./2018/ToObject'), + ToPrimitive: require('./2018/ToPrimitive'), + ToPropertyDescriptor: require('./2018/ToPropertyDescriptor'), + ToPropertyKey: require('./2018/ToPropertyKey'), + ToString: require('./2018/ToString'), + ToUint16: require('./2018/ToUint16'), + ToUint32: require('./2018/ToUint32'), + ToUint8: require('./2018/ToUint8'), + ToUint8Clamp: require('./2018/ToUint8Clamp'), + Type: require('./2018/Type'), + ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2018/WeekDay'), + YearFromTime: require('./2018/YearFromTime') +}; + +module.exports = ES2018; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es2019.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2019.js new file mode 100644 index 0000000..3bd65e4 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es2019.js @@ -0,0 +1,129 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/10.0/#sec-abstract-operations +var ES2019 = { + 'Abstract Equality Comparison': require('./2019/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2019/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2019/StrictEqualityComparison'), + AddEntriesFromIterable: require('./2019/AddEntriesFromIterable'), + AdvanceStringIndex: require('./2019/AdvanceStringIndex'), + ArrayCreate: require('./2019/ArrayCreate'), + ArraySetLength: require('./2019/ArraySetLength'), + ArraySpeciesCreate: require('./2019/ArraySpeciesCreate'), + Call: require('./2019/Call'), + CanonicalNumericIndexString: require('./2019/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2019/CompletePropertyDescriptor'), + CopyDataProperties: require('./2019/CopyDataProperties'), + CreateDataProperty: require('./2019/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2019/CreateDataPropertyOrThrow'), + CreateHTML: require('./2019/CreateHTML'), + CreateIterResultObject: require('./2019/CreateIterResultObject'), + CreateListFromArrayLike: require('./2019/CreateListFromArrayLike'), + CreateMethodProperty: require('./2019/CreateMethodProperty'), + DateFromTime: require('./2019/DateFromTime'), + DateString: require('./2019/DateString'), + Day: require('./2019/Day'), + DayFromYear: require('./2019/DayFromYear'), + DaysInYear: require('./2019/DaysInYear'), + DayWithinYear: require('./2019/DayWithinYear'), + DefinePropertyOrThrow: require('./2019/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2019/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2019/EnumerableOwnPropertyNames'), + FlattenIntoArray: require('./2019/FlattenIntoArray'), + FromPropertyDescriptor: require('./2019/FromPropertyDescriptor'), + Get: require('./2019/Get'), + GetIterator: require('./2019/GetIterator'), + GetMethod: require('./2019/GetMethod'), + GetOwnPropertyKeys: require('./2019/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2019/GetPrototypeFromConstructor'), + GetSubstitution: require('./2019/GetSubstitution'), + GetV: require('./2019/GetV'), + HasOwnProperty: require('./2019/HasOwnProperty'), + HasProperty: require('./2019/HasProperty'), + HourFromTime: require('./2019/HourFromTime'), + InLeapYear: require('./2019/InLeapYear'), + InstanceofOperator: require('./2019/InstanceofOperator'), + Invoke: require('./2019/Invoke'), + IsAccessorDescriptor: require('./2019/IsAccessorDescriptor'), + IsArray: require('./2019/IsArray'), + IsCallable: require('./2019/IsCallable'), + IsConcatSpreadable: require('./2019/IsConcatSpreadable'), + IsConstructor: require('./2019/IsConstructor'), + IsDataDescriptor: require('./2019/IsDataDescriptor'), + IsExtensible: require('./2019/IsExtensible'), + IsGenericDescriptor: require('./2019/IsGenericDescriptor'), + IsInteger: require('./2019/IsInteger'), + IsPromise: require('./2019/IsPromise'), + IsPropertyKey: require('./2019/IsPropertyKey'), + IsRegExp: require('./2019/IsRegExp'), + IsStringPrefix: require('./2019/IsStringPrefix'), + IterableToList: require('./2019/IterableToList'), + IteratorClose: require('./2019/IteratorClose'), + IteratorComplete: require('./2019/IteratorComplete'), + IteratorNext: require('./2019/IteratorNext'), + IteratorStep: require('./2019/IteratorStep'), + IteratorValue: require('./2019/IteratorValue'), + MakeDate: require('./2019/MakeDate'), + MakeDay: require('./2019/MakeDay'), + MakeTime: require('./2019/MakeTime'), + MinFromTime: require('./2019/MinFromTime'), + modulo: require('./2019/modulo'), + MonthFromTime: require('./2019/MonthFromTime'), + msFromTime: require('./2019/msFromTime'), + NumberToString: require('./2019/NumberToString'), + ObjectCreate: require('./2019/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2019/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2019/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2019/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2019/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2019/OrdinaryHasProperty'), + PromiseResolve: require('./2019/PromiseResolve'), + RegExpExec: require('./2019/RegExpExec'), + RequireObjectCoercible: require('./2019/RequireObjectCoercible'), + SameValue: require('./2019/SameValue'), + SameValueNonNumber: require('./2019/SameValueNonNumber'), + SameValueZero: require('./2019/SameValueZero'), + SecFromTime: require('./2019/SecFromTime'), + Set: require('./2019/Set'), + SetFunctionName: require('./2019/SetFunctionName'), + SetIntegrityLevel: require('./2019/SetIntegrityLevel'), + SpeciesConstructor: require('./2019/SpeciesConstructor'), + SymbolDescriptiveString: require('./2019/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2019/TestIntegrityLevel'), + thisBooleanValue: require('./2019/thisBooleanValue'), + thisNumberValue: require('./2019/thisNumberValue'), + thisStringValue: require('./2019/thisStringValue'), + thisSymbolValue: require('./2019/thisSymbolValue'), + thisTimeValue: require('./2019/thisTimeValue'), + TimeClip: require('./2019/TimeClip'), + TimeFromYear: require('./2019/TimeFromYear'), + TimeString: require('./2019/TimeString'), + TimeWithinDay: require('./2019/TimeWithinDay'), + ToBoolean: require('./2019/ToBoolean'), + ToDateString: require('./2019/ToDateString'), + ToIndex: require('./2019/ToIndex'), + ToInt16: require('./2019/ToInt16'), + ToInt32: require('./2019/ToInt32'), + ToInt8: require('./2019/ToInt8'), + ToInteger: require('./2019/ToInteger'), + ToLength: require('./2019/ToLength'), + ToNumber: require('./2019/ToNumber'), + ToObject: require('./2019/ToObject'), + ToPrimitive: require('./2019/ToPrimitive'), + ToPropertyDescriptor: require('./2019/ToPropertyDescriptor'), + ToPropertyKey: require('./2019/ToPropertyKey'), + ToString: require('./2019/ToString'), + ToUint16: require('./2019/ToUint16'), + ToUint32: require('./2019/ToUint32'), + ToUint8: require('./2019/ToUint8'), + ToUint8Clamp: require('./2019/ToUint8Clamp'), + TrimString: require('./2019/TrimString'), + Type: require('./2019/Type'), + ValidateAndApplyPropertyDescriptor: require('./2019/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2019/WeekDay'), + YearFromTime: require('./2019/YearFromTime') +}; + +module.exports = ES2019; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es5.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es5.js new file mode 100644 index 0000000..2cc9515 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es5.js @@ -0,0 +1,49 @@ +'use strict'; + +/* eslint global-require: 0 */ + +// https://es5.github.io/#x9 +module.exports = { + 'Abstract Equality Comparison': require('./5/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./5/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./5/StrictEqualityComparison'), + CheckObjectCoercible: require('./5/CheckObjectCoercible'), + DateFromTime: require('./5/DateFromTime'), + Day: require('./5/Day'), + DayFromYear: require('./5/DayFromYear'), + DaysInYear: require('./5/DaysInYear'), + DayWithinYear: require('./5/DayWithinYear'), + FromPropertyDescriptor: require('./5/FromPropertyDescriptor'), + HourFromTime: require('./5/HourFromTime'), + InLeapYear: require('./5/InLeapYear'), + IsAccessorDescriptor: require('./5/IsAccessorDescriptor'), + IsCallable: require('./5/IsCallable'), + IsDataDescriptor: require('./5/IsDataDescriptor'), + IsGenericDescriptor: require('./5/IsGenericDescriptor'), + IsPropertyDescriptor: require('./5/IsPropertyDescriptor'), + MakeDate: require('./5/MakeDate'), + MakeDay: require('./5/MakeDay'), + MakeTime: require('./5/MakeTime'), + MinFromTime: require('./5/MinFromTime'), + modulo: require('./5/modulo'), + MonthFromTime: require('./5/MonthFromTime'), + msFromTime: require('./5/msFromTime'), + SameValue: require('./5/SameValue'), + SecFromTime: require('./5/SecFromTime'), + TimeClip: require('./5/TimeClip'), + TimeFromYear: require('./5/TimeFromYear'), + TimeWithinDay: require('./5/TimeWithinDay'), + ToBoolean: require('./5/ToBoolean'), + ToInt32: require('./5/ToInt32'), + ToInteger: require('./5/ToInteger'), + ToNumber: require('./5/ToNumber'), + ToObject: require('./5/ToObject'), + ToPrimitive: require('./5/ToPrimitive'), + ToPropertyDescriptor: require('./5/ToPropertyDescriptor'), + ToString: require('./5/ToString'), + ToUint16: require('./5/ToUint16'), + ToUint32: require('./5/ToUint32'), + Type: require('./5/Type'), + WeekDay: require('./5/WeekDay'), + YearFromTime: require('./5/YearFromTime') +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es6.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es6.js new file mode 100644 index 0000000..2d1f4dc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es6.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2015'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/es7.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/es7.js new file mode 100644 index 0000000..f2f15c0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/es7.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2016'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/DefineOwnProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/DefineOwnProperty.js new file mode 100644 index 0000000..99ace10 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/DefineOwnProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +// eslint-disable-next-line max-params +module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { + if (!$defineProperty) { + if (!IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + // eslint-disable-next-line no-param-reassign + O[P] = V; // will use [[Define]] + return SameValue(O[P], V); + } + $defineProperty(O, P, FromPropertyDescriptor(desc)); + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/OwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..4a06ce3 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/OwnPropertyKeys.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); +var callBound = require('./callBound'); + +var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); +var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; + +var keys = require('object-keys'); + +module.exports = $ownKeys || function OwnPropertyKeys(source) { + var ownKeys = ($gOPN || keys)(source); + if ($gOPS) { + $pushApply(ownKeys, $gOPS(source)); + } + return ownKeys; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assertRecord.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assertRecord.js new file mode 100644 index 0000000..45e115a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assertRecord.js @@ -0,0 +1,48 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = require('has'); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { + if (Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(Type, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(Type, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assign.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 0000000..7e6666e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBind.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBind.js new file mode 100644 index 0000000..3c1a327 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBind.js @@ -0,0 +1,34 @@ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind() { + return $reflectApply(bind, $call, arguments); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBound.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBound.js new file mode 100644 index 0000000..9dc8fc5 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/every.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/every.js new file mode 100644 index 0000000..42a4582 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/every.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/forEach.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/forEach.js new file mode 100644 index 0000000..35915a6 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/forEach.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getInferredName.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getInferredName.js new file mode 100644 index 0000000..2dab6e7 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getInferredName.js @@ -0,0 +1,10 @@ +'use strict'; + +var getInferredName; +try { + // eslint-disable-next-line no-new-func + getInferredName = Function('s', 'return { [s]() {} }[s].name;'); +} catch (e) {} + +var inferred = function () {}; +module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getIteratorMethod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getIteratorMethod.js new file mode 100644 index 0000000..02f932c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getIteratorMethod.js @@ -0,0 +1,45 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('./callBound'); + +var $iterator = GetIntrinsic('%Symbol.iterator%', true); +var $stringSlice = callBound('String.prototype.slice'); + +module.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (ES.Type(iterable) === 'String') { + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(iterable, i, true); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + }; + } + return usingIterator; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js new file mode 100644 index 0000000..71168e9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getProto.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getProto.js new file mode 100644 index 0000000..af10fd8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getProto.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalGetProto || ( + // eslint-disable-next-line no-proto + [].__proto__ === $ArrayProto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getSymbolDescription.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getSymbolDescription.js new file mode 100644 index 0000000..45d80d2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/getSymbolDescription.js @@ -0,0 +1,41 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('./callBound'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true); +var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true); +var symToStr = callBound('Symbol.prototype.toString', true); + +var getInferredName = require('./getInferredName'); + +/* eslint-disable consistent-return */ +module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) { + if (!thisSymbolValue) { + throw new $SyntaxError('Symbols are not supported in this environment'); + } + + // will throw if not a symbol primitive or wrapper object + var sym = thisSymbolValue(symbol); + + if (getInferredName) { + var name = getInferredName(sym); + if (name === '') { return; } + return name.slice(1, -1); // name.slice('['.length, -']'.length); + } + + var desc; + if (getGlobalSymbolDescription) { + desc = getGlobalSymbolDescription(sym); + if (typeof desc === 'string') { + return desc; + } + } + + desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length); + if (desc) { + return desc; + } +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isFinite.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isFinite.js new file mode 100644 index 0000000..9e7cd4f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isFinite.js @@ -0,0 +1,5 @@ +'use strict'; + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isNaN.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isNaN.js new file mode 100644 index 0000000..cb8631d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isNaN.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrefixOf.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrefixOf.js new file mode 100644 index 0000000..b67d640 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrefixOf.js @@ -0,0 +1,13 @@ +'use strict'; + +var $strSlice = require('../helpers/callBound')('String.prototype.slice'); + +module.exports = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return $strSlice(string, 0, prefix.length) === prefix; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrimitive.js new file mode 100644 index 0000000..06f0bf0 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPropertyDescriptor.js new file mode 100644 index 0000000..3eff7eb --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isPropertyDescriptor.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line no-restricted-syntax + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js new file mode 100644 index 0000000..a6162a1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js @@ -0,0 +1,20 @@ +'use strict'; + +var every = require('./every'); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/maxSafeInteger.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/maxSafeInteger.js new file mode 100644 index 0000000..2fe8f38 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/maxSafeInteger.js @@ -0,0 +1,8 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); +var $Number = GetIntrinsic('%Number%'); + +module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/mod.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/mod.js new file mode 100644 index 0000000..67c8b78 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/mod.js @@ -0,0 +1,8 @@ +'use strict'; + +var $floor = Math.floor; + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/padTimeComponent.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/padTimeComponent.js new file mode 100644 index 0000000..cbd8d06 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/padTimeComponent.js @@ -0,0 +1,9 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $strSlice = callBound('String.prototype.slice'); + +module.exports = function padTimeComponent(c, count) { + return $strSlice('00' + c, -(count || 2)); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/regexTester.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/regexTester.js new file mode 100644 index 0000000..982cc9f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/regexTester.js @@ -0,0 +1,11 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $test = GetIntrinsic('RegExp.prototype.test'); + +var callBind = require('./callBind'); + +module.exports = function regexTester(regex) { + return callBind($test, regex); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/setProto.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/setProto.js new file mode 100644 index 0000000..29ec991 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/setProto.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalSetProto || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayProto + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/sign.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/sign.js new file mode 100644 index 0000000..598ea7d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/sign.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/timeConstants.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/timeConstants.js new file mode 100644 index 0000000..c275b40 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/helpers/timeConstants.js @@ -0,0 +1,19 @@ +'use strict'; + +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1e3; +var msPerMinute = msPerSecond * SecondsPerMinute; +var msPerHour = msPerMinute * MinutesPerHour; +var msPerDay = 86400000; + +module.exports = { + HoursPerDay: HoursPerDay, + MinutesPerHour: MinutesPerHour, + SecondsPerMinute: SecondsPerMinute, + msPerSecond: msPerSecond, + msPerMinute: msPerMinute, + msPerHour: msPerHour, + msPerDay: msPerDay +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/index.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/index.js new file mode 100644 index 0000000..7cef039 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var assign = require('./helpers/assign'); + +var ES5 = require('./es5'); +var ES2015 = require('./es2015'); +var ES2016 = require('./es2016'); +var ES2017 = require('./es2017'); +var ES2018 = require('./es2018'); +var ES2019 = require('./es2019'); + +var ES = { + ES5: ES5, + ES6: ES2015, + ES2015: ES2015, + ES7: ES2016, + ES2016: ES2016, + ES2017: ES2017, + ES2018: ES2018, + ES2019: ES2019 +}; +assign(ES, ES5); +delete ES.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible +assign(ES, ES2015); + +module.exports = ES; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/.eslintrc b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/.eslintrc new file mode 100644 index 0000000..bcd76f7 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": 0, + }, +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2015.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2015.js new file mode 100644 index 0000000..6c50891 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2015.js @@ -0,0 +1,249 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatetypedarray', + ArrayCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/6.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/6.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/6.0/#sec-implicit-completion-values', + Construct: 'https://ecma-international.org/ecma-262/6.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/6.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/6.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/6.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/6.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-createrealm', + CreateSetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createsetiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/6.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/6.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/6.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/6.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/6.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/6.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-functioncreate', + FunctionInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/6.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/6.0/#sec-get-o-p', + GetBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/6.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/6.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/6.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetSubstitution: 'https://ecma-international.org/ecma-262/6.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/6.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/6.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getviewvalue', + HasOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + HasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasproperty', + HostResolveImportedModule: 'sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/6.0/#sec-importedlocalnames', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/6.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/6.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/6.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/6.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/6.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsRegExp: 'https://ecma-international.org/ecma-262/6.0/#sec-isregexp', + IsStrictReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsSuperReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsWordChar: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IteratorClose: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/6.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/6.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/6.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/6.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/6.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + msPerDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/6.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/6.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty', + ParseModule: 'https://ecma-international.org/ecma-262/6.0/#sec-parsemodule', + PerformEval: 'https://ecma-international.org/ecma-262/6.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/6.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/6.0/#sec-preparefortailcall', + ProxyCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/6.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/6.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvethisbinding', + SameValue: 'https://ecma-international.org/ecma-262/6.0/#sec-samevalue', + SameValueZero: 'https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero', + SecFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/6.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-setviewvalue', + sign: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + SortCompare: 'https://ecma-international.org/ecma-262/6.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/6.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-stringcreate', + StringGetIndexProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-stringgetindexproperty', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object', + thisNumberValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/6.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/6.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/6.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/6.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/6.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/6.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/6.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/6.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/6.0/#sec-toobject', + ToPrimitive: 'https://ecma-international.org/ecma-262/6.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/6.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/6.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/6.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/6.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values', + TypedArrayFrom: 'https://ecma-international.org/ecma-262/6.0/#sec-typedarrayfrom', + UpdateEmpty: 'https://ecma-international.org/ecma-262/6.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/6.0/#sec-utc-t', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor', + WeekDay: 'https://ecma-international.org/ecma-262/6.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number' +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2016.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2016.js new file mode 100644 index 0000000..6a58b9c --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2016.js @@ -0,0 +1,276 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/7.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/7.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arrayspeciescreate', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/7.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/7.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/7.0/#sec-completion-record-specification-type', + Construct: 'https://ecma-international.org/ecma-262/7.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/7.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/7.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/7.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/7.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/7.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createsetiterator', + CreateStringIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/7.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/7.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerableownnames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/7.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/7.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/7.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/7.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/7.0/#sec-getactivescriptormodule', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/7.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/7.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/7.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getprototypefromconstructor', + GetSubstitution: 'https://ecma-international.org/ecma-262/7.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/7.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/7.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getviewvalue', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-globaldeclarationinstantiation', + HasOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasownproperty', + HasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasproperty', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/7.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/7.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/7.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/7.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/7.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/7.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/7.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/7.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/7.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/7.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/7.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/7.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-ispropertykey', + IsRegExp: 'https://ecma-international.org/ecma-262/7.0/#sec-isregexp', + IsWordChar: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike', + IteratorClose: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/7.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/7.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/7.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/7.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/7.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/7.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/7.0/#sec-newpromisecapability', + NextJob: 'https://ecma-international.org/ecma-262/7.0/#sec-nextjob-result', + NormalCompletion: 'https://ecma-international.org/ecma-262/7.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof', + ParseModule: 'https://ecma-international.org/ecma-262/7.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/7.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/7.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/7.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/7.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/7.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/7.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/7.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-returnifabrupt', + SameValue: 'https://ecma-international.org/ecma-262/7.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/7.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/7.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/7.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-setviewvalue', + SortCompare: 'https://ecma-international.org/ecma-262/7.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/7.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-stringcreate', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/7.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/7.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/7.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/7.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/7.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/7.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/7.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/7.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/7.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/7.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/7.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/7.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/7.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/7.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/7.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/7.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/7.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/7.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/7.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-validateandapplypropertydescriptor', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-validatetypedarray', + WeekDay: 'https://ecma-international.org/ecma-262/7.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number' +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2017.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2017.js new file mode 100644 index 0000000..896fcee --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2017.js @@ -0,0 +1,324 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/8.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/8.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/8.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/8.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/8.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arrayspeciescreate', + AsyncFunctionAwait: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-await', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-start', + AtomicLoad: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicreadmodifywrite', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/8.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/8.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/8.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/8.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/8.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/8.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/8.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/8.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/8.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/8.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/8.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-entercriticalsection', + EnumerableOwnProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/8.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/8.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/8.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/8.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/8.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/8.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/8.0/#ao-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/8.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/8.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/8.0/#ao-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/8.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/8.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/8.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/8.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/8.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/8.0/#ao-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/8.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/8.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/8.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/8.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/8.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/8.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-InLeapYear', + InstanceofOperator: 'https://ecma-international.org/ecma-262/8.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/8.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/8.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/8.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/8.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/8.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/8.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#ao-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/8.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isstrictreference', + IsSuperReference: 'https://ecma-international.org/ecma-262/8.0/#ao-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/8.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/8.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/8.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/8.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/8.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/8.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/8.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/8.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/8.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/8.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/8.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/8.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-numbertorawbytes', + ObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarysetprototypeof', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/8.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/8.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/8.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/8.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/8.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/8.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/8.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/8.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/8.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/8.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/8.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/8.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/8.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/8.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/8.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/8.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/8.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/8.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisstringvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thistimevalue', + TimeClip: 'https://ecma-international.org/ecma-262/8.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeFromYear', + TimeWithinDay: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeWithinDay', + ToBoolean: 'https://ecma-international.org/ecma-262/8.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/8.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/8.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/8.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/8.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/8.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/8.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/8.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/8.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/8.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/8.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/8.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/8.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/8.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/8.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/8.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/8.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/8.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-YearFromTime' +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2018.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2018.js new file mode 100644 index 0000000..c93b561 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2018.js @@ -0,0 +1,350 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/9.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/9.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/9.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/9.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/9.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arrayspeciescreate', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/9.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/9.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/9.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/9.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/9.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/9.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/9.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/9.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/9.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/9.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/9.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/9.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/9.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/9.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/9.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/9.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/9.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/9.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/9.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/9.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/9.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/9.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/9.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/9.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/9.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/9.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/9.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/9.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/9.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/9.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/9.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/9.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/9.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/9.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/9.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/9.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/9.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/9.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/9.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/9.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/9.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/9.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/9.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/9.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/9.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/9.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/9.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/9.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/9.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/9.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/9.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/9.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/9.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/9.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MinFromTime', + ModuleDeclarationEnvironmentSetup: 'https://ecma-international.org/ecma-262/9.0/#sec-moduledeclarationenvironmentsetup', + ModuleExecution: 'https://ecma-international.org/ecma-262/9.0/#sec-moduleexecution', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/9.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/9.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/9.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/9.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/9.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/9.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/9.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/9.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/9.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/9.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/9.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/9.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/9.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/9.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/9.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/9.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/9.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/9.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/9.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/9.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/9.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/9.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/9.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/9.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/9.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/9.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/9.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/9.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/9.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/9.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/9.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/9.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/9.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/9.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/9.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/9.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/9.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/9.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/9.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-YearFromTime' +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2019.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2019.js new file mode 100644 index 0000000..73f05e8 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/operations/2019.js @@ -0,0 +1,355 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/10.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-relational-comparison', + AddEntriesFromIterable: 'https://ecma-international.org/ecma-262/10.0/#sec-add-entries-from-iterable', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/10.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/10.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/10.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/10.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arrayspeciescreate', + AsyncFromSyncIteratorContinuation: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncfromsynciteratorcontinuation', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/10.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/10.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/10.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/10.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/10.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/10.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/10.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/10.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/10.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/10.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/10.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/10.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/10.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/10.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-event-set', + ExecuteModule: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-execute-module', + FlattenIntoArray: 'https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray', + floor: 'https://ecma-international.org/ecma-262/10.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/10.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/10.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/10.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/10.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/10.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/10.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/10.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/10.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/10.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/10.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/10.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/10.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/10.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/10.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/10.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/10.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/10.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/10.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/10.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/10.0/#sec-initializeboundname', + InitializeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-initialize-environment', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/10.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/10.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/10.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/10.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/10.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/10.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/10.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/10.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/10.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/10.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/10.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/10.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/10.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/10.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/10.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/10.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/10.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/10.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/10.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/10.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/10.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-normalcompletion', + NotifyWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-notifywaiter', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/10.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/10.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/10.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/10.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/10.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/10.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/10.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/10.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/10.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/10.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/10.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/10.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/10.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/10.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/10.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/10.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/10.0/#sec-symboldescriptivestring', + SynchronizeEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizeeventset', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/10.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/10.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/10.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/10.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/10.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/10.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/10.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/10.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/10.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/10.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/10.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/10.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/10.0/#sec-triggerpromisereactions', + TrimString: 'https://ecma-international.org/ecma-262/10.0/#sec-trimstring', + Type: 'https://ecma-international.org/ecma-262/10.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/10.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/10.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/10.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/10.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/10.0/#sec-valueofreadevent', + WeekDay: 'https://ecma-international.org/ecma-262/10.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-YearFromTime' +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/package.json b/node_modules/string.prototype.trimend/node_modules/es-abstract/package.json new file mode 100644 index 0000000..c7d60a1 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/package.json @@ -0,0 +1,139 @@ +{ + "_from": "es-abstract@^1.17.5", + "_id": "es-abstract@1.17.7", + "_inBundle": false, + "_integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "_location": "/string.prototype.trimend/es-abstract", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es-abstract@^1.17.5", + "name": "es-abstract", + "escapedName": "es-abstract", + "rawSpec": "^1.17.5", + "saveSpec": null, + "fetchSpec": "^1.17.5" + }, + "_requiredBy": [ + "/string.prototype.trimend" + ], + "_resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "_shasum": "a4de61b2f66989fc7421676c1cb9787573ace54c", + "_spec": "es-abstract@^1.17.5", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/string.prototype.trimend", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "bugs": { + "url": "https://github.com/ljharb/es-abstract/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "deprecated": false, + "description": "ECMAScript spec abstract operations.", + "devDependencies": { + "@ljharb/eslint-config": "^17.2.0", + "array.prototype.indexof": "^1.0.0", + "aud": "^1.1.2", + "cheerio": "^1.0.0-rc.3", + "diff": "^4.0.2", + "eclint": "^2.8.1", + "eslint": "^7.10.0", + "foreach": "^2.0.5", + "functions-have-names": "^1.2.1", + "has-strict-mode": "^1.0.0", + "in-publish": "^2.0.1", + "make-arrow-function": "^1.2.0", + "nyc": "^10.3.2", + "object-is": "^1.1.2", + "object.fromentries": "^2.0.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "greenkeeper": { + "//": "nyc is ignored because it requires node 4+, and we support older than that", + "ignore": [ + "nyc" + ] + }, + "homepage": "https://github.com/ljharb/es-abstract#readme", + "keywords": [ + "ECMAScript", + "ES", + "abstract", + "operation", + "abstract operation", + "JavaScript", + "ES5", + "ES6", + "ES7" + ], + "license": "MIT", + "main": "index.js", + "name": "es-abstract", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-abstract.git" + }, + "scripts": { + "coverage": "nyc npm run tests-only >/dev/null", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "lint": "eslint .", + "postcoverage": "nyc report", + "postspackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs git add", + "posttest": "aud --production", + "prepublish": "safe-publish-latest && (not-in-publish || npm run spackle)", + "prespackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs rm || true", + "pretest": "npm run lint", + "spackle": "node operations/spackle 1", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.17.7" +} diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/GetIntrinsic.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/GetIntrinsic.js new file mode 100644 index 0000000..a3e69a7 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/GetIntrinsic.js @@ -0,0 +1,94 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var test = require('tape'); +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + t.end(); +}); + +test('accessors', { skip: !Object.getOwnPropertyDescriptor || typeof Map !== 'function' }, function (t) { + var actual = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/diffOps.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/diffOps.js new file mode 100644 index 0000000..602098d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/diffOps.js @@ -0,0 +1,27 @@ +'use strict'; + +var keys = require('object-keys'); +var forEach = require('foreach'); +var indexOf = require('array.prototype.indexof'); + +module.exports = function diffOperations(actual, expected, expectedMissing) { + var actualKeys = keys(actual); + var expectedKeys = keys(expected); + + var extra = []; + var missing = []; + forEach(actualKeys, function (op) { + if (!(op in expected)) { + extra.push(op); + } else if (indexOf(expectedMissing, op) !== -1) { + extra.push(op); + } + }); + forEach(expectedKeys, function (op) { + if (typeof actual[op] !== 'function' && indexOf(expectedMissing, op) === -1) { + missing.push(op); + } + }); + + return { missing: missing, extra: extra }; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2015.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2015.js new file mode 100644 index 0000000..9bb8ec9 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2015.js @@ -0,0 +1,150 @@ +'use strict'; + +var ES = require('../').ES2015; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2015'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateSetIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'HasPrimitiveBase', + 'HostResolveImportedModule', + 'ImportedLocalNames', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'msPerDay', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'ParseModule', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'sign', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetIndexProperty', + 'TriggerPromiseReactions', + 'TypedArrayFrom', + 'UpdateEmpty', + 'UTC' +]; + +require('./tests').es2015(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2015); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2016.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2016.js new file mode 100644 index 0000000..611ea6a --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2016.js @@ -0,0 +1,173 @@ +'use strict'; + +var ES = require('../').ES2016; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2016'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GlobalDeclarationInstantiation', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NextJob', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateTypedArray' +]; + +require('./tests').es2016(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2016); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2017.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2017.js new file mode 100644 index 0000000..74eb38e --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2017.js @@ -0,0 +1,220 @@ +'use strict'; + +var ES = require('../').ES2017; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2017'); + +var expectedMissing = [ + 'abs', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionAwait', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters', + 'AddRestrictedFunctionProperties', + 'synchronizes-with' +]; + +require('./tests').es2017(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2017); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2018.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2018.js new file mode 100644 index 0000000..5ca1087 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2018.js @@ -0,0 +1,241 @@ +'use strict'; + +var ES = require('../').ES2018; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2018'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2018(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2018); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2019.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2019.js new file mode 100644 index 0000000..c034b60 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es2019.js @@ -0,0 +1,246 @@ +'use strict'; + +var ES = require('../').ES2019; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2019'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFromSyncIteratorContinuation', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'ExecuteModule', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeEnvironment', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NotifyWaiter', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'SynchronizeEventSet', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2019(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2019); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es5.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es5.js new file mode 100644 index 0000000..6647a1b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es5.js @@ -0,0 +1,786 @@ +'use strict'; + +var ES = require('../').ES5; +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +require('./helpers/runManifestTest')(test, ES, 5); + +ES = require('./helpers/createBoundESNamespace')(ES); + +test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + st.equal(ES.ToPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError'); + st.end(); + }); + + t.end(); +}); + +test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + forEach([0, -0, NaN], function (falsyNumber) { + t.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach([Infinity, 42, 1, -Infinity], function (truthyNumber) { + t.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + forEach(v.objects, function (obj) { + t.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + t.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + t.end(); +}); + +test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + t.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach([0, -0, 42, Infinity, -Infinity], function (num) { + t.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + t.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + forEach(v.objects, function (object) { + t.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + t['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); +}); + +test('ToString', function (t) { + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); +}); + +test('CheckObjectCoercible', function (t) { + t['throws'](function () { return ES.CheckObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.CheckObjectCoercible(null); }, TypeError, 'null throws'); + var checkCoercible = function (value) { + t.doesNotThrow(function () { return ES.CheckObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), checkCoercible); + t.end(); +}); + +test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.primitives); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); +}); + +test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); +}); + +test('Type', function (t) { + t.equal(ES.Type(), 'Undefined', 'Type() is Undefined'); + t.equal(ES.Type(undefined), 'Undefined', 'Type(undefined) is Undefined'); + t.equal(ES.Type(null), 'Null', 'Type(null) is Null'); + t.equal(ES.Type(true), 'Boolean', 'Type(true) is Boolean'); + t.equal(ES.Type(false), 'Boolean', 'Type(false) is Boolean'); + t.equal(ES.Type(0), 'Number', 'Type(0) is Number'); + t.equal(ES.Type(NaN), 'Number', 'Type(NaN) is Number'); + t.equal(ES.Type('abc'), 'String', 'Type("abc") is String'); + t.equal(ES.Type(function () {}), 'Object', 'Type(function () {}) is Object'); + t.equal(ES.Type({}), 'Object', 'Type({}) is Object'); + t.end(); +}); + +test('IsPropertyDescriptor', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsPropertyDescriptor(primitive), false, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptorWritable()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); +}); + +test('IsAccessorDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsAccessorDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); +}); + +test('IsDataDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsDataDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); +}); + +test('IsGenericDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('ToPropertyDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.descriptors.nonConfigurable(v.dataDescriptor()); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), data); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.ToPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ get: 'not callable' }); }, + TypeError, + '"get" must be undefined or callable' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ set: 'not callable' }); }, + TypeError, + '"set" must be undefined or callable' + ); + + t.end(); +}); + +test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); +}); + +test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); +}); + +test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); +}); + +test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); +}); + +var msPerSecond = 1e3; +var msPerMinute = 60 * msPerSecond; +var msPerHour = 60 * msPerMinute; +var msPerDay = 24 * msPerHour; + +test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); +}); + +test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); +}); + +test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); +}); + +test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); +}); + +test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); +}); + +test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); +}); + +test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); +}); + +test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); +}); + +test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); +}); + +test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); +}); + +test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); +}); + +test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); +}); + +test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); +}); + +test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + t.end(); +}); + +test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); +}); + +test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es6.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es6.js new file mode 100644 index 0000000..e7c9d98 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es6.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES6 = ES.ES6; +var ES2015 = ES.ES2015; +var ES6entry = require('../es6'); + +test('legacy es6 export', function (t) { + t.equal(ES6, ES2015, 'main ES6 === main ES2015'); + t.end(); +}); + +test('legacy es6 entry point', function (t) { + t.equal(ES6, ES6entry, 'main ES6 === ES6 entry point'); + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es7.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es7.js new file mode 100644 index 0000000..ee57e15 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/es7.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES7 = ES.ES7; +var ES2016 = ES.ES2016; +var ES7entry = require('../es7'); + +test('legacy es7 export', function (t) { + t.equal(ES7, ES2016, 'main ES7 === main ES2016'); + t.end(); +}); + +test('legacy es7 entry point', function (t) { + t.equal(ES7, ES7entry, 'main ES7 === ES7 entry point'); + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..9c2b4fc --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js @@ -0,0 +1,42 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('has-symbols')(); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); +var defineProperty = require('./defineProperty'); + +test('OwnPropertyKeys', function (t) { + t.deepEqual(OwnPropertyKeys({ a: 1, b: 2 }).sort(), ['a', 'b'].sort(), 'returns own string keys'); + + t.test('Symbols', { skip: !hasSymbols }, function (st) { + var o = { a: 1 }; + var sym = Symbol(); + o[sym] = 2; + + st.deepEqual(OwnPropertyKeys(o), ['a', sym], 'returns own string and symbol keys'); + + st.end(); + }); + + t.test('non-enumerables', { skip: !defineProperty.oDP }, function (st) { + var o = { a: 1, b: 42, c: NaN }; + defineProperty(o, 'b', { enumerable: false, value: 42 }); + defineProperty(o, 'c', { enumerable: false, get: function () { return NaN; } }); + + if (hasSymbols) { + defineProperty(o, 'd', { enumerable: false, value: true }); + defineProperty(o, 'e', { enumerable: false, get: function () { return true; } }); + } + + st.deepEqual( + OwnPropertyKeys(o).sort(), + (hasSymbols ? ['a', 'b', 'c', 'd', 'e'] : ['a', 'b', 'c']).sort(), + 'returns non-enumerable own keys, including accessors and symbols if available' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/assertRecord.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/assertRecord.js new file mode 100644 index 0000000..d6a80c2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/assertRecord.js @@ -0,0 +1,60 @@ +'use strict'; + +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var assertRecord = require('../../helpers/assertRecord'); +var v = require('./values'); + +module.exports = function assertRecordTests(ES, test) { + test('Property Descriptor', function (t) { + var record = 'Property Descriptor'; + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', { invalid: true }); }, + TypeError, + 'invalid keys not allowed on a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', {}); }, + 'empty object is an incomplete Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.accessorDescriptor()); }, + 'accessor descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.mutatorDescriptor()); }, + 'mutator descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.dataDescriptor()); }, + 'data descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.genericDescriptor()); }, + 'generic descriptor is a Property Descriptor' + ); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/createBoundESNamespace.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/createBoundESNamespace.js new file mode 100644 index 0000000..880ba3d --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/createBoundESNamespace.js @@ -0,0 +1,21 @@ +'use strict'; + +var bind = require('function-bind'); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); + +module.exports = function createBoundESNamespace(ES) { + var keys = OwnPropertyKeys(ES); + var result = {}; + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var prop = ES[key]; + if (typeof prop === 'function') { + prop = bind.call(prop, undefined); + } + result[key] = prop; + } + + return result; +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/defineProperty.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/defineProperty.js new file mode 100644 index 0000000..8f925be --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/defineProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var oDP = Object.defineProperty; +try { + oDP({}, 'a', { value: 1 }); +} catch (e) { + // IE 8 + oDP = null; +} + +module.exports = function defineProperty(O, P, Desc) { + if (oDP) { + return oDP(O, P, Desc); + } + if ((Desc.enumerable && Desc.configurable && Desc.writable) || !(P in O)) { + O[P] = Desc.value; // eslint-disable-line no-param-reassign + return O; + } + + throw new SyntaxError('helper does not yet support this configuration'); +}; +module.exports.oDP = oDP; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/getSymbolDescription.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/getSymbolDescription.js new file mode 100644 index 0000000..fbe7a7b --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/getSymbolDescription.js @@ -0,0 +1,67 @@ +'use strict'; + +var test = require('tape'); +var debug = require('object-inspect'); +var forEach = require('foreach'); +var has = require('has'); + +var v = require('./values'); +var getSymbolDescription = require('../../helpers/getSymbolDescription'); +var getInferredName = require('../../helpers/getInferredName'); + +test('getSymbolDescription', function (t) { + t.test('no symbols', { skip: v.hasSymbols }, function (st) { + st['throws']( + getSymbolDescription, + SyntaxError, + 'requires Symbol support' + ); + + st.end(); + }); + + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { getSymbolDescription(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('with symbols', { skip: !v.hasSymbols }, function (st) { + forEach( + [ + [Symbol(), undefined], + [Symbol(undefined), undefined], + [Symbol(null), 'null'], + [Symbol.iterator, 'Symbol.iterator'], + [Symbol('foo'), 'foo'] + ], + function (pair) { + var sym = pair[0]; + var desc = pair[1]; + st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc)); + } + ); + + st.test('only possible when inference or native `Symbol.prototype.description` is supported', { + skip: !getInferredName && !has(Symbol.prototype, 'description') + }, function (s2t) { + s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""'); + + s2t.end(); + }); + + st.test('only possible when global symbols are supported', { + skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor') + }, function (s2t) { + // eslint-disable-next-line no-restricted-properties + s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/runManifestTest.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/runManifestTest.js new file mode 100644 index 0000000..2fdb4f2 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/runManifestTest.js @@ -0,0 +1,27 @@ +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +var forEach = require('foreach'); +var keys = require('object-keys'); + +module.exports = function runManifestTest(test, ES, edition) { + test('ES' + edition + ' manifest', { skip: !fs.readdirSync }, function (t) { + var files = fs.readdirSync(path.join(__dirname, '../../' + edition), 'utf-8'); + var map = { + AbstractEqualityComparison: 'Abstract Equality Comparison', + AbstractRelationalComparison: 'Abstract Relational Comparison', + StrictEqualityComparison: 'Strict Equality Comparison' + }; + forEach(files, function (file) { + var name = path.basename(file, path.extname(file)); + var actual = ES[map[name] || name]; + var expected = require(path.join(__dirname, '../../' + edition + '/', file)); // eslint-disable-line global-require + t.equal(actual, expected, 'ES["' + name + '"] === ' + file); + }); + var actualCount = keys(ES).length; + t.equal(actualCount, files.length, 'expected ' + files.length + ' files, got ' + actualCount); + t.end(); + }); +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/values.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/values.js new file mode 100644 index 0000000..ccef743 --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/helpers/values.js @@ -0,0 +1,121 @@ +'use strict'; + +var assign = require('../../helpers/assign'); + +var hasSymbols = require('has-symbols')(); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; +var objects = [{}, coercibleObject, coercibleFnObject, toStringOnlyObject, valueOfOnlyObject]; +var nullPrimitives = [undefined, null]; +var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3]; +var zeroes = [0, -0]; +var infinities = [Infinity, -Infinity]; +var numbers = zeroes.concat([42], infinities, nonIntegerNumbers); +var strings = ['', 'foo', 'a\uD83D\uDCA9c']; +var booleans = [true, false]; +var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; +var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers); +var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols); +var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols); +var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives); +var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects); +var primitives = [].concat(nullPrimitives, nonNullPrimitives); +var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects); +var propertyKeys = [].concat(strings, symbols); +var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects); +var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN); +var truthies = [].concat(true, 'foo', 42, symbols, objects); +var timestamps = [].concat(0, 946713600000, 1546329600000); +var nonFunctions = [].concat(primitives, objects, [42]); +var nonArrays = [].concat(nonFunctions); + +var descriptors = { + configurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': true }); + }, + nonConfigurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': false }); + }, + enumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': true }); + }, + nonEnumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': false }); + }, + writable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': true }); + }, + nonWritable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': false }); + } +}; + +module.exports = { + coercibleObject: coercibleObject, + coercibleFnObject: coercibleFnObject, + valueOfOnlyObject: valueOfOnlyObject, + toStringOnlyObject: toStringOnlyObject, + uncoercibleObject: uncoercibleObject, + uncoercibleFnObject: uncoercibleFnObject, + objects: objects, + nonFunctions: nonFunctions, + nonArrays: nonArrays, + nullPrimitives: nullPrimitives, + numbers: numbers, + zeroes: zeroes, + infinities: infinities, + strings: strings, + booleans: booleans, + symbols: symbols, + hasSymbols: hasSymbols, + nonSymbolPrimitives: nonSymbolPrimitives, + nonNumberPrimitives: nonNumberPrimitives, + nonNullPrimitives: nonNullPrimitives, + nonUndefinedPrimitives: nonUndefinedPrimitives, + nonStrings: nonStrings, + nonNumbers: nonNumberPrimitives.concat(objects), + nonIntegerNumbers: nonIntegerNumbers, + primitives: primitives, + nonPropertyKeys: nonPropertyKeys, + propertyKeys: propertyKeys, + nonBooleans: nonBooleans, + falsies: falsies, + truthies: truthies, + timestamps: timestamps, + bothDescriptor: function () { + return { '[[Get]]': function () {}, '[[Value]]': true }; + }, + bothDescriptorWritable: function () { + return descriptors.writable({ '[[Get]]': function () {} }); + }, + accessorDescriptor: function (value) { + return descriptors.enumerable(descriptors.configurable({ + '[[Get]]': function get() { return value; } + })); + }, + mutatorDescriptor: function () { + return descriptors.enumerable(descriptors.configurable({ + '[[Set]]': function () {} + })); + }, + dataDescriptor: function (value) { + return descriptors.nonWritable({ + '[[Value]]': arguments.length > 0 ? value : 42 + }); + }, + genericDescriptor: function () { + return descriptors.configurable(descriptors.nonEnumerable()); + }, + descriptors: descriptors +}; diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/index.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/index.js new file mode 100644 index 0000000..3f1adba --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var ES = require('../'); +var test = require('tape'); +var keys = require('object-keys'); +var forEach = require('foreach'); + +var ESkeys = keys(ES).sort(); +var ES6keys = keys(ES.ES6).sort(); + +test('exposed properties', function (t) { + t.deepEqual(ESkeys, ES6keys.concat(['ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); + t.end(); +}); + +test('methods match', function (t) { + forEach(ES6keys, function (key) { + t.equal(ES.ES6[key], ES[key], 'method ' + key + ' on main ES object is ES6 method'); + }); + t.end(); +}); + +require('./GetIntrinsic'); + +require('./helpers/getSymbolDescription'); +require('./helpers/OwnPropertyKeys'); + +require('./es5'); +require('./es6'); +require('./es2015'); +require('./es7'); +require('./es2016'); +require('./es2017'); +require('./es2018'); +require('./es2019'); diff --git a/node_modules/string.prototype.trimend/node_modules/es-abstract/test/tests.js b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/tests.js new file mode 100644 index 0000000..844846f --- /dev/null +++ b/node_modules/string.prototype.trimend/node_modules/es-abstract/test/tests.js @@ -0,0 +1,4193 @@ +'use strict'; + +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); +var assign = require('object.assign'); +var keys = require('object-keys'); +var has = require('has'); +var arrowFns = require('make-arrow-function').list(); +var hasStrictMode = require('has-strict-mode')(); +var functionsHaveNames = require('functions-have-names')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +var $getProto = require('../helpers/getProto'); +var $setProto = require('../helpers/setProto'); +var defineProperty = require('./helpers/defineProperty'); +var getInferredName = require('../helpers/getInferredName'); +var getOwnPropertyDescriptor = require('../helpers/getOwnPropertyDescriptor'); +var assertRecordTests = require('./helpers/assertRecord'); +var v = require('./helpers/values'); +var diffOps = require('./diffOps'); + +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +var getArraySubclassWithSpeciesConstructor = function getArraySubclass(speciesConstructor) { + var Bar = function Bar() { + var inst = []; + Object.setPrototypeOf(inst, Bar.prototype); + defineProperty(inst, 'constructor', { value: Bar }); + return inst; + }; + Bar.prototype = Object.create(Array.prototype); + Object.setPrototypeOf(Bar, Array); + defineProperty(Bar, Symbol.species, { value: speciesConstructor }); + + return Bar; +}; + +var testIterator = function (t, iterator, expected) { + var resultCount = 0; + var result; + while (result = iterator.next(), !result.done) { // eslint-disable-line no-sequences + t.deepEqual(result, { done: false, value: expected[resultCount] }, 'result ' + resultCount); + resultCount += 1; + } + t.equal(resultCount, expected.length, 'expected ' + expected.length + ', got ' + resultCount); +}; + +var hasSpecies = v.hasSymbols && Symbol.species; + +var hasLastIndex = 'lastIndex' in (/a/).exec('a'); // IE 8 +var hasGroups = 'groups' in (/a/).exec('a'); // modern engines +var kludgeMatch = function kludgeMatch(R, matchObject) { + if (hasGroups) { + assign(matchObject, { groups: matchObject.groups }); + } + if (hasLastIndex) { + assign(matchObject, { lastIndex: R.lastIndex }); + } + return matchObject; +}; + +var testEnumerableOwnNames = function (t, enumerableOwnNames) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { enumerableOwnNames(nonObject); }, + debug(nonObject) + ' is not an Object' + ); + }); + + var Child = function Child() { + this.own = {}; + }; + Child.prototype = { + inherited: {} + }; + + var obj = new Child(); + + t.equal('own' in obj, true, 'has "own"'); + t.equal(has(obj, 'own'), true, 'has own "own"'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, 'own'), true, 'has enumerable "own"'); + + t.equal('inherited' in obj, true, 'has "inherited"'); + t.equal(has(obj, 'inherited'), false, 'has non-own "inherited"'); + t.equal(has(Child.prototype, 'inherited'), true, 'Child.prototype has own "inherited"'); + t.equal(Child.prototype.inherited, obj.inherited, 'Child.prototype.inherited === obj.inherited'); + t.equal(Object.prototype.propertyIsEnumerable.call(Child.prototype, 'inherited'), true, 'has enumerable "inherited"'); + + t.equal('toString' in obj, true, 'has "toString"'); + t.equal(has(obj, 'toString'), false, 'has non-own "toString"'); + t.equal(has(Object.prototype, 'toString'), true, 'Object.prototype has own "toString"'); + t.equal(Object.prototype.toString, obj.toString, 'Object.prototype.toString === obj.toString'); + // eslint-disable-next-line no-useless-call + t.equal(Object.prototype.propertyIsEnumerable.call(Object.prototype, 'toString'), false, 'has non-enumerable "toString"'); + + return obj; +}; + +var es2015 = function ES2015(ES, ops, expectedMissing, skips) { + test('has expected operations', function (t) { + var diff = diffOps(ES, ops, expectedMissing); + + t.deepEqual(diff.extra, [], 'no extra ops'); + + t.deepEqual(diff.missing, [], 'no unexpected missing ops'); + + t.end(); + }); + + test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), 3, 'coercibleObject with no hint coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), 3, 'coercibleObject with hint Number coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to NaN'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), 42, 'coercibleObject with hint String coerces to nonstringified toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), 7, 'toStringOnlyObject returns non-stringified toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), 4, 'valueOfOnlyObject returns valueOf'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st.end(); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); + var now = new Date(); + st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); + st.end(); + }); + + t.end(); + }); + + test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + + t.test('numbers', function (st) { + forEach(v.zeroes.concat(NaN), function (falsyNumber) { + st.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach(v.infinities.concat([42, 1]), function (truthyNumber) { + st.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + + st.end(); + }); + + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + + t.test('objects', function (st) { + forEach(v.objects, function (obj) { + st.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + st.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + + st.end(); + }); + + t.end(); + }); + + test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + + t.test('numbers', function (st) { + st.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach(v.zeroes.concat(v.infinities, 42), function (num) { + st.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + st.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + st.end(); + }); + + t.test('objects', function (st) { + forEach(v.objects, function (object) { + st.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + st['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + st.end(); + }); + + t.test('binary literals', function (st) { + st.equal(ES.ToNumber('0b10'), 2, '0b10 is 2'); + st.equal(ES.ToNumber({ toString: function () { return '0b11'; } }), 3, 'Object that toStrings to 0b11 is 3'); + + st.equal(true, is(ES.ToNumber('0b12'), NaN), '0b12 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0b112'; } }), NaN), 'Object that toStrings to 0b112 is NaN'); + st.end(); + }); + + t.test('octal literals', function (st) { + st.equal(ES.ToNumber('0o10'), 8, '0o10 is 8'); + st.equal(ES.ToNumber({ toString: function () { return '0o11'; } }), 9, 'Object that toStrings to 0o11 is 9'); + + st.equal(true, is(ES.ToNumber('0o18'), NaN), '0o18 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0o118'; } }), NaN), 'Object that toStrings to 0o118 is NaN'); + st.end(); + }); + + t.test('signed hex numbers', function (st) { + st.equal(true, is(ES.ToNumber('-0xF'), NaN), '-0xF is NaN'); + st.equal(true, is(ES.ToNumber(' -0xF '), NaN), 'space-padded -0xF is NaN'); + st.equal(true, is(ES.ToNumber('+0xF'), NaN), '+0xF is NaN'); + st.equal(true, is(ES.ToNumber(' +0xF '), NaN), 'space-padded +0xF is NaN'); + + st.end(); + }); + + t.test('trimming of whitespace and non-whitespace characters', function (st) { + var whitespace = ' \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'; + st.equal(0, ES.ToNumber(whitespace + 0 + whitespace), 'whitespace is trimmed'); + + // Zero-width space (zws), next line character (nel), and non-character (bom) are not whitespace. + var nonWhitespaces = { + '\\u0085': '\u0085', + '\\u200b': '\u200b', + '\\ufffe': '\ufffe' + }; + + forEach(nonWhitespaces, function (desc, nonWS) { + st.equal(true, is(ES.ToNumber(nonWS + 0 + nonWS), NaN), 'non-whitespace ' + desc + ' not trimmed'); + }); + + st.end(); + }); + + forEach(v.symbols, function (symbol) { + t['throws']( + function () { ES.ToNumber(symbol); }, + TypeError, + 'Symbols can’t be converted to a Number: ' + debug(symbol) + ); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); + var now = +new Date(); + st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); + st.end(); + }); + + t.end(); + }); + + test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); + }); + + test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToInt16', function (t) { + t.ok(is(0, ES.ToInt16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt16(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt16(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt16(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.end(); + }); + + test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); + }); + + test('ToInt8', function (t) { + t.ok(is(0, ES.ToInt8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt8(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt8(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt8(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToInt8(0x100 - 1), -1), '2^8 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10), 0x10), '2^4 returns 2^4'); + t.end(); + }); + + test('ToUint8', function (t) { + t.ok(is(0, ES.ToUint8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint8(0x100000000 - 1), 0x100 - 1), '2^32 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint8(0x80000000 - 1), 0x100 - 1), '2^31 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint8(0x10000 - 1), 0x100 - 1), '2^16 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToUint8(0x100 - 1), 0x100 - 1), '2^8 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint8(0x10), 0x10), '2^4 returns 2^4'); + t.ok(is(ES.ToUint8(0x10 - 1), 0x10 - 1), '2^4 - 1 returns 2^4 - 1'); + t.end(); + }); + + test('ToUint8Clamp', function (t) { + t.ok(is(0, ES.ToUint8Clamp(NaN)), 'NaN coerces to +0'); + t.ok(is(0, ES.ToUint8Clamp(0)), '+0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-0)), '-0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-Infinity)), '-Infinity returns +0'); + t['throws'](function () { return ES.ToUint8Clamp(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + forEach([255, 256, 0x100000, Infinity], function (number) { + t.ok(is(255, ES.ToUint8Clamp(number)), number + ' coerces to 255'); + }); + t.equal(1, ES.ToUint8Clamp(1.49), '1.49 coerces to 1'); + t.equal(2, ES.ToUint8Clamp(1.5), '1.5 coerces to 2, because 2 is even'); + t.equal(2, ES.ToUint8Clamp(1.51), '1.51 coerces to 2'); + + t.equal(2, ES.ToUint8Clamp(2.49), '2.49 coerces to 2'); + t.equal(2, ES.ToUint8Clamp(2.5), '2.5 coerces to 2, because 2 is even'); + t.equal(3, ES.ToUint8Clamp(2.51), '2.51 coerces to 3'); + t.end(); + }); + + test('ToString', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (item) { + t.equal(ES.ToString(item), String(item), 'ES.ToString(' + debug(item) + ') ToStrings to String(' + debug(item) + ')'); + }); + + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + + forEach(v.symbols, function (symbol) { + t['throws'](function () { return ES.ToString(symbol); }, TypeError, debug(symbol) + ' throws'); + }); + t.end(); + }); + + test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); + }); + + test('RequireObjectCoercible', function (t) { + t.equal(false, 'CheckObjectCoercible' in ES, 'CheckObjectCoercible -> RequireObjectCoercible in ES6'); + t['throws'](function () { return ES.RequireObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.RequireObjectCoercible(null); }, TypeError, 'null throws'); + var isCoercible = function (value) { + t.doesNotThrow(function () { return ES.RequireObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), isCoercible); + t.end(); + }); + + test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.nonFunctions); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); + }); + + test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); + }); + + test('SameValueZero', function (t) { + t.equal(true, ES.SameValueZero(NaN, NaN), 'NaN is SameValueZero as NaN'); + t.equal(true, ES.SameValueZero(0, -0), '+0 is SameValueZero as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValueZero(val, val), debug(val) + ' is SameValueZero to itself'); + }); + t.end(); + }); + + test('ToPropertyKey', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (value) { + t.equal(ES.ToPropertyKey(value), String(value), 'ToPropertyKey(value) === String(value) for non-Symbols'); + }); + + forEach(v.symbols, function (symbol) { + t.equal( + ES.ToPropertyKey(symbol), + symbol, + 'ToPropertyKey(' + debug(symbol) + ') === ' + debug(symbol) + ); + t.equal( + ES.ToPropertyKey(Object(symbol)), + symbol, + 'ToPropertyKey(' + debug(Object(symbol)) + ') === ' + debug(symbol) + ); + }); + + t.end(); + }); + + test('ToLength', function (t) { + t['throws'](function () { return ES.ToLength(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + t.equal(3, ES.ToLength(v.coercibleObject), 'coercibleObject coerces to 3'); + t.equal(42, ES.ToLength('42.5'), '"42.5" coerces to 42'); + t.equal(7, ES.ToLength(7.3), '7.3 coerces to 7'); + forEach([-0, -1, -42, -Infinity], function (negative) { + t.ok(is(0, ES.ToLength(negative)), negative + ' coerces to +0'); + }); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 1), '2^53 coerces to 2^53 - 1'); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 3), '2^53 + 2 coerces to 2^53 - 1'); + t.end(); + }); + + test('IsArray', function (t) { + t.equal(true, ES.IsArray([]), '[] is array'); + t.equal(false, ES.IsArray({}), '{} is not array'); + t.equal(false, ES.IsArray({ length: 1, 0: true }), 'arraylike object is not array'); + forEach(v.objects.concat(v.primitives), function (value) { + t.equal(false, ES.IsArray(value), debug(value) + ' is not array'); + }); + t.end(); + }); + + test('IsRegExp', function (t) { + forEach([/a/g, new RegExp('a', 'g')], function (regex) { + t.equal(true, ES.IsRegExp(regex), regex + ' is regex'); + }); + + forEach(v.objects.concat(v.primitives), function (nonRegex) { + t.equal(false, ES.IsRegExp(nonRegex), debug(nonRegex) + ' is not regex'); + }); + + t.test('Symbol.match', { skip: !v.hasSymbols || !Symbol.match }, function (st) { + var obj = {}; + obj[Symbol.match] = true; + st.equal(true, ES.IsRegExp(obj), 'object with truthy Symbol.match is regex'); + + var regex = /a/; + regex[Symbol.match] = false; + st.equal(false, ES.IsRegExp(regex), 'regex with falsy Symbol.match is not regex'); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyKey', function (t) { + forEach(v.numbers.concat(v.objects), function (notKey) { + t.equal(false, ES.IsPropertyKey(notKey), debug(notKey) + ' is not property key'); + }); + + t.equal(true, ES.IsPropertyKey('foo'), 'string is property key'); + + forEach(v.symbols, function (symbol) { + t.equal(true, ES.IsPropertyKey(symbol), debug(symbol) + ' is property key'); + }); + t.end(); + }); + + test('IsInteger', function (t) { + for (var i = -100; i < 100; i += 10) { + t.equal(true, ES.IsInteger(i), i + ' is integer'); + t.equal(false, ES.IsInteger(i + 0.2), (i + 0.2) + ' is not integer'); + } + t.equal(true, ES.IsInteger(-0), '-0 is integer'); + var notInts = v.nonNumbers.concat(v.nonIntegerNumbers, v.infinities, [NaN, [], new Date()]); + forEach(notInts, function (notInt) { + t.equal(false, ES.IsInteger(notInt), debug(notInt) + ' is not integer'); + }); + t.equal(false, ES.IsInteger(v.uncoercibleObject), 'uncoercibleObject is not integer'); + t.end(); + }); + + test('IsExtensible', function (t) { + forEach(v.objects, function (object) { + t.equal(true, ES.IsExtensible(object), debug(object) + ' object is extensible'); + }); + forEach(v.primitives, function (primitive) { + t.equal(false, ES.IsExtensible(primitive), debug(primitive) + ' is not extensible'); + }); + if (Object.preventExtensions) { + t.equal(false, ES.IsExtensible(Object.preventExtensions({})), 'object with extensions prevented is not extensible'); + } + t.end(); + }); + + test('CanonicalNumericIndexString', function (t) { + var throwsOnNonString = function (notString) { + t['throws']( + function () { return ES.CanonicalNumericIndexString(notString); }, + TypeError, + debug(notString) + ' is not a string' + ); + }; + forEach(v.objects.concat(v.numbers), throwsOnNonString); + t.ok(is(-0, ES.CanonicalNumericIndexString('-0')), '"-0" returns -0'); + for (var i = -50; i < 50; i += 10) { + t.equal(i, ES.CanonicalNumericIndexString(String(i)), '"' + i + '" returns ' + i); + t.equal(undefined, ES.CanonicalNumericIndexString(String(i) + 'a'), '"' + i + 'a" returns undefined'); + } + t.end(); + }); + + test('IsConstructor', function (t) { + t.equal(true, ES.IsConstructor(function () {}), 'function is constructor'); + t.equal(false, ES.IsConstructor(/a/g), 'regex is not constructor'); + forEach(v.objects, function (object) { + t.equal(false, ES.IsConstructor(object), object + ' object is not constructor'); + }); + + try { + var arrow = Function('return () => {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(arrow), false, 'arrow function is not constructor'); + } catch (e) { + t.comment('SKIP: arrow function syntax not supported.'); + } + + try { + var foo = Function('return class Foo {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(foo), true, 'class is constructor'); + } catch (e) { + t.comment('SKIP: class syntax not supported.'); + } + + if (typeof Reflect !== 'object' || typeof Proxy !== 'function' || has(Proxy, 'prototype')) { + t.comment('SKIP: Proxy is constructor'); + } else { + t.equal(ES.IsConstructor(Proxy), true, 'Proxy is constructor'); + } + + t.end(); + }); + + test('Call', function (t) { + var receiver = {}; + var notFuncs = v.nonFunctions.concat([/a/g, new RegExp('a', 'g')]); + t.plan(notFuncs.length + 5); + var throwsIfNotCallable = function (notFunc) { + t['throws']( + function () { return ES.Call(notFunc, receiver); }, + TypeError, + debug(notFunc) + ' (' + typeof notFunc + ') is not callable' + ); + }; + forEach(notFuncs, throwsIfNotCallable); + ES.Call( + function (a, b) { + t.equal(this, receiver, 'context matches expected'); + t.deepEqual([a, b], [1, 2], 'named args are correct'); + t.equal(arguments.length, 3, 'extra argument was passed'); + t.equal(arguments[2], 3, 'extra argument was correct'); + }, + receiver, + [1, 2, 3] + ); + + t.test('Call doesn’t use func.apply', function (st) { + st.plan(4); + + var bad = function (a, b) { + st.equal(this, receiver, 'context matches expected'); + st.deepEqual([a, b], [1, 2], 'named args are correct'); + st.equal(arguments.length, 3, 'extra argument was passed'); + st.equal(arguments[2], 3, 'extra argument was correct'); + }; + + bad.apply = function () { + st.fail('bad.apply shouldn’t get called'); + }; + + ES.Call(bad, receiver, [1, 2, 3]); + st.end(); + }); + + t.end(); + }); + + test('GetV', function (t) { + t['throws'](function () { return ES.GetV({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + var obj = { a: function () {} }; + t.equal(ES.GetV(obj, 'a'), obj.a, 'returns property if it exists'); + t.equal(ES.GetV(obj, 'b'), undefined, 'returns undefiend if property does not exist'); + t.end(); + }); + + test('GetMethod', function (t) { + t['throws'](function () { return ES.GetMethod({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + t.equal(ES.GetMethod({}, 'a'), undefined, 'returns undefined in property is undefined'); + t.equal(ES.GetMethod({ a: null }, 'a'), undefined, 'returns undefined if property is null'); + t.equal(ES.GetMethod({ a: undefined }, 'a'), undefined, 'returns undefined if property is undefined'); + var obj = { a: function () {} }; + t['throws'](function () { ES.GetMethod({ a: 'b' }, 'a'); }, TypeError, 'throws TypeError if property exists and is not callable'); + t.equal(ES.GetMethod(obj, 'a'), obj.a, 'returns property if it is callable'); + t.end(); + }); + + test('Get', function (t) { + t['throws'](function () { return ES.Get('a', 'a'); }, TypeError, 'Throws a TypeError if `O` is not an Object'); + t['throws'](function () { return ES.Get({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + + var value = {}; + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var sym = Symbol('sym'); + var obj = {}; + obj[sym] = value; + st.equal(ES.Get(obj, sym), value, 'returns property `P` if it exists on object `O`'); + st.end(); + }); + t.equal(ES.Get({ a: value }, 'a'), value, 'returns property `P` if it exists on object `O`'); + t.end(); + }); + + test('Type', { skip: !v.hasSymbols }, function (t) { + t.equal(ES.Type(Symbol.iterator), 'Symbol', 'Type(Symbol.iterator) is Symbol'); + t.end(); + }); + + test('SpeciesConstructor', function (t) { + t['throws'](function () { ES.SpeciesConstructor(null); }, TypeError); + t['throws'](function () { ES.SpeciesConstructor(undefined); }, TypeError); + + var defaultConstructor = function Foo() {}; + + t.equal( + ES.SpeciesConstructor({ constructor: undefined }, defaultConstructor), + defaultConstructor, + 'undefined constructor returns defaultConstructor' + ); + + t['throws']( + function () { return ES.SpeciesConstructor({ constructor: null }, defaultConstructor); }, + TypeError, + 'non-undefined non-object constructor throws' + ); + + t.test('with Symbol.species', { skip: !hasSpecies }, function (st) { + var Bar = function Bar() {}; + Bar[Symbol.species] = null; + + st.equal( + ES.SpeciesConstructor(new Bar(), defaultConstructor), + defaultConstructor, + 'undefined/null Symbol.species returns default constructor' + ); + + var Baz = function Baz() {}; + Baz[Symbol.species] = Bar; + st.equal( + ES.SpeciesConstructor(new Baz(), defaultConstructor), + Bar, + 'returns Symbol.species constructor value' + ); + + Baz[Symbol.species] = {}; + st['throws']( + function () { ES.SpeciesConstructor(new Baz(), defaultConstructor); }, + TypeError, + 'throws when non-constructor non-null non-undefined species value found' + ); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyDescriptor', { skip: skips && skips.IsPropertyDescriptor }, function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t.equal( + ES.IsPropertyDescriptor(primitive), + false, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); + + assertRecordTests(ES, test); + + test('IsAccessorDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsAccessorDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); + }); + + test('IsDataDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsDataDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); + }); + + test('IsGenericDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); + }); + + test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'] + }); + + t.deepEqual(ES.FromPropertyDescriptor(v.genericDescriptor()), { + enumerable: false, + configurable: true + }); + + t.end(); + }); + + test('ToPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.dataDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), assign(data, { '[[Configurable]]': false })); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.FromPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('CompletePropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.CompletePropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var generic = v.genericDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(generic), + { + '[[Configurable]]': !!generic['[[Configurable]]'], + '[[Enumerable]]': !!generic['[[Enumerable]]'], + '[[Value]]': undefined, + '[[Writable]]': false + }, + 'completes a Generic Descriptor' + ); + + var data = v.dataDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(data), + { + '[[Configurable]]': !!data['[[Configurable]]'], + '[[Enumerable]]': false, + '[[Value]]': data['[[Value]]'], + '[[Writable]]': !!data['[[Writable]]'] + }, + 'completes a Data Descriptor' + ); + + var accessor = v.accessorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(accessor), + { + '[[Get]]': accessor['[[Get]]'], + '[[Enumerable]]': !!accessor['[[Enumerable]]'], + '[[Configurable]]': !!accessor['[[Configurable]]'], + '[[Set]]': undefined + }, + 'completes an Accessor Descriptor' + ); + + var mutator = v.mutatorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(mutator), + { + '[[Set]]': mutator['[[Set]]'], + '[[Enumerable]]': !!mutator['[[Enumerable]]'], + '[[Configurable]]': !!mutator['[[Configurable]]'], + '[[Get]]': undefined + }, + 'completes a mutator Descriptor' + ); + + t['throws']( + function () { ES.CompletePropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('Set', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.Set(primitive, '', null, false); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Set({}, nonKey, null, false); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.Set({}, '', null, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var o = {}; + var value = {}; + ES.Set(o, 'key', value, true); + t.deepEqual(o, { key: value }, 'key is set'); + + t.test('nonwritable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { writable: false }); + + st['throws']( + function () { ES.Set(obj, 'a', {}, true); }, + TypeError, + 'can not Set nonwritable property' + ); + + st.doesNotThrow( + function () { + st.equal(ES.Set(obj, 'a', {}, false), false, 'unsuccessful Set returns false'); + }, + 'setting Throw to false prevents an exception' + ); + + st.end(); + }); + + t.test('nonconfigurable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { configurable: false }); + + st.equal(ES.Set(obj, 'a', value, true), true, 'successful Set returns true'); + st.deepEqual(obj, { a: value }, 'key is set'); + + st.end(); + }); + + t.test('doesn’t call [[Get]] in conforming strict mode environments', { skip: noThrowOnStrictViolation }, function (st) { + var getterCalled = false; + var setterCalls = 0; + var obj = {}; + defineProperty(obj, 'a', { + get: function () { + getterCalled = true; + }, + set: function () { + setterCalls += 1; + } + }); + + st.equal(ES.Set(obj, 'a', value, false), true, 'successful Set returns true'); + st.equal(setterCalls, 1, 'setter was called once'); + st.equal(getterCalled, false, 'getter was not called'); + + st.end(); + }); + + t.end(); + }); + + test('HasOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasOwnProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasOwnProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasOwnProperty({}, 'toString'), false, 'inherited properties are not own'); + t.equal( + ES.HasOwnProperty({ toString: 1 }, 'toString'), + true, + 'shadowed inherited own properties are own' + ); + t.equal(ES.HasOwnProperty({ a: 1 }, 'a'), true, 'own properties are own'); + + t.end(); + }); + + test('HasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasProperty({}, 'nope'), false, 'object does not have nonexistent properties'); + t.equal(ES.HasProperty({}, 'toString'), true, 'object has inherited properties'); + t.equal( + ES.HasProperty({ toString: 1 }, 'toString'), + true, + 'object has shadowed inherited own properties' + ); + t.equal(ES.HasProperty({ a: 1 }, 'a'), true, 'object has own properties'); + + t.end(); + }); + + test('IsConcatSpreadable', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsConcatSpreadable(primitive), false, debug(primitive) + ' is not an Object'); + }); + + var hasSymbolConcatSpreadable = v.hasSymbols && Symbol.isConcatSpreadable; + t.test('Symbol.isConcatSpreadable', { skip: !hasSymbolConcatSpreadable }, function (st) { + forEach(v.falsies, function (falsy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = falsy; + st.equal( + ES.IsConcatSpreadable(obj), + false, + 'an object with ' + debug(falsy) + ' as Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + forEach(v.truthies, function (truthy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = truthy; + st.equal( + ES.IsConcatSpreadable(obj), + true, + 'an object with ' + debug(truthy) + ' as Symbol.isConcatSpreadable is concat spreadable' + ); + }); + + st.end(); + }); + + forEach(v.objects, function (object) { + t.equal( + ES.IsConcatSpreadable(object), + false, + 'non-array without Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + t.equal(ES.IsConcatSpreadable([]), true, 'arrays are concat spreadable'); + + t.end(); + }); + + test('Invoke', function (t) { + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Invoke({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t['throws'](function () { ES.Invoke({ o: false }, 'o'); }, TypeError, 'fails on a non-function'); + + t.test('invoked callback', function (st) { + var aValue = {}; + var bValue = {}; + var obj = { + f: function (a) { + st.equal(arguments.length, 2, '2 args passed'); + st.equal(a, aValue, 'first arg is correct'); + st.equal(arguments[1], bValue, 'second arg is correct'); + } + }; + st.plan(3); + ES.Invoke(obj, 'f', aValue, bValue); + }); + + t.end(); + }); + + test('GetIterator', function (t) { + var arr = [1, 2]; + testIterator(t, ES.GetIterator(arr), arr); + + testIterator(t, ES.GetIterator('abc'), 'abc'.split('')); + + t.test('Symbol.iterator', { skip: !v.hasSymbols }, function (st) { + var m = new Map(); + m.set(1, 'a'); + m.set(2, 'b'); + + testIterator(st, ES.GetIterator(m), [[1, 'a'], [2, 'b']]); + + st.end(); + }); + + t.end(); + }); + + test('IteratorNext', { skip: true }); + + test('IteratorComplete', { skip: true }); + + test('IteratorValue', { skip: true }); + + test('IteratorStep', { skip: true }); + + test('IteratorClose', { skip: true }); + + test('CreateIterResultObject', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.CreateIterResultObject({}, nonBoolean); }, + TypeError, + '"done" argument must be a boolean; ' + debug(nonBoolean) + ' is not' + ); + }); + + var value = {}; + t.deepEqual( + ES.CreateIterResultObject(value, true), + { value: value, done: true }, + 'creates a "done" iteration result' + ); + t.deepEqual( + ES.CreateIterResultObject(value, false), + { value: value, done: false }, + 'creates a "not done" iteration result' + ); + + t.end(); + }); + + test('RegExpExec', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.RegExpExec(primitive); }, + TypeError, + '"R" argument must be an object; ' + debug(primitive) + ' is not' + ); + }); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.RegExpExec({}, nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + t.test('gets and calls a callable "exec"', function (st) { + var str = '123'; + var o = { + exec: function (S) { + st.equal(this, o, '"exec" receiver is R'); + st.equal(S, str, '"exec" argument is S'); + + return null; + } + }; + st.plan(2); + ES.RegExpExec(o, str); + st.end(); + }); + + t.test('throws if a callable "exec" returns a non-null non-object', function (st) { + var str = '123'; + st.plan(v.nonNullPrimitives.length); + forEach(v.nonNullPrimitives, function (nonNullPrimitive) { + st['throws']( + function () { ES.RegExpExec({ exec: function () { return nonNullPrimitive; } }, str); }, + TypeError, + '"exec" method must return `null` or an Object; ' + debug(nonNullPrimitive) + ' is not' + ); + }); + st.end(); + }); + + t.test('actual regex that should match against a string', function (st) { + var S = 'aabc'; + var R = /a/g; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + + t.test('actual regex that should match against a string, with shadowed "exec"', function (st) { + var S = 'aabc'; + var R = /a/g; + R.exec = undefined; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + t.end(); + }); + + test('ArraySpeciesCreate', function (t) { + t.test('errors', function (st) { + var testNonNumber = function (nonNumber) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a number' + ); + }; + forEach(v.nonNumbers, testNonNumber); + + st['throws']( + function () { ES.ArraySpeciesCreate([], -1); }, + TypeError, + '-1 is not >= 0' + ); + st['throws']( + function () { ES.ArraySpeciesCreate([], -Infinity); }, + TypeError, + '-Infinity is not >= 0' + ); + + var testNonIntegers = function (nonInteger) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonInteger); }, + TypeError, + debug(nonInteger) + ' is not an integer' + ); + }; + forEach(v.nonIntegerNumbers, testNonIntegers); + + st.end(); + }); + + t.test('works with a non-array', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + var arr = ES.ArraySpeciesCreate(nonArray, 0); + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, 0, 'length is correct'); + st.equal(arr.constructor, Array, 'constructor is correct'); + }); + + st.end(); + }); + + t.test('works with a normal array', function (st) { + var len = 2; + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, len, 'length is correct'); + st.equal(arr.constructor, orig.constructor, 'constructor is correct'); + + st.end(); + }); + + t.test('-0 length produces +0 length', function (st) { + var len = -0; + st.ok(is(len, -0), '-0 is negative zero'); + st.notOk(is(len, 0), '-0 is not positive zero'); + + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.equal(ES.IsArray(arr), true); + st.ok(is(arr.length, 0)); + st.equal(arr.constructor, orig.constructor); + + st.end(); + }); + + t.test('works with species construtor', { skip: !hasSpecies }, function (st) { + var sentinel = {}; + var Foo = function Foo(len) { + this.length = len; + this.sentinel = sentinel; + }; + var Bar = getArraySubclassWithSpeciesConstructor(Foo); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Foo, 'result used species constructor'); + st.equal(arr.length, 3, 'length property is correct'); + st.equal(arr.sentinel, sentinel, 'Foo constructor was exercised'); + + st.end(); + }); + + t.test('works with null species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(null); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('works with undefined species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('throws with object non-construtor species constructor', { skip: !hasSpecies }, function (st) { + forEach(v.objects, function (obj) { + var Bar = getArraySubclassWithSpeciesConstructor(obj); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + st['throws']( + function () { ES.ArraySpeciesCreate(bar, 3); }, + TypeError, + debug(obj) + ' is not a constructor' + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('CreateDataProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataProperty(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = { id: 'sentinel' }; + var secondSentinel = { id: 'second sentinel' }; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataProperty(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + var secondStatus = ES.CreateDataProperty(obj, propertyKey, secondSentinel); + t.equal(secondStatus, true, 'second status is true'); + t.equal( + obj[propertyKey], + secondSentinel, + debug(secondSentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + t.test('with defineProperty', { skip: !defineProperty.oDP }, function (st) { + var nonWritable = defineProperty({}, propertyKey, { configurable: true, writable: false }); + + var nonWritableStatus = ES.CreateDataProperty(nonWritable, propertyKey, sentinel); + st.equal(nonWritableStatus, false, 'create data property failed'); + st.notEqual( + nonWritable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonwritable' + ); + + var nonConfigurable = defineProperty({}, propertyKey, { configurable: false, writable: true }); + + var nonConfigurableStatus = ES.CreateDataProperty(nonConfigurable, propertyKey, sentinel); + st.equal(nonConfigurableStatus, false, 'create data property failed'); + st.notEqual( + nonConfigurable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonconfigurable' + ); + st.end(); + }); + }); + + t.end(); + }); + + test('CreateDataPropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = {}; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataPropertyOrThrow(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + if (typeof Object.preventExtensions === 'function') { + var notExtensible = {}; + Object.preventExtensions(notExtensible); + + t['throws']( + function () { ES.CreateDataPropertyOrThrow(notExtensible, propertyKey, sentinel); }, + TypeError, + 'can not install ' + debug(propertyKey) + ' on non-extensible object' + ); + t.notEqual( + notExtensible[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object' + ); + } + }); + + t.end(); + }); + + test('ObjectCreate', function (t) { + forEach(v.nonNullPrimitives, function (value) { + t['throws']( + function () { ES.ObjectCreate(value); }, + TypeError, + debug(value) + ' is not null, or an object' + ); + }); + + t.test('proto arg', function (st) { + var Parent = function Parent() {}; + Parent.prototype.foo = {}; + var child = ES.ObjectCreate(Parent.prototype); + st.equal(child instanceof Parent, true, 'child is instanceof Parent'); + st.equal(child.foo, Parent.prototype.foo, 'child inherits properties from Parent.prototype'); + + st.end(); + }); + + t.test('internal slots arg', function (st) { + st.doesNotThrow(function () { ES.ObjectCreate({}, []); }, 'an empty slot list is valid'); + + st['throws']( + function () { ES.ObjectCreate({}, ['a']); }, + SyntaxError, + 'internal slots are not supported' + ); + + st.end(); + }); + + t.test('null proto', { skip: !Object.create && !$setProto }, function (st) { + st.equal('toString' in {}, true, 'normal objects have toString'); + st.equal('toString' in ES.ObjectCreate(null), false, 'makes a null object'); + + st.end(); + }); + + t.test('null proto when no native Object.create', { skip: Object.create || $setProto }, function (st) { + st['throws']( + function () { ES.ObjectCreate(null); }, + SyntaxError, + 'without a native Object.create, can not create null objects' + ); + + st.end(); + }); + + t.end(); + }); + + test('AdvanceStringIndex', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.AdvanceStringIndex(nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + var notInts = v.nonNumbers.concat( + v.nonIntegerNumbers, + v.infinities, + [NaN, [], new Date(), Math.pow(2, 53), -1] + ); + forEach(notInts, function (nonInt) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', nonInt); }, + TypeError, + '"index" argument must be an integer, ' + debug(nonInt) + ' is not.' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', 0, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var str = 'a\uD83D\uDCA9c'; + + t.test('non-unicode mode', function (st) { + for (var i = 0; i < str.length + 2; i += 1) { + st.equal(ES.AdvanceStringIndex(str, i, false), i + 1, i + ' advances to ' + (i + 1)); + } + + st.end(); + }); + + t.test('unicode mode', function (st) { + st.equal(ES.AdvanceStringIndex(str, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(str, 1, true), 3, '1 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 3, true), 4, '3 advances to 4'); + st.equal(ES.AdvanceStringIndex(str, 4, true), 5, '4 advances to 5'); + + st.end(); + }); + + t.test('lone surrogates', function (st) { + var halfPoo = 'a\uD83Dc'; + + st.equal(ES.AdvanceStringIndex(halfPoo, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(halfPoo, 1, true), 2, '1 advances to 2'); + st.equal(ES.AdvanceStringIndex(halfPoo, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(halfPoo, 3, true), 4, '3 advances to 4'); + + st.end(); + }); + + t.test('surrogate pairs', function (st) { + var lowestPair = String.fromCharCode('0xD800') + String.fromCharCode('0xDC00'); + var highestPair = String.fromCharCode('0xDBFF') + String.fromCharCode('0xDFFF'); + var poop = String.fromCharCode('0xD83D') + String.fromCharCode('0xDCA9'); + + st.equal(ES.AdvanceStringIndex(lowestPair, 0, true), 2, 'lowest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(highestPair, 0, true), 2, 'highest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(poop, 0, true), 2, 'poop, 0 -> 2'); + + st.end(); + }); + + t.end(); + }); + + test('CreateMethodProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateMethodProperty(primitive, 'key'); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateMethodProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var value = { foo: 'bar' }; + + st.equal(ES.CreateMethodProperty(obj, key, value), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + { + configurable: true, + enumerable: false, + value: value, + writable: true + }, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.equal(obj[key], value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.CreateMethodProperty(obj, 'foo', { value: 'baz' }); }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.CreateMethodProperty(function () {}, 'name', { value: 'baz' }); }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DefinePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DefinePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DefinePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var descriptor = { + configurable: true, + enumerable: false, + value: { foo: 'bar' }, + writable: true + }; + + st.equal(ES.DefinePropertyOrThrow(obj, key, descriptor), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + descriptor, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.deepEqual(obj[key], descriptor.value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { + ES.DefinePropertyOrThrow(obj, 'foo', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { + ES.DefinePropertyOrThrow(function () {}, 'name', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DeletePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DeletePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DeletePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = { 'the key': 42 }; + var key = 'the key'; + + st.equal(ES.DeletePropertyOrThrow(obj, key), true, 'deletes property successfully'); + st.equal(key in obj, false, 'key is no longer in the object'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.DeletePropertyOrThrow(obj, 'foo'); }, + TypeError, + 'nonconfigurable key can not be deleted' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.DeletePropertyOrThrow(function () {}, 'name'); }, + TypeError, + 'nonconfigurable function name can not be deleted' + ); + st.end(); + }); + + t.end(); + }); + + test('EnumerableOwnNames', { skip: skips && skips.EnumerableOwnNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { return ES.EnumerableOwnNames(O); }); + + t.deepEqual( + ES.EnumerableOwnNames(obj), + ['own'], + 'returns enumerable own names' + ); + + t.end(); + }); + + test('thisNumberValue', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.thisNumberValue(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.thisNumberValue(number), number, debug(number) + ' is its own thisNumberValue'); + var obj = Object(number); + t.equal(ES.thisNumberValue(obj), number, debug(obj) + ' is the boxed thisNumberValue'); + }); + + t.end(); + }); + + test('thisBooleanValue', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.thisBooleanValue(nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.booleans, function (boolean) { + t.equal(ES.thisBooleanValue(boolean), boolean, debug(boolean) + ' is its own thisBooleanValue'); + var obj = Object(boolean); + t.equal(ES.thisBooleanValue(obj), boolean, debug(obj) + ' is the boxed thisBooleanValue'); + }); + + t.end(); + }); + + test('thisStringValue', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.thisStringValue(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.thisStringValue(string), string, debug(string) + ' is its own thisStringValue'); + var obj = Object(string); + t.equal(ES.thisStringValue(obj), string, debug(obj) + ' is the boxed thisStringValue'); + }); + + t.end(); + }); + + test('thisTimeValue', function (t) { + forEach(v.primitives.concat(v.objects), function (nonDate) { + t['throws']( + function () { ES.thisTimeValue(nonDate); }, + TypeError, + debug(nonDate) + ' is not a Date' + ); + }); + + forEach(v.timestamps, function (timestamp) { + var date = new Date(timestamp); + + t.equal(ES.thisTimeValue(date), timestamp, debug(date) + ' is its own thisTimeValue'); + }); + + t.end(); + }); + + test('SetIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.SetIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.SetIntegrityLevel({}); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + var O = { a: 1 }; + t.test('sealed', { skip: !Object.preventExtensions || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'sealed'), true); + st['throws']( + function () { O.b = 2; }, + /^TypeError: (Cannot|Can't) add property b, object is not extensible$/, + 'sealing prevent new properties from being added' + ); + O.a = 2; + st.equal(O.a, 2, 'pre-frozen, existing properties are mutable'); + st.end(); + }); + + t.test('frozen', { skip: !Object.freeze || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'frozen'), true); + st['throws']( + function () { O.a = 3; }, + /^TypeError: Cannot assign to read only property 'a' of /, + 'freezing prevents existing properties from being mutated' + ); + st.end(); + }); + + t.end(); + }); + + test('TestIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.TestIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.TestIntegrityLevel({ a: 1 }); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'sealed'), false, 'basic object is not sealed'); + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'frozen'), false, 'basic object is not frozen'); + + t.test('preventExtensions', { skip: !Object.preventExtensions }, function (st) { + var o = Object.preventExtensions({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), false, 'nonextensible object is not sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'nonextensible object is not frozen'); + + var empty = Object.preventExtensions({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty nonextensible object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty nonextensible object is frozen'); + st.end(); + }); + + t.test('seal', { skip: !Object.seal }, function (st) { + var o = Object.seal({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'sealed object is not frozen'); + + var empty = Object.seal({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty sealed object is frozen'); + + st.end(); + }); + + t.test('freeze', { skip: !Object.freeze }, function (st) { + var o = Object.freeze({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), true, 'frozen object is frozen'); + + var empty = Object.freeze({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty frozen object is frozen'); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryHasInstance', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t.equal(ES.OrdinaryHasInstance(nonFunction, {}), false, debug(nonFunction) + ' is not callable'); + }); + + forEach(v.primitives, function (primitive) { + t.equal(ES.OrdinaryHasInstance(function () {}, primitive), false, debug(primitive) + ' is not an object'); + }); + + var C = function C() {}; + var D = function D() {}; + t.equal(ES.OrdinaryHasInstance(C, new C()), true, 'constructor function has an instance of itself'); + t.equal(ES.OrdinaryHasInstance(C, new D()), false, 'constructor/instance mismatch is false'); + t.equal(ES.OrdinaryHasInstance(D, new C()), false, 'instance/constructor mismatch is false'); + t.equal(ES.OrdinaryHasInstance(C, {}), false, 'plain object is not an instance of a constructor'); + t.equal(ES.OrdinaryHasInstance(Object, {}), true, 'plain object is an instance of Object'); + + t.end(); + }); + + test('OrdinaryHasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryHasProperty(primitive, ''); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryHasProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryHasProperty({ a: 1 }, 'a'), true, 'own property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'toString'), true, 'inherited property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'nope'), false, 'absent property is false'); + + t.end(); + }); + + test('InstanceofOperator', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.InstanceofOperator(primitive, function () {}); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.InstanceofOperator({}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not callable' + ); + }); + + var C = function C() {}; + var D = function D() {}; + + t.equal(ES.InstanceofOperator(new C(), C), true, 'constructor function has an instance of itself'); + t.equal(ES.InstanceofOperator(new D(), C), false, 'constructor/instance mismatch is false'); + t.equal(ES.InstanceofOperator(new C(), D), false, 'instance/constructor mismatch is false'); + t.equal(ES.InstanceofOperator({}, C), false, 'plain object is not an instance of a constructor'); + t.equal(ES.InstanceofOperator({}, Object), true, 'plain object is an instance of Object'); + + t.test('Symbol.hasInstance', { skip: !v.hasSymbols || !Symbol.hasInstance }, function (st) { + st.plan(4); + + var O = {}; + var C2 = function () {}; + st.equal(ES.InstanceofOperator(O, C2), false, 'O is not an instance of C2'); + + defineProperty(C2, Symbol.hasInstance, { + value: function (obj) { + st.equal(this, C2, 'hasInstance receiver is C2'); + st.equal(obj, O, 'hasInstance argument is O'); + + return {}; // testing coercion to boolean + } + }); + + st.equal(ES.InstanceofOperator(O, C2), true, 'O is now an instance of C2'); + + st.end(); + }); + + t.end(); + }); + + test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); + }); + + test('ValidateAndApplyPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (nonUndefinedPrimitive) { + t['throws']( + function () { ES.ValidateAndApplyPropertyDescriptor(nonUndefinedPrimitive, '', false, v.genericDescriptor(), v.genericDescriptor()); }, + TypeError, + 'O: ' + debug(nonUndefinedPrimitive) + ' is not undefined or an Object' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + nonBoolean, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'extensible: ' + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.primitives, function (primitive) { + // Desc must be a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + primitive, + v.genericDescriptor() + ); + }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + // current must be undefined or a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + v.genericDescriptor(), + primitive + ); + }, + TypeError, + 'current: ' + debug(primitive) + ' is not a Property Descriptor or undefined' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + // if O is an object, P must be a property key + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + {}, + nonPropertyKey, + false, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('current is undefined', function (st) { + var propertyKey = 'howdy'; + + st.test('generic descriptor', function (s2t) { + var generic = v.genericDescriptor(); + generic['[[Enumerable]]'] = true; + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, generic); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, generic), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, generic), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = undefined; + s2t.deepEqual(O, expected, 'generic descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('data descriptor', function (s2t) { + var data = v.dataDescriptor(); + data['[[Enumerable]]'] = true; + + var O = {}; + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, data), + true, + 'noop when O is undefined' + ); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, data), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, data), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = data['[[Value]]']; + s2t.deepEqual(O, expected, 'data descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('accessor descriptor', { skip: !defineProperty.oDP }, function (s2t) { + var count = 0; + var accessor = v.accessorDescriptor(); + accessor['[[Enumerable]]'] = true; + accessor['[[Get]]'] = function () { + count += 1; + return count; + }; + + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, accessor); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, accessor), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, accessor), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = accessor['[[Get]]']() + 1; + s2t.deepEqual(O, expected, 'accessor descriptor has been defined as an own accessor property'); + s2t.end(); + }); + + st.end(); + }); + + t.test('every field in Desc is absent', { skip: 'it is unclear if having no fields qualifies Desc to be a Property Descriptor' }); + + forEach([v.dataDescriptor, v.accessorDescriptor, v.mutatorDescriptor], function (getDescriptor) { + t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, 'property key', true, getDescriptor(), getDescriptor()), + true, + 'when Desc and current are the same, early return true' + ); + }); + + t.test('current is nonconfigurable', function (st) { + // note: these must not be generic descriptors, or else the algorithm returns an early true + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if Desc is configurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.enumerable(v.dataDescriptor()), + v.descriptors.nonEnumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is Enumerable and current is not' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.nonEnumerable(v.dataDescriptor()), + v.descriptors.enumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is not Enumerable and current is' + ); + + var descLackingEnumerable = v.accessorDescriptor(); + delete descLackingEnumerable['[[Enumerable]]']; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + descLackingEnumerable, + v.descriptors.enumerable(v.accessorDescriptor()) + ), + true, + 'not false if Desc lacks Enumerable' + ); + + st.end(); + }); + + t.test('Desc and current: one is a data descriptor, one is not', { skip: !defineProperty || !getOwnPropertyDescriptor }, function (st) { + // note: Desc must be configurable if current is nonconfigurable, to hit this branch + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.accessorDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if current (data) is nonconfigurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if current (not data) is nonconfigurable' + ); + + // one is data and one is not, + // // if current is data, convert to accessor + // // else convert to data + + var startsWithData = { + 'property key': 42 + }; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithData, + 'property key', + true, + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())) + ), + true, + 'operation is successful: current is data, Desc is accessor' + ); + var shouldBeAccessor = getOwnPropertyDescriptor(startsWithData, 'property key'); + st.equal(typeof shouldBeAccessor.get, 'function', 'has a getter'); + + var key = 'property key'; + var startsWithAccessor = {}; + defineProperty(startsWithAccessor, key, { + configurable: true, + enumerable: true, + get: function get() { return 42; } + }); + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithAccessor, + key, + true, + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor(42))) + ), + true, + 'operation is successful: current is accessor, Desc is data' + ); + var shouldBeData = getOwnPropertyDescriptor(startsWithAccessor, 'property key'); + st.deepEqual(shouldBeData, { configurable: true, enumerable: true, value: 42, writable: false }, 'is a data property'); + + st.end(); + }); + + t.test('Desc and current are both data descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.writable(v.dataDescriptor()), + v.descriptors.nonWritable(v.descriptors.nonConfigurable(v.dataDescriptor())) + ), + false, + 'false if frozen current and writable Desc' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable({ '[[Value]]': 42 }), + v.descriptors.nonWritable({ '[[Value]]': 7 }) + ), + false, + 'false if nonwritable current has a different value than Desc' + ); + + st.end(); + }); + + t.test('current is nonconfigurable; Desc and current are both accessor descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.mutatorDescriptor(), + v.descriptors.nonConfigurable(v.mutatorDescriptor()) + ), + false, + 'false if both Sets are not equal' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.accessorDescriptor(), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if both Gets are not equal' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryGetOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty(primitive, ''); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryGetOwnProperty({}, 'not in the object'), undefined, 'missing property yields undefined'); + t.equal(ES.OrdinaryGetOwnProperty({}, 'toString'), undefined, 'inherited non-own property yields undefined'); + + t.deepEqual( + ES.OrdinaryGetOwnProperty({ a: 1 }, 'a'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: true, + value: 1, + writable: true + }), + 'own assigned data property yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(/a/, 'lastIndex'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'regex lastIndex yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty([], 'length'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'array length yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(Object.prototype, 'toString'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: false, + value: Object.prototype.toString, + writable: true + }), + 'own non-enumerable data property yields expected descriptor' + ); + + t.test('ES5+', { skip: !defineProperty.oDP }, function (st) { + var O = {}; + defineProperty(O, 'foo', { + configurable: false, + enumerable: false, + value: O, + writable: true + }); + + st.deepEqual( + ES.OrdinaryGetOwnProperty(O, 'foo'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: O, + writable: true + }), + 'defined own property yields expected descriptor' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryDefineOwnProperty', { skip: !getOwnPropertyDescriptor }, function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty({}, nonPropertyKey, v.genericDescriptor()); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty(primitive, '', v.genericDescriptor()); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var O = {}; + var P = 'property key'; + var Desc = v.accessorDescriptor(); + t.equal( + ES.OrdinaryDefineOwnProperty(O, P, Desc), + true, + 'operation is successful' + ); + t.deepEqual( + getOwnPropertyDescriptor(O, P), + ES.FromPropertyDescriptor(ES.CompletePropertyDescriptor(Desc)), + 'expected property descriptor is defined' + ); + + t.end(); + }); + + test('ArrayCreate', function (t) { + forEach(v.nonIntegerNumbers.concat([-1]), function (nonIntegerNumber) { + t['throws']( + function () { ES.ArrayCreate(nonIntegerNumber); }, + TypeError, + 'length must be an integer number >= 0' + ); + }); + + t['throws']( + function () { ES.ArrayCreate(Math.pow(2, 32)); }, + RangeError, + 'length must be < 2**32' + ); + + t.deepEqual(ES.ArrayCreate(-0), [], 'length of -0 creates an empty array'); + t.deepEqual(ES.ArrayCreate(0), [], 'length of +0 creates an empty array'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(1), [,], 'length of 1 creates a sparse array of length 1'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(2), [,,], 'length of 2 creates a sparse array of length 2'); + + t.test('proto argument', { skip: !$setProto }, function (st) { + var fakeProto = { + push: { toString: function () { return 'not array push'; } } + }; + st.equal(ES.ArrayCreate(0, fakeProto).push, fakeProto.push, 'passing the proto argument works'); + st.end(); + }); + + t.end(); + }); + + test('ArraySetLength', function (t) { + forEach(v.primitives.concat(v.objects), function (nonArray) { + t['throws']( + function () { ES.ArraySetLength(nonArray, 0); }, + TypeError, + 'A: ' + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ArraySetLength([], primitive); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.test('making length nonwritable', { skip: !getOwnPropertyDescriptor }, function (st) { + var a = []; + ES.ArraySetLength(a, { '[[Writable]]': false }); + st.deepEqual( + getOwnPropertyDescriptor(a, 'length'), + { + configurable: false, + enumerable: false, + value: 0, + writable: false + }, + 'without a value, length becomes nonwritable' + ); + st.end(); + }); + + var arr = []; + ES.ArraySetLength(arr, { '[[Value]]': 7 }); + t.equal(arr.length, 7, 'array now has a length of 7'); + + t.end(); + }); + + test('CreateHTML', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.CreateHTML('', nonString, '', ''); }, + TypeError, + 'tag: ' + debug(nonString) + ' is not a String' + ); + t['throws']( + function () { ES.CreateHTML('', '', nonString, ''); }, + TypeError, + 'attribute: ' + debug(nonString) + ' is not a String' + ); + }); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + '' + ), + 'the string', + 'works with an empty string attribute value' + ); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + 'attr', + 'value "with quotes"' + ), + 'the string', + 'works with an attribute, and a value with quotes' + ); + + t.end(); + }); + + test('GetOwnPropertyKeys', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.GetOwnPropertyKeys(primitive, 'String'); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.GetOwnPropertyKeys({}, 'not string or symbol'); }, + TypeError, + 'Type: must be "String" or "Symbol"' + ); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var O = { a: 1 }; + O[Symbol.iterator] = true; + var s = Symbol('test'); + defineProperty(O, s, { enumerable: false, value: true }); + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'Symbol'), + [Symbol.iterator, s], + 'works with Symbols, enumerable or not' + ); + + st.end(); + }); + + t.test('non-enumerable names', { skip: !defineProperty.oDP }, function (st) { + var O = { a: 1 }; + defineProperty(O, 'b', { enumerable: false, value: 2 }); + if (v.hasSymbols) { + O[Symbol.iterator] = true; + } + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'String').sort(), + ['a', 'b'].sort(), + 'works with Strings, enumerable or not' + ); + + st.end(); + }); + + t.deepEqual( + ES.GetOwnPropertyKeys({ a: 1, b: 2 }, 'String').sort(), + ['a', 'b'].sort(), + 'works with enumerable keys' + ); + + t.end(); + }); + + test('SymbolDescriptiveString', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.SymbolDescriptiveString(nonSymbol); }, + TypeError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(ES.SymbolDescriptiveString(Symbol()), 'Symbol()', 'undefined description'); + st.equal(ES.SymbolDescriptiveString(Symbol('')), 'Symbol()', 'empty string description'); + st.equal(ES.SymbolDescriptiveString(Symbol.iterator), 'Symbol(Symbol.iterator)', 'well-known symbol'); + st.equal(ES.SymbolDescriptiveString(Symbol('foo')), 'Symbol(foo)', 'string description'); + + st.end(); + }); + + t.end(); + }); + + test('GetSubstitution', { skip: skips && skips.GetSubstitution }, function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + if (canDistinguishSparseFromUndefined || typeof nonString !== 'undefined') { + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + } + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); + }); + + test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); + }); + + test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); + }); + + test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); + }); + + var msPerSecond = 1e3; + var msPerMinute = 60 * msPerSecond; + var msPerHour = 60 * msPerMinute; + var msPerDay = 24 * msPerHour; + + test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); + }); + + test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); + }); + + test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); + }); + + test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); + }); + + test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); + }); + + test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); + }); + + test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); + }); + + test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); + }); + + test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); + }); + + test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); + }); + + test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); + }); + + test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); + }); + + test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); + }); + + test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + + t.end(); + }); + + test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); + }); + + test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); + }); + + test('ToDateString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.ToDateString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + t.equal(ES.ToDateString(NaN), 'Invalid Date', 'NaN becomes "Invalid Date"'); + var now = +new Date(); + t.equal(ES.ToDateString(now), Date(now), 'any timestamp becomes `Date(timestamp)`'); + t.end(); + }); + + test('CreateListFromArrayLike', function (t) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { ES.CreateListFromArrayLike(nonObject); }, + TypeError, + debug(nonObject) + ' is not an Object' + ); + }); + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.CreateListFromArrayLike({}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + t.deepEqual( + ES.CreateListFromArrayLike({ length: 2, 0: 'a', 1: 'b', 2: 'c' }), + ['a', 'b'], + 'arraylike stops at the length' + ); + + t.end(); + }); + + test('GetPrototypeFromConstructor', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(nonFunction, '%Array%'); }, + TypeError, + debug(nonFunction) + ' is not a constructor' + ); + }); + + forEach(arrowFns, function (arrowFn) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(arrowFn, '%Array%'); }, + TypeError, + debug(arrowFn) + ' is not a constructor' + ); + }); + + var f = function () {}; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + f.prototype, + 'function with normal `prototype` property returns it' + ); + forEach([true, 'foo', 42], function (truthyPrimitive) { + f.prototype = truthyPrimitive; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + Array.prototype, + 'function with non-object `prototype` property (' + debug(truthyPrimitive) + ') returns default intrinsic' + ); + }); + + t.end(); + }); + + var getNamelessFunction = function () { + var f = Object(function () {}); + try { + delete f.name; + } catch (e) { /**/ } + return f; + }; + + test('SetFunctionName', function (t) { + t.test('non-extensible function', { skip: !Object.preventExtensions }, function (st) { + var f = getNamelessFunction(); + Object.preventExtensions(f); + st['throws']( + function () { ES.SetFunctionName(f, ''); }, + TypeError, + 'throws on a non-extensible function' + ); + st.end(); + }); + + t.test('has an own name property', { skip: !functionsHaveNames }, function (st) { + st['throws']( + function () { ES.SetFunctionName(function g() {}, ''); }, + TypeError, + 'throws if function has an own `name` property' + ); + st.end(); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.SetFunctionName(getNamelessFunction(), nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Symbol or String' + ); + }); + + t.test('symbols', { skip: !v.hasSymbols || has(getNamelessFunction(), 'name') }, function (st) { + var pairs = [ + [Symbol(), ''], + [Symbol(undefined), ''], + [Symbol(null), '[null]'], + [Symbol(''), getInferredName ? '[]' : ''], + [Symbol.iterator, '[Symbol.iterator]'], + [Symbol('foo'), '[foo]'] + ]; + forEach(pairs, function (pair) { + var sym = pair[0]; + var desc = pair[1]; + var f = getNamelessFunction(); + ES.SetFunctionName(f, sym); + st.equal(f.name, desc, debug(sym) + ' yields a name of ' + debug(desc)); + }); + + st.end(); + }); + + var f = getNamelessFunction(); + t.test('when names are configurable', { skip: !functionsHaveConfigurableNames || has(f, 'name') }, function (st) { + // without prefix + st.notEqual(f.name, 'foo', 'precondition'); + ES.SetFunctionName(f, 'foo'); + st.equal(f.name, 'foo', 'function name is set without a prefix'); + + // with prefix + var g = getNamelessFunction(); + st.notEqual(g.name, 'pre- foo', 'precondition'); + ES.SetFunctionName(g, 'foo', 'pre-'); + st.equal(g.name, 'pre- foo', 'function name is set with a prefix'); + + st.end(); + }); + + t.end(); + }); +}; + +var es2016 = function ES2016(ES, ops, expectedMissing, skips) { + es2015(ES, ops, expectedMissing, skips); + + test('SameValueNonNumber', function (t) { + var willThrow = [ + [3, 4], + [NaN, 4], + [4, ''], + ['abc', true], + [{}, false] + ]; + forEach(willThrow, function (nums) { + t['throws'](function () { return ES.SameValueNonNumber.apply(ES, nums); }, TypeError, 'value must be same type and non-number'); + }); + + forEach(v.objects.concat(v.nonNumberPrimitives), function (val) { + t.equal(val === val, ES.SameValueNonNumber(val, val), debug(val) + ' is SameValueNonNumber to itself'); + }); + + t.end(); + }); + + test('IterableToArrayLike', { skip: skips && skips.IterableToArrayLike }, function (t) { + t.test('custom iterables', { skip: !v.hasSymbols }, function (st) { + var O = {}; + O[Symbol.iterator] = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + st.deepEqual( + ES.IterableToArrayLike(O), + [0, 1, 2, 3, 4], + 'Symbol.iterator method is called and values collected' + ); + + st.end(); + }); + + t.deepEqual(ES.IterableToArrayLike('abc'), ['a', 'b', 'c'], 'a string of code units spreads'); + t.deepEqual(ES.IterableToArrayLike('💩'), ['💩'], 'a string of code points spreads'); + t.deepEqual(ES.IterableToArrayLike('a💩c'), ['a', '💩', 'c'], 'a string of code points and units spreads'); + + var arr = [1, 2, 3]; + t.deepEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a similar array'); + t.notEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a different, but similar, array'); + + var O = {}; + t.equal(ES.IterableToArrayLike(O), O, 'a non-iterable non-array non-string object is returned directly'); + + t.end(); + }); + + test('OrdinaryGetPrototypeOf', function (t) { + t.test('values', { skip: !$getProto }, function (st) { + st.equal(ES.OrdinaryGetPrototypeOf([]), Array.prototype, 'array [[Prototype]] is Array.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf({}), Object.prototype, 'object [[Prototype]] is Object.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(/a/g), RegExp.prototype, 'regex [[Prototype]] is RegExp.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object('')), String.prototype, 'boxed string [[Prototype]] is String.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(42)), Number.prototype, 'boxed number [[Prototype]] is Number.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(true)), Boolean.prototype, 'boxed boolean [[Prototype]] is Boolean.prototype'); + if (v.hasSymbols) { + st.equal(ES.OrdinaryGetPrototypeOf(Object(Symbol.iterator)), Symbol.prototype, 'boxed symbol [[Prototype]] is Symbol.prototype'); + } + st.end(); + }); + + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetPrototypeOf(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + t.end(); + }); + + test('OrdinarySetPrototypeOf', { skip: !$getProto || !$setProto }, function (t) { + var a = []; + var proto = {}; + + t.equal(ES.OrdinaryGetPrototypeOf(a), Array.prototype, 'precondition'); + t.equal(ES.OrdinarySetPrototypeOf(a, proto), true, 'setting prototype is successful'); + t.equal(ES.OrdinaryGetPrototypeOf(a), proto, 'postcondition'); + + t.end(); + }); +}; + +var es2017 = function ES2017(ES, ops, expectedMissing, skips) { + es2016(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnNames: true, + IterableToArrayLike: true + })); + + test('ToIndex', function (t) { + t.ok(is(ES.ToIndex(), 0), 'no value gives 0'); + t.ok(is(ES.ToIndex(undefined), 0), 'undefined value gives 0'); + + t['throws'](function () { ES.ToIndex(-1); }, RangeError, 'negative numbers throw'); + + t['throws'](function () { ES.ToIndex(MAX_SAFE_INTEGER + 1); }, RangeError, 'too large numbers throw'); + + t.equal(ES.ToIndex(3), 3, 'numbers work'); + t.equal(ES.ToIndex(v.valueOfOnlyObject), 4, 'coercible objects are coerced'); + + t.end(); + }); + + test('EnumerableOwnProperties', { skip: skips && skips.EnumerableOwnProperties }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnProperties(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IterableToList', function (t) { + var customIterator = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + + t.deepEqual( + ES.IterableToList({}, customIterator), + [0, 1, 2, 3, 4], + 'iterator method is called and values collected' + ); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.deepEqual(ES.IterableToList('abc', String.prototype[Symbol.iterator]), ['a', 'b', 'c'], 'a string of code units spreads'); + st.deepEqual(ES.IterableToList('☃', String.prototype[Symbol.iterator]), ['☃'], 'a string of code points spreads'); + + var arr = [1, 2, 3]; + st.deepEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a similar array'); + st.notEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a different, but similar, array'); + + st.end(); + }); + + t['throws']( + function () { ES.IterableToList({}, void 0); }, + TypeError, + 'non-function iterator method' + ); + + t.end(); + }); +}; + +var es2018 = function ES2018(ES, ops, expectedMissing, skips) { + es2017(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnProperties: true, + GetSubstitution: true, + IsPropertyDescriptor: true + })); + + test('thisSymbolValue', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.thisSymbolValue(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('no native Symbols', { skip: v.hasSymbols }, function (st) { + forEach(v.objects.concat(v.primitives), function (value) { + st['throws']( + function () { ES.thisSymbolValue(value); }, + SyntaxError, + 'Symbols are not supported' + ); + }); + st.end(); + }); + + t.test('symbol values', { skip: !v.hasSymbols }, function (st) { + forEach(v.symbols, function (symbol) { + st.equal(ES.thisSymbolValue(symbol), symbol, 'Symbol value of ' + debug(symbol) + ' is same symbol'); + + st.equal( + ES.thisSymbolValue(Object(symbol)), + symbol, + 'Symbol value of ' + debug(Object(symbol)) + ' is ' + debug(symbol) + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('IsStringPrefix', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.IsStringPrefix(nonString, 'a'); }, + TypeError, + 'first arg: ' + debug(nonString) + ' is not a string' + ); + t['throws']( + function () { ES.IsStringPrefix('a', nonString); }, + TypeError, + 'second arg: ' + debug(nonString) + ' is not a string' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.IsStringPrefix(string, string), true, debug(string) + ' is a prefix of itself'); + + t.equal(ES.IsStringPrefix('', string), true, 'the empty string is a prefix of everything'); + }); + + t.equal(ES.IsStringPrefix('abc', 'abcd'), true, '"abc" is a prefix of "abcd"'); + t.equal(ES.IsStringPrefix('abcd', 'abc'), false, '"abcd" is not a prefix of "abc"'); + + t.equal(ES.IsStringPrefix('a', 'bc'), false, '"a" is not a prefix of "bc"'); + + t.end(); + }); + + test('NumberToString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.NumberToString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.NumberToString(number), String(number), debug(number) + ' stringifies to ' + number); + }); + + t.end(); + }); + + test('CopyDataProperties', function (t) { + t.test('first argument: target', function (st) { + forEach(v.primitives, function (primitive) { + st['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + st.end(); + }); + + t.test('second argument: source', function (st) { + var frozenTarget = Object.freeze ? Object.freeze({}) : {}; + forEach(v.nullPrimitives, function (nullish) { + st.equal( + ES.CopyDataProperties(frozenTarget, nullish, []), + frozenTarget, + debug(nullish) + ' "source" yields identical, unmodified target' + ); + }); + + forEach(v.nonNullPrimitives, function (objectCoercible) { + var target = {}; + var result = ES.CopyDataProperties(target, objectCoercible, []); + st.equal(result, target, 'result === target'); + st.deepEqual(keys(result), keys(Object(objectCoercible)), 'target ends up with keys of ' + debug(objectCoercible)); + }); + + st.test('enumerable accessor property', { skip: !defineProperty.oDP }, function (s2t) { + var target = {}; + var source = {}; + defineProperty(source, 'a', { + enumerable: true, + get: function () { return 42; } + }); + var result = ES.CopyDataProperties(target, source, []); + s2t.equal(result, target, 'result === target'); + s2t.deepEqual(result, { a: 42 }, 'target ends up with enumerable accessor of source'); + s2t.end(); + }); + + st.end(); + }); + + t.test('third argument: excludedItems', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, [nonPropertyKey]); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + var result = ES.CopyDataProperties({}, { a: 1, b: 2, c: 3 }, ['b']); + st.deepEqual(keys(result).sort(), ['a', 'c'].sort(), 'excluded string keys are excluded'); + + st.test('excluding symbols', { skip: !v.hasSymbols }, function (s2t) { + var source = {}; + forEach(v.symbols, function (symbol) { + source[symbol] = true; + }); + + var includedSymbols = v.symbols.slice(1); + var excludedSymbols = v.symbols.slice(0, 1); + var target = ES.CopyDataProperties({}, source, excludedSymbols); + + forEach(includedSymbols, function (symbol) { + s2t.equal(has(target, symbol), true, debug(symbol) + ' is included'); + }); + + forEach(excludedSymbols, function (symbol) { + s2t.equal(has(target, symbol), false, debug(symbol) + ' is excluded'); + }); + + s2t.end(); + }); + + st.end(); + }); + + t.end(); + }); + + test('PromiseResolve', function (t) { + t.test('Promises unsupported', { skip: typeof Promise === 'function' }, function (st) { + st['throws']( + function () { ES.PromiseResolve(); }, + SyntaxError, + 'Promises are not supported' + ); + st.end(); + }); + + t.test('Promises supported', { skip: typeof Promise !== 'function' }, function (st) { + st.plan(2); + + var a = {}; + var b = {}; + var fulfilled = Promise.resolve(a); + var rejected = Promise.reject(b); + + ES.PromiseResolve(Promise, fulfilled).then(function (x) { + st.equal(x, a, 'fulfilled promise resolves to fulfilled'); + }); + + ES.PromiseResolve(Promise, rejected)['catch'](function (e) { + st.equal(e, b, 'rejected promise resolves to rejected'); + }); + }); + + t.end(); + }); + + test('EnumerableOwnPropertyNames', { skip: skips && skips.EnumerableOwnPropertyNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnPropertyNames(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IsPromise', { skip: typeof Promise !== 'function' }, function (t) { + forEach(v.objects.concat(v.primitives), function (nonPromise) { + t.equal(ES.IsPromise(nonPromise), false, debug(nonPromise) + ' is not a Promise'); + }); + + var thenable = { then: Promise.prototype.then }; + t.equal(ES.IsPromise(thenable), false, 'generic thenable is not a Promise'); + + t.equal(ES.IsPromise(Promise.resolve()), true, 'Promise is a Promise'); + + t.end(); + }); + + test('GetSubstitution (ES2018+)', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], undefined, ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], undefined, ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], undefined, nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], undefined, ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], undefined, ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, undefined, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], undefined, ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('DateString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.DateString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + t.equal(ES.DateString(Date.UTC(2019, 8, 10, 7, 8, 9)), 'Tue Sep 10 2019'); + t.equal(ES.DateString(Date.UTC(2016, 1, 29, 7, 8, 9)), 'Mon Feb 29 2016'); // leap day + t.end(); + }); + + test('TimeString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.TimeString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + var tv = Date.UTC(2019, 8, 10, 7, 8, 9); + t.equal(ES.TimeString(tv), '07:08:09 GMT'); + t.end(); + }); +}; + +var es2019 = function ES2018(ES, ops, expectedMissing, skips) { + es2018(ES, ops, expectedMissing, assign({}, skips, { + })); + + test('AddEntriesFromIterable', function (t) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, undefined, function () {}); }, + TypeError, + 'iterable must not be undefined' + ); + t['throws']( + function () { ES.AddEntriesFromIterable({}, null, function () {}); }, + TypeError, + 'iterable must not be null' + ); + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, {}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.plan(4); + + var O = {}; + st.equal(ES.AddEntriesFromIterable(O, [], function () {}), O, 'returns the target'); + + var adder = function (key, value) { + st.equal(this, O, 'adder gets proper receiver'); + st.equal(key, 0, 'k is key'); + st.equal(value, 'a', 'v is value'); + }; + ES.AddEntriesFromIterable(O, ['a'].entries(), adder); + + st.end(); + }); + + t.end(); + }); + + test('FlattenIntoArray', function (t) { + t.test('no mapper function', function (st) { + var testDepth = function testDepth(tt, depth, expected) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, depth); + tt.deepEqual(a, expected, 'depth: ' + depth); + }; + + testDepth(st, 1, [1, 2, [3], 4, [[[5]]]]); + testDepth(st, 2, [1, 2, 3, 4, [[5]]]); + testDepth(st, 3, [1, 2, 3, 4, [5]]); + testDepth(st, 4, [1, 2, 3, 4, 5]); + testDepth(st, Infinity, [1, 2, 3, 4, 5]); + st.end(); + }); + + t.test('mapper function', function (st) { + var testMapper = function testMapper(tt, mapper, expected, thisArg) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, 1, mapper, thisArg); + tt.deepEqual(a, expected); + }; + + var double = function double(x) { + return typeof x === 'number' ? 2 * x : x; + }; + testMapper( + st, + double, + [1, 4, [3], 8, [[[5]]]] + ); + var receiver = hasStrictMode ? 42 : Object(42); + testMapper( + st, + function (x) { return [this, double(x)]; }, + [receiver, [1], receiver, 4, receiver, [[3]], receiver, [], receiver, 8, receiver, [[[[5]]]]], + 42 + ); + st.end(); + }); + + t.end(); + }); + + test('TrimString', function (t) { + t.test('non-object string', function (st) { + forEach(v.nullPrimitives, function (nullish) { + st['throws']( + function () { ES.TrimString(nullish); }, + debug(nullish) + ' is not an Object' + ); + }); + st.end(); + }); + + var string = ' \n abc \n '; + t.equal(ES.TrimString(string, 'start'), string.slice(string.indexOf('a'))); + t.equal(ES.TrimString(string, 'end'), string.slice(0, string.lastIndexOf('c') + 1)); + t.equal(ES.TrimString(string, 'start+end'), string.slice(string.indexOf('a'), string.lastIndexOf('c') + 1)); + + t.end(); + }); +}; + +module.exports = { + es2015: es2015, + es2016: es2016, + es2017: es2017, + es2018: es2018, + es2019: es2019 +}; diff --git a/node_modules/string.prototype.trimend/package.json b/node_modules/string.prototype.trimend/package.json new file mode 100644 index 0000000..d8bd839 --- /dev/null +++ b/node_modules/string.prototype.trimend/package.json @@ -0,0 +1,121 @@ +{ + "_from": "string.prototype.trimend@^1.0.1", + "_id": "string.prototype.trimend@1.0.1", + "_inBundle": false, + "_integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "_location": "/string.prototype.trimend", + "_phantomChildren": { + "es-to-primitive": "1.2.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "has-symbols": "1.0.1", + "is-callable": "1.2.2", + "is-regex": "1.1.1", + "object-inspect": "1.8.0", + "object-keys": "1.1.1", + "object.assign": "4.1.1", + "string.prototype.trimend": "1.0.1", + "string.prototype.trimstart": "1.0.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "string.prototype.trimend@^1.0.1", + "name": "string.prototype.trimend", + "escapedName": "string.prototype.trimend", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "_shasum": "85812a6b847ac002270f5808146064c995fb6913", + "_spec": "string.prototype.trimend@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/es-shims/String.prototype.trimEnd/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + { + "name": "Khaled Al-Ansari", + "email": "khaledelansari@gmail.com" + } + ], + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "deprecated": false, + "description": "ES2019 spec-compliant String.prototype.trimEnd shim.", + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^16.0.0", + "aud": "^1.1.0", + "auto-changelog": "^1.16.4", + "eslint": "^6.8.0", + "functions-have-names": "^1.2.1", + "tape": "^5.0.0-next.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/es-shims/String.prototype.trimEnd#readme", + "keywords": [ + "es6", + "es7", + "es8", + "javascript", + "prototype", + "polyfill", + "utility", + "trim", + "trimLeft", + "trimRight", + "trimStart", + "trimEnd", + "tc39" + ], + "license": "MIT", + "main": "index.js", + "name": "string.prototype.trimend", + "repository": { + "type": "git", + "url": "git://github.com/es-shims/String.prototype.trimEnd.git" + }, + "scripts": { + "lint": "eslint .", + "posttest": "npx aud --production", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "pretest": "npm run lint && es-shim-api --bound", + "test": "npm run tests-only", + "test:module": "node test", + "test:shimmed": "node test/shimmed", + "tests-only": "npm run --silent test:shimmed && npm run --silent test:module", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "version": "1.0.1" +} diff --git a/node_modules/string.prototype.trimend/polyfill.js b/node_modules/string.prototype.trimend/polyfill.js new file mode 100644 index 0000000..0fa4f70 --- /dev/null +++ b/node_modules/string.prototype.trimend/polyfill.js @@ -0,0 +1,15 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = function getPolyfill() { + if (!String.prototype.trimEnd && !String.prototype.trimRight) { + return implementation; + } + var zeroWidthSpace = '\u200b'; + var trimmed = zeroWidthSpace.trimEnd ? zeroWidthSpace.trimEnd() : zeroWidthSpace.trimRight(); + if (trimmed !== zeroWidthSpace) { + return implementation; + } + return String.prototype.trimEnd || String.prototype.trimRight; +}; diff --git a/node_modules/string.prototype.trimend/shim.js b/node_modules/string.prototype.trimend/shim.js new file mode 100644 index 0000000..5a8f477 --- /dev/null +++ b/node_modules/string.prototype.trimend/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var define = require('define-properties'); +var getPolyfill = require('./polyfill'); + +module.exports = function shimTrimEnd() { + var polyfill = getPolyfill(); + define( + String.prototype, + { trimEnd: polyfill }, + { trimEnd: function () { return String.prototype.trimEnd !== polyfill; } } + ); + return polyfill; +}; diff --git a/node_modules/string.prototype.trimend/test/index.js b/node_modules/string.prototype.trimend/test/index.js new file mode 100644 index 0000000..2ee8f67 --- /dev/null +++ b/node_modules/string.prototype.trimend/test/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var trimEnd = require('../'); +var test = require('tape'); +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('bad array/this value', function (st) { + st['throws'](function () { trimEnd(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { trimEnd(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(trimEnd, t); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/test/shimmed.js b/node_modules/string.prototype.trimend/test/shimmed.js new file mode 100644 index 0000000..3ab9860 --- /dev/null +++ b/node_modules/string.prototype.trimend/test/shimmed.js @@ -0,0 +1,37 @@ +'use strict'; + +var trimEnd = require('../'); +trimEnd.shim(); + +var runTests = require('./tests'); + +var test = require('tape'); +var defineProperties = require('define-properties'); +var bind = require('function-bind'); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names')(); + +test('shimmed', function (t) { + t.equal(String.prototype.trimEnd.length, 0, 'String#trimEnd has a length of 0'); + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal((/^(?:trimRight|trimEnd)$/).test(String.prototype.trimEnd.name), true, 'String#trimEnd has name "trimRight" or "trimEnd"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(String.prototype, 'trimEnd'), 'String#trimEnd is not enumerable'); + et.end(); + }); + + var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); + + t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) { + st['throws'](function () { return trimEnd(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return trimEnd(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(bind.call(Function.call, String.prototype.trimEnd), t); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimend/test/tests.js b/node_modules/string.prototype.trimend/test/tests.js new file mode 100644 index 0000000..ce00554 --- /dev/null +++ b/node_modules/string.prototype.trimend/test/tests.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function (trimEnd, t) { + t.test('normal cases', function (st) { + st.equal(trimEnd(' \t\na \t\n'), ' \t\na', 'strips whitespace off the left side'); + st.equal(trimEnd('a'), 'a', 'noop when no whitespace'); + + var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + st.equal(trimEnd(allWhitespaceChars + 'a' + allWhitespaceChars), allWhitespaceChars + 'a', 'all expected whitespace chars are trimmed'); + + st.end(); + }); + + // see https://codeblog.jonskeet.uk/2014/12/01/when-is-an-identifier-not-an-identifier-attack-of-the-mongolian-vowel-separator/ + var mongolianVowelSeparator = '\u180E'; + t.test('unicode >= 4 && < 6.3', { skip: !(/^\s$/).test(mongolianVowelSeparator) }, function (st) { + st.equal(trimEnd(mongolianVowelSeparator + 'a' + mongolianVowelSeparator), mongolianVowelSeparator + 'a', 'mongolian vowel separator is whitespace'); + st.end(); + }); + + t.test('zero-width spaces', function (st) { + var zeroWidth = '\u200b'; + st.equal(trimEnd(zeroWidth), zeroWidth, 'zero width space does not trim'); + st.end(); + }); +}; diff --git a/node_modules/string.prototype.trimstart/.editorconfig b/node_modules/string.prototype.trimstart/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/string.prototype.trimstart/.eslintrc b/node_modules/string.prototype.trimstart/.eslintrc new file mode 100644 index 0000000..54af451 --- /dev/null +++ b/node_modules/string.prototype.trimstart/.eslintrc @@ -0,0 +1,15 @@ +{ + "root": true, + + "extends": "@ljharb", + + "overrides": [ + { + "files": "test/**", + "rules": { + "id-length": 0, + "no-invalid-this": 1, + }, + }, + ], +} diff --git a/node_modules/string.prototype.trimstart/.github/workflows/rebase.yml b/node_modules/string.prototype.trimstart/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/string.prototype.trimstart/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/string.prototype.trimstart/.travis.yml b/node_modules/string.prototype.trimstart/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/string.prototype.trimstart/CHANGELOG.md b/node_modules/string.prototype.trimstart/CHANGELOG.md new file mode 100644 index 0000000..b0d6c1a --- /dev/null +++ b/node_modules/string.prototype.trimstart/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.1](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.0...v1.0.1) - 2020-04-09 + +### Commits + +- [meta] add some missing repo metadata [`3385da3`](https://github.com/es-shims/String.prototype.trimStart/commit/3385da3bbb87819de11a869981ca954887a6a092) +- [Dev Deps] update `auto-changelog` [`879377d`](https://github.com/es-shims/String.prototype.trimStart/commit/879377df9c1ff97d8f0b3eac800683f1d68a304c) + +## [v1.0.0](https://github.com/es-shims/String.prototype.trimStart/compare/v0.1.0...v1.0.0) - 2020-03-30 + +### Commits + +- [Breaking] convert to es-shim API [`970922c`](https://github.com/es-shims/String.prototype.trimStart/commit/970922c494c78b033c351c77f61a8aefd49c30d9) +- [meta] add `auto-changelog` [`ff30c09`](https://github.com/es-shims/String.prototype.trimStart/commit/ff30c0996289113d2c3dbbfca7e280ff151bf36d) +- [meta] update readme [`816291d`](https://github.com/es-shims/String.prototype.trimStart/commit/816291d01e0eaf85da9b732c179cfb2454bd282e) +- [Tests] add `npm run lint` [`3341104`](https://github.com/es-shims/String.prototype.trimStart/commit/3341104450bc6ac84f3b70a6d6c0fbeb4df5131e) +- Only apps should have lockfiles [`f008df7`](https://github.com/es-shims/String.prototype.trimStart/commit/f008df73fbf3dcf8dfad6d5cad86de7050d0ae09) +- [actions] add automatic rebasing / merge commit blocking [`e5ba35c`](https://github.com/es-shims/String.prototype.trimStart/commit/e5ba35c1a14fcf652336cc9c4be49d232981161e) +- [Tests] use shared travis-ci configs [`46516b1`](https://github.com/es-shims/String.prototype.trimStart/commit/46516b137a8c07ed5807d751bd61199688ef9baa) +- [meta] add `funding` field [`34ae856`](https://github.com/es-shims/String.prototype.trimStart/commit/34ae8563f115bd4a5e5f5d2d786c0fa0a420fa2a) +- [meta] fix non-updated version number [`3b0e262`](https://github.com/es-shims/String.prototype.trimStart/commit/3b0e262e2f4eeee2e1b99fe890f8ca17bed8f2fd) + +## [v0.1.0](https://github.com/es-shims/String.prototype.trimStart/compare/v0.0.1...v0.1.0) - 2017-12-19 + +### Commits + +- updated README [`ab2f6ac`](https://github.com/es-shims/String.prototype.trimStart/commit/ab2f6ac8813ed336a0f2dc3aa8cdb52f4d52814b) + +## v0.0.1 - 2017-12-19 + +### Commits + +- finished polyfill [`1c7ca20`](https://github.com/es-shims/String.prototype.trimStart/commit/1c7ca2043e3383b6e743870bc622ad4a38477147) +- created README file: [`192ecad`](https://github.com/es-shims/String.prototype.trimStart/commit/192ecaded4e0d5baaa65cd41e590b8d837520d44) +- Initial commit [`14044f8`](https://github.com/es-shims/String.prototype.trimStart/commit/14044f8a0fe1d155fe7403a8327bdbaf135da2d6) +- updated README [`d4fb6be`](https://github.com/es-shims/String.prototype.trimStart/commit/d4fb6be15455dd68fc4b306bee1d30dd4afc96e7) diff --git a/node_modules/string.prototype.trimstart/LICENSE b/node_modules/string.prototype.trimstart/LICENSE new file mode 100644 index 0000000..e48a1b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Khaled Al-Ansari + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/string.prototype.trimstart/README.md b/node_modules/string.prototype.trimstart/README.md new file mode 100644 index 0000000..4c6215f --- /dev/null +++ b/node_modules/string.prototype.trimstart/README.md @@ -0,0 +1,47 @@ +String.prototype.trimStart [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +An ES2019-spec-compliant `String.prototype.trimStart` shim. Invoke its "shim" method to shim `String.prototype.trimStart` if it is unavailable. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s. + +Most common usage: +```js +var trimStart = require('string.prototype.trimstart'); + +assert(trimStart(' \t\na \t\n') === 'a \t\n'); + +if (!String.prototype.trimStart) { + trimStart.shim(); +} + +assert(trimStart(' \t\na \t\n') === ' \t\na \t\n'.trimStart()); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.com/package/string.prototype.trimstart +[npm-version-svg]: http://vb.teelaun.ch/es-shims/String.prototype.trimStart.svg +[travis-svg]: https://travis-ci.org/es-shims/String.prototype.trimStart.svg +[travis-url]: https://travis-ci.org/es-shims/String.prototype.trimStart +[deps-svg]: https://david-dm.org/es-shims/String.prototype.trimStart.svg +[deps-url]: https://david-dm.org/es-shims/String.prototype.trimStart +[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimStart/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimStart#info=devDependencies +[testling-svg]: https://ci.testling.com/es-shims/String.prototype.trimStart.png +[testling-url]: https://ci.testling.com/es-shims/String.prototype.trimStart +[npm-badge-png]: https://nodei.co/npm/string.prototype.trimstart.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/string.prototype.trimstart.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/string.prototype.trimstart.svg +[downloads-url]: http://npm-stat.com/charts.html?package=string.prototype.trimstart diff --git a/node_modules/string.prototype.trimstart/auto.js b/node_modules/string.prototype.trimstart/auto.js new file mode 100644 index 0000000..8ebf606 --- /dev/null +++ b/node_modules/string.prototype.trimstart/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/string.prototype.trimstart/implementation.js b/node_modules/string.prototype.trimstart/implementation.js new file mode 100644 index 0000000..484b787 --- /dev/null +++ b/node_modules/string.prototype.trimstart/implementation.js @@ -0,0 +1,12 @@ +'use strict'; + +var callBind = require('es-abstract/helpers/callBind'); +var replace = callBind(String.prototype.replace); + +/* eslint-disable no-control-regex */ +var startWhitespace = /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/; +/* eslint-enable no-control-regex */ + +module.exports = function trimStart() { + return replace(this, startWhitespace, ''); +}; diff --git a/node_modules/string.prototype.trimstart/index.js b/node_modules/string.prototype.trimstart/index.js new file mode 100644 index 0000000..3232160 --- /dev/null +++ b/node_modules/string.prototype.trimstart/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBind = require('es-abstract/helpers/callBind'); +var define = require('define-properties'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var bound = callBind(getPolyfill()); + +define(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.editorconfig b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.editorconfig new file mode 100644 index 0000000..eaa2141 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintignore b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintrc b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintrc new file mode 100644 index 0000000..1bac5b7 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.eslintrc @@ -0,0 +1,66 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + }, + + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 4], + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "new-cap": 0, + "no-extra-parens": 1, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "operations/*", + "rules": { + "max-lines": 0, + }, + }, + { + "files": "operations/*.js", + "parserOptions": { + "ecmaVersion": 2020, + }, + "rules": { + "no-console": 0, + "no-multi-str": 0, + }, + }, + { + "files": "operations/getOps.js", + "rules": { + "no-console": 0, + "no-process-exit": 0, + }, + }, + { + "files": "test/**", + "rules": { + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": 0, + "max-statements-per-line": [2, { "max": 3 }], + "max-statements": 0, + "no-implicit-coercion": 0, + "no-invalid-this": 1, + "object-curly-newline": 0, + "prefer-regex-literals": 0, + }, + }, + ], +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.gitattributes b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.gitattributes new file mode 100644 index 0000000..0b600dc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.gitattributes @@ -0,0 +1,472 @@ +2015/AbstractRelationalComparison.js spackled linguist-generated=true +2015/DateFromTime.js spackled linguist-generated=true +2015/Day.js spackled linguist-generated=true +2015/DayFromYear.js spackled linguist-generated=true +2015/DayWithinYear.js spackled linguist-generated=true +2015/DaysInYear.js spackled linguist-generated=true +2015/HourFromTime.js spackled linguist-generated=true +2015/InLeapYear.js spackled linguist-generated=true +2015/IsCallable.js spackled linguist-generated=true +2015/IsPropertyDescriptor.js spackled linguist-generated=true +2015/MakeDate.js spackled linguist-generated=true +2015/MakeDay.js spackled linguist-generated=true +2015/MakeTime.js spackled linguist-generated=true +2015/MinFromTime.js spackled linguist-generated=true +2015/MonthFromTime.js spackled linguist-generated=true +2015/SameValue.js spackled linguist-generated=true +2015/SecFromTime.js spackled linguist-generated=true +2015/StrictEqualityComparison.js spackled linguist-generated=true +2015/TimeClip.js spackled linguist-generated=true +2015/TimeFromYear.js spackled linguist-generated=true +2015/TimeWithinDay.js spackled linguist-generated=true +2015/ToBoolean.js spackled linguist-generated=true +2015/ToInt32.js spackled linguist-generated=true +2015/ToPropertyDescriptor.js spackled linguist-generated=true +2015/ToUint16.js spackled linguist-generated=true +2015/ToUint32.js spackled linguist-generated=true +2015/WeekDay.js spackled linguist-generated=true +2015/YearFromTime.js spackled linguist-generated=true +2015/modulo.js spackled linguist-generated=true +2015/msFromTime.js spackled linguist-generated=true +2016/AbstractEqualityComparison.js spackled linguist-generated=true +2016/AbstractRelationalComparison.js spackled linguist-generated=true +2016/AdvanceStringIndex.js spackled linguist-generated=true +2016/ArrayCreate.js spackled linguist-generated=true +2016/ArraySetLength.js spackled linguist-generated=true +2016/ArraySpeciesCreate.js spackled linguist-generated=true +2016/Call.js spackled linguist-generated=true +2016/CanonicalNumericIndexString.js spackled linguist-generated=true +2016/CompletePropertyDescriptor.js spackled linguist-generated=true +2016/CreateDataProperty.js spackled linguist-generated=true +2016/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2016/CreateHTML.js spackled linguist-generated=true +2016/CreateIterResultObject.js spackled linguist-generated=true +2016/CreateListFromArrayLike.js spackled linguist-generated=true +2016/CreateMethodProperty.js spackled linguist-generated=true +2016/DateFromTime.js spackled linguist-generated=true +2016/Day.js spackled linguist-generated=true +2016/DayFromYear.js spackled linguist-generated=true +2016/DayWithinYear.js spackled linguist-generated=true +2016/DaysInYear.js spackled linguist-generated=true +2016/DefinePropertyOrThrow.js spackled linguist-generated=true +2016/DeletePropertyOrThrow.js spackled linguist-generated=true +2016/EnumerableOwnNames.js spackled linguist-generated=true +2016/FromPropertyDescriptor.js spackled linguist-generated=true +2016/Get.js spackled linguist-generated=true +2016/GetIterator.js spackled linguist-generated=true +2016/GetMethod.js spackled linguist-generated=true +2016/GetOwnPropertyKeys.js spackled linguist-generated=true +2016/GetPrototypeFromConstructor.js spackled linguist-generated=true +2016/GetSubstitution.js spackled linguist-generated=true +2016/GetV.js spackled linguist-generated=true +2016/HasOwnProperty.js spackled linguist-generated=true +2016/HasProperty.js spackled linguist-generated=true +2016/HourFromTime.js spackled linguist-generated=true +2016/InLeapYear.js spackled linguist-generated=true +2016/InstanceofOperator.js spackled linguist-generated=true +2016/Invoke.js spackled linguist-generated=true +2016/IsAccessorDescriptor.js spackled linguist-generated=true +2016/IsArray.js spackled linguist-generated=true +2016/IsCallable.js spackled linguist-generated=true +2016/IsConcatSpreadable.js spackled linguist-generated=true +2016/IsConstructor.js spackled linguist-generated=true +2016/IsDataDescriptor.js spackled linguist-generated=true +2016/IsExtensible.js spackled linguist-generated=true +2016/IsGenericDescriptor.js spackled linguist-generated=true +2016/IsInteger.js spackled linguist-generated=true +2016/IsPromise.js spackled linguist-generated=true +2016/IsPropertyDescriptor.js spackled linguist-generated=true +2016/IsPropertyKey.js spackled linguist-generated=true +2016/IsRegExp.js spackled linguist-generated=true +2016/IteratorClose.js spackled linguist-generated=true +2016/IteratorComplete.js spackled linguist-generated=true +2016/IteratorNext.js spackled linguist-generated=true +2016/IteratorStep.js spackled linguist-generated=true +2016/IteratorValue.js spackled linguist-generated=true +2016/MakeDate.js spackled linguist-generated=true +2016/MakeDay.js spackled linguist-generated=true +2016/MakeTime.js spackled linguist-generated=true +2016/MinFromTime.js spackled linguist-generated=true +2016/MonthFromTime.js spackled linguist-generated=true +2016/ObjectCreate.js spackled linguist-generated=true +2016/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2016/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2016/OrdinaryHasInstance.js spackled linguist-generated=true +2016/OrdinaryHasProperty.js spackled linguist-generated=true +2016/RegExpExec.js spackled linguist-generated=true +2016/RequireObjectCoercible.js spackled linguist-generated=true +2016/SameValue.js spackled linguist-generated=true +2016/SameValueZero.js spackled linguist-generated=true +2016/SecFromTime.js spackled linguist-generated=true +2016/Set.js spackled linguist-generated=true +2016/SetFunctionName.js spackled linguist-generated=true +2016/SetIntegrityLevel.js spackled linguist-generated=true +2016/SpeciesConstructor.js spackled linguist-generated=true +2016/StrictEqualityComparison.js spackled linguist-generated=true +2016/SymbolDescriptiveString.js spackled linguist-generated=true +2016/TestIntegrityLevel.js spackled linguist-generated=true +2016/TimeClip.js spackled linguist-generated=true +2016/TimeFromYear.js spackled linguist-generated=true +2016/TimeWithinDay.js spackled linguist-generated=true +2016/ToBoolean.js spackled linguist-generated=true +2016/ToDateString.js spackled linguist-generated=true +2016/ToInt16.js spackled linguist-generated=true +2016/ToInt32.js spackled linguist-generated=true +2016/ToInt8.js spackled linguist-generated=true +2016/ToInteger.js spackled linguist-generated=true +2016/ToLength.js spackled linguist-generated=true +2016/ToNumber.js spackled linguist-generated=true +2016/ToObject.js spackled linguist-generated=true +2016/ToPrimitive.js spackled linguist-generated=true +2016/ToPropertyDescriptor.js spackled linguist-generated=true +2016/ToPropertyKey.js spackled linguist-generated=true +2016/ToString.js spackled linguist-generated=true +2016/ToUint16.js spackled linguist-generated=true +2016/ToUint32.js spackled linguist-generated=true +2016/ToUint8.js spackled linguist-generated=true +2016/ToUint8Clamp.js spackled linguist-generated=true +2016/Type.js spackled linguist-generated=true +2016/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2016/WeekDay.js spackled linguist-generated=true +2016/YearFromTime.js spackled linguist-generated=true +2016/modulo.js spackled linguist-generated=true +2016/msFromTime.js spackled linguist-generated=true +2016/thisBooleanValue.js spackled linguist-generated=true +2016/thisNumberValue.js spackled linguist-generated=true +2016/thisStringValue.js spackled linguist-generated=true +2016/thisTimeValue.js spackled linguist-generated=true +2017/AbstractEqualityComparison.js spackled linguist-generated=true +2017/AbstractRelationalComparison.js spackled linguist-generated=true +2017/AdvanceStringIndex.js spackled linguist-generated=true +2017/ArrayCreate.js spackled linguist-generated=true +2017/ArraySetLength.js spackled linguist-generated=true +2017/ArraySpeciesCreate.js spackled linguist-generated=true +2017/Call.js spackled linguist-generated=true +2017/CanonicalNumericIndexString.js spackled linguist-generated=true +2017/CompletePropertyDescriptor.js spackled linguist-generated=true +2017/CreateDataProperty.js spackled linguist-generated=true +2017/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2017/CreateHTML.js spackled linguist-generated=true +2017/CreateIterResultObject.js spackled linguist-generated=true +2017/CreateListFromArrayLike.js spackled linguist-generated=true +2017/CreateMethodProperty.js spackled linguist-generated=true +2017/DateFromTime.js spackled linguist-generated=true +2017/Day.js spackled linguist-generated=true +2017/DayFromYear.js spackled linguist-generated=true +2017/DayWithinYear.js spackled linguist-generated=true +2017/DaysInYear.js spackled linguist-generated=true +2017/DefinePropertyOrThrow.js spackled linguist-generated=true +2017/DeletePropertyOrThrow.js spackled linguist-generated=true +2017/FromPropertyDescriptor.js spackled linguist-generated=true +2017/Get.js spackled linguist-generated=true +2017/GetIterator.js spackled linguist-generated=true +2017/GetMethod.js spackled linguist-generated=true +2017/GetOwnPropertyKeys.js spackled linguist-generated=true +2017/GetPrototypeFromConstructor.js spackled linguist-generated=true +2017/GetSubstitution.js spackled linguist-generated=true +2017/GetV.js spackled linguist-generated=true +2017/HasOwnProperty.js spackled linguist-generated=true +2017/HasProperty.js spackled linguist-generated=true +2017/HourFromTime.js spackled linguist-generated=true +2017/InLeapYear.js spackled linguist-generated=true +2017/InstanceofOperator.js spackled linguist-generated=true +2017/Invoke.js spackled linguist-generated=true +2017/IsAccessorDescriptor.js spackled linguist-generated=true +2017/IsArray.js spackled linguist-generated=true +2017/IsCallable.js spackled linguist-generated=true +2017/IsConcatSpreadable.js spackled linguist-generated=true +2017/IsConstructor.js spackled linguist-generated=true +2017/IsDataDescriptor.js spackled linguist-generated=true +2017/IsExtensible.js spackled linguist-generated=true +2017/IsGenericDescriptor.js spackled linguist-generated=true +2017/IsInteger.js spackled linguist-generated=true +2017/IsPromise.js spackled linguist-generated=true +2017/IsPropertyDescriptor.js spackled linguist-generated=true +2017/IsPropertyKey.js spackled linguist-generated=true +2017/IsRegExp.js spackled linguist-generated=true +2017/IteratorClose.js spackled linguist-generated=true +2017/IteratorComplete.js spackled linguist-generated=true +2017/IteratorNext.js spackled linguist-generated=true +2017/IteratorStep.js spackled linguist-generated=true +2017/IteratorValue.js spackled linguist-generated=true +2017/MakeDate.js spackled linguist-generated=true +2017/MakeDay.js spackled linguist-generated=true +2017/MakeTime.js spackled linguist-generated=true +2017/MinFromTime.js spackled linguist-generated=true +2017/MonthFromTime.js spackled linguist-generated=true +2017/ObjectCreate.js spackled linguist-generated=true +2017/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2017/OrdinaryHasInstance.js spackled linguist-generated=true +2017/OrdinaryHasProperty.js spackled linguist-generated=true +2017/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2017/RegExpExec.js spackled linguist-generated=true +2017/RequireObjectCoercible.js spackled linguist-generated=true +2017/SameValue.js spackled linguist-generated=true +2017/SameValueNonNumber.js spackled linguist-generated=true +2017/SameValueZero.js spackled linguist-generated=true +2017/SecFromTime.js spackled linguist-generated=true +2017/Set.js spackled linguist-generated=true +2017/SetFunctionName.js spackled linguist-generated=true +2017/SetIntegrityLevel.js spackled linguist-generated=true +2017/SpeciesConstructor.js spackled linguist-generated=true +2017/StrictEqualityComparison.js spackled linguist-generated=true +2017/SymbolDescriptiveString.js spackled linguist-generated=true +2017/TestIntegrityLevel.js spackled linguist-generated=true +2017/TimeClip.js spackled linguist-generated=true +2017/TimeFromYear.js spackled linguist-generated=true +2017/TimeWithinDay.js spackled linguist-generated=true +2017/ToBoolean.js spackled linguist-generated=true +2017/ToDateString.js spackled linguist-generated=true +2017/ToInt16.js spackled linguist-generated=true +2017/ToInt32.js spackled linguist-generated=true +2017/ToInt8.js spackled linguist-generated=true +2017/ToInteger.js spackled linguist-generated=true +2017/ToLength.js spackled linguist-generated=true +2017/ToNumber.js spackled linguist-generated=true +2017/ToObject.js spackled linguist-generated=true +2017/ToPrimitive.js spackled linguist-generated=true +2017/ToPropertyDescriptor.js spackled linguist-generated=true +2017/ToPropertyKey.js spackled linguist-generated=true +2017/ToString.js spackled linguist-generated=true +2017/ToUint16.js spackled linguist-generated=true +2017/ToUint32.js spackled linguist-generated=true +2017/ToUint8.js spackled linguist-generated=true +2017/ToUint8Clamp.js spackled linguist-generated=true +2017/Type.js spackled linguist-generated=true +2017/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2017/WeekDay.js spackled linguist-generated=true +2017/YearFromTime.js spackled linguist-generated=true +2017/modulo.js spackled linguist-generated=true +2017/msFromTime.js spackled linguist-generated=true +2017/thisBooleanValue.js spackled linguist-generated=true +2017/thisNumberValue.js spackled linguist-generated=true +2017/thisStringValue.js spackled linguist-generated=true +2017/thisTimeValue.js spackled linguist-generated=true +2018/AbstractEqualityComparison.js spackled linguist-generated=true +2018/AbstractRelationalComparison.js spackled linguist-generated=true +2018/AdvanceStringIndex.js spackled linguist-generated=true +2018/ArrayCreate.js spackled linguist-generated=true +2018/ArraySetLength.js spackled linguist-generated=true +2018/ArraySpeciesCreate.js spackled linguist-generated=true +2018/Call.js spackled linguist-generated=true +2018/CanonicalNumericIndexString.js spackled linguist-generated=true +2018/CompletePropertyDescriptor.js spackled linguist-generated=true +2018/CreateDataProperty.js spackled linguist-generated=true +2018/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2018/CreateHTML.js spackled linguist-generated=true +2018/CreateIterResultObject.js spackled linguist-generated=true +2018/CreateListFromArrayLike.js spackled linguist-generated=true +2018/CreateMethodProperty.js spackled linguist-generated=true +2018/DateFromTime.js spackled linguist-generated=true +2018/Day.js spackled linguist-generated=true +2018/DayFromYear.js spackled linguist-generated=true +2018/DayWithinYear.js spackled linguist-generated=true +2018/DaysInYear.js spackled linguist-generated=true +2018/DefinePropertyOrThrow.js spackled linguist-generated=true +2018/DeletePropertyOrThrow.js spackled linguist-generated=true +2018/FromPropertyDescriptor.js spackled linguist-generated=true +2018/Get.js spackled linguist-generated=true +2018/GetIterator.js spackled linguist-generated=true +2018/GetMethod.js spackled linguist-generated=true +2018/GetOwnPropertyKeys.js spackled linguist-generated=true +2018/GetPrototypeFromConstructor.js spackled linguist-generated=true +2018/GetV.js spackled linguist-generated=true +2018/HasOwnProperty.js spackled linguist-generated=true +2018/HasProperty.js spackled linguist-generated=true +2018/HourFromTime.js spackled linguist-generated=true +2018/InLeapYear.js spackled linguist-generated=true +2018/InstanceofOperator.js spackled linguist-generated=true +2018/Invoke.js spackled linguist-generated=true +2018/IsAccessorDescriptor.js spackled linguist-generated=true +2018/IsArray.js spackled linguist-generated=true +2018/IsCallable.js spackled linguist-generated=true +2018/IsConcatSpreadable.js spackled linguist-generated=true +2018/IsConstructor.js spackled linguist-generated=true +2018/IsDataDescriptor.js spackled linguist-generated=true +2018/IsExtensible.js spackled linguist-generated=true +2018/IsGenericDescriptor.js spackled linguist-generated=true +2018/IsInteger.js spackled linguist-generated=true +2018/IsPromise.js spackled linguist-generated=true +2018/IsPropertyKey.js spackled linguist-generated=true +2018/IsRegExp.js spackled linguist-generated=true +2018/IterableToList.js spackled linguist-generated=true +2018/IteratorClose.js spackled linguist-generated=true +2018/IteratorComplete.js spackled linguist-generated=true +2018/IteratorNext.js spackled linguist-generated=true +2018/IteratorStep.js spackled linguist-generated=true +2018/IteratorValue.js spackled linguist-generated=true +2018/MakeDate.js spackled linguist-generated=true +2018/MakeDay.js spackled linguist-generated=true +2018/MakeTime.js spackled linguist-generated=true +2018/MinFromTime.js spackled linguist-generated=true +2018/MonthFromTime.js spackled linguist-generated=true +2018/ObjectCreate.js spackled linguist-generated=true +2018/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2018/OrdinaryHasInstance.js spackled linguist-generated=true +2018/OrdinaryHasProperty.js spackled linguist-generated=true +2018/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2018/RegExpExec.js spackled linguist-generated=true +2018/RequireObjectCoercible.js spackled linguist-generated=true +2018/SameValue.js spackled linguist-generated=true +2018/SameValueNonNumber.js spackled linguist-generated=true +2018/SameValueZero.js spackled linguist-generated=true +2018/SecFromTime.js spackled linguist-generated=true +2018/Set.js spackled linguist-generated=true +2018/SetFunctionName.js spackled linguist-generated=true +2018/SetIntegrityLevel.js spackled linguist-generated=true +2018/SpeciesConstructor.js spackled linguist-generated=true +2018/StrictEqualityComparison.js spackled linguist-generated=true +2018/SymbolDescriptiveString.js spackled linguist-generated=true +2018/TestIntegrityLevel.js spackled linguist-generated=true +2018/TimeClip.js spackled linguist-generated=true +2018/TimeFromYear.js spackled linguist-generated=true +2018/TimeWithinDay.js spackled linguist-generated=true +2018/ToBoolean.js spackled linguist-generated=true +2018/ToDateString.js spackled linguist-generated=true +2018/ToIndex.js spackled linguist-generated=true +2018/ToInt16.js spackled linguist-generated=true +2018/ToInt32.js spackled linguist-generated=true +2018/ToInt8.js spackled linguist-generated=true +2018/ToInteger.js spackled linguist-generated=true +2018/ToLength.js spackled linguist-generated=true +2018/ToNumber.js spackled linguist-generated=true +2018/ToObject.js spackled linguist-generated=true +2018/ToPrimitive.js spackled linguist-generated=true +2018/ToPropertyDescriptor.js spackled linguist-generated=true +2018/ToPropertyKey.js spackled linguist-generated=true +2018/ToString.js spackled linguist-generated=true +2018/ToUint16.js spackled linguist-generated=true +2018/ToUint32.js spackled linguist-generated=true +2018/ToUint8.js spackled linguist-generated=true +2018/ToUint8Clamp.js spackled linguist-generated=true +2018/Type.js spackled linguist-generated=true +2018/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2018/WeekDay.js spackled linguist-generated=true +2018/YearFromTime.js spackled linguist-generated=true +2018/modulo.js spackled linguist-generated=true +2018/msFromTime.js spackled linguist-generated=true +2018/thisBooleanValue.js spackled linguist-generated=true +2018/thisNumberValue.js spackled linguist-generated=true +2018/thisStringValue.js spackled linguist-generated=true +2018/thisTimeValue.js spackled linguist-generated=true +2019/AbstractEqualityComparison.js spackled linguist-generated=true +2019/AbstractRelationalComparison.js spackled linguist-generated=true +2019/AdvanceStringIndex.js spackled linguist-generated=true +2019/ArrayCreate.js spackled linguist-generated=true +2019/ArraySetLength.js spackled linguist-generated=true +2019/ArraySpeciesCreate.js spackled linguist-generated=true +2019/Call.js spackled linguist-generated=true +2019/CanonicalNumericIndexString.js spackled linguist-generated=true +2019/CompletePropertyDescriptor.js spackled linguist-generated=true +2019/CopyDataProperties.js spackled linguist-generated=true +2019/CreateDataProperty.js spackled linguist-generated=true +2019/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2019/CreateHTML.js spackled linguist-generated=true +2019/CreateIterResultObject.js spackled linguist-generated=true +2019/CreateListFromArrayLike.js spackled linguist-generated=true +2019/CreateMethodProperty.js spackled linguist-generated=true +2019/DateFromTime.js spackled linguist-generated=true +2019/DateString.js spackled linguist-generated=true +2019/Day.js spackled linguist-generated=true +2019/DayFromYear.js spackled linguist-generated=true +2019/DayWithinYear.js spackled linguist-generated=true +2019/DaysInYear.js spackled linguist-generated=true +2019/DefinePropertyOrThrow.js spackled linguist-generated=true +2019/DeletePropertyOrThrow.js spackled linguist-generated=true +2019/EnumerableOwnPropertyNames.js spackled linguist-generated=true +2019/FromPropertyDescriptor.js spackled linguist-generated=true +2019/Get.js spackled linguist-generated=true +2019/GetIterator.js spackled linguist-generated=true +2019/GetMethod.js spackled linguist-generated=true +2019/GetOwnPropertyKeys.js spackled linguist-generated=true +2019/GetPrototypeFromConstructor.js spackled linguist-generated=true +2019/GetSubstitution.js spackled linguist-generated=true +2019/GetV.js spackled linguist-generated=true +2019/HasOwnProperty.js spackled linguist-generated=true +2019/HasProperty.js spackled linguist-generated=true +2019/HourFromTime.js spackled linguist-generated=true +2019/InLeapYear.js spackled linguist-generated=true +2019/InstanceofOperator.js spackled linguist-generated=true +2019/Invoke.js spackled linguist-generated=true +2019/IsAccessorDescriptor.js spackled linguist-generated=true +2019/IsArray.js spackled linguist-generated=true +2019/IsCallable.js spackled linguist-generated=true +2019/IsConcatSpreadable.js spackled linguist-generated=true +2019/IsConstructor.js spackled linguist-generated=true +2019/IsDataDescriptor.js spackled linguist-generated=true +2019/IsExtensible.js spackled linguist-generated=true +2019/IsGenericDescriptor.js spackled linguist-generated=true +2019/IsInteger.js spackled linguist-generated=true +2019/IsPromise.js spackled linguist-generated=true +2019/IsPropertyKey.js spackled linguist-generated=true +2019/IsRegExp.js spackled linguist-generated=true +2019/IsStringPrefix.js spackled linguist-generated=true +2019/IterableToList.js spackled linguist-generated=true +2019/IteratorClose.js spackled linguist-generated=true +2019/IteratorComplete.js spackled linguist-generated=true +2019/IteratorNext.js spackled linguist-generated=true +2019/IteratorStep.js spackled linguist-generated=true +2019/IteratorValue.js spackled linguist-generated=true +2019/MakeDate.js spackled linguist-generated=true +2019/MakeDay.js spackled linguist-generated=true +2019/MakeTime.js spackled linguist-generated=true +2019/MinFromTime.js spackled linguist-generated=true +2019/MonthFromTime.js spackled linguist-generated=true +2019/NumberToString.js spackled linguist-generated=true +2019/ObjectCreate.js spackled linguist-generated=true +2019/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2019/OrdinaryHasInstance.js spackled linguist-generated=true +2019/OrdinaryHasProperty.js spackled linguist-generated=true +2019/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2019/PromiseResolve.js spackled linguist-generated=true +2019/RegExpExec.js spackled linguist-generated=true +2019/RequireObjectCoercible.js spackled linguist-generated=true +2019/SameValue.js spackled linguist-generated=true +2019/SameValueNonNumber.js spackled linguist-generated=true +2019/SameValueZero.js spackled linguist-generated=true +2019/SecFromTime.js spackled linguist-generated=true +2019/Set.js spackled linguist-generated=true +2019/SetFunctionName.js spackled linguist-generated=true +2019/SetIntegrityLevel.js spackled linguist-generated=true +2019/SpeciesConstructor.js spackled linguist-generated=true +2019/StrictEqualityComparison.js spackled linguist-generated=true +2019/SymbolDescriptiveString.js spackled linguist-generated=true +2019/TestIntegrityLevel.js spackled linguist-generated=true +2019/TimeClip.js spackled linguist-generated=true +2019/TimeFromYear.js spackled linguist-generated=true +2019/TimeString.js spackled linguist-generated=true +2019/TimeWithinDay.js spackled linguist-generated=true +2019/ToBoolean.js spackled linguist-generated=true +2019/ToDateString.js spackled linguist-generated=true +2019/ToIndex.js spackled linguist-generated=true +2019/ToInt16.js spackled linguist-generated=true +2019/ToInt32.js spackled linguist-generated=true +2019/ToInt8.js spackled linguist-generated=true +2019/ToInteger.js spackled linguist-generated=true +2019/ToLength.js spackled linguist-generated=true +2019/ToNumber.js spackled linguist-generated=true +2019/ToObject.js spackled linguist-generated=true +2019/ToPrimitive.js spackled linguist-generated=true +2019/ToPropertyDescriptor.js spackled linguist-generated=true +2019/ToPropertyKey.js spackled linguist-generated=true +2019/ToString.js spackled linguist-generated=true +2019/ToUint16.js spackled linguist-generated=true +2019/ToUint32.js spackled linguist-generated=true +2019/ToUint8.js spackled linguist-generated=true +2019/ToUint8Clamp.js spackled linguist-generated=true +2019/Type.js spackled linguist-generated=true +2019/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2019/WeekDay.js spackled linguist-generated=true +2019/YearFromTime.js spackled linguist-generated=true +2019/modulo.js spackled linguist-generated=true +2019/msFromTime.js spackled linguist-generated=true +2019/thisBooleanValue.js spackled linguist-generated=true +2019/thisNumberValue.js spackled linguist-generated=true +2019/thisStringValue.js spackled linguist-generated=true +2019/thisSymbolValue.js spackled linguist-generated=true \ No newline at end of file diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/FUNDING.yml b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/FUNDING.yml new file mode 100644 index 0000000..beeb7a2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-abstract +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/codeql-analysis.yml b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..e77ad6a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/codeql-analysis.yml @@ -0,0 +1,52 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 17 * * 4' + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/rebase.yml b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.nycrc b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.nycrc new file mode 100644 index 0000000..d316b4d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.nycrc @@ -0,0 +1,14 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "operations", + "test" + ] +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/.travis.yml b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.travis.yml new file mode 100644 index 0000000..5c34024 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/.travis.yml @@ -0,0 +1,32 @@ +version: ~> 1.0 +language: node_js +os: + - linux +cache: + directories: + - "$HOME/.npm" + - "$(nvm cache dir)" + - "$(nvm_version_path $(nvm_version_remote 0.4))" + - "$(nvm_version_path $(nvm_version_remote 0.6))" + - "$(nvm_version_path $(nvm_version_remote 0.10))" +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml +script: + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi' +matrix: + include: + - node_js: "8" + env: COVERAGE=true + - node_js: "4" + env: COVERAGE=true + - node_js: "0.12" + env: COVERAGE=true + - node_js: "0.8" + env: COVERAGE=true + exclude: + - node_js: "0.12" + env: TEST=true + - node_js: "0.8" + env: TEST=true diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractRelationalComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AdvanceStringIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArrayCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySetLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySpeciesCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Call.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateHTML.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateIterResultObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateListFromArrayLike.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateMethodProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DateFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Day.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayWithinYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DaysInYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/EnumerableOwnNames.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/FromPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Get.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetIterator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetMethod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetSubstitution.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetV.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HourFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InLeapYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InstanceofOperator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Invoke.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsAccessorDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsArray.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsCallable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConcatSpreadable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsDataDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsExtensible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsGenericDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPromise.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsRegExp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorClose.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorComplete.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorNext.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorStep.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MinFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MonthFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ObjectCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasInstance.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RegExpExec.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RequireObjectCoercible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValueZero.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SecFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Set.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetFunctionName.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SpeciesConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/StrictEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SymbolDescriptiveString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TestIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeClip.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeWithinDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToBoolean.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToDateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8Clamp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Type.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/WeekDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/YearFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/modulo.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/msFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisBooleanValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisNumberValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisStringValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisTimeValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2015/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractRelationalComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AdvanceStringIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArrayCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySetLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySpeciesCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Call.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateHTML.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateIterResultObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateListFromArrayLike.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateMethodProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DateFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Day.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayWithinYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DaysInYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/EnumerableOwnNames.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/EnumerableOwnNames.js new file mode 100644 index 0000000..d068584 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/FromPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Get.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetIterator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetMethod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetSubstitution.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetV.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HourFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InLeapYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InstanceofOperator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Invoke.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsAccessorDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsArray.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsCallable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConcatSpreadable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsDataDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsExtensible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsGenericDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPromise.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsRegExp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IterableToArrayLike.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IterableToArrayLike.js new file mode 100644 index 0000000..885cade --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IterableToArrayLike.js @@ -0,0 +1,56 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var GetIterator = require('./GetIterator'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); +var ES = { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type +}; + +// https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike +/** + * 1. Let usingIterator be ? GetMethod(items, @@iterator). + * 2. If usingIterator is not undefined, then + * 1. Let iterator be ? GetIterator(items, usingIterator). + * 2. Let values be a new empty List. + * 3. Let next be true. + * 4. Repeat, while next is not false + * 1. Let next be ? IteratorStep(iterator). + * 2. If next is not false, then + * 1. Let nextValue be ? IteratorValue(next). + * 2. Append nextValue to the end of the List values. + * 5. Return CreateArrayFromList(values). + * 3. NOTE: items is not an Iterable so assume it is already an array-like object. + * 4. Return ! ToObject(items). + */ + +module.exports = function IterableToArrayLike(items) { + var usingIterator = getIteratorMethod(ES, items); + if (typeof usingIterator !== 'undefined') { + var iterator = GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return ToObject(items); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorClose.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorComplete.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorNext.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorStep.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MinFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MonthFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ObjectCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasInstance.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RegExpExec.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RequireObjectCoercible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueNonNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueZero.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SecFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Set.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetFunctionName.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SpeciesConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/StrictEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SymbolDescriptiveString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TestIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeClip.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeWithinDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToBoolean.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToDateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8Clamp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Type.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/WeekDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/YearFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/modulo.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/msFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisBooleanValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisNumberValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisStringValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisTimeValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2016/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractRelationalComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AdvanceStringIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArrayCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySetLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySpeciesCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Call.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateHTML.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateIterResultObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateListFromArrayLike.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateMethodProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DateFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Day.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayWithinYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DaysInYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/EnumerableOwnProperties.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/EnumerableOwnProperties.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/EnumerableOwnProperties.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/FromPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Get.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetIterator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetMethod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetSubstitution.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetSubstitution.js new file mode 100644 index 0000000..de41b01 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetV.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HourFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InLeapYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InstanceofOperator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Invoke.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsAccessorDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsArray.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsCallable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConcatSpreadable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsDataDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsExtensible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsGenericDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPromise.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsRegExp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IterableToList.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorClose.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorComplete.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorNext.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorStep.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MinFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MonthFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ObjectCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasInstance.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RegExpExec.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RequireObjectCoercible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueNonNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueZero.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SecFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Set.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetFunctionName.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SpeciesConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/StrictEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SymbolDescriptiveString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TestIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeClip.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeWithinDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToBoolean.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToDateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8Clamp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Type.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/WeekDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/YearFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/modulo.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/msFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisBooleanValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisNumberValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisStringValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisTimeValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2017/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractRelationalComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AdvanceStringIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArrayCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySetLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySpeciesCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Call.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CopyDataProperties.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateHTML.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateIterResultObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateListFromArrayLike.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateMethodProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Day.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayWithinYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DaysInYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/FromPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Get.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetIterator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetMethod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetSubstitution.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetV.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HourFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InLeapYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InstanceofOperator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Invoke.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsAccessorDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsArray.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsCallable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConcatSpreadable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsDataDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsExtensible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsGenericDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPromise.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsRegExp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsStringPrefix.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IterableToList.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorClose.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorComplete.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorNext.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorStep.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MinFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MonthFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/NumberToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ObjectCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasInstance.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/PromiseResolve.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RegExpExec.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RequireObjectCoercible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueNonNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueZero.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SecFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Set.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetFunctionName.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SpeciesConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/StrictEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SymbolDescriptiveString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TestIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeClip.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeWithinDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToBoolean.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToDateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8Clamp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Type.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/WeekDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/YearFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/modulo.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/msFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisBooleanValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisNumberValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisStringValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisSymbolValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisTimeValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisTimeValue.js new file mode 100644 index 0000000..d7cda28 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2018/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractEqualityComparison.js new file mode 100644 index 0000000..40b3909 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractRelationalComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AddEntriesFromIterable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AddEntriesFromIterable.js new file mode 100644 index 0000000..5aed447 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AddEntriesFromIterable.js @@ -0,0 +1,52 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var Get = require('./Get'); +var GetIterator = require('./GetIterator'); +var IsCallable = require('./IsCallable'); +var IteratorClose = require('./IteratorClose'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var Type = require('./Type'); + +// https://tc39.es/ecma262/#sec-add-entries-from-iterable + +module.exports = function AddEntriesFromIterable(target, iterable, adder) { + if (!IsCallable(adder)) { + throw new $TypeError('Assertion failed: `adder` is not callable'); + } + if (iterable == null) { + throw new $TypeError('Assertion failed: `iterable` is present, and not nullish'); + } + var iteratorRecord = GetIterator(iterable); + while (true) { // eslint-disable-line no-constant-condition + var next = IteratorStep(iteratorRecord); + if (!next) { + return target; + } + var nextItem = IteratorValue(next); + if (Type(nextItem) !== 'Object') { + var error = new $TypeError('iterator next must return an Object, got ' + inspect(nextItem)); + return IteratorClose( + iteratorRecord, + function () { throw error; } // eslint-disable-line no-loop-func + ); + } + try { + var k = Get(nextItem, '0'); + var v = Get(nextItem, '1'); + Call(adder, target, [k, v]); + } catch (e) { + return IteratorClose( + iteratorRecord, + function () { throw e; } + ); + } + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AdvanceStringIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AdvanceStringIndex.js new file mode 100644 index 0000000..666f578 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArrayCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArrayCreate.js new file mode 100644 index 0000000..fc9a7cf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySetLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySetLength.js new file mode 100644 index 0000000..c9134c6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySpeciesCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySpeciesCreate.js new file mode 100644 index 0000000..98b9b56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Call.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Call.js new file mode 100644 index 0000000..f0f0451 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CanonicalNumericIndexString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CanonicalNumericIndexString.js new file mode 100644 index 0000000..625f853 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CompletePropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CompletePropertyDescriptor.js new file mode 100644 index 0000000..548bf41 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CopyDataProperties.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CopyDataProperties.js new file mode 100644 index 0000000..402de28 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CopyDataProperties.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new $TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataProperty.js new file mode 100644 index 0000000..32a86ef --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js new file mode 100644 index 0000000..9feaec8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateHTML.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateHTML.js new file mode 100644 index 0000000..536c92d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateIterResultObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateIterResultObject.js new file mode 100644 index 0000000..aef1d22 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateListFromArrayLike.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateListFromArrayLike.js new file mode 100644 index 0000000..d6b44b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateMethodProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateMethodProperty.js new file mode 100644 index 0000000..5b599ae --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateString.js new file mode 100644 index 0000000..fc30329 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Day.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayWithinYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DaysInYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DefinePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DefinePropertyOrThrow.js new file mode 100644 index 0000000..7977f6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DeletePropertyOrThrow.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DeletePropertyOrThrow.js new file mode 100644 index 0000000..b476817 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js new file mode 100644 index 0000000..e2ed722 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FlattenIntoArray.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FlattenIntoArray.js new file mode 100644 index 0000000..313a6ed --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FlattenIntoArray.js @@ -0,0 +1,58 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray + +// eslint-disable-next-line max-params, max-statements +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = ToLength(Get(element, 'length')); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FromPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FromPropertyDescriptor.js new file mode 100644 index 0000000..5ec200e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Get.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Get.js new file mode 100644 index 0000000..5b9ad78 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetIterator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetIterator.js new file mode 100644 index 0000000..7beddac --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetMethod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetMethod.js new file mode 100644 index 0000000..aef8cbc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetOwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetOwnPropertyKeys.js new file mode 100644 index 0000000..8d7e5ee --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js new file mode 100644 index 0000000..62da8fb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetSubstitution.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetSubstitution.js new file mode 100644 index 0000000..2ec9ebc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetV.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetV.js new file mode 100644 index 0000000..7b5139a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasOwnProperty.js new file mode 100644 index 0000000..679059f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasProperty.js new file mode 100644 index 0000000..5f2d212 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HourFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InLeapYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InstanceofOperator.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InstanceofOperator.js new file mode 100644 index 0000000..ebd308c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Invoke.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Invoke.js new file mode 100644 index 0000000..769f0e3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsAccessorDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsAccessorDescriptor.js new file mode 100644 index 0000000..5139464 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsArray.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsArray.js new file mode 100644 index 0000000..7b25f37 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsCallable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConcatSpreadable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConcatSpreadable.js new file mode 100644 index 0000000..dc8aae1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConstructor.js new file mode 100644 index 0000000..8ba9fe5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsDataDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsDataDescriptor.js new file mode 100644 index 0000000..0ad3045 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsExtensible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsExtensible.js new file mode 100644 index 0000000..0c4c8a6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsGenericDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsInteger.js new file mode 100644 index 0000000..0f488b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPromise.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPromise.js new file mode 100644 index 0000000..e8e92a2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPropertyKey.js new file mode 100644 index 0000000..74b8d95 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsRegExp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsRegExp.js new file mode 100644 index 0000000..fdf2323 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsStringPrefix.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsStringPrefix.js new file mode 100644 index 0000000..f5e2996 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IterableToList.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IterableToList.js new file mode 100644 index 0000000..0b8cdcf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorClose.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorClose.js new file mode 100644 index 0000000..35c8c2b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorComplete.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorComplete.js new file mode 100644 index 0000000..a62b9bf --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorNext.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorNext.js new file mode 100644 index 0000000..7e59915 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorStep.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorStep.js new file mode 100644 index 0000000..41b9d1b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorValue.js new file mode 100644 index 0000000..5e71a44 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MinFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MonthFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/NumberToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/NumberToString.js new file mode 100644 index 0000000..741727c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/NumberToString.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new $TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ObjectCreate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ObjectCreate.js new file mode 100644 index 0000000..e2445b0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js new file mode 100644 index 0000000..59780b3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js new file mode 100644 index 0000000..b9882e5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js new file mode 100644 index 0000000..344077a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasInstance.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasInstance.js new file mode 100644 index 0000000..51abe26 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasProperty.js new file mode 100644 index 0000000..076c25a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js new file mode 100644 index 0000000..3541331 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/PromiseResolve.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/PromiseResolve.js new file mode 100644 index 0000000..f70745d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RegExpExec.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RegExpExec.js new file mode 100644 index 0000000..15c9186 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RequireObjectCoercible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RequireObjectCoercible.js new file mode 100644 index 0000000..9008359 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueNonNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueNonNumber.js new file mode 100644 index 0000000..5668752 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueZero.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueZero.js new file mode 100644 index 0000000..0dedcd2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SecFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Set.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Set.js new file mode 100644 index 0000000..9545b13 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetFunctionName.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetFunctionName.js new file mode 100644 index 0000000..f93324a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetIntegrityLevel.js new file mode 100644 index 0000000..3d5c81d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SpeciesConstructor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SpeciesConstructor.js new file mode 100644 index 0000000..3cdcd74 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/StrictEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SymbolDescriptiveString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SymbolDescriptiveString.js new file mode 100644 index 0000000..7bd8191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TestIntegrityLevel.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TestIntegrityLevel.js new file mode 100644 index 0000000..7a57397 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeClip.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeString.js new file mode 100644 index 0000000..87642eb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeWithinDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToBoolean.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToDateString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToDateString.js new file mode 100644 index 0000000..7a6d4c4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToIndex.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToIndex.js new file mode 100644 index 0000000..a55398d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt16.js new file mode 100644 index 0000000..5a112c2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt8.js new file mode 100644 index 0000000..d103123 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInteger.js new file mode 100644 index 0000000..16f7db9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToLength.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToLength.js new file mode 100644 index 0000000..1bef9be --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToNumber.js new file mode 100644 index 0000000..7a3cdc8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToObject.js new file mode 100644 index 0000000..50d5b94 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPrimitive.js new file mode 100644 index 0000000..81c655d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyKey.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyKey.js new file mode 100644 index 0000000..38f40dd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToString.js new file mode 100644 index 0000000..a345431 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8.js new file mode 100644 index 0000000..bf84753 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8Clamp.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8Clamp.js new file mode 100644 index 0000000..c7f9f56 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TrimString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TrimString.js new file mode 100644 index 0000000..b27112c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/TrimString.js @@ -0,0 +1,29 @@ +'use strict'; + +var trimStart = require('string.prototype.trimstart'); +var trimEnd = require('string.prototype.trimend'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-trimstring + +module.exports = function TrimString(string, where) { + var str = RequireObjectCoercible(string); + var S = ToString(str); + var T; + if (where === 'start') { + T = trimStart(S); + } else if (where === 'end') { + T = trimEnd(S); + } else if (where === 'start+end') { + T = trimStart(trimEnd(S)); + } else { + throw new $TypeError('Assertion failed: invalid `where` value; must be "start", "end", or "start+end"'); + } + return T; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Type.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Type.js new file mode 100644 index 0000000..0bd1165 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 0000000..d4b9007 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/WeekDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/YearFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/modulo.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/msFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisBooleanValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisBooleanValue.js new file mode 100644 index 0000000..3ffac9c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisNumberValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisNumberValue.js new file mode 100644 index 0000000..0345e52 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisStringValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisStringValue.js new file mode 100644 index 0000000..3b99b6e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisSymbolValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisSymbolValue.js new file mode 100644 index 0000000..3c3b347 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisTimeValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisTimeValue.js new file mode 100644 index 0000000..a9a47ac --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/2019/thisTimeValue.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../2018/thisTimeValue'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractEqualityComparison.js new file mode 100644 index 0000000..e55c764 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractRelationalComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractRelationalComparison.js new file mode 100644 index 0000000..bc7ca83 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/CheckObjectCoercible.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/CheckObjectCoercible.js new file mode 100644 index 0000000..f02b289 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/CheckObjectCoercible.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 + +module.exports = function CheckObjectCoercible(value, optMessage) { + if (value == null) { + throw new $TypeError(optMessage || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DateFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DateFromTime.js new file mode 100644 index 0000000..962dba1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Day.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Day.js new file mode 100644 index 0000000..00df813 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayFromYear.js new file mode 100644 index 0000000..08dd5af --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayWithinYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayWithinYear.js new file mode 100644 index 0000000..cfc4002 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DaysInYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DaysInYear.js new file mode 100644 index 0000000..db32251 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/FromPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/FromPropertyDescriptor.js new file mode 100644 index 0000000..a3cefbe --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/FromPropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/HourFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/HourFromTime.js new file mode 100644 index 0000000..957ce32 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/InLeapYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/InLeapYear.js new file mode 100644 index 0000000..38ba8fd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsAccessorDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsAccessorDescriptor.js new file mode 100644 index 0000000..561382a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsCallable.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsCallable.js new file mode 100644 index 0000000..e4bfa36 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsDataDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsDataDescriptor.js new file mode 100644 index 0000000..783e2dc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsGenericDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsGenericDescriptor.js new file mode 100644 index 0000000..93340e9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsPropertyDescriptor.js new file mode 100644 index 0000000..2a96c63 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDate.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDate.js new file mode 100644 index 0000000..7b592d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDay.js new file mode 100644 index 0000000..f1ab810 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeTime.js new file mode 100644 index 0000000..e118500 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MinFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MinFromTime.js new file mode 100644 index 0000000..e80e191 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MonthFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MonthFromTime.js new file mode 100644 index 0000000..4f120f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SameValue.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SameValue.js new file mode 100644 index 0000000..47c936d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SecFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SecFromTime.js new file mode 100644 index 0000000..7190011 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/StrictEqualityComparison.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/StrictEqualityComparison.js new file mode 100644 index 0000000..eea5df3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeClip.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeClip.js new file mode 100644 index 0000000..57aa08c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeFromYear.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeFromYear.js new file mode 100644 index 0000000..df646c3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeWithinDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeWithinDay.js new file mode 100644 index 0000000..c5b21d3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToBoolean.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToBoolean.js new file mode 100644 index 0000000..65d8737 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInt32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInt32.js new file mode 100644 index 0000000..a8d2680 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInteger.js new file mode 100644 index 0000000..a95265b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToInteger.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4 + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return $sign(number) * $floor($abs(number)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToNumber.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToNumber.js new file mode 100644 index 0000000..4a7a3b8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToNumber.js @@ -0,0 +1,7 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 + +module.exports = function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToObject.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToObject.js new file mode 100644 index 0000000..1d27a13 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var CheckObjectCoercible = require('./CheckObjectCoercible'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.9 + +module.exports = function ToObject(value) { + CheckObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPrimitive.js new file mode 100644 index 0000000..071df70 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.1 + +module.exports = require('es-to-primitive/es5'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPropertyDescriptor.js new file mode 100644 index 0000000..7c40136 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new $TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToString.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToString.js new file mode 100644 index 0000000..80ece42 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToString.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.8 + +module.exports = function ToString(value) { + return $String(value); +}; + diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint16.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint16.js new file mode 100644 index 0000000..c8a408b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint32.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint32.js new file mode 100644 index 0000000..3660f62 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Type.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Type.js new file mode 100644 index 0000000..9cc750c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/Type.js @@ -0,0 +1,24 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/5.1/#sec-8 + +module.exports = function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/WeekDay.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/WeekDay.js new file mode 100644 index 0000000..2973e02 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/YearFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/YearFromTime.js new file mode 100644 index 0000000..ff5339f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/modulo.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/modulo.js new file mode 100644 index 0000000..bc04c06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/msFromTime.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/msFromTime.js new file mode 100644 index 0000000..c31eda0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/5/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/CHANGELOG.md b/node_modules/string.prototype.trimstart/node_modules/es-abstract/CHANGELOG.md new file mode 100644 index 0000000..584b7cd --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/CHANGELOG.md @@ -0,0 +1,395 @@ +1.18.0-next.1 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [eslint] fix warning + * [Tests] temporarily allow SES tests to fail (#115) + * [Tests] ses-compat - initialize module after ses lockdown (#113) + * [Tests] [Refactor] use defineProperty helper rather than assignment + * [Tests] [Refactor] clean up defineProperty test helper + +1.18.0-next.0 / 2020-08-14 +================= + * [New] add `ES2020` + * [New] `GetIntrinsic`: add `%AggregateError%`, `%FinalizationRegistry%`, and `%WeakRef%` + * [New] `ES5`+: add `abs`, `floor`; use `modulo` consistently + * [New] `GetIntrinsic`: Cache accessed intrinsics (#98) + * [New] `GetIntrinsic`: Add ES201x function intrinsics (#97) + * [New] `ES2015`+: add `QuoteJSONString`, `OrdinaryCreateFromConstructor` + * [New] `ES2017`+: add `StringGetOwnProperty` + * [New] `ES2016`+: add `UTF16Encoding` + * [New] `ES2018`+: add `SetFunctionLength`, `UnicodeEscape` + * [New] add `isLeadingSurrogate`/`isTrailingSurrogate` helpers + * [Fix] `ES5`+: `ToPropertyDescriptor`: use intrinsic TypeError + * [Fix] `ES2018+`: `CopyDataProperties`/`NumberToString`: use intrinsic TypeError + * [Deps] update `is-regex`, `object-inspect` + * [Dev Deps] update `eslint` + +1.17.7 / 2020-09-30 +================= + * [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116) + * [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115) + * [Fix] `callBind`: ensure compatibility with SES + * [Deps] update `is-callable`, `is-regex`, `object-inspect`, `object.assign` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + +1.17.6 / 2020-06-13 +================= + * [Fix] `helpers/getSymbolDescription`: use the global Symbol registry when available (#92) + * [Fix] `ES2015+`: `IsConstructor`: when `Reflect.construct` is available, be spec-accurate (#93) + * [Fix] `ES2015+`: `Set`: Always return boolean value (#101) + * [Fix] `ES2015+`: `Set`: ensure exceptions are thrown in IE 9 when requested + * [Fix] Use `Reflect.apply(…)` if available (#99) + * [Fix] `helpers/floor`: module-cache `Math.floor` + * [Fix] `helpers/getSymbolDescription`: Prefer bound `description` getter when present + * [Fix] `2016`: Use `getIteratorMethod` in `IterableToArrayLike` (#94) + * [Fix] `helpers/OwnPropertyKeys`: Use `Reflect.ownKeys(…)` if available (#91) + * [Fix] `2018+`: Fix `CopyDataProperties` depending on `this` (#95) + * [meta] mark spackled files as autogenerated + * [meta] `Type`: fix spec URL + * [meta] `ES2015`: complete ops list + * [Deps] update `is‑callable`, `is‑regex` + * [Deps] switch from `string.prototype.trimleft`/`string.prototype.trimright` to `string.prototype.trimstart`/`string.prototype.trimend` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `in-publish`, `object-is`, `tape`; add `aud` + * [eslint] `helpers/isPropertyDescriptor`: fix indentation + * [Tests] `helpers/getSymbolDescription`: add test cases; some envs have `Symbol.for` but can not infer a name (#92) + * [Tests] try out CodeQL analysis + * [Tests] reformat expected missing ops + * [Tests] Run tests with `undefined` this (#96) + +1.17.5 / 2020-03-22 +================= + * [Fix] `CreateDataProperty`: update an existing property + * [Fix] run missing spackle from cd7504701879ddea0f5981e99cbcf93bfea9171d + * [Dev Deps] update `make-arrow-function`, `tape`, `@ljharb/eslint-config` + +1.17.4 / 2020-01-21 +================= + * [Fix] `2015+`: add code to handle IE 8’s problems + * [Tests] fix tests for IE 8 + +1.17.3 / 2020-01-19 +================= + * [Fix] `ObjectCreate` `2015+`: Fall back to `__proto__` and normal `new` in older browsers + * [Fix] `GetIntrinsic`: ensure the `allowMissing` property actually works on dotted intrinsics + +1.17.2 / 2020-01-14 +================= + * [Fix] `helpers/OwnPropertyKeys`: include non-enumerables too + +1.17.1 / 2020-01-14 +================= + * [Refactor] add `OwnPropertyKeys` helper, use it in `CopyDataProperties` + * [Refactor] `IteratorClose`: remove useless assignment + * [Dev Deps] update `eslint`, `tape`, `diff` + +1.17.0 / 2019-12-20 +================= + * [New] Split up each operation into its own file (prereleased) + * [Fix] `GetIntrinsic`: IE 8 has a broken `Object.getOwnPropertyDescriptor` + * [Fix] `object.assign` is a runtime dep (prereleased) + * [Refactor] `GetIntrinsic`: remove the internal property salts, since % already handles that + * [Refactor] `GetIntrinsic`: further simplification + * [Deps] update `is-callable`, `string.prototype.trimleft`, `string.prototype.trimright`, `is-regex` + * [Dev Deps] update `@ljharb/eslint-config`, `object-is`, `object.fromentries`, `tape` + * [Tests] add `.eslintignore` + * [meta] remove unused Makefile and associated utils + * [meta] only run spackle script in publish (#78) (prereleased) + +1.17.0-next.1 / 2019-12-11 +================= + * [Fix] `object.assign` is a runtime dep + * [meta] only run spackle script in publish (#78) + +1.17.0-next.0 / 2019-12-11 +================= + * [New] Split up each operation into its own file + +1.16.3 / 2019-12-04 +================= + * [Fix] `GetIntrinsic`: when given a path to a getter, return the actual getter + * [Dev Deps] update `eslint` + +1.16.2 / 2019-11-24 +================= + * [Fix] IE 6-7 lack JSON + * [Fix] IE 6-8 strings can’t use array slice, they need string slice + * [Dev Deps] update `eslint` + +1.16.1 / 2019-11-24 +================= + * [Fix] `GetIntrinsics`: turns out IE 8 throws when `Object.getOwnPropertyDescriptor(arguments);`, and does not throw on `callee` anyways + * [Deps] update `es-to-primitive`, `has-symbols`, `object-inspect` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + * [meta] re-include year files inside `operations` + * [meta] add `funding` field + * [actions] add Automatic Rebase github action + * [Tests] use shared travis-ci config + * [Tests] disable `check-coverage`, and let codecov do it + +1.16.0 / 2019-10-18 +================= + * [New] `ES2015+`: add `SetFunctionName` + * [New] `ES2015+`: add `GetPrototypeFromConstructor`, with caveats + * [New] `ES2015+`: add `CreateListFromArrayLike` + * [New] `ES2016+`: add `OrdinarySetPrototypeOf` + * [New] `ES2016+`: add `OrdinaryGetPrototypeOf` + * [New] add `getSymbolDescription` and `getInferredName` helpers + * [Fix] `GetIterator`: add fallback for pre-Symbol environments, tests + * [Dev Deps] update `object.fromentries` + * [Tests] add `node` `v12.2` + +1.15.0 / 2019-10-02 +================= + * [New] `ES2018`+: add `DateString`, `TimeString` + * [New] `ES2015`+: add `ToDateString` + * [New] `ES5`+: add `msFromTime`, `SecFromTime`, `MinFromTime`, `HourFromTime`, `TimeWithinDay`, `Day`, `DayFromYear`, `TimeFromYear`, `YearFromTime`, `WeekDay`, `DaysInYear`, `InLeapYear`, `DayWithinYear`, `MonthFromTime`, `DateFromTime`, `MakeDay`, `MakeDate`, `MakeTime`, `TimeClip`, `modulo` + * [New] add `regexTester` helper + * [New] add `callBound` helper + * [New] add ES2020’s intrinsic dot notation + * [New] add `isPrefixOf` helper + * [New] add `maxSafeInteger` helper + * [Deps] update `string.prototype.trimleft`, `string.prototype.trimright` + * [Dev Deps] update `eslint` + * [Tests] on `node` `v12.11` + * [meta] npmignore operations scripts; add "deltas" + +1.14.2 / 2019-09-08 +================= + * [Fix] `ES2016`: `IterableToArrayLike`: add proper fallback for strings, pre-Symbols + * [Tests] on `node` `v12.10` + +1.14.1 / 2019-09-03 +================= + * [meta] republish with some extra files removed + +1.14.0 / 2019-09-02 +================= + * [New] add ES2019 + * [New] `ES2017+`: add `IterableToList` + * [New] `ES2016`: add `IterableToArrayLike` + * [New] `ES2015+`: add `ArrayCreate`, `ArraySetLength`, `OrdinaryDefineOwnProperty`, `OrdinaryGetOwnProperty`, `OrdinaryHasProperty`, `CreateHTML`, `GetOwnPropertyKeys`, `InstanceofOperator`, `SymbolDescriptiveString`, `GetSubstitution`, `ValidateAndApplyPropertyDescriptor`, `IsPromise`, `OrdinaryHasInstance`, `TestIntegrityLevel`, `SetIntegrityLevel` + * [New] add `callBind` helper, and use it + * [New] add helpers: `isPropertyDescriptor`, `every` + * [New] ES5+: add `Abstract Relational Comparison` + * [New] ES5+: add `Abstract Equality Comparison`, `Strict Equality Comparison` + * [Fix] `ES2015+`: `GetIterator`: only require native Symbols when `method` is omitted + * [Fix] `ES2015`: `Call`: error message now properly displays Symbols using `object-inspect` + * [Fix] `ES2015+`: `ValidateAndApplyPropertyDescriptor`: use ES2017 logic to bypass spec bugs + * [Fix] `ES2015+`: `CreateDataProperty`, `DefinePropertyOrThrow`, `ValidateAndApplyPropertyDescriptor`: add fallbacks for ES3 + * [Fix] `ES2015+`: `FromPropertyDescriptor`: no longer requires a fully complete Property Descriptor + * [Fix] `ES5`: `IsPropertyDescriptor`: call into `IsDataDescriptor` and `IsAccessorDescriptor` + * [Refactor] use `has-symbols` for Symbol detection + * [Fix] `helpers/assertRecord`: remove `console.log` + * [Deps] update `object-keys` + * [readme] add security note + * [meta] change http URLs to https + * [meta] linter cleanup + * [meta] fix getOps script + * [meta] add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `replace`, `cheerio`, `tape` + * [Tests] up to `node` `v12.9`, `v11.15`, `v10.16`, `v8.16`, `v6.17` + * [Tests] temporarily allow node 0.6 to fail; segfaulting in travis + * [Tests] use the values helper more in es5 tests + * [Tests] fix linting to apply to all files + * [Tests] run `npx aud` only on prod deps + * [Tests] add v.descriptors helpers + * [Tests] use `npx aud` instead of `npm audit` with hoops + * [Tests] use `eclint` instead of `editorconfig-tools` + * [Tests] some intrinsic cleanup + * [Tests] migrate es5 tests to use values helper + * [Tests] add some missing ES2015 ops + +1.13.0 / 2019-01-02 +================= + * [New] add ES2018 + * [New] add ES2015/ES2016: EnumerableOwnNames; ES2017: EnumerableOwnProperties + * [New] `ES2015+`: add `thisBooleanValue`, `thisNumberValue`, `thisStringValue`, `thisTimeValue` + * [New] `ES2015+`: add `DefinePropertyOrThrow`, `DeletePropertyOrThrow`, `CreateMethodProperty` + * [New] add `assertRecord` helper + * [Deps] update `is-callable`, `has`, `object-keys`, `es-to-primitive` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `semver`, `safe-publish-latest`, `replace` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + * [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` + * [Tests] move descriptor factories to `values` helper + * [Tests] add `getOps` to programmatically fetch abstract operation names + +1.12.0 / 2018-05-31 +================= + * [New] add `GetIntrinsic` entry point + * [New] `ES2015`+: add `ObjectCreate` + * [Robustness]: `ES2015+`: ensure `Math.{abs,floor}` and `Function.call` are cached + +1.11.0 / 2018-03-21 +================= + * [New] `ES2015+`: add iterator abstract ops + * [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape` + * [Tests] up to `node` `v9.8`, `v8.10`, `v6.13` + +1.10.0 / 2017-11-24 +================= + * [New] ES2015+: `AdvanceStringIndex` + * [Dev Deps] update `eslint`, `nsp` + * [Tests] require node 0.6 to pass again + * [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS + +1.9.0 / 2017-09-30 +================= + * [New] `es2015+`: add `ArraySpeciesCreate` + * [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow` + * [Tests] consolidate duplicated tests + * [Tests] increase coverage + * [Dev Deps] update `nsp`, `eslint` + +1.8.2 / 2017-09-03 +================= + * [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27) + * [Dev Deps] update `eslint` + +1.8.1 / 2017-08-30 +================= + * [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26) + * [Deps] update `function-bind` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [Docs] github broke markdown parsing + +1.8.0 / 2017-08-04 +================= + * [New] add ES2017 + * [New] move es6+ to es2015+; leave es6/es7 as aliases + * [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor` + * [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec` + * [Fix] es7/es2016: do not mutate ES6 + * [Fix] assign helper only supports one source + * [Deps] update `is-regex` + * [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` + * [Tests] add tests for missing and excess operations + * [Tests] add codecov for coverage + * [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node + * [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same + * [Tests] ES2015: add ToNumber symbol tests + * [Tests] switch to `nyc` for code coverage + * [Tests] make IsRegExp tests consistent across editions + +1.7.0 / 2017-01-22 +================= + * [New] ES6: Add `GetMethod` (#16) + * [New] ES6: Add `GetV` (#16) + * [New] ES6: Add `Get` (#17) + * [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix + * [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + +1.6.1 / 2016-08-21 +================= + * [Fix] ES6: IsConstructor should return true for `class` constructors. + +1.6.0 / 2016-08-20 +================= + * [New] ES5 / ES6: add `Type` + * [New] ES6: `SpeciesConstructor` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest` + * [Tests] up to `node` `v6.4`, `v5.12`, `v4.5` + +1.5.1 / 2016-05-30 +================= + * [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument + * [Refactor] create `isNaN` helper + * [Deps] update `is-callable`, `function-bind` + * [Deps] update `es-to-primitive`, fix ES5 tests + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp` + * [Tests] up to `node` `v6.2`, `v5.11`, `v4.4` + * [Tests] use pretest/posttest for linting/security + +1.5.0 / 2015-12-27 +================= + * [New] adds `Symbol.toPrimitive` support via `es-to-primitive` + * [Deps] update `is-callable`, `es-to-primitive` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape` + * [Tests] up to `node` `v5.3` + +1.4.3 / 2015-11-04 +================= + * [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4) + * [Refactor] `ES6.ToNumber`: No need to double-trim + * [Refactor] group tests better + * [Tests] should still pass on `node` `v0.8` + +1.4.2 / 2015-11-02 +================= + * [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3) + +1.4.1 / 2015-10-31 +================= + * [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2) + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v5.0` + * [Tests] fix npm upgrades for older node versions + * package.json: use object form of "authors", add "contributors" + +1.4.0 / 2015-09-26 +================= + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v4.2` + * [New] Add `SameValueNonNumber` to ES7 + +1.3.2 / 2015-09-26 +================= + * [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` + +1.3.1 / 2015-08-15 +================= + * [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly + +1.3.0 / 2015-08-15 +================= + * [New] ES6’s ToNumber now supports binary and octal literals. + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] up to `io.js` `v3.0` + +1.2.2 / 2015-07-28 +================= + * [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw. + * [Tests] Test on latest `io.js` versions. + * [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp` + +1.2.1 / 2015-03-20 +================= + * Fix `isFinite` helper. + +1.2.0 / 2015-03-19 +================= + * Use `es-to-primitive` for ToPrimitive methods. + * Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions. + +1.1.2 / 2015-03-20 +================= + * Fix isFinite helper. + +1.1.1 / 2015-03-19 +================= + * Fix isPrimitive check for functions + * Update `eslint`, `editorconfig-tools`, `semver`, `nsp` + +1.1.0 / 2015-02-17 +================= + * Add ES7 export (non-default). + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Test on `iojs-v1.2`. + +1.0.1 / 2015-01-30 +================= + * Use `is-callable` instead of an internal function. + * Update `tape`, `jscs`, `nsp`, `eslint` + +1.0.0 / 2015-01-10 +================= + * v1.0.0 diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/GetIntrinsic.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/GetIntrinsic.js new file mode 100644 index 0000000..5d38e1f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/GetIntrinsic.js @@ -0,0 +1,225 @@ +'use strict'; + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; + +var $TypeError = TypeError; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayPrototype%': Array.prototype, + '%ArrayProto_entries%': Array.prototype.entries, + '%ArrayProto_forEach%': Array.prototype.forEach, + '%ArrayProto_keys%': Array.prototype.keys, + '%ArrayProto_values%': Array.prototype.values, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': asyncFunction, + '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%Boolean%': Boolean, + '%BooleanPrototype%': Boolean.prototype, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '%Date%': Date, + '%DatePrototype%': Date.prototype, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%ErrorPrototype%': Error.prototype, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%EvalErrorPrototype%': EvalError.prototype, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '%Function%': Function, + '%FunctionPrototype%': Function.prototype, + '%Generator%': generator ? getProto(generator()) : undefined, + '%GeneratorFunction%': generatorFunction, + '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '%Math%': Math, + '%Number%': Number, + '%NumberPrototype%': Number.prototype, + '%Object%': Object, + '%ObjectPrototype%': Object.prototype, + '%ObjProto_toString%': Object.prototype.toString, + '%ObjProto_valueOf%': Object.prototype.valueOf, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%RangeErrorPrototype%': RangeError.prototype, + '%ReferenceError%': ReferenceError, + '%ReferenceErrorPrototype%': ReferenceError.prototype, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%RegExpPrototype%': RegExp.prototype, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringPrototype%': String.prototype, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '%SyntaxError%': SyntaxError, + '%SyntaxErrorPrototype%': SyntaxError.prototype, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '%TypeError%': $TypeError, + '%TypeErrorPrototype%': $TypeError.prototype, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '%URIError%': URIError, + '%URIErrorPrototype%': URIError.prototype, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +var bind = require('function-bind'); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + if (!(name in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[name]; +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, parts[i]); + if (!allowMissing && !(parts[i] in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]]; + } else { + value = value[parts[i]]; + } + } + } + return value; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/LICENSE b/node_modules/string.prototype.trimstart/node_modules/es-abstract/LICENSE new file mode 100644 index 0000000..8c271c1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/README.md b/node_modules/string.prototype.trimstart/node_modules/es-abstract/README.md new file mode 100644 index 0000000..20342d1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/README.md @@ -0,0 +1,48 @@ +# es-abstract [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +ECMAScript spec abstract operations. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +All abstract operations will also be available under an `es5`/`es2015`/`es2016`/`es2017`/`es2018`/`es2019` entry point, and exported property, if you require a specific version. + +## Example + +```js +var ES = require('es-abstract'); +var assert = require('assert'); + +assert(ES.isCallable(function () {})); +assert(!ES.isCallable(/a/g)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-abstract +[npm-version-svg]: http://versionbadg.es/ljharb/es-abstract.svg +[travis-svg]: https://travis-ci.org/ljharb/es-abstract.svg +[travis-url]: https://travis-ci.org/ljharb/es-abstract +[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg +[deps-url]: https://david-dm.org/ljharb/es-abstract +[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/es-abstract.png +[testling-url]: https://ci.testling.com/ljharb/es-abstract +[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-abstract.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-abstract.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-abstract diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2015.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2015.js new file mode 100644 index 0000000..dc02ca4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2015.js @@ -0,0 +1,115 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-operations +var ES6 = { + 'Abstract Equality Comparison': require('./2015/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2015/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2015/StrictEqualityComparison'), + AdvanceStringIndex: require('./2015/AdvanceStringIndex'), + ArrayCreate: require('./2015/ArrayCreate'), + ArraySetLength: require('./2015/ArraySetLength'), + ArraySpeciesCreate: require('./2015/ArraySpeciesCreate'), + Call: require('./2015/Call'), + CanonicalNumericIndexString: require('./2015/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2015/CompletePropertyDescriptor'), + CreateDataProperty: require('./2015/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2015/CreateDataPropertyOrThrow'), + CreateHTML: require('./2015/CreateHTML'), + CreateIterResultObject: require('./2015/CreateIterResultObject'), + CreateListFromArrayLike: require('./2015/CreateListFromArrayLike'), + CreateMethodProperty: require('./2015/CreateMethodProperty'), + DateFromTime: require('./2015/DateFromTime'), + Day: require('./2015/Day'), + DayFromYear: require('./2015/DayFromYear'), + DaysInYear: require('./2015/DaysInYear'), + DayWithinYear: require('./2015/DayWithinYear'), + DefinePropertyOrThrow: require('./2015/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2015/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2015/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2015/FromPropertyDescriptor'), + Get: require('./2015/Get'), + GetIterator: require('./2015/GetIterator'), + GetMethod: require('./2015/GetMethod'), + GetOwnPropertyKeys: require('./2015/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2015/GetPrototypeFromConstructor'), + GetSubstitution: require('./2015/GetSubstitution'), + GetV: require('./2015/GetV'), + HasOwnProperty: require('./2015/HasOwnProperty'), + HasProperty: require('./2015/HasProperty'), + HourFromTime: require('./2015/HourFromTime'), + InLeapYear: require('./2015/InLeapYear'), + InstanceofOperator: require('./2015/InstanceofOperator'), + Invoke: require('./2015/Invoke'), + IsAccessorDescriptor: require('./2015/IsAccessorDescriptor'), + IsArray: require('./2015/IsArray'), + IsCallable: require('./2015/IsCallable'), + IsConcatSpreadable: require('./2015/IsConcatSpreadable'), + IsConstructor: require('./2015/IsConstructor'), + IsDataDescriptor: require('./2015/IsDataDescriptor'), + IsExtensible: require('./2015/IsExtensible'), + IsGenericDescriptor: require('./2015/IsGenericDescriptor'), + IsInteger: require('./2015/IsInteger'), + IsPromise: require('./2015/IsPromise'), + IsPropertyDescriptor: require('./2015/IsPropertyDescriptor'), + IsPropertyKey: require('./2015/IsPropertyKey'), + IsRegExp: require('./2015/IsRegExp'), + IteratorClose: require('./2015/IteratorClose'), + IteratorComplete: require('./2015/IteratorComplete'), + IteratorNext: require('./2015/IteratorNext'), + IteratorStep: require('./2015/IteratorStep'), + IteratorValue: require('./2015/IteratorValue'), + MakeDate: require('./2015/MakeDate'), + MakeDay: require('./2015/MakeDay'), + MakeTime: require('./2015/MakeTime'), + MinFromTime: require('./2015/MinFromTime'), + modulo: require('./2015/modulo'), + MonthFromTime: require('./2015/MonthFromTime'), + msFromTime: require('./2015/msFromTime'), + ObjectCreate: require('./2015/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2015/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2015/OrdinaryGetOwnProperty'), + OrdinaryHasInstance: require('./2015/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2015/OrdinaryHasProperty'), + RegExpExec: require('./2015/RegExpExec'), + RequireObjectCoercible: require('./2015/RequireObjectCoercible'), + SameValue: require('./2015/SameValue'), + SameValueZero: require('./2015/SameValueZero'), + SecFromTime: require('./2015/SecFromTime'), + Set: require('./2015/Set'), + SetFunctionName: require('./2015/SetFunctionName'), + SetIntegrityLevel: require('./2015/SetIntegrityLevel'), + SpeciesConstructor: require('./2015/SpeciesConstructor'), + SymbolDescriptiveString: require('./2015/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2015/TestIntegrityLevel'), + thisBooleanValue: require('./2015/thisBooleanValue'), + thisNumberValue: require('./2015/thisNumberValue'), + thisStringValue: require('./2015/thisStringValue'), + thisTimeValue: require('./2015/thisTimeValue'), + TimeClip: require('./2015/TimeClip'), + TimeFromYear: require('./2015/TimeFromYear'), + TimeWithinDay: require('./2015/TimeWithinDay'), + ToBoolean: require('./2015/ToBoolean'), + ToDateString: require('./2015/ToDateString'), + ToInt16: require('./2015/ToInt16'), + ToInt32: require('./2015/ToInt32'), + ToInt8: require('./2015/ToInt8'), + ToInteger: require('./2015/ToInteger'), + ToLength: require('./2015/ToLength'), + ToNumber: require('./2015/ToNumber'), + ToObject: require('./2015/ToObject'), + ToPrimitive: require('./2015/ToPrimitive'), + ToPropertyDescriptor: require('./2015/ToPropertyDescriptor'), + ToPropertyKey: require('./2015/ToPropertyKey'), + ToString: require('./2015/ToString'), + ToUint16: require('./2015/ToUint16'), + ToUint32: require('./2015/ToUint32'), + ToUint8: require('./2015/ToUint8'), + ToUint8Clamp: require('./2015/ToUint8Clamp'), + Type: require('./2015/Type'), + ValidateAndApplyPropertyDescriptor: require('./2015/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2015/WeekDay'), + YearFromTime: require('./2015/YearFromTime') +}; + +module.exports = ES6; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2016.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2016.js new file mode 100644 index 0000000..9e72e82 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2016.js @@ -0,0 +1,119 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/7.0/#sec-abstract-operations +var ES2016 = { + 'Abstract Equality Comparison': require('./2016/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2016/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2016/StrictEqualityComparison'), + AdvanceStringIndex: require('./2016/AdvanceStringIndex'), + ArrayCreate: require('./2016/ArrayCreate'), + ArraySetLength: require('./2016/ArraySetLength'), + ArraySpeciesCreate: require('./2016/ArraySpeciesCreate'), + Call: require('./2016/Call'), + CanonicalNumericIndexString: require('./2016/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2016/CompletePropertyDescriptor'), + CreateDataProperty: require('./2016/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2016/CreateDataPropertyOrThrow'), + CreateHTML: require('./2016/CreateHTML'), + CreateIterResultObject: require('./2016/CreateIterResultObject'), + CreateListFromArrayLike: require('./2016/CreateListFromArrayLike'), + CreateMethodProperty: require('./2016/CreateMethodProperty'), + DateFromTime: require('./2016/DateFromTime'), + Day: require('./2016/Day'), + DayFromYear: require('./2016/DayFromYear'), + DaysInYear: require('./2016/DaysInYear'), + DayWithinYear: require('./2016/DayWithinYear'), + DefinePropertyOrThrow: require('./2016/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2016/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2016/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2016/FromPropertyDescriptor'), + Get: require('./2016/Get'), + GetIterator: require('./2016/GetIterator'), + GetMethod: require('./2016/GetMethod'), + GetOwnPropertyKeys: require('./2016/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2016/GetPrototypeFromConstructor'), + GetSubstitution: require('./2016/GetSubstitution'), + GetV: require('./2016/GetV'), + HasOwnProperty: require('./2016/HasOwnProperty'), + HasProperty: require('./2016/HasProperty'), + HourFromTime: require('./2016/HourFromTime'), + InLeapYear: require('./2016/InLeapYear'), + InstanceofOperator: require('./2016/InstanceofOperator'), + Invoke: require('./2016/Invoke'), + IsAccessorDescriptor: require('./2016/IsAccessorDescriptor'), + IsArray: require('./2016/IsArray'), + IsCallable: require('./2016/IsCallable'), + IsConcatSpreadable: require('./2016/IsConcatSpreadable'), + IsConstructor: require('./2016/IsConstructor'), + IsDataDescriptor: require('./2016/IsDataDescriptor'), + IsExtensible: require('./2016/IsExtensible'), + IsGenericDescriptor: require('./2016/IsGenericDescriptor'), + IsInteger: require('./2016/IsInteger'), + IsPromise: require('./2016/IsPromise'), + IsPropertyDescriptor: require('./2016/IsPropertyDescriptor'), + IsPropertyKey: require('./2016/IsPropertyKey'), + IsRegExp: require('./2016/IsRegExp'), + IterableToArrayLike: require('./2016/IterableToArrayLike'), + IteratorClose: require('./2016/IteratorClose'), + IteratorComplete: require('./2016/IteratorComplete'), + IteratorNext: require('./2016/IteratorNext'), + IteratorStep: require('./2016/IteratorStep'), + IteratorValue: require('./2016/IteratorValue'), + MakeDate: require('./2016/MakeDate'), + MakeDay: require('./2016/MakeDay'), + MakeTime: require('./2016/MakeTime'), + MinFromTime: require('./2016/MinFromTime'), + modulo: require('./2016/modulo'), + MonthFromTime: require('./2016/MonthFromTime'), + msFromTime: require('./2016/msFromTime'), + ObjectCreate: require('./2016/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2016/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2016/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2016/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2016/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2016/OrdinaryHasProperty'), + RegExpExec: require('./2016/RegExpExec'), + RequireObjectCoercible: require('./2016/RequireObjectCoercible'), + SameValue: require('./2016/SameValue'), + SameValueNonNumber: require('./2016/SameValueNonNumber'), + SameValueZero: require('./2016/SameValueZero'), + SecFromTime: require('./2016/SecFromTime'), + Set: require('./2016/Set'), + SetFunctionName: require('./2016/SetFunctionName'), + SetIntegrityLevel: require('./2016/SetIntegrityLevel'), + SpeciesConstructor: require('./2016/SpeciesConstructor'), + SymbolDescriptiveString: require('./2016/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2016/TestIntegrityLevel'), + thisBooleanValue: require('./2016/thisBooleanValue'), + thisNumberValue: require('./2016/thisNumberValue'), + thisStringValue: require('./2016/thisStringValue'), + thisTimeValue: require('./2016/thisTimeValue'), + TimeClip: require('./2016/TimeClip'), + TimeFromYear: require('./2016/TimeFromYear'), + TimeWithinDay: require('./2016/TimeWithinDay'), + ToBoolean: require('./2016/ToBoolean'), + ToDateString: require('./2016/ToDateString'), + ToInt16: require('./2016/ToInt16'), + ToInt32: require('./2016/ToInt32'), + ToInt8: require('./2016/ToInt8'), + ToInteger: require('./2016/ToInteger'), + ToLength: require('./2016/ToLength'), + ToNumber: require('./2016/ToNumber'), + ToObject: require('./2016/ToObject'), + ToPrimitive: require('./2016/ToPrimitive'), + ToPropertyDescriptor: require('./2016/ToPropertyDescriptor'), + ToPropertyKey: require('./2016/ToPropertyKey'), + ToString: require('./2016/ToString'), + ToUint16: require('./2016/ToUint16'), + ToUint32: require('./2016/ToUint32'), + ToUint8: require('./2016/ToUint8'), + ToUint8Clamp: require('./2016/ToUint8Clamp'), + Type: require('./2016/Type'), + ValidateAndApplyPropertyDescriptor: require('./2016/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2016/WeekDay'), + YearFromTime: require('./2016/YearFromTime') +}; + +module.exports = ES2016; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2017.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2017.js new file mode 100644 index 0000000..5f317b7 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2017.js @@ -0,0 +1,120 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/8.0/#sec-abstract-operations +var ES2017 = { + 'Abstract Equality Comparison': require('./2017/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2017/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2017/StrictEqualityComparison'), + AdvanceStringIndex: require('./2017/AdvanceStringIndex'), + ArrayCreate: require('./2017/ArrayCreate'), + ArraySetLength: require('./2017/ArraySetLength'), + ArraySpeciesCreate: require('./2017/ArraySpeciesCreate'), + Call: require('./2017/Call'), + CanonicalNumericIndexString: require('./2017/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2017/CompletePropertyDescriptor'), + CreateDataProperty: require('./2017/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2017/CreateDataPropertyOrThrow'), + CreateHTML: require('./2017/CreateHTML'), + CreateIterResultObject: require('./2017/CreateIterResultObject'), + CreateListFromArrayLike: require('./2017/CreateListFromArrayLike'), + CreateMethodProperty: require('./2017/CreateMethodProperty'), + DateFromTime: require('./2017/DateFromTime'), + Day: require('./2017/Day'), + DayFromYear: require('./2017/DayFromYear'), + DaysInYear: require('./2017/DaysInYear'), + DayWithinYear: require('./2017/DayWithinYear'), + DefinePropertyOrThrow: require('./2017/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2017/DeletePropertyOrThrow'), + EnumerableOwnProperties: require('./2017/EnumerableOwnProperties'), + FromPropertyDescriptor: require('./2017/FromPropertyDescriptor'), + Get: require('./2017/Get'), + GetIterator: require('./2017/GetIterator'), + GetMethod: require('./2017/GetMethod'), + GetOwnPropertyKeys: require('./2017/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2017/GetPrototypeFromConstructor'), + GetSubstitution: require('./2017/GetSubstitution'), + GetV: require('./2017/GetV'), + HasOwnProperty: require('./2017/HasOwnProperty'), + HasProperty: require('./2017/HasProperty'), + HourFromTime: require('./2017/HourFromTime'), + InLeapYear: require('./2017/InLeapYear'), + InstanceofOperator: require('./2017/InstanceofOperator'), + Invoke: require('./2017/Invoke'), + IsAccessorDescriptor: require('./2017/IsAccessorDescriptor'), + IsArray: require('./2017/IsArray'), + IsCallable: require('./2017/IsCallable'), + IsConcatSpreadable: require('./2017/IsConcatSpreadable'), + IsConstructor: require('./2017/IsConstructor'), + IsDataDescriptor: require('./2017/IsDataDescriptor'), + IsExtensible: require('./2017/IsExtensible'), + IsGenericDescriptor: require('./2017/IsGenericDescriptor'), + IsInteger: require('./2017/IsInteger'), + IsPromise: require('./2017/IsPromise'), + IsPropertyDescriptor: require('./2017/IsPropertyDescriptor'), + IsPropertyKey: require('./2017/IsPropertyKey'), + IsRegExp: require('./2017/IsRegExp'), + IterableToList: require('./2017/IterableToList'), + IteratorClose: require('./2017/IteratorClose'), + IteratorComplete: require('./2017/IteratorComplete'), + IteratorNext: require('./2017/IteratorNext'), + IteratorStep: require('./2017/IteratorStep'), + IteratorValue: require('./2017/IteratorValue'), + MakeDate: require('./2017/MakeDate'), + MakeDay: require('./2017/MakeDay'), + MakeTime: require('./2017/MakeTime'), + MinFromTime: require('./2017/MinFromTime'), + modulo: require('./2017/modulo'), + MonthFromTime: require('./2017/MonthFromTime'), + msFromTime: require('./2017/msFromTime'), + ObjectCreate: require('./2017/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2017/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2017/OrdinaryGetOwnProperty'), + OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), + OrdinaryGetPrototypeOf: require('./2017/OrdinaryGetPrototypeOf'), + OrdinaryHasInstance: require('./2017/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2017/OrdinaryHasProperty'), + RegExpExec: require('./2017/RegExpExec'), + RequireObjectCoercible: require('./2017/RequireObjectCoercible'), + SameValue: require('./2017/SameValue'), + SameValueNonNumber: require('./2017/SameValueNonNumber'), + SameValueZero: require('./2017/SameValueZero'), + SecFromTime: require('./2017/SecFromTime'), + Set: require('./2017/Set'), + SetFunctionName: require('./2017/SetFunctionName'), + SetIntegrityLevel: require('./2017/SetIntegrityLevel'), + SpeciesConstructor: require('./2017/SpeciesConstructor'), + SymbolDescriptiveString: require('./2017/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2017/TestIntegrityLevel'), + thisBooleanValue: require('./2017/thisBooleanValue'), + thisNumberValue: require('./2017/thisNumberValue'), + thisStringValue: require('./2017/thisStringValue'), + thisTimeValue: require('./2017/thisTimeValue'), + TimeClip: require('./2017/TimeClip'), + TimeFromYear: require('./2017/TimeFromYear'), + TimeWithinDay: require('./2017/TimeWithinDay'), + ToBoolean: require('./2017/ToBoolean'), + ToDateString: require('./2017/ToDateString'), + ToIndex: require('./2017/ToIndex'), + ToInt16: require('./2017/ToInt16'), + ToInt32: require('./2017/ToInt32'), + ToInt8: require('./2017/ToInt8'), + ToInteger: require('./2017/ToInteger'), + ToLength: require('./2017/ToLength'), + ToNumber: require('./2017/ToNumber'), + ToObject: require('./2017/ToObject'), + ToPrimitive: require('./2017/ToPrimitive'), + ToPropertyDescriptor: require('./2017/ToPropertyDescriptor'), + ToPropertyKey: require('./2017/ToPropertyKey'), + ToString: require('./2017/ToString'), + ToUint16: require('./2017/ToUint16'), + ToUint32: require('./2017/ToUint32'), + ToUint8: require('./2017/ToUint8'), + ToUint8Clamp: require('./2017/ToUint8Clamp'), + Type: require('./2017/Type'), + ValidateAndApplyPropertyDescriptor: require('./2017/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2017/WeekDay'), + YearFromTime: require('./2017/YearFromTime') +}; + +module.exports = ES2017; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2018.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2018.js new file mode 100644 index 0000000..e68910b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2018.js @@ -0,0 +1,126 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/9.0/#sec-abstract-operations +var ES2018 = { + 'Abstract Equality Comparison': require('./2018/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2018/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2018/StrictEqualityComparison'), + AdvanceStringIndex: require('./2018/AdvanceStringIndex'), + ArrayCreate: require('./2018/ArrayCreate'), + ArraySetLength: require('./2018/ArraySetLength'), + ArraySpeciesCreate: require('./2018/ArraySpeciesCreate'), + Call: require('./2018/Call'), + CanonicalNumericIndexString: require('./2018/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2018/CompletePropertyDescriptor'), + CopyDataProperties: require('./2018/CopyDataProperties'), + CreateDataProperty: require('./2018/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2018/CreateDataPropertyOrThrow'), + CreateHTML: require('./2018/CreateHTML'), + CreateIterResultObject: require('./2018/CreateIterResultObject'), + CreateListFromArrayLike: require('./2018/CreateListFromArrayLike'), + CreateMethodProperty: require('./2018/CreateMethodProperty'), + DateFromTime: require('./2018/DateFromTime'), + DateString: require('./2018/DateString'), + Day: require('./2018/Day'), + DayFromYear: require('./2018/DayFromYear'), + DaysInYear: require('./2018/DaysInYear'), + DayWithinYear: require('./2018/DayWithinYear'), + DefinePropertyOrThrow: require('./2018/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2018/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'), + FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'), + Get: require('./2018/Get'), + GetIterator: require('./2018/GetIterator'), + GetMethod: require('./2018/GetMethod'), + GetOwnPropertyKeys: require('./2018/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2018/GetPrototypeFromConstructor'), + GetSubstitution: require('./2018/GetSubstitution'), + GetV: require('./2018/GetV'), + HasOwnProperty: require('./2018/HasOwnProperty'), + HasProperty: require('./2018/HasProperty'), + HourFromTime: require('./2018/HourFromTime'), + InLeapYear: require('./2018/InLeapYear'), + InstanceofOperator: require('./2018/InstanceofOperator'), + Invoke: require('./2018/Invoke'), + IsAccessorDescriptor: require('./2018/IsAccessorDescriptor'), + IsArray: require('./2018/IsArray'), + IsCallable: require('./2018/IsCallable'), + IsConcatSpreadable: require('./2018/IsConcatSpreadable'), + IsConstructor: require('./2018/IsConstructor'), + IsDataDescriptor: require('./2018/IsDataDescriptor'), + IsExtensible: require('./2018/IsExtensible'), + IsGenericDescriptor: require('./2018/IsGenericDescriptor'), + IsInteger: require('./2018/IsInteger'), + IsPromise: require('./2018/IsPromise'), + IsPropertyKey: require('./2018/IsPropertyKey'), + IsRegExp: require('./2018/IsRegExp'), + IsStringPrefix: require('./2018/IsStringPrefix'), + IterableToList: require('./2018/IterableToList'), + IteratorClose: require('./2018/IteratorClose'), + IteratorComplete: require('./2018/IteratorComplete'), + IteratorNext: require('./2018/IteratorNext'), + IteratorStep: require('./2018/IteratorStep'), + IteratorValue: require('./2018/IteratorValue'), + MakeDate: require('./2018/MakeDate'), + MakeDay: require('./2018/MakeDay'), + MakeTime: require('./2018/MakeTime'), + MinFromTime: require('./2018/MinFromTime'), + modulo: require('./2018/modulo'), + MonthFromTime: require('./2018/MonthFromTime'), + msFromTime: require('./2018/msFromTime'), + NumberToString: require('./2018/NumberToString'), + ObjectCreate: require('./2018/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'), + PromiseResolve: require('./2018/PromiseResolve'), + RegExpExec: require('./2018/RegExpExec'), + RequireObjectCoercible: require('./2018/RequireObjectCoercible'), + SameValue: require('./2018/SameValue'), + SameValueNonNumber: require('./2018/SameValueNonNumber'), + SameValueZero: require('./2018/SameValueZero'), + SecFromTime: require('./2018/SecFromTime'), + Set: require('./2018/Set'), + SetFunctionName: require('./2018/SetFunctionName'), + SetIntegrityLevel: require('./2018/SetIntegrityLevel'), + SpeciesConstructor: require('./2018/SpeciesConstructor'), + SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2018/TestIntegrityLevel'), + thisBooleanValue: require('./2018/thisBooleanValue'), + thisNumberValue: require('./2018/thisNumberValue'), + thisStringValue: require('./2018/thisStringValue'), + thisSymbolValue: require('./2018/thisSymbolValue'), + thisTimeValue: require('./2018/thisTimeValue'), + TimeClip: require('./2018/TimeClip'), + TimeFromYear: require('./2018/TimeFromYear'), + TimeString: require('./2018/TimeString'), + TimeWithinDay: require('./2018/TimeWithinDay'), + ToBoolean: require('./2018/ToBoolean'), + ToDateString: require('./2018/ToDateString'), + ToIndex: require('./2018/ToIndex'), + ToInt16: require('./2018/ToInt16'), + ToInt32: require('./2018/ToInt32'), + ToInt8: require('./2018/ToInt8'), + ToInteger: require('./2018/ToInteger'), + ToLength: require('./2018/ToLength'), + ToNumber: require('./2018/ToNumber'), + ToObject: require('./2018/ToObject'), + ToPrimitive: require('./2018/ToPrimitive'), + ToPropertyDescriptor: require('./2018/ToPropertyDescriptor'), + ToPropertyKey: require('./2018/ToPropertyKey'), + ToString: require('./2018/ToString'), + ToUint16: require('./2018/ToUint16'), + ToUint32: require('./2018/ToUint32'), + ToUint8: require('./2018/ToUint8'), + ToUint8Clamp: require('./2018/ToUint8Clamp'), + Type: require('./2018/Type'), + ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2018/WeekDay'), + YearFromTime: require('./2018/YearFromTime') +}; + +module.exports = ES2018; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2019.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2019.js new file mode 100644 index 0000000..3bd65e4 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es2019.js @@ -0,0 +1,129 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/10.0/#sec-abstract-operations +var ES2019 = { + 'Abstract Equality Comparison': require('./2019/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2019/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2019/StrictEqualityComparison'), + AddEntriesFromIterable: require('./2019/AddEntriesFromIterable'), + AdvanceStringIndex: require('./2019/AdvanceStringIndex'), + ArrayCreate: require('./2019/ArrayCreate'), + ArraySetLength: require('./2019/ArraySetLength'), + ArraySpeciesCreate: require('./2019/ArraySpeciesCreate'), + Call: require('./2019/Call'), + CanonicalNumericIndexString: require('./2019/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2019/CompletePropertyDescriptor'), + CopyDataProperties: require('./2019/CopyDataProperties'), + CreateDataProperty: require('./2019/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2019/CreateDataPropertyOrThrow'), + CreateHTML: require('./2019/CreateHTML'), + CreateIterResultObject: require('./2019/CreateIterResultObject'), + CreateListFromArrayLike: require('./2019/CreateListFromArrayLike'), + CreateMethodProperty: require('./2019/CreateMethodProperty'), + DateFromTime: require('./2019/DateFromTime'), + DateString: require('./2019/DateString'), + Day: require('./2019/Day'), + DayFromYear: require('./2019/DayFromYear'), + DaysInYear: require('./2019/DaysInYear'), + DayWithinYear: require('./2019/DayWithinYear'), + DefinePropertyOrThrow: require('./2019/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2019/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2019/EnumerableOwnPropertyNames'), + FlattenIntoArray: require('./2019/FlattenIntoArray'), + FromPropertyDescriptor: require('./2019/FromPropertyDescriptor'), + Get: require('./2019/Get'), + GetIterator: require('./2019/GetIterator'), + GetMethod: require('./2019/GetMethod'), + GetOwnPropertyKeys: require('./2019/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2019/GetPrototypeFromConstructor'), + GetSubstitution: require('./2019/GetSubstitution'), + GetV: require('./2019/GetV'), + HasOwnProperty: require('./2019/HasOwnProperty'), + HasProperty: require('./2019/HasProperty'), + HourFromTime: require('./2019/HourFromTime'), + InLeapYear: require('./2019/InLeapYear'), + InstanceofOperator: require('./2019/InstanceofOperator'), + Invoke: require('./2019/Invoke'), + IsAccessorDescriptor: require('./2019/IsAccessorDescriptor'), + IsArray: require('./2019/IsArray'), + IsCallable: require('./2019/IsCallable'), + IsConcatSpreadable: require('./2019/IsConcatSpreadable'), + IsConstructor: require('./2019/IsConstructor'), + IsDataDescriptor: require('./2019/IsDataDescriptor'), + IsExtensible: require('./2019/IsExtensible'), + IsGenericDescriptor: require('./2019/IsGenericDescriptor'), + IsInteger: require('./2019/IsInteger'), + IsPromise: require('./2019/IsPromise'), + IsPropertyKey: require('./2019/IsPropertyKey'), + IsRegExp: require('./2019/IsRegExp'), + IsStringPrefix: require('./2019/IsStringPrefix'), + IterableToList: require('./2019/IterableToList'), + IteratorClose: require('./2019/IteratorClose'), + IteratorComplete: require('./2019/IteratorComplete'), + IteratorNext: require('./2019/IteratorNext'), + IteratorStep: require('./2019/IteratorStep'), + IteratorValue: require('./2019/IteratorValue'), + MakeDate: require('./2019/MakeDate'), + MakeDay: require('./2019/MakeDay'), + MakeTime: require('./2019/MakeTime'), + MinFromTime: require('./2019/MinFromTime'), + modulo: require('./2019/modulo'), + MonthFromTime: require('./2019/MonthFromTime'), + msFromTime: require('./2019/msFromTime'), + NumberToString: require('./2019/NumberToString'), + ObjectCreate: require('./2019/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2019/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2019/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2019/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2019/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2019/OrdinaryHasProperty'), + PromiseResolve: require('./2019/PromiseResolve'), + RegExpExec: require('./2019/RegExpExec'), + RequireObjectCoercible: require('./2019/RequireObjectCoercible'), + SameValue: require('./2019/SameValue'), + SameValueNonNumber: require('./2019/SameValueNonNumber'), + SameValueZero: require('./2019/SameValueZero'), + SecFromTime: require('./2019/SecFromTime'), + Set: require('./2019/Set'), + SetFunctionName: require('./2019/SetFunctionName'), + SetIntegrityLevel: require('./2019/SetIntegrityLevel'), + SpeciesConstructor: require('./2019/SpeciesConstructor'), + SymbolDescriptiveString: require('./2019/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2019/TestIntegrityLevel'), + thisBooleanValue: require('./2019/thisBooleanValue'), + thisNumberValue: require('./2019/thisNumberValue'), + thisStringValue: require('./2019/thisStringValue'), + thisSymbolValue: require('./2019/thisSymbolValue'), + thisTimeValue: require('./2019/thisTimeValue'), + TimeClip: require('./2019/TimeClip'), + TimeFromYear: require('./2019/TimeFromYear'), + TimeString: require('./2019/TimeString'), + TimeWithinDay: require('./2019/TimeWithinDay'), + ToBoolean: require('./2019/ToBoolean'), + ToDateString: require('./2019/ToDateString'), + ToIndex: require('./2019/ToIndex'), + ToInt16: require('./2019/ToInt16'), + ToInt32: require('./2019/ToInt32'), + ToInt8: require('./2019/ToInt8'), + ToInteger: require('./2019/ToInteger'), + ToLength: require('./2019/ToLength'), + ToNumber: require('./2019/ToNumber'), + ToObject: require('./2019/ToObject'), + ToPrimitive: require('./2019/ToPrimitive'), + ToPropertyDescriptor: require('./2019/ToPropertyDescriptor'), + ToPropertyKey: require('./2019/ToPropertyKey'), + ToString: require('./2019/ToString'), + ToUint16: require('./2019/ToUint16'), + ToUint32: require('./2019/ToUint32'), + ToUint8: require('./2019/ToUint8'), + ToUint8Clamp: require('./2019/ToUint8Clamp'), + TrimString: require('./2019/TrimString'), + Type: require('./2019/Type'), + ValidateAndApplyPropertyDescriptor: require('./2019/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2019/WeekDay'), + YearFromTime: require('./2019/YearFromTime') +}; + +module.exports = ES2019; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es5.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es5.js new file mode 100644 index 0000000..2cc9515 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es5.js @@ -0,0 +1,49 @@ +'use strict'; + +/* eslint global-require: 0 */ + +// https://es5.github.io/#x9 +module.exports = { + 'Abstract Equality Comparison': require('./5/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./5/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./5/StrictEqualityComparison'), + CheckObjectCoercible: require('./5/CheckObjectCoercible'), + DateFromTime: require('./5/DateFromTime'), + Day: require('./5/Day'), + DayFromYear: require('./5/DayFromYear'), + DaysInYear: require('./5/DaysInYear'), + DayWithinYear: require('./5/DayWithinYear'), + FromPropertyDescriptor: require('./5/FromPropertyDescriptor'), + HourFromTime: require('./5/HourFromTime'), + InLeapYear: require('./5/InLeapYear'), + IsAccessorDescriptor: require('./5/IsAccessorDescriptor'), + IsCallable: require('./5/IsCallable'), + IsDataDescriptor: require('./5/IsDataDescriptor'), + IsGenericDescriptor: require('./5/IsGenericDescriptor'), + IsPropertyDescriptor: require('./5/IsPropertyDescriptor'), + MakeDate: require('./5/MakeDate'), + MakeDay: require('./5/MakeDay'), + MakeTime: require('./5/MakeTime'), + MinFromTime: require('./5/MinFromTime'), + modulo: require('./5/modulo'), + MonthFromTime: require('./5/MonthFromTime'), + msFromTime: require('./5/msFromTime'), + SameValue: require('./5/SameValue'), + SecFromTime: require('./5/SecFromTime'), + TimeClip: require('./5/TimeClip'), + TimeFromYear: require('./5/TimeFromYear'), + TimeWithinDay: require('./5/TimeWithinDay'), + ToBoolean: require('./5/ToBoolean'), + ToInt32: require('./5/ToInt32'), + ToInteger: require('./5/ToInteger'), + ToNumber: require('./5/ToNumber'), + ToObject: require('./5/ToObject'), + ToPrimitive: require('./5/ToPrimitive'), + ToPropertyDescriptor: require('./5/ToPropertyDescriptor'), + ToString: require('./5/ToString'), + ToUint16: require('./5/ToUint16'), + ToUint32: require('./5/ToUint32'), + Type: require('./5/Type'), + WeekDay: require('./5/WeekDay'), + YearFromTime: require('./5/YearFromTime') +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es6.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es6.js new file mode 100644 index 0000000..2d1f4dc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es6.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2015'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/es7.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es7.js new file mode 100644 index 0000000..f2f15c0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/es7.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2016'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/DefineOwnProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/DefineOwnProperty.js new file mode 100644 index 0000000..99ace10 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/DefineOwnProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +// eslint-disable-next-line max-params +module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { + if (!$defineProperty) { + if (!IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + // eslint-disable-next-line no-param-reassign + O[P] = V; // will use [[Define]] + return SameValue(O[P], V); + } + $defineProperty(O, P, FromPropertyDescriptor(desc)); + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/OwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..4a06ce3 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/OwnPropertyKeys.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); +var callBound = require('./callBound'); + +var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); +var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; + +var keys = require('object-keys'); + +module.exports = $ownKeys || function OwnPropertyKeys(source) { + var ownKeys = ($gOPN || keys)(source); + if ($gOPS) { + $pushApply(ownKeys, $gOPS(source)); + } + return ownKeys; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assertRecord.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assertRecord.js new file mode 100644 index 0000000..45e115a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assertRecord.js @@ -0,0 +1,48 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = require('has'); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { + if (Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(Type, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(Type, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assign.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 0000000..7e6666e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBind.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBind.js new file mode 100644 index 0000000..3c1a327 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBind.js @@ -0,0 +1,34 @@ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind() { + return $reflectApply(bind, $call, arguments); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBound.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBound.js new file mode 100644 index 0000000..9dc8fc5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/every.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/every.js new file mode 100644 index 0000000..42a4582 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/every.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/forEach.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/forEach.js new file mode 100644 index 0000000..35915a6 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/forEach.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getInferredName.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getInferredName.js new file mode 100644 index 0000000..2dab6e7 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getInferredName.js @@ -0,0 +1,10 @@ +'use strict'; + +var getInferredName; +try { + // eslint-disable-next-line no-new-func + getInferredName = Function('s', 'return { [s]() {} }[s].name;'); +} catch (e) {} + +var inferred = function () {}; +module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getIteratorMethod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getIteratorMethod.js new file mode 100644 index 0000000..02f932c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getIteratorMethod.js @@ -0,0 +1,45 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('./callBound'); + +var $iterator = GetIntrinsic('%Symbol.iterator%', true); +var $stringSlice = callBound('String.prototype.slice'); + +module.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (ES.Type(iterable) === 'String') { + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(iterable, i, true); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + }; + } + return usingIterator; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js new file mode 100644 index 0000000..71168e9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getProto.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getProto.js new file mode 100644 index 0000000..af10fd8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getProto.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalGetProto || ( + // eslint-disable-next-line no-proto + [].__proto__ === $ArrayProto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getSymbolDescription.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getSymbolDescription.js new file mode 100644 index 0000000..45d80d2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/getSymbolDescription.js @@ -0,0 +1,41 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('./callBound'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true); +var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true); +var symToStr = callBound('Symbol.prototype.toString', true); + +var getInferredName = require('./getInferredName'); + +/* eslint-disable consistent-return */ +module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) { + if (!thisSymbolValue) { + throw new $SyntaxError('Symbols are not supported in this environment'); + } + + // will throw if not a symbol primitive or wrapper object + var sym = thisSymbolValue(symbol); + + if (getInferredName) { + var name = getInferredName(sym); + if (name === '') { return; } + return name.slice(1, -1); // name.slice('['.length, -']'.length); + } + + var desc; + if (getGlobalSymbolDescription) { + desc = getGlobalSymbolDescription(sym); + if (typeof desc === 'string') { + return desc; + } + } + + desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length); + if (desc) { + return desc; + } +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isFinite.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isFinite.js new file mode 100644 index 0000000..9e7cd4f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isFinite.js @@ -0,0 +1,5 @@ +'use strict'; + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isNaN.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isNaN.js new file mode 100644 index 0000000..cb8631d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isNaN.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrefixOf.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrefixOf.js new file mode 100644 index 0000000..b67d640 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrefixOf.js @@ -0,0 +1,13 @@ +'use strict'; + +var $strSlice = require('../helpers/callBound')('String.prototype.slice'); + +module.exports = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return $strSlice(string, 0, prefix.length) === prefix; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrimitive.js new file mode 100644 index 0000000..06f0bf0 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPropertyDescriptor.js new file mode 100644 index 0000000..3eff7eb --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isPropertyDescriptor.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line no-restricted-syntax + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js new file mode 100644 index 0000000..a6162a1 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js @@ -0,0 +1,20 @@ +'use strict'; + +var every = require('./every'); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/maxSafeInteger.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/maxSafeInteger.js new file mode 100644 index 0000000..2fe8f38 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/maxSafeInteger.js @@ -0,0 +1,8 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); +var $Number = GetIntrinsic('%Number%'); + +module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/mod.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/mod.js new file mode 100644 index 0000000..67c8b78 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/mod.js @@ -0,0 +1,8 @@ +'use strict'; + +var $floor = Math.floor; + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/padTimeComponent.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/padTimeComponent.js new file mode 100644 index 0000000..cbd8d06 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/padTimeComponent.js @@ -0,0 +1,9 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $strSlice = callBound('String.prototype.slice'); + +module.exports = function padTimeComponent(c, count) { + return $strSlice('00' + c, -(count || 2)); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/regexTester.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/regexTester.js new file mode 100644 index 0000000..982cc9f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/regexTester.js @@ -0,0 +1,11 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $test = GetIntrinsic('RegExp.prototype.test'); + +var callBind = require('./callBind'); + +module.exports = function regexTester(regex) { + return callBind($test, regex); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/setProto.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/setProto.js new file mode 100644 index 0000000..29ec991 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/setProto.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalSetProto || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayProto + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/sign.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/sign.js new file mode 100644 index 0000000..598ea7d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/sign.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/timeConstants.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/timeConstants.js new file mode 100644 index 0000000..c275b40 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/helpers/timeConstants.js @@ -0,0 +1,19 @@ +'use strict'; + +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1e3; +var msPerMinute = msPerSecond * SecondsPerMinute; +var msPerHour = msPerMinute * MinutesPerHour; +var msPerDay = 86400000; + +module.exports = { + HoursPerDay: HoursPerDay, + MinutesPerHour: MinutesPerHour, + SecondsPerMinute: SecondsPerMinute, + msPerSecond: msPerSecond, + msPerMinute: msPerMinute, + msPerHour: msPerHour, + msPerDay: msPerDay +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/index.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/index.js new file mode 100644 index 0000000..7cef039 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var assign = require('./helpers/assign'); + +var ES5 = require('./es5'); +var ES2015 = require('./es2015'); +var ES2016 = require('./es2016'); +var ES2017 = require('./es2017'); +var ES2018 = require('./es2018'); +var ES2019 = require('./es2019'); + +var ES = { + ES5: ES5, + ES6: ES2015, + ES2015: ES2015, + ES7: ES2016, + ES2016: ES2016, + ES2017: ES2017, + ES2018: ES2018, + ES2019: ES2019 +}; +assign(ES, ES5); +delete ES.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible +assign(ES, ES2015); + +module.exports = ES; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/.eslintrc b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/.eslintrc new file mode 100644 index 0000000..bcd76f7 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": 0, + }, +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2015.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2015.js new file mode 100644 index 0000000..6c50891 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2015.js @@ -0,0 +1,249 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatetypedarray', + ArrayCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/6.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/6.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/6.0/#sec-implicit-completion-values', + Construct: 'https://ecma-international.org/ecma-262/6.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/6.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/6.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/6.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/6.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-createrealm', + CreateSetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createsetiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/6.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/6.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/6.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/6.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/6.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/6.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-functioncreate', + FunctionInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/6.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/6.0/#sec-get-o-p', + GetBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/6.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/6.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/6.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetSubstitution: 'https://ecma-international.org/ecma-262/6.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/6.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/6.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getviewvalue', + HasOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + HasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasproperty', + HostResolveImportedModule: 'sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/6.0/#sec-importedlocalnames', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/6.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/6.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/6.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/6.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/6.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsRegExp: 'https://ecma-international.org/ecma-262/6.0/#sec-isregexp', + IsStrictReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsSuperReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsWordChar: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IteratorClose: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/6.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/6.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/6.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/6.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/6.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + msPerDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/6.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/6.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty', + ParseModule: 'https://ecma-international.org/ecma-262/6.0/#sec-parsemodule', + PerformEval: 'https://ecma-international.org/ecma-262/6.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/6.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/6.0/#sec-preparefortailcall', + ProxyCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/6.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/6.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvethisbinding', + SameValue: 'https://ecma-international.org/ecma-262/6.0/#sec-samevalue', + SameValueZero: 'https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero', + SecFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/6.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-setviewvalue', + sign: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + SortCompare: 'https://ecma-international.org/ecma-262/6.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/6.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-stringcreate', + StringGetIndexProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-stringgetindexproperty', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object', + thisNumberValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/6.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/6.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/6.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/6.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/6.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/6.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/6.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/6.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/6.0/#sec-toobject', + ToPrimitive: 'https://ecma-international.org/ecma-262/6.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/6.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/6.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/6.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/6.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values', + TypedArrayFrom: 'https://ecma-international.org/ecma-262/6.0/#sec-typedarrayfrom', + UpdateEmpty: 'https://ecma-international.org/ecma-262/6.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/6.0/#sec-utc-t', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor', + WeekDay: 'https://ecma-international.org/ecma-262/6.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number' +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2016.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2016.js new file mode 100644 index 0000000..6a58b9c --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2016.js @@ -0,0 +1,276 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/7.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/7.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arrayspeciescreate', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/7.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/7.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/7.0/#sec-completion-record-specification-type', + Construct: 'https://ecma-international.org/ecma-262/7.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/7.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/7.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/7.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/7.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/7.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createsetiterator', + CreateStringIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/7.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/7.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerableownnames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/7.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/7.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/7.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/7.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/7.0/#sec-getactivescriptormodule', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/7.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/7.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/7.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getprototypefromconstructor', + GetSubstitution: 'https://ecma-international.org/ecma-262/7.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/7.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/7.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getviewvalue', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-globaldeclarationinstantiation', + HasOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasownproperty', + HasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasproperty', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/7.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/7.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/7.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/7.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/7.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/7.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/7.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/7.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/7.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/7.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/7.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/7.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-ispropertykey', + IsRegExp: 'https://ecma-international.org/ecma-262/7.0/#sec-isregexp', + IsWordChar: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike', + IteratorClose: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/7.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/7.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/7.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/7.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/7.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/7.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/7.0/#sec-newpromisecapability', + NextJob: 'https://ecma-international.org/ecma-262/7.0/#sec-nextjob-result', + NormalCompletion: 'https://ecma-international.org/ecma-262/7.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof', + ParseModule: 'https://ecma-international.org/ecma-262/7.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/7.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/7.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/7.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/7.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/7.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/7.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/7.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-returnifabrupt', + SameValue: 'https://ecma-international.org/ecma-262/7.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/7.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/7.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/7.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-setviewvalue', + SortCompare: 'https://ecma-international.org/ecma-262/7.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/7.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-stringcreate', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/7.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/7.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/7.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/7.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/7.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/7.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/7.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/7.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/7.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/7.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/7.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/7.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/7.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/7.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/7.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/7.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/7.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/7.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/7.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-validateandapplypropertydescriptor', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-validatetypedarray', + WeekDay: 'https://ecma-international.org/ecma-262/7.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number' +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2017.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2017.js new file mode 100644 index 0000000..896fcee --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2017.js @@ -0,0 +1,324 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/8.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/8.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/8.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/8.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/8.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arrayspeciescreate', + AsyncFunctionAwait: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-await', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-start', + AtomicLoad: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicreadmodifywrite', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/8.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/8.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/8.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/8.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/8.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/8.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/8.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/8.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/8.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/8.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/8.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-entercriticalsection', + EnumerableOwnProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/8.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/8.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/8.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/8.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/8.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/8.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/8.0/#ao-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/8.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/8.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/8.0/#ao-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/8.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/8.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/8.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/8.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/8.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/8.0/#ao-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/8.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/8.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/8.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/8.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/8.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/8.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-InLeapYear', + InstanceofOperator: 'https://ecma-international.org/ecma-262/8.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/8.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/8.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/8.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/8.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/8.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/8.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#ao-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/8.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isstrictreference', + IsSuperReference: 'https://ecma-international.org/ecma-262/8.0/#ao-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/8.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/8.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/8.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/8.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/8.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/8.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/8.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/8.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/8.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/8.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/8.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/8.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-numbertorawbytes', + ObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarysetprototypeof', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/8.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/8.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/8.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/8.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/8.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/8.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/8.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/8.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/8.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/8.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/8.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/8.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/8.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/8.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/8.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/8.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/8.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/8.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisstringvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thistimevalue', + TimeClip: 'https://ecma-international.org/ecma-262/8.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeFromYear', + TimeWithinDay: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeWithinDay', + ToBoolean: 'https://ecma-international.org/ecma-262/8.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/8.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/8.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/8.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/8.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/8.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/8.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/8.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/8.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/8.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/8.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/8.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/8.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/8.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/8.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/8.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/8.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/8.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-YearFromTime' +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2018.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2018.js new file mode 100644 index 0000000..c93b561 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2018.js @@ -0,0 +1,350 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/9.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/9.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/9.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/9.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/9.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arrayspeciescreate', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/9.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/9.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/9.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/9.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/9.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/9.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/9.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/9.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/9.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/9.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/9.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/9.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/9.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/9.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/9.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/9.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/9.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/9.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/9.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/9.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/9.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/9.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/9.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/9.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/9.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/9.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/9.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/9.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/9.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/9.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/9.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/9.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/9.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/9.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/9.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/9.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/9.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/9.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/9.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/9.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/9.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/9.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/9.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/9.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/9.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/9.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/9.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/9.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/9.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/9.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/9.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/9.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/9.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/9.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MinFromTime', + ModuleDeclarationEnvironmentSetup: 'https://ecma-international.org/ecma-262/9.0/#sec-moduledeclarationenvironmentsetup', + ModuleExecution: 'https://ecma-international.org/ecma-262/9.0/#sec-moduleexecution', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/9.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/9.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/9.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/9.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/9.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/9.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/9.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/9.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/9.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/9.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/9.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/9.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/9.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/9.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/9.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/9.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/9.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/9.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/9.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/9.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/9.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/9.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/9.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/9.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/9.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/9.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/9.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/9.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/9.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/9.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/9.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/9.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/9.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/9.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/9.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/9.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/9.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/9.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/9.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-YearFromTime' +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2019.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2019.js new file mode 100644 index 0000000..73f05e8 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/operations/2019.js @@ -0,0 +1,355 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/10.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-relational-comparison', + AddEntriesFromIterable: 'https://ecma-international.org/ecma-262/10.0/#sec-add-entries-from-iterable', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/10.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/10.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/10.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/10.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arrayspeciescreate', + AsyncFromSyncIteratorContinuation: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncfromsynciteratorcontinuation', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/10.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/10.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/10.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/10.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/10.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/10.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/10.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/10.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/10.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/10.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/10.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/10.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/10.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/10.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-event-set', + ExecuteModule: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-execute-module', + FlattenIntoArray: 'https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray', + floor: 'https://ecma-international.org/ecma-262/10.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/10.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/10.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/10.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/10.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/10.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/10.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/10.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/10.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/10.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/10.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/10.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/10.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/10.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/10.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/10.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/10.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/10.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/10.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/10.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/10.0/#sec-initializeboundname', + InitializeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-initialize-environment', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/10.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/10.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/10.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/10.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/10.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/10.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/10.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/10.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/10.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/10.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/10.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/10.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/10.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/10.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/10.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/10.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/10.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/10.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/10.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/10.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/10.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-normalcompletion', + NotifyWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-notifywaiter', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/10.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/10.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/10.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/10.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/10.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/10.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/10.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/10.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/10.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/10.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/10.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/10.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/10.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/10.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/10.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/10.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/10.0/#sec-symboldescriptivestring', + SynchronizeEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizeeventset', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/10.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/10.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/10.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/10.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/10.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/10.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/10.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/10.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/10.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/10.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/10.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/10.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/10.0/#sec-triggerpromisereactions', + TrimString: 'https://ecma-international.org/ecma-262/10.0/#sec-trimstring', + Type: 'https://ecma-international.org/ecma-262/10.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/10.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/10.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/10.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/10.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/10.0/#sec-valueofreadevent', + WeekDay: 'https://ecma-international.org/ecma-262/10.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-YearFromTime' +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/package.json b/node_modules/string.prototype.trimstart/node_modules/es-abstract/package.json new file mode 100644 index 0000000..1a81b94 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/package.json @@ -0,0 +1,139 @@ +{ + "_from": "es-abstract@^1.17.5", + "_id": "es-abstract@1.17.7", + "_inBundle": false, + "_integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "_location": "/string.prototype.trimstart/es-abstract", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es-abstract@^1.17.5", + "name": "es-abstract", + "escapedName": "es-abstract", + "rawSpec": "^1.17.5", + "saveSpec": null, + "fetchSpec": "^1.17.5" + }, + "_requiredBy": [ + "/string.prototype.trimstart" + ], + "_resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "_shasum": "a4de61b2f66989fc7421676c1cb9787573ace54c", + "_spec": "es-abstract@^1.17.5", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/string.prototype.trimstart", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "bugs": { + "url": "https://github.com/ljharb/es-abstract/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "deprecated": false, + "description": "ECMAScript spec abstract operations.", + "devDependencies": { + "@ljharb/eslint-config": "^17.2.0", + "array.prototype.indexof": "^1.0.0", + "aud": "^1.1.2", + "cheerio": "^1.0.0-rc.3", + "diff": "^4.0.2", + "eclint": "^2.8.1", + "eslint": "^7.10.0", + "foreach": "^2.0.5", + "functions-have-names": "^1.2.1", + "has-strict-mode": "^1.0.0", + "in-publish": "^2.0.1", + "make-arrow-function": "^1.2.0", + "nyc": "^10.3.2", + "object-is": "^1.1.2", + "object.fromentries": "^2.0.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "greenkeeper": { + "//": "nyc is ignored because it requires node 4+, and we support older than that", + "ignore": [ + "nyc" + ] + }, + "homepage": "https://github.com/ljharb/es-abstract#readme", + "keywords": [ + "ECMAScript", + "ES", + "abstract", + "operation", + "abstract operation", + "JavaScript", + "ES5", + "ES6", + "ES7" + ], + "license": "MIT", + "main": "index.js", + "name": "es-abstract", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-abstract.git" + }, + "scripts": { + "coverage": "nyc npm run tests-only >/dev/null", + "eccheck": "eclint check *.js **/*.js > /dev/null", + "lint": "eslint .", + "postcoverage": "nyc report", + "postspackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs git add", + "posttest": "aud --production", + "prepublish": "safe-publish-latest && (not-in-publish || npm run spackle)", + "prespackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs rm || true", + "pretest": "npm run lint", + "spackle": "node operations/spackle 1", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.17.7" +} diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/GetIntrinsic.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/GetIntrinsic.js new file mode 100644 index 0000000..a3e69a7 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/GetIntrinsic.js @@ -0,0 +1,94 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var test = require('tape'); +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + t.end(); +}); + +test('accessors', { skip: !Object.getOwnPropertyDescriptor || typeof Map !== 'function' }, function (t) { + var actual = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/diffOps.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/diffOps.js new file mode 100644 index 0000000..602098d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/diffOps.js @@ -0,0 +1,27 @@ +'use strict'; + +var keys = require('object-keys'); +var forEach = require('foreach'); +var indexOf = require('array.prototype.indexof'); + +module.exports = function diffOperations(actual, expected, expectedMissing) { + var actualKeys = keys(actual); + var expectedKeys = keys(expected); + + var extra = []; + var missing = []; + forEach(actualKeys, function (op) { + if (!(op in expected)) { + extra.push(op); + } else if (indexOf(expectedMissing, op) !== -1) { + extra.push(op); + } + }); + forEach(expectedKeys, function (op) { + if (typeof actual[op] !== 'function' && indexOf(expectedMissing, op) === -1) { + missing.push(op); + } + }); + + return { missing: missing, extra: extra }; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2015.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2015.js new file mode 100644 index 0000000..9bb8ec9 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2015.js @@ -0,0 +1,150 @@ +'use strict'; + +var ES = require('../').ES2015; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2015'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateSetIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'HasPrimitiveBase', + 'HostResolveImportedModule', + 'ImportedLocalNames', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'msPerDay', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'ParseModule', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'sign', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetIndexProperty', + 'TriggerPromiseReactions', + 'TypedArrayFrom', + 'UpdateEmpty', + 'UTC' +]; + +require('./tests').es2015(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2015); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2016.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2016.js new file mode 100644 index 0000000..611ea6a --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2016.js @@ -0,0 +1,173 @@ +'use strict'; + +var ES = require('../').ES2016; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2016'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GlobalDeclarationInstantiation', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NextJob', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateTypedArray' +]; + +require('./tests').es2016(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2016); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2017.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2017.js new file mode 100644 index 0000000..74eb38e --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2017.js @@ -0,0 +1,220 @@ +'use strict'; + +var ES = require('../').ES2017; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2017'); + +var expectedMissing = [ + 'abs', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionAwait', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters', + 'AddRestrictedFunctionProperties', + 'synchronizes-with' +]; + +require('./tests').es2017(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2017); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2018.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2018.js new file mode 100644 index 0000000..5ca1087 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2018.js @@ -0,0 +1,241 @@ +'use strict'; + +var ES = require('../').ES2018; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2018'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2018(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2018); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2019.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2019.js new file mode 100644 index 0000000..c034b60 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es2019.js @@ -0,0 +1,246 @@ +'use strict'; + +var ES = require('../').ES2019; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2019'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFromSyncIteratorContinuation', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'ExecuteModule', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeEnvironment', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NotifyWaiter', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'SynchronizeEventSet', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2019(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2019); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es5.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es5.js new file mode 100644 index 0000000..6647a1b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es5.js @@ -0,0 +1,786 @@ +'use strict'; + +var ES = require('../').ES5; +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +require('./helpers/runManifestTest')(test, ES, 5); + +ES = require('./helpers/createBoundESNamespace')(ES); + +test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + st.equal(ES.ToPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError'); + st.end(); + }); + + t.end(); +}); + +test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + forEach([0, -0, NaN], function (falsyNumber) { + t.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach([Infinity, 42, 1, -Infinity], function (truthyNumber) { + t.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + forEach(v.objects, function (obj) { + t.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + t.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + t.end(); +}); + +test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + t.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach([0, -0, 42, Infinity, -Infinity], function (num) { + t.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + t.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + forEach(v.objects, function (object) { + t.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + t['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); +}); + +test('ToString', function (t) { + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); +}); + +test('CheckObjectCoercible', function (t) { + t['throws'](function () { return ES.CheckObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.CheckObjectCoercible(null); }, TypeError, 'null throws'); + var checkCoercible = function (value) { + t.doesNotThrow(function () { return ES.CheckObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), checkCoercible); + t.end(); +}); + +test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.primitives); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); +}); + +test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); +}); + +test('Type', function (t) { + t.equal(ES.Type(), 'Undefined', 'Type() is Undefined'); + t.equal(ES.Type(undefined), 'Undefined', 'Type(undefined) is Undefined'); + t.equal(ES.Type(null), 'Null', 'Type(null) is Null'); + t.equal(ES.Type(true), 'Boolean', 'Type(true) is Boolean'); + t.equal(ES.Type(false), 'Boolean', 'Type(false) is Boolean'); + t.equal(ES.Type(0), 'Number', 'Type(0) is Number'); + t.equal(ES.Type(NaN), 'Number', 'Type(NaN) is Number'); + t.equal(ES.Type('abc'), 'String', 'Type("abc") is String'); + t.equal(ES.Type(function () {}), 'Object', 'Type(function () {}) is Object'); + t.equal(ES.Type({}), 'Object', 'Type({}) is Object'); + t.end(); +}); + +test('IsPropertyDescriptor', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsPropertyDescriptor(primitive), false, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptorWritable()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); +}); + +test('IsAccessorDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsAccessorDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); +}); + +test('IsDataDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsDataDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); +}); + +test('IsGenericDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('ToPropertyDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.descriptors.nonConfigurable(v.dataDescriptor()); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), data); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.ToPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ get: 'not callable' }); }, + TypeError, + '"get" must be undefined or callable' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ set: 'not callable' }); }, + TypeError, + '"set" must be undefined or callable' + ); + + t.end(); +}); + +test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); +}); + +test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); +}); + +test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); +}); + +test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); +}); + +var msPerSecond = 1e3; +var msPerMinute = 60 * msPerSecond; +var msPerHour = 60 * msPerMinute; +var msPerDay = 24 * msPerHour; + +test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); +}); + +test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); +}); + +test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); +}); + +test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); +}); + +test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); +}); + +test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); +}); + +test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); +}); + +test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); +}); + +test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); +}); + +test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); +}); + +test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); +}); + +test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); +}); + +test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); +}); + +test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + t.end(); +}); + +test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); +}); + +test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es6.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es6.js new file mode 100644 index 0000000..e7c9d98 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es6.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES6 = ES.ES6; +var ES2015 = ES.ES2015; +var ES6entry = require('../es6'); + +test('legacy es6 export', function (t) { + t.equal(ES6, ES2015, 'main ES6 === main ES2015'); + t.end(); +}); + +test('legacy es6 entry point', function (t) { + t.equal(ES6, ES6entry, 'main ES6 === ES6 entry point'); + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es7.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es7.js new file mode 100644 index 0000000..ee57e15 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/es7.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES7 = ES.ES7; +var ES2016 = ES.ES2016; +var ES7entry = require('../es7'); + +test('legacy es7 export', function (t) { + t.equal(ES7, ES2016, 'main ES7 === main ES2016'); + t.end(); +}); + +test('legacy es7 entry point', function (t) { + t.equal(ES7, ES7entry, 'main ES7 === ES7 entry point'); + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js new file mode 100644 index 0000000..9c2b4fc --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js @@ -0,0 +1,42 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('has-symbols')(); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); +var defineProperty = require('./defineProperty'); + +test('OwnPropertyKeys', function (t) { + t.deepEqual(OwnPropertyKeys({ a: 1, b: 2 }).sort(), ['a', 'b'].sort(), 'returns own string keys'); + + t.test('Symbols', { skip: !hasSymbols }, function (st) { + var o = { a: 1 }; + var sym = Symbol(); + o[sym] = 2; + + st.deepEqual(OwnPropertyKeys(o), ['a', sym], 'returns own string and symbol keys'); + + st.end(); + }); + + t.test('non-enumerables', { skip: !defineProperty.oDP }, function (st) { + var o = { a: 1, b: 42, c: NaN }; + defineProperty(o, 'b', { enumerable: false, value: 42 }); + defineProperty(o, 'c', { enumerable: false, get: function () { return NaN; } }); + + if (hasSymbols) { + defineProperty(o, 'd', { enumerable: false, value: true }); + defineProperty(o, 'e', { enumerable: false, get: function () { return true; } }); + } + + st.deepEqual( + OwnPropertyKeys(o).sort(), + (hasSymbols ? ['a', 'b', 'c', 'd', 'e'] : ['a', 'b', 'c']).sort(), + 'returns non-enumerable own keys, including accessors and symbols if available' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/assertRecord.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/assertRecord.js new file mode 100644 index 0000000..d6a80c2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/assertRecord.js @@ -0,0 +1,60 @@ +'use strict'; + +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var assertRecord = require('../../helpers/assertRecord'); +var v = require('./values'); + +module.exports = function assertRecordTests(ES, test) { + test('Property Descriptor', function (t) { + var record = 'Property Descriptor'; + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', { invalid: true }); }, + TypeError, + 'invalid keys not allowed on a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', {}); }, + 'empty object is an incomplete Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.accessorDescriptor()); }, + 'accessor descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.mutatorDescriptor()); }, + 'mutator descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.dataDescriptor()); }, + 'data descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.genericDescriptor()); }, + 'generic descriptor is a Property Descriptor' + ); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/createBoundESNamespace.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/createBoundESNamespace.js new file mode 100644 index 0000000..880ba3d --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/createBoundESNamespace.js @@ -0,0 +1,21 @@ +'use strict'; + +var bind = require('function-bind'); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); + +module.exports = function createBoundESNamespace(ES) { + var keys = OwnPropertyKeys(ES); + var result = {}; + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var prop = ES[key]; + if (typeof prop === 'function') { + prop = bind.call(prop, undefined); + } + result[key] = prop; + } + + return result; +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/defineProperty.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/defineProperty.js new file mode 100644 index 0000000..8f925be --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/defineProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var oDP = Object.defineProperty; +try { + oDP({}, 'a', { value: 1 }); +} catch (e) { + // IE 8 + oDP = null; +} + +module.exports = function defineProperty(O, P, Desc) { + if (oDP) { + return oDP(O, P, Desc); + } + if ((Desc.enumerable && Desc.configurable && Desc.writable) || !(P in O)) { + O[P] = Desc.value; // eslint-disable-line no-param-reassign + return O; + } + + throw new SyntaxError('helper does not yet support this configuration'); +}; +module.exports.oDP = oDP; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/getSymbolDescription.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/getSymbolDescription.js new file mode 100644 index 0000000..fbe7a7b --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/getSymbolDescription.js @@ -0,0 +1,67 @@ +'use strict'; + +var test = require('tape'); +var debug = require('object-inspect'); +var forEach = require('foreach'); +var has = require('has'); + +var v = require('./values'); +var getSymbolDescription = require('../../helpers/getSymbolDescription'); +var getInferredName = require('../../helpers/getInferredName'); + +test('getSymbolDescription', function (t) { + t.test('no symbols', { skip: v.hasSymbols }, function (st) { + st['throws']( + getSymbolDescription, + SyntaxError, + 'requires Symbol support' + ); + + st.end(); + }); + + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { getSymbolDescription(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('with symbols', { skip: !v.hasSymbols }, function (st) { + forEach( + [ + [Symbol(), undefined], + [Symbol(undefined), undefined], + [Symbol(null), 'null'], + [Symbol.iterator, 'Symbol.iterator'], + [Symbol('foo'), 'foo'] + ], + function (pair) { + var sym = pair[0]; + var desc = pair[1]; + st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc)); + } + ); + + st.test('only possible when inference or native `Symbol.prototype.description` is supported', { + skip: !getInferredName && !has(Symbol.prototype, 'description') + }, function (s2t) { + s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""'); + + s2t.end(); + }); + + st.test('only possible when global symbols are supported', { + skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor') + }, function (s2t) { + // eslint-disable-next-line no-restricted-properties + s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/runManifestTest.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/runManifestTest.js new file mode 100644 index 0000000..2fdb4f2 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/runManifestTest.js @@ -0,0 +1,27 @@ +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +var forEach = require('foreach'); +var keys = require('object-keys'); + +module.exports = function runManifestTest(test, ES, edition) { + test('ES' + edition + ' manifest', { skip: !fs.readdirSync }, function (t) { + var files = fs.readdirSync(path.join(__dirname, '../../' + edition), 'utf-8'); + var map = { + AbstractEqualityComparison: 'Abstract Equality Comparison', + AbstractRelationalComparison: 'Abstract Relational Comparison', + StrictEqualityComparison: 'Strict Equality Comparison' + }; + forEach(files, function (file) { + var name = path.basename(file, path.extname(file)); + var actual = ES[map[name] || name]; + var expected = require(path.join(__dirname, '../../' + edition + '/', file)); // eslint-disable-line global-require + t.equal(actual, expected, 'ES["' + name + '"] === ' + file); + }); + var actualCount = keys(ES).length; + t.equal(actualCount, files.length, 'expected ' + files.length + ' files, got ' + actualCount); + t.end(); + }); +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/values.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/values.js new file mode 100644 index 0000000..ccef743 --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/helpers/values.js @@ -0,0 +1,121 @@ +'use strict'; + +var assign = require('../../helpers/assign'); + +var hasSymbols = require('has-symbols')(); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; +var objects = [{}, coercibleObject, coercibleFnObject, toStringOnlyObject, valueOfOnlyObject]; +var nullPrimitives = [undefined, null]; +var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3]; +var zeroes = [0, -0]; +var infinities = [Infinity, -Infinity]; +var numbers = zeroes.concat([42], infinities, nonIntegerNumbers); +var strings = ['', 'foo', 'a\uD83D\uDCA9c']; +var booleans = [true, false]; +var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; +var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers); +var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols); +var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols); +var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives); +var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects); +var primitives = [].concat(nullPrimitives, nonNullPrimitives); +var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects); +var propertyKeys = [].concat(strings, symbols); +var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects); +var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN); +var truthies = [].concat(true, 'foo', 42, symbols, objects); +var timestamps = [].concat(0, 946713600000, 1546329600000); +var nonFunctions = [].concat(primitives, objects, [42]); +var nonArrays = [].concat(nonFunctions); + +var descriptors = { + configurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': true }); + }, + nonConfigurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': false }); + }, + enumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': true }); + }, + nonEnumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': false }); + }, + writable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': true }); + }, + nonWritable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': false }); + } +}; + +module.exports = { + coercibleObject: coercibleObject, + coercibleFnObject: coercibleFnObject, + valueOfOnlyObject: valueOfOnlyObject, + toStringOnlyObject: toStringOnlyObject, + uncoercibleObject: uncoercibleObject, + uncoercibleFnObject: uncoercibleFnObject, + objects: objects, + nonFunctions: nonFunctions, + nonArrays: nonArrays, + nullPrimitives: nullPrimitives, + numbers: numbers, + zeroes: zeroes, + infinities: infinities, + strings: strings, + booleans: booleans, + symbols: symbols, + hasSymbols: hasSymbols, + nonSymbolPrimitives: nonSymbolPrimitives, + nonNumberPrimitives: nonNumberPrimitives, + nonNullPrimitives: nonNullPrimitives, + nonUndefinedPrimitives: nonUndefinedPrimitives, + nonStrings: nonStrings, + nonNumbers: nonNumberPrimitives.concat(objects), + nonIntegerNumbers: nonIntegerNumbers, + primitives: primitives, + nonPropertyKeys: nonPropertyKeys, + propertyKeys: propertyKeys, + nonBooleans: nonBooleans, + falsies: falsies, + truthies: truthies, + timestamps: timestamps, + bothDescriptor: function () { + return { '[[Get]]': function () {}, '[[Value]]': true }; + }, + bothDescriptorWritable: function () { + return descriptors.writable({ '[[Get]]': function () {} }); + }, + accessorDescriptor: function (value) { + return descriptors.enumerable(descriptors.configurable({ + '[[Get]]': function get() { return value; } + })); + }, + mutatorDescriptor: function () { + return descriptors.enumerable(descriptors.configurable({ + '[[Set]]': function () {} + })); + }, + dataDescriptor: function (value) { + return descriptors.nonWritable({ + '[[Value]]': arguments.length > 0 ? value : 42 + }); + }, + genericDescriptor: function () { + return descriptors.configurable(descriptors.nonEnumerable()); + }, + descriptors: descriptors +}; diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/index.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/index.js new file mode 100644 index 0000000..3f1adba --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var ES = require('../'); +var test = require('tape'); +var keys = require('object-keys'); +var forEach = require('foreach'); + +var ESkeys = keys(ES).sort(); +var ES6keys = keys(ES.ES6).sort(); + +test('exposed properties', function (t) { + t.deepEqual(ESkeys, ES6keys.concat(['ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); + t.end(); +}); + +test('methods match', function (t) { + forEach(ES6keys, function (key) { + t.equal(ES.ES6[key], ES[key], 'method ' + key + ' on main ES object is ES6 method'); + }); + t.end(); +}); + +require('./GetIntrinsic'); + +require('./helpers/getSymbolDescription'); +require('./helpers/OwnPropertyKeys'); + +require('./es5'); +require('./es6'); +require('./es2015'); +require('./es7'); +require('./es2016'); +require('./es2017'); +require('./es2018'); +require('./es2019'); diff --git a/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/tests.js b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/tests.js new file mode 100644 index 0000000..844846f --- /dev/null +++ b/node_modules/string.prototype.trimstart/node_modules/es-abstract/test/tests.js @@ -0,0 +1,4193 @@ +'use strict'; + +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); +var assign = require('object.assign'); +var keys = require('object-keys'); +var has = require('has'); +var arrowFns = require('make-arrow-function').list(); +var hasStrictMode = require('has-strict-mode')(); +var functionsHaveNames = require('functions-have-names')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +var $getProto = require('../helpers/getProto'); +var $setProto = require('../helpers/setProto'); +var defineProperty = require('./helpers/defineProperty'); +var getInferredName = require('../helpers/getInferredName'); +var getOwnPropertyDescriptor = require('../helpers/getOwnPropertyDescriptor'); +var assertRecordTests = require('./helpers/assertRecord'); +var v = require('./helpers/values'); +var diffOps = require('./diffOps'); + +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +var getArraySubclassWithSpeciesConstructor = function getArraySubclass(speciesConstructor) { + var Bar = function Bar() { + var inst = []; + Object.setPrototypeOf(inst, Bar.prototype); + defineProperty(inst, 'constructor', { value: Bar }); + return inst; + }; + Bar.prototype = Object.create(Array.prototype); + Object.setPrototypeOf(Bar, Array); + defineProperty(Bar, Symbol.species, { value: speciesConstructor }); + + return Bar; +}; + +var testIterator = function (t, iterator, expected) { + var resultCount = 0; + var result; + while (result = iterator.next(), !result.done) { // eslint-disable-line no-sequences + t.deepEqual(result, { done: false, value: expected[resultCount] }, 'result ' + resultCount); + resultCount += 1; + } + t.equal(resultCount, expected.length, 'expected ' + expected.length + ', got ' + resultCount); +}; + +var hasSpecies = v.hasSymbols && Symbol.species; + +var hasLastIndex = 'lastIndex' in (/a/).exec('a'); // IE 8 +var hasGroups = 'groups' in (/a/).exec('a'); // modern engines +var kludgeMatch = function kludgeMatch(R, matchObject) { + if (hasGroups) { + assign(matchObject, { groups: matchObject.groups }); + } + if (hasLastIndex) { + assign(matchObject, { lastIndex: R.lastIndex }); + } + return matchObject; +}; + +var testEnumerableOwnNames = function (t, enumerableOwnNames) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { enumerableOwnNames(nonObject); }, + debug(nonObject) + ' is not an Object' + ); + }); + + var Child = function Child() { + this.own = {}; + }; + Child.prototype = { + inherited: {} + }; + + var obj = new Child(); + + t.equal('own' in obj, true, 'has "own"'); + t.equal(has(obj, 'own'), true, 'has own "own"'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, 'own'), true, 'has enumerable "own"'); + + t.equal('inherited' in obj, true, 'has "inherited"'); + t.equal(has(obj, 'inherited'), false, 'has non-own "inherited"'); + t.equal(has(Child.prototype, 'inherited'), true, 'Child.prototype has own "inherited"'); + t.equal(Child.prototype.inherited, obj.inherited, 'Child.prototype.inherited === obj.inherited'); + t.equal(Object.prototype.propertyIsEnumerable.call(Child.prototype, 'inherited'), true, 'has enumerable "inherited"'); + + t.equal('toString' in obj, true, 'has "toString"'); + t.equal(has(obj, 'toString'), false, 'has non-own "toString"'); + t.equal(has(Object.prototype, 'toString'), true, 'Object.prototype has own "toString"'); + t.equal(Object.prototype.toString, obj.toString, 'Object.prototype.toString === obj.toString'); + // eslint-disable-next-line no-useless-call + t.equal(Object.prototype.propertyIsEnumerable.call(Object.prototype, 'toString'), false, 'has non-enumerable "toString"'); + + return obj; +}; + +var es2015 = function ES2015(ES, ops, expectedMissing, skips) { + test('has expected operations', function (t) { + var diff = diffOps(ES, ops, expectedMissing); + + t.deepEqual(diff.extra, [], 'no extra ops'); + + t.deepEqual(diff.missing, [], 'no unexpected missing ops'); + + t.end(); + }); + + test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), 3, 'coercibleObject with no hint coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), 3, 'coercibleObject with hint Number coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to NaN'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), 42, 'coercibleObject with hint String coerces to nonstringified toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), 7, 'toStringOnlyObject returns non-stringified toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), 4, 'valueOfOnlyObject returns valueOf'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st.end(); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); + var now = new Date(); + st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); + st.end(); + }); + + t.end(); + }); + + test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + + t.test('numbers', function (st) { + forEach(v.zeroes.concat(NaN), function (falsyNumber) { + st.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach(v.infinities.concat([42, 1]), function (truthyNumber) { + st.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + + st.end(); + }); + + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + + t.test('objects', function (st) { + forEach(v.objects, function (obj) { + st.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + st.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + + st.end(); + }); + + t.end(); + }); + + test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + + t.test('numbers', function (st) { + st.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach(v.zeroes.concat(v.infinities, 42), function (num) { + st.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + st.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + st.end(); + }); + + t.test('objects', function (st) { + forEach(v.objects, function (object) { + st.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + st['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + st.end(); + }); + + t.test('binary literals', function (st) { + st.equal(ES.ToNumber('0b10'), 2, '0b10 is 2'); + st.equal(ES.ToNumber({ toString: function () { return '0b11'; } }), 3, 'Object that toStrings to 0b11 is 3'); + + st.equal(true, is(ES.ToNumber('0b12'), NaN), '0b12 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0b112'; } }), NaN), 'Object that toStrings to 0b112 is NaN'); + st.end(); + }); + + t.test('octal literals', function (st) { + st.equal(ES.ToNumber('0o10'), 8, '0o10 is 8'); + st.equal(ES.ToNumber({ toString: function () { return '0o11'; } }), 9, 'Object that toStrings to 0o11 is 9'); + + st.equal(true, is(ES.ToNumber('0o18'), NaN), '0o18 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0o118'; } }), NaN), 'Object that toStrings to 0o118 is NaN'); + st.end(); + }); + + t.test('signed hex numbers', function (st) { + st.equal(true, is(ES.ToNumber('-0xF'), NaN), '-0xF is NaN'); + st.equal(true, is(ES.ToNumber(' -0xF '), NaN), 'space-padded -0xF is NaN'); + st.equal(true, is(ES.ToNumber('+0xF'), NaN), '+0xF is NaN'); + st.equal(true, is(ES.ToNumber(' +0xF '), NaN), 'space-padded +0xF is NaN'); + + st.end(); + }); + + t.test('trimming of whitespace and non-whitespace characters', function (st) { + var whitespace = ' \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'; + st.equal(0, ES.ToNumber(whitespace + 0 + whitespace), 'whitespace is trimmed'); + + // Zero-width space (zws), next line character (nel), and non-character (bom) are not whitespace. + var nonWhitespaces = { + '\\u0085': '\u0085', + '\\u200b': '\u200b', + '\\ufffe': '\ufffe' + }; + + forEach(nonWhitespaces, function (desc, nonWS) { + st.equal(true, is(ES.ToNumber(nonWS + 0 + nonWS), NaN), 'non-whitespace ' + desc + ' not trimmed'); + }); + + st.end(); + }); + + forEach(v.symbols, function (symbol) { + t['throws']( + function () { ES.ToNumber(symbol); }, + TypeError, + 'Symbols can’t be converted to a Number: ' + debug(symbol) + ); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); + var now = +new Date(); + st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); + st.end(); + }); + + t.end(); + }); + + test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); + }); + + test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToInt16', function (t) { + t.ok(is(0, ES.ToInt16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt16(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt16(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt16(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.end(); + }); + + test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); + }); + + test('ToInt8', function (t) { + t.ok(is(0, ES.ToInt8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt8(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt8(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt8(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToInt8(0x100 - 1), -1), '2^8 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10), 0x10), '2^4 returns 2^4'); + t.end(); + }); + + test('ToUint8', function (t) { + t.ok(is(0, ES.ToUint8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint8(0x100000000 - 1), 0x100 - 1), '2^32 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint8(0x80000000 - 1), 0x100 - 1), '2^31 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint8(0x10000 - 1), 0x100 - 1), '2^16 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToUint8(0x100 - 1), 0x100 - 1), '2^8 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint8(0x10), 0x10), '2^4 returns 2^4'); + t.ok(is(ES.ToUint8(0x10 - 1), 0x10 - 1), '2^4 - 1 returns 2^4 - 1'); + t.end(); + }); + + test('ToUint8Clamp', function (t) { + t.ok(is(0, ES.ToUint8Clamp(NaN)), 'NaN coerces to +0'); + t.ok(is(0, ES.ToUint8Clamp(0)), '+0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-0)), '-0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-Infinity)), '-Infinity returns +0'); + t['throws'](function () { return ES.ToUint8Clamp(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + forEach([255, 256, 0x100000, Infinity], function (number) { + t.ok(is(255, ES.ToUint8Clamp(number)), number + ' coerces to 255'); + }); + t.equal(1, ES.ToUint8Clamp(1.49), '1.49 coerces to 1'); + t.equal(2, ES.ToUint8Clamp(1.5), '1.5 coerces to 2, because 2 is even'); + t.equal(2, ES.ToUint8Clamp(1.51), '1.51 coerces to 2'); + + t.equal(2, ES.ToUint8Clamp(2.49), '2.49 coerces to 2'); + t.equal(2, ES.ToUint8Clamp(2.5), '2.5 coerces to 2, because 2 is even'); + t.equal(3, ES.ToUint8Clamp(2.51), '2.51 coerces to 3'); + t.end(); + }); + + test('ToString', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (item) { + t.equal(ES.ToString(item), String(item), 'ES.ToString(' + debug(item) + ') ToStrings to String(' + debug(item) + ')'); + }); + + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + + forEach(v.symbols, function (symbol) { + t['throws'](function () { return ES.ToString(symbol); }, TypeError, debug(symbol) + ' throws'); + }); + t.end(); + }); + + test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); + }); + + test('RequireObjectCoercible', function (t) { + t.equal(false, 'CheckObjectCoercible' in ES, 'CheckObjectCoercible -> RequireObjectCoercible in ES6'); + t['throws'](function () { return ES.RequireObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.RequireObjectCoercible(null); }, TypeError, 'null throws'); + var isCoercible = function (value) { + t.doesNotThrow(function () { return ES.RequireObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), isCoercible); + t.end(); + }); + + test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.nonFunctions); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); + }); + + test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); + }); + + test('SameValueZero', function (t) { + t.equal(true, ES.SameValueZero(NaN, NaN), 'NaN is SameValueZero as NaN'); + t.equal(true, ES.SameValueZero(0, -0), '+0 is SameValueZero as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValueZero(val, val), debug(val) + ' is SameValueZero to itself'); + }); + t.end(); + }); + + test('ToPropertyKey', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (value) { + t.equal(ES.ToPropertyKey(value), String(value), 'ToPropertyKey(value) === String(value) for non-Symbols'); + }); + + forEach(v.symbols, function (symbol) { + t.equal( + ES.ToPropertyKey(symbol), + symbol, + 'ToPropertyKey(' + debug(symbol) + ') === ' + debug(symbol) + ); + t.equal( + ES.ToPropertyKey(Object(symbol)), + symbol, + 'ToPropertyKey(' + debug(Object(symbol)) + ') === ' + debug(symbol) + ); + }); + + t.end(); + }); + + test('ToLength', function (t) { + t['throws'](function () { return ES.ToLength(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + t.equal(3, ES.ToLength(v.coercibleObject), 'coercibleObject coerces to 3'); + t.equal(42, ES.ToLength('42.5'), '"42.5" coerces to 42'); + t.equal(7, ES.ToLength(7.3), '7.3 coerces to 7'); + forEach([-0, -1, -42, -Infinity], function (negative) { + t.ok(is(0, ES.ToLength(negative)), negative + ' coerces to +0'); + }); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 1), '2^53 coerces to 2^53 - 1'); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 3), '2^53 + 2 coerces to 2^53 - 1'); + t.end(); + }); + + test('IsArray', function (t) { + t.equal(true, ES.IsArray([]), '[] is array'); + t.equal(false, ES.IsArray({}), '{} is not array'); + t.equal(false, ES.IsArray({ length: 1, 0: true }), 'arraylike object is not array'); + forEach(v.objects.concat(v.primitives), function (value) { + t.equal(false, ES.IsArray(value), debug(value) + ' is not array'); + }); + t.end(); + }); + + test('IsRegExp', function (t) { + forEach([/a/g, new RegExp('a', 'g')], function (regex) { + t.equal(true, ES.IsRegExp(regex), regex + ' is regex'); + }); + + forEach(v.objects.concat(v.primitives), function (nonRegex) { + t.equal(false, ES.IsRegExp(nonRegex), debug(nonRegex) + ' is not regex'); + }); + + t.test('Symbol.match', { skip: !v.hasSymbols || !Symbol.match }, function (st) { + var obj = {}; + obj[Symbol.match] = true; + st.equal(true, ES.IsRegExp(obj), 'object with truthy Symbol.match is regex'); + + var regex = /a/; + regex[Symbol.match] = false; + st.equal(false, ES.IsRegExp(regex), 'regex with falsy Symbol.match is not regex'); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyKey', function (t) { + forEach(v.numbers.concat(v.objects), function (notKey) { + t.equal(false, ES.IsPropertyKey(notKey), debug(notKey) + ' is not property key'); + }); + + t.equal(true, ES.IsPropertyKey('foo'), 'string is property key'); + + forEach(v.symbols, function (symbol) { + t.equal(true, ES.IsPropertyKey(symbol), debug(symbol) + ' is property key'); + }); + t.end(); + }); + + test('IsInteger', function (t) { + for (var i = -100; i < 100; i += 10) { + t.equal(true, ES.IsInteger(i), i + ' is integer'); + t.equal(false, ES.IsInteger(i + 0.2), (i + 0.2) + ' is not integer'); + } + t.equal(true, ES.IsInteger(-0), '-0 is integer'); + var notInts = v.nonNumbers.concat(v.nonIntegerNumbers, v.infinities, [NaN, [], new Date()]); + forEach(notInts, function (notInt) { + t.equal(false, ES.IsInteger(notInt), debug(notInt) + ' is not integer'); + }); + t.equal(false, ES.IsInteger(v.uncoercibleObject), 'uncoercibleObject is not integer'); + t.end(); + }); + + test('IsExtensible', function (t) { + forEach(v.objects, function (object) { + t.equal(true, ES.IsExtensible(object), debug(object) + ' object is extensible'); + }); + forEach(v.primitives, function (primitive) { + t.equal(false, ES.IsExtensible(primitive), debug(primitive) + ' is not extensible'); + }); + if (Object.preventExtensions) { + t.equal(false, ES.IsExtensible(Object.preventExtensions({})), 'object with extensions prevented is not extensible'); + } + t.end(); + }); + + test('CanonicalNumericIndexString', function (t) { + var throwsOnNonString = function (notString) { + t['throws']( + function () { return ES.CanonicalNumericIndexString(notString); }, + TypeError, + debug(notString) + ' is not a string' + ); + }; + forEach(v.objects.concat(v.numbers), throwsOnNonString); + t.ok(is(-0, ES.CanonicalNumericIndexString('-0')), '"-0" returns -0'); + for (var i = -50; i < 50; i += 10) { + t.equal(i, ES.CanonicalNumericIndexString(String(i)), '"' + i + '" returns ' + i); + t.equal(undefined, ES.CanonicalNumericIndexString(String(i) + 'a'), '"' + i + 'a" returns undefined'); + } + t.end(); + }); + + test('IsConstructor', function (t) { + t.equal(true, ES.IsConstructor(function () {}), 'function is constructor'); + t.equal(false, ES.IsConstructor(/a/g), 'regex is not constructor'); + forEach(v.objects, function (object) { + t.equal(false, ES.IsConstructor(object), object + ' object is not constructor'); + }); + + try { + var arrow = Function('return () => {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(arrow), false, 'arrow function is not constructor'); + } catch (e) { + t.comment('SKIP: arrow function syntax not supported.'); + } + + try { + var foo = Function('return class Foo {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(foo), true, 'class is constructor'); + } catch (e) { + t.comment('SKIP: class syntax not supported.'); + } + + if (typeof Reflect !== 'object' || typeof Proxy !== 'function' || has(Proxy, 'prototype')) { + t.comment('SKIP: Proxy is constructor'); + } else { + t.equal(ES.IsConstructor(Proxy), true, 'Proxy is constructor'); + } + + t.end(); + }); + + test('Call', function (t) { + var receiver = {}; + var notFuncs = v.nonFunctions.concat([/a/g, new RegExp('a', 'g')]); + t.plan(notFuncs.length + 5); + var throwsIfNotCallable = function (notFunc) { + t['throws']( + function () { return ES.Call(notFunc, receiver); }, + TypeError, + debug(notFunc) + ' (' + typeof notFunc + ') is not callable' + ); + }; + forEach(notFuncs, throwsIfNotCallable); + ES.Call( + function (a, b) { + t.equal(this, receiver, 'context matches expected'); + t.deepEqual([a, b], [1, 2], 'named args are correct'); + t.equal(arguments.length, 3, 'extra argument was passed'); + t.equal(arguments[2], 3, 'extra argument was correct'); + }, + receiver, + [1, 2, 3] + ); + + t.test('Call doesn’t use func.apply', function (st) { + st.plan(4); + + var bad = function (a, b) { + st.equal(this, receiver, 'context matches expected'); + st.deepEqual([a, b], [1, 2], 'named args are correct'); + st.equal(arguments.length, 3, 'extra argument was passed'); + st.equal(arguments[2], 3, 'extra argument was correct'); + }; + + bad.apply = function () { + st.fail('bad.apply shouldn’t get called'); + }; + + ES.Call(bad, receiver, [1, 2, 3]); + st.end(); + }); + + t.end(); + }); + + test('GetV', function (t) { + t['throws'](function () { return ES.GetV({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + var obj = { a: function () {} }; + t.equal(ES.GetV(obj, 'a'), obj.a, 'returns property if it exists'); + t.equal(ES.GetV(obj, 'b'), undefined, 'returns undefiend if property does not exist'); + t.end(); + }); + + test('GetMethod', function (t) { + t['throws'](function () { return ES.GetMethod({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + t.equal(ES.GetMethod({}, 'a'), undefined, 'returns undefined in property is undefined'); + t.equal(ES.GetMethod({ a: null }, 'a'), undefined, 'returns undefined if property is null'); + t.equal(ES.GetMethod({ a: undefined }, 'a'), undefined, 'returns undefined if property is undefined'); + var obj = { a: function () {} }; + t['throws'](function () { ES.GetMethod({ a: 'b' }, 'a'); }, TypeError, 'throws TypeError if property exists and is not callable'); + t.equal(ES.GetMethod(obj, 'a'), obj.a, 'returns property if it is callable'); + t.end(); + }); + + test('Get', function (t) { + t['throws'](function () { return ES.Get('a', 'a'); }, TypeError, 'Throws a TypeError if `O` is not an Object'); + t['throws'](function () { return ES.Get({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + + var value = {}; + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var sym = Symbol('sym'); + var obj = {}; + obj[sym] = value; + st.equal(ES.Get(obj, sym), value, 'returns property `P` if it exists on object `O`'); + st.end(); + }); + t.equal(ES.Get({ a: value }, 'a'), value, 'returns property `P` if it exists on object `O`'); + t.end(); + }); + + test('Type', { skip: !v.hasSymbols }, function (t) { + t.equal(ES.Type(Symbol.iterator), 'Symbol', 'Type(Symbol.iterator) is Symbol'); + t.end(); + }); + + test('SpeciesConstructor', function (t) { + t['throws'](function () { ES.SpeciesConstructor(null); }, TypeError); + t['throws'](function () { ES.SpeciesConstructor(undefined); }, TypeError); + + var defaultConstructor = function Foo() {}; + + t.equal( + ES.SpeciesConstructor({ constructor: undefined }, defaultConstructor), + defaultConstructor, + 'undefined constructor returns defaultConstructor' + ); + + t['throws']( + function () { return ES.SpeciesConstructor({ constructor: null }, defaultConstructor); }, + TypeError, + 'non-undefined non-object constructor throws' + ); + + t.test('with Symbol.species', { skip: !hasSpecies }, function (st) { + var Bar = function Bar() {}; + Bar[Symbol.species] = null; + + st.equal( + ES.SpeciesConstructor(new Bar(), defaultConstructor), + defaultConstructor, + 'undefined/null Symbol.species returns default constructor' + ); + + var Baz = function Baz() {}; + Baz[Symbol.species] = Bar; + st.equal( + ES.SpeciesConstructor(new Baz(), defaultConstructor), + Bar, + 'returns Symbol.species constructor value' + ); + + Baz[Symbol.species] = {}; + st['throws']( + function () { ES.SpeciesConstructor(new Baz(), defaultConstructor); }, + TypeError, + 'throws when non-constructor non-null non-undefined species value found' + ); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyDescriptor', { skip: skips && skips.IsPropertyDescriptor }, function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t.equal( + ES.IsPropertyDescriptor(primitive), + false, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); + + assertRecordTests(ES, test); + + test('IsAccessorDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsAccessorDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); + }); + + test('IsDataDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsDataDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); + }); + + test('IsGenericDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); + }); + + test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'] + }); + + t.deepEqual(ES.FromPropertyDescriptor(v.genericDescriptor()), { + enumerable: false, + configurable: true + }); + + t.end(); + }); + + test('ToPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.dataDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), assign(data, { '[[Configurable]]': false })); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.FromPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('CompletePropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.CompletePropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var generic = v.genericDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(generic), + { + '[[Configurable]]': !!generic['[[Configurable]]'], + '[[Enumerable]]': !!generic['[[Enumerable]]'], + '[[Value]]': undefined, + '[[Writable]]': false + }, + 'completes a Generic Descriptor' + ); + + var data = v.dataDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(data), + { + '[[Configurable]]': !!data['[[Configurable]]'], + '[[Enumerable]]': false, + '[[Value]]': data['[[Value]]'], + '[[Writable]]': !!data['[[Writable]]'] + }, + 'completes a Data Descriptor' + ); + + var accessor = v.accessorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(accessor), + { + '[[Get]]': accessor['[[Get]]'], + '[[Enumerable]]': !!accessor['[[Enumerable]]'], + '[[Configurable]]': !!accessor['[[Configurable]]'], + '[[Set]]': undefined + }, + 'completes an Accessor Descriptor' + ); + + var mutator = v.mutatorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(mutator), + { + '[[Set]]': mutator['[[Set]]'], + '[[Enumerable]]': !!mutator['[[Enumerable]]'], + '[[Configurable]]': !!mutator['[[Configurable]]'], + '[[Get]]': undefined + }, + 'completes a mutator Descriptor' + ); + + t['throws']( + function () { ES.CompletePropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('Set', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.Set(primitive, '', null, false); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Set({}, nonKey, null, false); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.Set({}, '', null, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var o = {}; + var value = {}; + ES.Set(o, 'key', value, true); + t.deepEqual(o, { key: value }, 'key is set'); + + t.test('nonwritable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { writable: false }); + + st['throws']( + function () { ES.Set(obj, 'a', {}, true); }, + TypeError, + 'can not Set nonwritable property' + ); + + st.doesNotThrow( + function () { + st.equal(ES.Set(obj, 'a', {}, false), false, 'unsuccessful Set returns false'); + }, + 'setting Throw to false prevents an exception' + ); + + st.end(); + }); + + t.test('nonconfigurable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { configurable: false }); + + st.equal(ES.Set(obj, 'a', value, true), true, 'successful Set returns true'); + st.deepEqual(obj, { a: value }, 'key is set'); + + st.end(); + }); + + t.test('doesn’t call [[Get]] in conforming strict mode environments', { skip: noThrowOnStrictViolation }, function (st) { + var getterCalled = false; + var setterCalls = 0; + var obj = {}; + defineProperty(obj, 'a', { + get: function () { + getterCalled = true; + }, + set: function () { + setterCalls += 1; + } + }); + + st.equal(ES.Set(obj, 'a', value, false), true, 'successful Set returns true'); + st.equal(setterCalls, 1, 'setter was called once'); + st.equal(getterCalled, false, 'getter was not called'); + + st.end(); + }); + + t.end(); + }); + + test('HasOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasOwnProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasOwnProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasOwnProperty({}, 'toString'), false, 'inherited properties are not own'); + t.equal( + ES.HasOwnProperty({ toString: 1 }, 'toString'), + true, + 'shadowed inherited own properties are own' + ); + t.equal(ES.HasOwnProperty({ a: 1 }, 'a'), true, 'own properties are own'); + + t.end(); + }); + + test('HasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasProperty({}, 'nope'), false, 'object does not have nonexistent properties'); + t.equal(ES.HasProperty({}, 'toString'), true, 'object has inherited properties'); + t.equal( + ES.HasProperty({ toString: 1 }, 'toString'), + true, + 'object has shadowed inherited own properties' + ); + t.equal(ES.HasProperty({ a: 1 }, 'a'), true, 'object has own properties'); + + t.end(); + }); + + test('IsConcatSpreadable', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsConcatSpreadable(primitive), false, debug(primitive) + ' is not an Object'); + }); + + var hasSymbolConcatSpreadable = v.hasSymbols && Symbol.isConcatSpreadable; + t.test('Symbol.isConcatSpreadable', { skip: !hasSymbolConcatSpreadable }, function (st) { + forEach(v.falsies, function (falsy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = falsy; + st.equal( + ES.IsConcatSpreadable(obj), + false, + 'an object with ' + debug(falsy) + ' as Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + forEach(v.truthies, function (truthy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = truthy; + st.equal( + ES.IsConcatSpreadable(obj), + true, + 'an object with ' + debug(truthy) + ' as Symbol.isConcatSpreadable is concat spreadable' + ); + }); + + st.end(); + }); + + forEach(v.objects, function (object) { + t.equal( + ES.IsConcatSpreadable(object), + false, + 'non-array without Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + t.equal(ES.IsConcatSpreadable([]), true, 'arrays are concat spreadable'); + + t.end(); + }); + + test('Invoke', function (t) { + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Invoke({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t['throws'](function () { ES.Invoke({ o: false }, 'o'); }, TypeError, 'fails on a non-function'); + + t.test('invoked callback', function (st) { + var aValue = {}; + var bValue = {}; + var obj = { + f: function (a) { + st.equal(arguments.length, 2, '2 args passed'); + st.equal(a, aValue, 'first arg is correct'); + st.equal(arguments[1], bValue, 'second arg is correct'); + } + }; + st.plan(3); + ES.Invoke(obj, 'f', aValue, bValue); + }); + + t.end(); + }); + + test('GetIterator', function (t) { + var arr = [1, 2]; + testIterator(t, ES.GetIterator(arr), arr); + + testIterator(t, ES.GetIterator('abc'), 'abc'.split('')); + + t.test('Symbol.iterator', { skip: !v.hasSymbols }, function (st) { + var m = new Map(); + m.set(1, 'a'); + m.set(2, 'b'); + + testIterator(st, ES.GetIterator(m), [[1, 'a'], [2, 'b']]); + + st.end(); + }); + + t.end(); + }); + + test('IteratorNext', { skip: true }); + + test('IteratorComplete', { skip: true }); + + test('IteratorValue', { skip: true }); + + test('IteratorStep', { skip: true }); + + test('IteratorClose', { skip: true }); + + test('CreateIterResultObject', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.CreateIterResultObject({}, nonBoolean); }, + TypeError, + '"done" argument must be a boolean; ' + debug(nonBoolean) + ' is not' + ); + }); + + var value = {}; + t.deepEqual( + ES.CreateIterResultObject(value, true), + { value: value, done: true }, + 'creates a "done" iteration result' + ); + t.deepEqual( + ES.CreateIterResultObject(value, false), + { value: value, done: false }, + 'creates a "not done" iteration result' + ); + + t.end(); + }); + + test('RegExpExec', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.RegExpExec(primitive); }, + TypeError, + '"R" argument must be an object; ' + debug(primitive) + ' is not' + ); + }); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.RegExpExec({}, nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + t.test('gets and calls a callable "exec"', function (st) { + var str = '123'; + var o = { + exec: function (S) { + st.equal(this, o, '"exec" receiver is R'); + st.equal(S, str, '"exec" argument is S'); + + return null; + } + }; + st.plan(2); + ES.RegExpExec(o, str); + st.end(); + }); + + t.test('throws if a callable "exec" returns a non-null non-object', function (st) { + var str = '123'; + st.plan(v.nonNullPrimitives.length); + forEach(v.nonNullPrimitives, function (nonNullPrimitive) { + st['throws']( + function () { ES.RegExpExec({ exec: function () { return nonNullPrimitive; } }, str); }, + TypeError, + '"exec" method must return `null` or an Object; ' + debug(nonNullPrimitive) + ' is not' + ); + }); + st.end(); + }); + + t.test('actual regex that should match against a string', function (st) { + var S = 'aabc'; + var R = /a/g; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + + t.test('actual regex that should match against a string, with shadowed "exec"', function (st) { + var S = 'aabc'; + var R = /a/g; + R.exec = undefined; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + t.end(); + }); + + test('ArraySpeciesCreate', function (t) { + t.test('errors', function (st) { + var testNonNumber = function (nonNumber) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a number' + ); + }; + forEach(v.nonNumbers, testNonNumber); + + st['throws']( + function () { ES.ArraySpeciesCreate([], -1); }, + TypeError, + '-1 is not >= 0' + ); + st['throws']( + function () { ES.ArraySpeciesCreate([], -Infinity); }, + TypeError, + '-Infinity is not >= 0' + ); + + var testNonIntegers = function (nonInteger) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonInteger); }, + TypeError, + debug(nonInteger) + ' is not an integer' + ); + }; + forEach(v.nonIntegerNumbers, testNonIntegers); + + st.end(); + }); + + t.test('works with a non-array', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + var arr = ES.ArraySpeciesCreate(nonArray, 0); + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, 0, 'length is correct'); + st.equal(arr.constructor, Array, 'constructor is correct'); + }); + + st.end(); + }); + + t.test('works with a normal array', function (st) { + var len = 2; + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, len, 'length is correct'); + st.equal(arr.constructor, orig.constructor, 'constructor is correct'); + + st.end(); + }); + + t.test('-0 length produces +0 length', function (st) { + var len = -0; + st.ok(is(len, -0), '-0 is negative zero'); + st.notOk(is(len, 0), '-0 is not positive zero'); + + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.equal(ES.IsArray(arr), true); + st.ok(is(arr.length, 0)); + st.equal(arr.constructor, orig.constructor); + + st.end(); + }); + + t.test('works with species construtor', { skip: !hasSpecies }, function (st) { + var sentinel = {}; + var Foo = function Foo(len) { + this.length = len; + this.sentinel = sentinel; + }; + var Bar = getArraySubclassWithSpeciesConstructor(Foo); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Foo, 'result used species constructor'); + st.equal(arr.length, 3, 'length property is correct'); + st.equal(arr.sentinel, sentinel, 'Foo constructor was exercised'); + + st.end(); + }); + + t.test('works with null species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(null); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('works with undefined species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('throws with object non-construtor species constructor', { skip: !hasSpecies }, function (st) { + forEach(v.objects, function (obj) { + var Bar = getArraySubclassWithSpeciesConstructor(obj); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + st['throws']( + function () { ES.ArraySpeciesCreate(bar, 3); }, + TypeError, + debug(obj) + ' is not a constructor' + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('CreateDataProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataProperty(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = { id: 'sentinel' }; + var secondSentinel = { id: 'second sentinel' }; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataProperty(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + var secondStatus = ES.CreateDataProperty(obj, propertyKey, secondSentinel); + t.equal(secondStatus, true, 'second status is true'); + t.equal( + obj[propertyKey], + secondSentinel, + debug(secondSentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + t.test('with defineProperty', { skip: !defineProperty.oDP }, function (st) { + var nonWritable = defineProperty({}, propertyKey, { configurable: true, writable: false }); + + var nonWritableStatus = ES.CreateDataProperty(nonWritable, propertyKey, sentinel); + st.equal(nonWritableStatus, false, 'create data property failed'); + st.notEqual( + nonWritable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonwritable' + ); + + var nonConfigurable = defineProperty({}, propertyKey, { configurable: false, writable: true }); + + var nonConfigurableStatus = ES.CreateDataProperty(nonConfigurable, propertyKey, sentinel); + st.equal(nonConfigurableStatus, false, 'create data property failed'); + st.notEqual( + nonConfigurable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonconfigurable' + ); + st.end(); + }); + }); + + t.end(); + }); + + test('CreateDataPropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = {}; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataPropertyOrThrow(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + if (typeof Object.preventExtensions === 'function') { + var notExtensible = {}; + Object.preventExtensions(notExtensible); + + t['throws']( + function () { ES.CreateDataPropertyOrThrow(notExtensible, propertyKey, sentinel); }, + TypeError, + 'can not install ' + debug(propertyKey) + ' on non-extensible object' + ); + t.notEqual( + notExtensible[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object' + ); + } + }); + + t.end(); + }); + + test('ObjectCreate', function (t) { + forEach(v.nonNullPrimitives, function (value) { + t['throws']( + function () { ES.ObjectCreate(value); }, + TypeError, + debug(value) + ' is not null, or an object' + ); + }); + + t.test('proto arg', function (st) { + var Parent = function Parent() {}; + Parent.prototype.foo = {}; + var child = ES.ObjectCreate(Parent.prototype); + st.equal(child instanceof Parent, true, 'child is instanceof Parent'); + st.equal(child.foo, Parent.prototype.foo, 'child inherits properties from Parent.prototype'); + + st.end(); + }); + + t.test('internal slots arg', function (st) { + st.doesNotThrow(function () { ES.ObjectCreate({}, []); }, 'an empty slot list is valid'); + + st['throws']( + function () { ES.ObjectCreate({}, ['a']); }, + SyntaxError, + 'internal slots are not supported' + ); + + st.end(); + }); + + t.test('null proto', { skip: !Object.create && !$setProto }, function (st) { + st.equal('toString' in {}, true, 'normal objects have toString'); + st.equal('toString' in ES.ObjectCreate(null), false, 'makes a null object'); + + st.end(); + }); + + t.test('null proto when no native Object.create', { skip: Object.create || $setProto }, function (st) { + st['throws']( + function () { ES.ObjectCreate(null); }, + SyntaxError, + 'without a native Object.create, can not create null objects' + ); + + st.end(); + }); + + t.end(); + }); + + test('AdvanceStringIndex', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.AdvanceStringIndex(nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + var notInts = v.nonNumbers.concat( + v.nonIntegerNumbers, + v.infinities, + [NaN, [], new Date(), Math.pow(2, 53), -1] + ); + forEach(notInts, function (nonInt) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', nonInt); }, + TypeError, + '"index" argument must be an integer, ' + debug(nonInt) + ' is not.' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', 0, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var str = 'a\uD83D\uDCA9c'; + + t.test('non-unicode mode', function (st) { + for (var i = 0; i < str.length + 2; i += 1) { + st.equal(ES.AdvanceStringIndex(str, i, false), i + 1, i + ' advances to ' + (i + 1)); + } + + st.end(); + }); + + t.test('unicode mode', function (st) { + st.equal(ES.AdvanceStringIndex(str, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(str, 1, true), 3, '1 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 3, true), 4, '3 advances to 4'); + st.equal(ES.AdvanceStringIndex(str, 4, true), 5, '4 advances to 5'); + + st.end(); + }); + + t.test('lone surrogates', function (st) { + var halfPoo = 'a\uD83Dc'; + + st.equal(ES.AdvanceStringIndex(halfPoo, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(halfPoo, 1, true), 2, '1 advances to 2'); + st.equal(ES.AdvanceStringIndex(halfPoo, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(halfPoo, 3, true), 4, '3 advances to 4'); + + st.end(); + }); + + t.test('surrogate pairs', function (st) { + var lowestPair = String.fromCharCode('0xD800') + String.fromCharCode('0xDC00'); + var highestPair = String.fromCharCode('0xDBFF') + String.fromCharCode('0xDFFF'); + var poop = String.fromCharCode('0xD83D') + String.fromCharCode('0xDCA9'); + + st.equal(ES.AdvanceStringIndex(lowestPair, 0, true), 2, 'lowest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(highestPair, 0, true), 2, 'highest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(poop, 0, true), 2, 'poop, 0 -> 2'); + + st.end(); + }); + + t.end(); + }); + + test('CreateMethodProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateMethodProperty(primitive, 'key'); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateMethodProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var value = { foo: 'bar' }; + + st.equal(ES.CreateMethodProperty(obj, key, value), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + { + configurable: true, + enumerable: false, + value: value, + writable: true + }, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.equal(obj[key], value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.CreateMethodProperty(obj, 'foo', { value: 'baz' }); }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.CreateMethodProperty(function () {}, 'name', { value: 'baz' }); }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DefinePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DefinePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DefinePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var descriptor = { + configurable: true, + enumerable: false, + value: { foo: 'bar' }, + writable: true + }; + + st.equal(ES.DefinePropertyOrThrow(obj, key, descriptor), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + descriptor, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.deepEqual(obj[key], descriptor.value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { + ES.DefinePropertyOrThrow(obj, 'foo', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { + ES.DefinePropertyOrThrow(function () {}, 'name', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DeletePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DeletePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DeletePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = { 'the key': 42 }; + var key = 'the key'; + + st.equal(ES.DeletePropertyOrThrow(obj, key), true, 'deletes property successfully'); + st.equal(key in obj, false, 'key is no longer in the object'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.DeletePropertyOrThrow(obj, 'foo'); }, + TypeError, + 'nonconfigurable key can not be deleted' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.DeletePropertyOrThrow(function () {}, 'name'); }, + TypeError, + 'nonconfigurable function name can not be deleted' + ); + st.end(); + }); + + t.end(); + }); + + test('EnumerableOwnNames', { skip: skips && skips.EnumerableOwnNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { return ES.EnumerableOwnNames(O); }); + + t.deepEqual( + ES.EnumerableOwnNames(obj), + ['own'], + 'returns enumerable own names' + ); + + t.end(); + }); + + test('thisNumberValue', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.thisNumberValue(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.thisNumberValue(number), number, debug(number) + ' is its own thisNumberValue'); + var obj = Object(number); + t.equal(ES.thisNumberValue(obj), number, debug(obj) + ' is the boxed thisNumberValue'); + }); + + t.end(); + }); + + test('thisBooleanValue', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.thisBooleanValue(nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.booleans, function (boolean) { + t.equal(ES.thisBooleanValue(boolean), boolean, debug(boolean) + ' is its own thisBooleanValue'); + var obj = Object(boolean); + t.equal(ES.thisBooleanValue(obj), boolean, debug(obj) + ' is the boxed thisBooleanValue'); + }); + + t.end(); + }); + + test('thisStringValue', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.thisStringValue(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.thisStringValue(string), string, debug(string) + ' is its own thisStringValue'); + var obj = Object(string); + t.equal(ES.thisStringValue(obj), string, debug(obj) + ' is the boxed thisStringValue'); + }); + + t.end(); + }); + + test('thisTimeValue', function (t) { + forEach(v.primitives.concat(v.objects), function (nonDate) { + t['throws']( + function () { ES.thisTimeValue(nonDate); }, + TypeError, + debug(nonDate) + ' is not a Date' + ); + }); + + forEach(v.timestamps, function (timestamp) { + var date = new Date(timestamp); + + t.equal(ES.thisTimeValue(date), timestamp, debug(date) + ' is its own thisTimeValue'); + }); + + t.end(); + }); + + test('SetIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.SetIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.SetIntegrityLevel({}); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + var O = { a: 1 }; + t.test('sealed', { skip: !Object.preventExtensions || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'sealed'), true); + st['throws']( + function () { O.b = 2; }, + /^TypeError: (Cannot|Can't) add property b, object is not extensible$/, + 'sealing prevent new properties from being added' + ); + O.a = 2; + st.equal(O.a, 2, 'pre-frozen, existing properties are mutable'); + st.end(); + }); + + t.test('frozen', { skip: !Object.freeze || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'frozen'), true); + st['throws']( + function () { O.a = 3; }, + /^TypeError: Cannot assign to read only property 'a' of /, + 'freezing prevents existing properties from being mutated' + ); + st.end(); + }); + + t.end(); + }); + + test('TestIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.TestIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.TestIntegrityLevel({ a: 1 }); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'sealed'), false, 'basic object is not sealed'); + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'frozen'), false, 'basic object is not frozen'); + + t.test('preventExtensions', { skip: !Object.preventExtensions }, function (st) { + var o = Object.preventExtensions({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), false, 'nonextensible object is not sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'nonextensible object is not frozen'); + + var empty = Object.preventExtensions({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty nonextensible object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty nonextensible object is frozen'); + st.end(); + }); + + t.test('seal', { skip: !Object.seal }, function (st) { + var o = Object.seal({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'sealed object is not frozen'); + + var empty = Object.seal({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty sealed object is frozen'); + + st.end(); + }); + + t.test('freeze', { skip: !Object.freeze }, function (st) { + var o = Object.freeze({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), true, 'frozen object is frozen'); + + var empty = Object.freeze({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty frozen object is frozen'); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryHasInstance', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t.equal(ES.OrdinaryHasInstance(nonFunction, {}), false, debug(nonFunction) + ' is not callable'); + }); + + forEach(v.primitives, function (primitive) { + t.equal(ES.OrdinaryHasInstance(function () {}, primitive), false, debug(primitive) + ' is not an object'); + }); + + var C = function C() {}; + var D = function D() {}; + t.equal(ES.OrdinaryHasInstance(C, new C()), true, 'constructor function has an instance of itself'); + t.equal(ES.OrdinaryHasInstance(C, new D()), false, 'constructor/instance mismatch is false'); + t.equal(ES.OrdinaryHasInstance(D, new C()), false, 'instance/constructor mismatch is false'); + t.equal(ES.OrdinaryHasInstance(C, {}), false, 'plain object is not an instance of a constructor'); + t.equal(ES.OrdinaryHasInstance(Object, {}), true, 'plain object is an instance of Object'); + + t.end(); + }); + + test('OrdinaryHasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryHasProperty(primitive, ''); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryHasProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryHasProperty({ a: 1 }, 'a'), true, 'own property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'toString'), true, 'inherited property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'nope'), false, 'absent property is false'); + + t.end(); + }); + + test('InstanceofOperator', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.InstanceofOperator(primitive, function () {}); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.InstanceofOperator({}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not callable' + ); + }); + + var C = function C() {}; + var D = function D() {}; + + t.equal(ES.InstanceofOperator(new C(), C), true, 'constructor function has an instance of itself'); + t.equal(ES.InstanceofOperator(new D(), C), false, 'constructor/instance mismatch is false'); + t.equal(ES.InstanceofOperator(new C(), D), false, 'instance/constructor mismatch is false'); + t.equal(ES.InstanceofOperator({}, C), false, 'plain object is not an instance of a constructor'); + t.equal(ES.InstanceofOperator({}, Object), true, 'plain object is an instance of Object'); + + t.test('Symbol.hasInstance', { skip: !v.hasSymbols || !Symbol.hasInstance }, function (st) { + st.plan(4); + + var O = {}; + var C2 = function () {}; + st.equal(ES.InstanceofOperator(O, C2), false, 'O is not an instance of C2'); + + defineProperty(C2, Symbol.hasInstance, { + value: function (obj) { + st.equal(this, C2, 'hasInstance receiver is C2'); + st.equal(obj, O, 'hasInstance argument is O'); + + return {}; // testing coercion to boolean + } + }); + + st.equal(ES.InstanceofOperator(O, C2), true, 'O is now an instance of C2'); + + st.end(); + }); + + t.end(); + }); + + test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); + }); + + test('ValidateAndApplyPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (nonUndefinedPrimitive) { + t['throws']( + function () { ES.ValidateAndApplyPropertyDescriptor(nonUndefinedPrimitive, '', false, v.genericDescriptor(), v.genericDescriptor()); }, + TypeError, + 'O: ' + debug(nonUndefinedPrimitive) + ' is not undefined or an Object' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + nonBoolean, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'extensible: ' + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.primitives, function (primitive) { + // Desc must be a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + primitive, + v.genericDescriptor() + ); + }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + // current must be undefined or a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + v.genericDescriptor(), + primitive + ); + }, + TypeError, + 'current: ' + debug(primitive) + ' is not a Property Descriptor or undefined' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + // if O is an object, P must be a property key + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + {}, + nonPropertyKey, + false, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('current is undefined', function (st) { + var propertyKey = 'howdy'; + + st.test('generic descriptor', function (s2t) { + var generic = v.genericDescriptor(); + generic['[[Enumerable]]'] = true; + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, generic); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, generic), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, generic), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = undefined; + s2t.deepEqual(O, expected, 'generic descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('data descriptor', function (s2t) { + var data = v.dataDescriptor(); + data['[[Enumerable]]'] = true; + + var O = {}; + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, data), + true, + 'noop when O is undefined' + ); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, data), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, data), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = data['[[Value]]']; + s2t.deepEqual(O, expected, 'data descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('accessor descriptor', { skip: !defineProperty.oDP }, function (s2t) { + var count = 0; + var accessor = v.accessorDescriptor(); + accessor['[[Enumerable]]'] = true; + accessor['[[Get]]'] = function () { + count += 1; + return count; + }; + + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, accessor); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, accessor), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, accessor), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = accessor['[[Get]]']() + 1; + s2t.deepEqual(O, expected, 'accessor descriptor has been defined as an own accessor property'); + s2t.end(); + }); + + st.end(); + }); + + t.test('every field in Desc is absent', { skip: 'it is unclear if having no fields qualifies Desc to be a Property Descriptor' }); + + forEach([v.dataDescriptor, v.accessorDescriptor, v.mutatorDescriptor], function (getDescriptor) { + t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, 'property key', true, getDescriptor(), getDescriptor()), + true, + 'when Desc and current are the same, early return true' + ); + }); + + t.test('current is nonconfigurable', function (st) { + // note: these must not be generic descriptors, or else the algorithm returns an early true + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if Desc is configurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.enumerable(v.dataDescriptor()), + v.descriptors.nonEnumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is Enumerable and current is not' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.nonEnumerable(v.dataDescriptor()), + v.descriptors.enumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is not Enumerable and current is' + ); + + var descLackingEnumerable = v.accessorDescriptor(); + delete descLackingEnumerable['[[Enumerable]]']; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + descLackingEnumerable, + v.descriptors.enumerable(v.accessorDescriptor()) + ), + true, + 'not false if Desc lacks Enumerable' + ); + + st.end(); + }); + + t.test('Desc and current: one is a data descriptor, one is not', { skip: !defineProperty || !getOwnPropertyDescriptor }, function (st) { + // note: Desc must be configurable if current is nonconfigurable, to hit this branch + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.accessorDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if current (data) is nonconfigurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if current (not data) is nonconfigurable' + ); + + // one is data and one is not, + // // if current is data, convert to accessor + // // else convert to data + + var startsWithData = { + 'property key': 42 + }; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithData, + 'property key', + true, + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())) + ), + true, + 'operation is successful: current is data, Desc is accessor' + ); + var shouldBeAccessor = getOwnPropertyDescriptor(startsWithData, 'property key'); + st.equal(typeof shouldBeAccessor.get, 'function', 'has a getter'); + + var key = 'property key'; + var startsWithAccessor = {}; + defineProperty(startsWithAccessor, key, { + configurable: true, + enumerable: true, + get: function get() { return 42; } + }); + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithAccessor, + key, + true, + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor(42))) + ), + true, + 'operation is successful: current is accessor, Desc is data' + ); + var shouldBeData = getOwnPropertyDescriptor(startsWithAccessor, 'property key'); + st.deepEqual(shouldBeData, { configurable: true, enumerable: true, value: 42, writable: false }, 'is a data property'); + + st.end(); + }); + + t.test('Desc and current are both data descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.writable(v.dataDescriptor()), + v.descriptors.nonWritable(v.descriptors.nonConfigurable(v.dataDescriptor())) + ), + false, + 'false if frozen current and writable Desc' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable({ '[[Value]]': 42 }), + v.descriptors.nonWritable({ '[[Value]]': 7 }) + ), + false, + 'false if nonwritable current has a different value than Desc' + ); + + st.end(); + }); + + t.test('current is nonconfigurable; Desc and current are both accessor descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.mutatorDescriptor(), + v.descriptors.nonConfigurable(v.mutatorDescriptor()) + ), + false, + 'false if both Sets are not equal' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.accessorDescriptor(), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if both Gets are not equal' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryGetOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty(primitive, ''); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryGetOwnProperty({}, 'not in the object'), undefined, 'missing property yields undefined'); + t.equal(ES.OrdinaryGetOwnProperty({}, 'toString'), undefined, 'inherited non-own property yields undefined'); + + t.deepEqual( + ES.OrdinaryGetOwnProperty({ a: 1 }, 'a'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: true, + value: 1, + writable: true + }), + 'own assigned data property yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(/a/, 'lastIndex'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'regex lastIndex yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty([], 'length'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'array length yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(Object.prototype, 'toString'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: false, + value: Object.prototype.toString, + writable: true + }), + 'own non-enumerable data property yields expected descriptor' + ); + + t.test('ES5+', { skip: !defineProperty.oDP }, function (st) { + var O = {}; + defineProperty(O, 'foo', { + configurable: false, + enumerable: false, + value: O, + writable: true + }); + + st.deepEqual( + ES.OrdinaryGetOwnProperty(O, 'foo'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: O, + writable: true + }), + 'defined own property yields expected descriptor' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryDefineOwnProperty', { skip: !getOwnPropertyDescriptor }, function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty({}, nonPropertyKey, v.genericDescriptor()); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty(primitive, '', v.genericDescriptor()); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var O = {}; + var P = 'property key'; + var Desc = v.accessorDescriptor(); + t.equal( + ES.OrdinaryDefineOwnProperty(O, P, Desc), + true, + 'operation is successful' + ); + t.deepEqual( + getOwnPropertyDescriptor(O, P), + ES.FromPropertyDescriptor(ES.CompletePropertyDescriptor(Desc)), + 'expected property descriptor is defined' + ); + + t.end(); + }); + + test('ArrayCreate', function (t) { + forEach(v.nonIntegerNumbers.concat([-1]), function (nonIntegerNumber) { + t['throws']( + function () { ES.ArrayCreate(nonIntegerNumber); }, + TypeError, + 'length must be an integer number >= 0' + ); + }); + + t['throws']( + function () { ES.ArrayCreate(Math.pow(2, 32)); }, + RangeError, + 'length must be < 2**32' + ); + + t.deepEqual(ES.ArrayCreate(-0), [], 'length of -0 creates an empty array'); + t.deepEqual(ES.ArrayCreate(0), [], 'length of +0 creates an empty array'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(1), [,], 'length of 1 creates a sparse array of length 1'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(2), [,,], 'length of 2 creates a sparse array of length 2'); + + t.test('proto argument', { skip: !$setProto }, function (st) { + var fakeProto = { + push: { toString: function () { return 'not array push'; } } + }; + st.equal(ES.ArrayCreate(0, fakeProto).push, fakeProto.push, 'passing the proto argument works'); + st.end(); + }); + + t.end(); + }); + + test('ArraySetLength', function (t) { + forEach(v.primitives.concat(v.objects), function (nonArray) { + t['throws']( + function () { ES.ArraySetLength(nonArray, 0); }, + TypeError, + 'A: ' + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ArraySetLength([], primitive); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.test('making length nonwritable', { skip: !getOwnPropertyDescriptor }, function (st) { + var a = []; + ES.ArraySetLength(a, { '[[Writable]]': false }); + st.deepEqual( + getOwnPropertyDescriptor(a, 'length'), + { + configurable: false, + enumerable: false, + value: 0, + writable: false + }, + 'without a value, length becomes nonwritable' + ); + st.end(); + }); + + var arr = []; + ES.ArraySetLength(arr, { '[[Value]]': 7 }); + t.equal(arr.length, 7, 'array now has a length of 7'); + + t.end(); + }); + + test('CreateHTML', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.CreateHTML('', nonString, '', ''); }, + TypeError, + 'tag: ' + debug(nonString) + ' is not a String' + ); + t['throws']( + function () { ES.CreateHTML('', '', nonString, ''); }, + TypeError, + 'attribute: ' + debug(nonString) + ' is not a String' + ); + }); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + '' + ), + 'the string', + 'works with an empty string attribute value' + ); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + 'attr', + 'value "with quotes"' + ), + 'the string', + 'works with an attribute, and a value with quotes' + ); + + t.end(); + }); + + test('GetOwnPropertyKeys', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.GetOwnPropertyKeys(primitive, 'String'); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.GetOwnPropertyKeys({}, 'not string or symbol'); }, + TypeError, + 'Type: must be "String" or "Symbol"' + ); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var O = { a: 1 }; + O[Symbol.iterator] = true; + var s = Symbol('test'); + defineProperty(O, s, { enumerable: false, value: true }); + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'Symbol'), + [Symbol.iterator, s], + 'works with Symbols, enumerable or not' + ); + + st.end(); + }); + + t.test('non-enumerable names', { skip: !defineProperty.oDP }, function (st) { + var O = { a: 1 }; + defineProperty(O, 'b', { enumerable: false, value: 2 }); + if (v.hasSymbols) { + O[Symbol.iterator] = true; + } + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'String').sort(), + ['a', 'b'].sort(), + 'works with Strings, enumerable or not' + ); + + st.end(); + }); + + t.deepEqual( + ES.GetOwnPropertyKeys({ a: 1, b: 2 }, 'String').sort(), + ['a', 'b'].sort(), + 'works with enumerable keys' + ); + + t.end(); + }); + + test('SymbolDescriptiveString', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.SymbolDescriptiveString(nonSymbol); }, + TypeError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(ES.SymbolDescriptiveString(Symbol()), 'Symbol()', 'undefined description'); + st.equal(ES.SymbolDescriptiveString(Symbol('')), 'Symbol()', 'empty string description'); + st.equal(ES.SymbolDescriptiveString(Symbol.iterator), 'Symbol(Symbol.iterator)', 'well-known symbol'); + st.equal(ES.SymbolDescriptiveString(Symbol('foo')), 'Symbol(foo)', 'string description'); + + st.end(); + }); + + t.end(); + }); + + test('GetSubstitution', { skip: skips && skips.GetSubstitution }, function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + if (canDistinguishSparseFromUndefined || typeof nonString !== 'undefined') { + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + } + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); + }); + + test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); + }); + + test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); + }); + + test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); + }); + + var msPerSecond = 1e3; + var msPerMinute = 60 * msPerSecond; + var msPerHour = 60 * msPerMinute; + var msPerDay = 24 * msPerHour; + + test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); + }); + + test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); + }); + + test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); + }); + + test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); + }); + + test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); + }); + + test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); + }); + + test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); + }); + + test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); + }); + + test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); + }); + + test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); + }); + + test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); + }); + + test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); + }); + + test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); + }); + + test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + + t.end(); + }); + + test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); + }); + + test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); + }); + + test('ToDateString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.ToDateString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + t.equal(ES.ToDateString(NaN), 'Invalid Date', 'NaN becomes "Invalid Date"'); + var now = +new Date(); + t.equal(ES.ToDateString(now), Date(now), 'any timestamp becomes `Date(timestamp)`'); + t.end(); + }); + + test('CreateListFromArrayLike', function (t) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { ES.CreateListFromArrayLike(nonObject); }, + TypeError, + debug(nonObject) + ' is not an Object' + ); + }); + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.CreateListFromArrayLike({}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + t.deepEqual( + ES.CreateListFromArrayLike({ length: 2, 0: 'a', 1: 'b', 2: 'c' }), + ['a', 'b'], + 'arraylike stops at the length' + ); + + t.end(); + }); + + test('GetPrototypeFromConstructor', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(nonFunction, '%Array%'); }, + TypeError, + debug(nonFunction) + ' is not a constructor' + ); + }); + + forEach(arrowFns, function (arrowFn) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(arrowFn, '%Array%'); }, + TypeError, + debug(arrowFn) + ' is not a constructor' + ); + }); + + var f = function () {}; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + f.prototype, + 'function with normal `prototype` property returns it' + ); + forEach([true, 'foo', 42], function (truthyPrimitive) { + f.prototype = truthyPrimitive; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + Array.prototype, + 'function with non-object `prototype` property (' + debug(truthyPrimitive) + ') returns default intrinsic' + ); + }); + + t.end(); + }); + + var getNamelessFunction = function () { + var f = Object(function () {}); + try { + delete f.name; + } catch (e) { /**/ } + return f; + }; + + test('SetFunctionName', function (t) { + t.test('non-extensible function', { skip: !Object.preventExtensions }, function (st) { + var f = getNamelessFunction(); + Object.preventExtensions(f); + st['throws']( + function () { ES.SetFunctionName(f, ''); }, + TypeError, + 'throws on a non-extensible function' + ); + st.end(); + }); + + t.test('has an own name property', { skip: !functionsHaveNames }, function (st) { + st['throws']( + function () { ES.SetFunctionName(function g() {}, ''); }, + TypeError, + 'throws if function has an own `name` property' + ); + st.end(); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.SetFunctionName(getNamelessFunction(), nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Symbol or String' + ); + }); + + t.test('symbols', { skip: !v.hasSymbols || has(getNamelessFunction(), 'name') }, function (st) { + var pairs = [ + [Symbol(), ''], + [Symbol(undefined), ''], + [Symbol(null), '[null]'], + [Symbol(''), getInferredName ? '[]' : ''], + [Symbol.iterator, '[Symbol.iterator]'], + [Symbol('foo'), '[foo]'] + ]; + forEach(pairs, function (pair) { + var sym = pair[0]; + var desc = pair[1]; + var f = getNamelessFunction(); + ES.SetFunctionName(f, sym); + st.equal(f.name, desc, debug(sym) + ' yields a name of ' + debug(desc)); + }); + + st.end(); + }); + + var f = getNamelessFunction(); + t.test('when names are configurable', { skip: !functionsHaveConfigurableNames || has(f, 'name') }, function (st) { + // without prefix + st.notEqual(f.name, 'foo', 'precondition'); + ES.SetFunctionName(f, 'foo'); + st.equal(f.name, 'foo', 'function name is set without a prefix'); + + // with prefix + var g = getNamelessFunction(); + st.notEqual(g.name, 'pre- foo', 'precondition'); + ES.SetFunctionName(g, 'foo', 'pre-'); + st.equal(g.name, 'pre- foo', 'function name is set with a prefix'); + + st.end(); + }); + + t.end(); + }); +}; + +var es2016 = function ES2016(ES, ops, expectedMissing, skips) { + es2015(ES, ops, expectedMissing, skips); + + test('SameValueNonNumber', function (t) { + var willThrow = [ + [3, 4], + [NaN, 4], + [4, ''], + ['abc', true], + [{}, false] + ]; + forEach(willThrow, function (nums) { + t['throws'](function () { return ES.SameValueNonNumber.apply(ES, nums); }, TypeError, 'value must be same type and non-number'); + }); + + forEach(v.objects.concat(v.nonNumberPrimitives), function (val) { + t.equal(val === val, ES.SameValueNonNumber(val, val), debug(val) + ' is SameValueNonNumber to itself'); + }); + + t.end(); + }); + + test('IterableToArrayLike', { skip: skips && skips.IterableToArrayLike }, function (t) { + t.test('custom iterables', { skip: !v.hasSymbols }, function (st) { + var O = {}; + O[Symbol.iterator] = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + st.deepEqual( + ES.IterableToArrayLike(O), + [0, 1, 2, 3, 4], + 'Symbol.iterator method is called and values collected' + ); + + st.end(); + }); + + t.deepEqual(ES.IterableToArrayLike('abc'), ['a', 'b', 'c'], 'a string of code units spreads'); + t.deepEqual(ES.IterableToArrayLike('💩'), ['💩'], 'a string of code points spreads'); + t.deepEqual(ES.IterableToArrayLike('a💩c'), ['a', '💩', 'c'], 'a string of code points and units spreads'); + + var arr = [1, 2, 3]; + t.deepEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a similar array'); + t.notEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a different, but similar, array'); + + var O = {}; + t.equal(ES.IterableToArrayLike(O), O, 'a non-iterable non-array non-string object is returned directly'); + + t.end(); + }); + + test('OrdinaryGetPrototypeOf', function (t) { + t.test('values', { skip: !$getProto }, function (st) { + st.equal(ES.OrdinaryGetPrototypeOf([]), Array.prototype, 'array [[Prototype]] is Array.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf({}), Object.prototype, 'object [[Prototype]] is Object.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(/a/g), RegExp.prototype, 'regex [[Prototype]] is RegExp.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object('')), String.prototype, 'boxed string [[Prototype]] is String.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(42)), Number.prototype, 'boxed number [[Prototype]] is Number.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(true)), Boolean.prototype, 'boxed boolean [[Prototype]] is Boolean.prototype'); + if (v.hasSymbols) { + st.equal(ES.OrdinaryGetPrototypeOf(Object(Symbol.iterator)), Symbol.prototype, 'boxed symbol [[Prototype]] is Symbol.prototype'); + } + st.end(); + }); + + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetPrototypeOf(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + t.end(); + }); + + test('OrdinarySetPrototypeOf', { skip: !$getProto || !$setProto }, function (t) { + var a = []; + var proto = {}; + + t.equal(ES.OrdinaryGetPrototypeOf(a), Array.prototype, 'precondition'); + t.equal(ES.OrdinarySetPrototypeOf(a, proto), true, 'setting prototype is successful'); + t.equal(ES.OrdinaryGetPrototypeOf(a), proto, 'postcondition'); + + t.end(); + }); +}; + +var es2017 = function ES2017(ES, ops, expectedMissing, skips) { + es2016(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnNames: true, + IterableToArrayLike: true + })); + + test('ToIndex', function (t) { + t.ok(is(ES.ToIndex(), 0), 'no value gives 0'); + t.ok(is(ES.ToIndex(undefined), 0), 'undefined value gives 0'); + + t['throws'](function () { ES.ToIndex(-1); }, RangeError, 'negative numbers throw'); + + t['throws'](function () { ES.ToIndex(MAX_SAFE_INTEGER + 1); }, RangeError, 'too large numbers throw'); + + t.equal(ES.ToIndex(3), 3, 'numbers work'); + t.equal(ES.ToIndex(v.valueOfOnlyObject), 4, 'coercible objects are coerced'); + + t.end(); + }); + + test('EnumerableOwnProperties', { skip: skips && skips.EnumerableOwnProperties }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnProperties(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IterableToList', function (t) { + var customIterator = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + + t.deepEqual( + ES.IterableToList({}, customIterator), + [0, 1, 2, 3, 4], + 'iterator method is called and values collected' + ); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.deepEqual(ES.IterableToList('abc', String.prototype[Symbol.iterator]), ['a', 'b', 'c'], 'a string of code units spreads'); + st.deepEqual(ES.IterableToList('☃', String.prototype[Symbol.iterator]), ['☃'], 'a string of code points spreads'); + + var arr = [1, 2, 3]; + st.deepEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a similar array'); + st.notEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a different, but similar, array'); + + st.end(); + }); + + t['throws']( + function () { ES.IterableToList({}, void 0); }, + TypeError, + 'non-function iterator method' + ); + + t.end(); + }); +}; + +var es2018 = function ES2018(ES, ops, expectedMissing, skips) { + es2017(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnProperties: true, + GetSubstitution: true, + IsPropertyDescriptor: true + })); + + test('thisSymbolValue', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.thisSymbolValue(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('no native Symbols', { skip: v.hasSymbols }, function (st) { + forEach(v.objects.concat(v.primitives), function (value) { + st['throws']( + function () { ES.thisSymbolValue(value); }, + SyntaxError, + 'Symbols are not supported' + ); + }); + st.end(); + }); + + t.test('symbol values', { skip: !v.hasSymbols }, function (st) { + forEach(v.symbols, function (symbol) { + st.equal(ES.thisSymbolValue(symbol), symbol, 'Symbol value of ' + debug(symbol) + ' is same symbol'); + + st.equal( + ES.thisSymbolValue(Object(symbol)), + symbol, + 'Symbol value of ' + debug(Object(symbol)) + ' is ' + debug(symbol) + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('IsStringPrefix', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.IsStringPrefix(nonString, 'a'); }, + TypeError, + 'first arg: ' + debug(nonString) + ' is not a string' + ); + t['throws']( + function () { ES.IsStringPrefix('a', nonString); }, + TypeError, + 'second arg: ' + debug(nonString) + ' is not a string' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.IsStringPrefix(string, string), true, debug(string) + ' is a prefix of itself'); + + t.equal(ES.IsStringPrefix('', string), true, 'the empty string is a prefix of everything'); + }); + + t.equal(ES.IsStringPrefix('abc', 'abcd'), true, '"abc" is a prefix of "abcd"'); + t.equal(ES.IsStringPrefix('abcd', 'abc'), false, '"abcd" is not a prefix of "abc"'); + + t.equal(ES.IsStringPrefix('a', 'bc'), false, '"a" is not a prefix of "bc"'); + + t.end(); + }); + + test('NumberToString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.NumberToString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.NumberToString(number), String(number), debug(number) + ' stringifies to ' + number); + }); + + t.end(); + }); + + test('CopyDataProperties', function (t) { + t.test('first argument: target', function (st) { + forEach(v.primitives, function (primitive) { + st['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + st.end(); + }); + + t.test('second argument: source', function (st) { + var frozenTarget = Object.freeze ? Object.freeze({}) : {}; + forEach(v.nullPrimitives, function (nullish) { + st.equal( + ES.CopyDataProperties(frozenTarget, nullish, []), + frozenTarget, + debug(nullish) + ' "source" yields identical, unmodified target' + ); + }); + + forEach(v.nonNullPrimitives, function (objectCoercible) { + var target = {}; + var result = ES.CopyDataProperties(target, objectCoercible, []); + st.equal(result, target, 'result === target'); + st.deepEqual(keys(result), keys(Object(objectCoercible)), 'target ends up with keys of ' + debug(objectCoercible)); + }); + + st.test('enumerable accessor property', { skip: !defineProperty.oDP }, function (s2t) { + var target = {}; + var source = {}; + defineProperty(source, 'a', { + enumerable: true, + get: function () { return 42; } + }); + var result = ES.CopyDataProperties(target, source, []); + s2t.equal(result, target, 'result === target'); + s2t.deepEqual(result, { a: 42 }, 'target ends up with enumerable accessor of source'); + s2t.end(); + }); + + st.end(); + }); + + t.test('third argument: excludedItems', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, [nonPropertyKey]); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + var result = ES.CopyDataProperties({}, { a: 1, b: 2, c: 3 }, ['b']); + st.deepEqual(keys(result).sort(), ['a', 'c'].sort(), 'excluded string keys are excluded'); + + st.test('excluding symbols', { skip: !v.hasSymbols }, function (s2t) { + var source = {}; + forEach(v.symbols, function (symbol) { + source[symbol] = true; + }); + + var includedSymbols = v.symbols.slice(1); + var excludedSymbols = v.symbols.slice(0, 1); + var target = ES.CopyDataProperties({}, source, excludedSymbols); + + forEach(includedSymbols, function (symbol) { + s2t.equal(has(target, symbol), true, debug(symbol) + ' is included'); + }); + + forEach(excludedSymbols, function (symbol) { + s2t.equal(has(target, symbol), false, debug(symbol) + ' is excluded'); + }); + + s2t.end(); + }); + + st.end(); + }); + + t.end(); + }); + + test('PromiseResolve', function (t) { + t.test('Promises unsupported', { skip: typeof Promise === 'function' }, function (st) { + st['throws']( + function () { ES.PromiseResolve(); }, + SyntaxError, + 'Promises are not supported' + ); + st.end(); + }); + + t.test('Promises supported', { skip: typeof Promise !== 'function' }, function (st) { + st.plan(2); + + var a = {}; + var b = {}; + var fulfilled = Promise.resolve(a); + var rejected = Promise.reject(b); + + ES.PromiseResolve(Promise, fulfilled).then(function (x) { + st.equal(x, a, 'fulfilled promise resolves to fulfilled'); + }); + + ES.PromiseResolve(Promise, rejected)['catch'](function (e) { + st.equal(e, b, 'rejected promise resolves to rejected'); + }); + }); + + t.end(); + }); + + test('EnumerableOwnPropertyNames', { skip: skips && skips.EnumerableOwnPropertyNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnPropertyNames(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IsPromise', { skip: typeof Promise !== 'function' }, function (t) { + forEach(v.objects.concat(v.primitives), function (nonPromise) { + t.equal(ES.IsPromise(nonPromise), false, debug(nonPromise) + ' is not a Promise'); + }); + + var thenable = { then: Promise.prototype.then }; + t.equal(ES.IsPromise(thenable), false, 'generic thenable is not a Promise'); + + t.equal(ES.IsPromise(Promise.resolve()), true, 'Promise is a Promise'); + + t.end(); + }); + + test('GetSubstitution (ES2018+)', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], undefined, ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], undefined, ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], undefined, nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], undefined, ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], undefined, ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, undefined, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], undefined, ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('DateString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.DateString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + t.equal(ES.DateString(Date.UTC(2019, 8, 10, 7, 8, 9)), 'Tue Sep 10 2019'); + t.equal(ES.DateString(Date.UTC(2016, 1, 29, 7, 8, 9)), 'Mon Feb 29 2016'); // leap day + t.end(); + }); + + test('TimeString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.TimeString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + var tv = Date.UTC(2019, 8, 10, 7, 8, 9); + t.equal(ES.TimeString(tv), '07:08:09 GMT'); + t.end(); + }); +}; + +var es2019 = function ES2018(ES, ops, expectedMissing, skips) { + es2018(ES, ops, expectedMissing, assign({}, skips, { + })); + + test('AddEntriesFromIterable', function (t) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, undefined, function () {}); }, + TypeError, + 'iterable must not be undefined' + ); + t['throws']( + function () { ES.AddEntriesFromIterable({}, null, function () {}); }, + TypeError, + 'iterable must not be null' + ); + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, {}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.plan(4); + + var O = {}; + st.equal(ES.AddEntriesFromIterable(O, [], function () {}), O, 'returns the target'); + + var adder = function (key, value) { + st.equal(this, O, 'adder gets proper receiver'); + st.equal(key, 0, 'k is key'); + st.equal(value, 'a', 'v is value'); + }; + ES.AddEntriesFromIterable(O, ['a'].entries(), adder); + + st.end(); + }); + + t.end(); + }); + + test('FlattenIntoArray', function (t) { + t.test('no mapper function', function (st) { + var testDepth = function testDepth(tt, depth, expected) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, depth); + tt.deepEqual(a, expected, 'depth: ' + depth); + }; + + testDepth(st, 1, [1, 2, [3], 4, [[[5]]]]); + testDepth(st, 2, [1, 2, 3, 4, [[5]]]); + testDepth(st, 3, [1, 2, 3, 4, [5]]); + testDepth(st, 4, [1, 2, 3, 4, 5]); + testDepth(st, Infinity, [1, 2, 3, 4, 5]); + st.end(); + }); + + t.test('mapper function', function (st) { + var testMapper = function testMapper(tt, mapper, expected, thisArg) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, 1, mapper, thisArg); + tt.deepEqual(a, expected); + }; + + var double = function double(x) { + return typeof x === 'number' ? 2 * x : x; + }; + testMapper( + st, + double, + [1, 4, [3], 8, [[[5]]]] + ); + var receiver = hasStrictMode ? 42 : Object(42); + testMapper( + st, + function (x) { return [this, double(x)]; }, + [receiver, [1], receiver, 4, receiver, [[3]], receiver, [], receiver, 8, receiver, [[[[5]]]]], + 42 + ); + st.end(); + }); + + t.end(); + }); + + test('TrimString', function (t) { + t.test('non-object string', function (st) { + forEach(v.nullPrimitives, function (nullish) { + st['throws']( + function () { ES.TrimString(nullish); }, + debug(nullish) + ' is not an Object' + ); + }); + st.end(); + }); + + var string = ' \n abc \n '; + t.equal(ES.TrimString(string, 'start'), string.slice(string.indexOf('a'))); + t.equal(ES.TrimString(string, 'end'), string.slice(0, string.lastIndexOf('c') + 1)); + t.equal(ES.TrimString(string, 'start+end'), string.slice(string.indexOf('a'), string.lastIndexOf('c') + 1)); + + t.end(); + }); +}; + +module.exports = { + es2015: es2015, + es2016: es2016, + es2017: es2017, + es2018: es2018, + es2019: es2019 +}; diff --git a/node_modules/string.prototype.trimstart/package.json b/node_modules/string.prototype.trimstart/package.json new file mode 100644 index 0000000..1d7f8ed --- /dev/null +++ b/node_modules/string.prototype.trimstart/package.json @@ -0,0 +1,121 @@ +{ + "_from": "string.prototype.trimstart@^1.0.1", + "_id": "string.prototype.trimstart@1.0.1", + "_inBundle": false, + "_integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "_location": "/string.prototype.trimstart", + "_phantomChildren": { + "es-to-primitive": "1.2.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "has-symbols": "1.0.1", + "is-callable": "1.2.2", + "is-regex": "1.1.1", + "object-inspect": "1.8.0", + "object-keys": "1.1.1", + "object.assign": "4.1.1", + "string.prototype.trimend": "1.0.1", + "string.prototype.trimstart": "1.0.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "string.prototype.trimstart@^1.0.1", + "name": "string.prototype.trimstart", + "escapedName": "string.prototype.trimstart", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/array-includes/es-abstract", + "/array.prototype.flat/es-abstract", + "/es-abstract", + "/object.entries/es-abstract", + "/object.values/es-abstract", + "/string.prototype.trimend/es-abstract", + "/string.prototype.trimstart/es-abstract" + ], + "_resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "_shasum": "14af6d9f34b053f7cfc89b72f8f2ee14b9039a54", + "_spec": "string.prototype.trimstart@^1.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/es-abstract", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/es-shims/String.prototype.trimStart/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com" + }, + { + "name": "Khaled Al-Ansari", + "email": "khaledelansari@gmail.com" + } + ], + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "deprecated": false, + "description": "ES2019 spec-compliant String.prototype.trimStart shim.", + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^16.0.0", + "aud": "^1.1.0", + "auto-changelog": "^1.16.4", + "eslint": "^6.8.0", + "functions-have-names": "^1.2.1", + "tape": "^5.0.0-next.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/es-shims/String.prototype.trimStart#readme", + "keywords": [ + "es6", + "es7", + "es8", + "javascript", + "prototype", + "polyfill", + "utility", + "trim", + "trimLeft", + "trimRight", + "trimStart", + "trimEnd", + "tc39" + ], + "license": "MIT", + "main": "index.js", + "name": "string.prototype.trimstart", + "repository": { + "type": "git", + "url": "git://github.com/es-shims/String.prototype.trimStart.git" + }, + "scripts": { + "lint": "eslint .", + "posttest": "npx aud --production", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "pretest": "npm run lint && es-shim-api --bound", + "test": "npm run tests-only", + "test:module": "node test", + "test:shimmed": "node test/shimmed", + "tests-only": "npm run --silent test:shimmed && npm run --silent test:module", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "version": "1.0.1" +} diff --git a/node_modules/string.prototype.trimstart/polyfill.js b/node_modules/string.prototype.trimstart/polyfill.js new file mode 100644 index 0000000..9adaccd --- /dev/null +++ b/node_modules/string.prototype.trimstart/polyfill.js @@ -0,0 +1,15 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = function getPolyfill() { + if (!String.prototype.trimStart && !String.prototype.trimLeft) { + return implementation; + } + var zeroWidthSpace = '\u200b'; + var trimmed = zeroWidthSpace.trimStart ? zeroWidthSpace.trimStart() : zeroWidthSpace.trimLeft(); + if (trimmed !== zeroWidthSpace) { + return implementation; + } + return String.prototype.trimStart || String.prototype.trimLeft; +}; diff --git a/node_modules/string.prototype.trimstart/shim.js b/node_modules/string.prototype.trimstart/shim.js new file mode 100644 index 0000000..5ea6dfd --- /dev/null +++ b/node_modules/string.prototype.trimstart/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var define = require('define-properties'); +var getPolyfill = require('./polyfill'); + +module.exports = function shimTrimStart() { + var polyfill = getPolyfill(); + define( + String.prototype, + { trimStart: polyfill }, + { trimStart: function () { return String.prototype.trimStart !== polyfill; } } + ); + return polyfill; +}; diff --git a/node_modules/string.prototype.trimstart/test/index.js b/node_modules/string.prototype.trimstart/test/index.js new file mode 100644 index 0000000..baff6b5 --- /dev/null +++ b/node_modules/string.prototype.trimstart/test/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var trimStart = require('../'); +var test = require('tape'); + +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('bad array/this value', function (st) { + st['throws'](function () { trimStart(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { trimStart(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(trimStart, t); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/test/shimmed.js b/node_modules/string.prototype.trimstart/test/shimmed.js new file mode 100644 index 0000000..d859713 --- /dev/null +++ b/node_modules/string.prototype.trimstart/test/shimmed.js @@ -0,0 +1,37 @@ +'use strict'; + +var trimStart = require('../'); +trimStart.shim(); + +var runTests = require('./tests'); + +var test = require('tape'); +var defineProperties = require('define-properties'); +var callBind = require('es-abstract/helpers/callBind'); +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names')(); + +test('shimmed', function (t) { + t.equal(String.prototype.trimStart.length, 0, 'String#trimStart has a length of 0'); + t.test('Function name', { skip: !functionsHaveNames }, function (st) { + st.equal((/^(?:trimLeft|trimStart)$/).test(String.prototype.trimStart.name), true, 'String#trimStart has name "trimLeft" or "trimStart"'); + st.end(); + }); + + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(String.prototype, 'trimStart'), 'String#trimStart is not enumerable'); + et.end(); + }); + + var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); + + t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) { + st['throws'](function () { return trimStart(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { return trimStart(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + runTests(callBind(String.prototype.trimStart), t); + + t.end(); +}); diff --git a/node_modules/string.prototype.trimstart/test/tests.js b/node_modules/string.prototype.trimstart/test/tests.js new file mode 100644 index 0000000..a515158 --- /dev/null +++ b/node_modules/string.prototype.trimstart/test/tests.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function (trimStart, t) { + t.test('normal cases', function (st) { + st.equal(trimStart(' \t\na \t\n'), 'a \t\n', 'strips whitespace off the left side'); + st.equal(trimStart('a'), 'a', 'noop when no whitespace'); + + var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + st.equal(trimStart(allWhitespaceChars + 'a' + allWhitespaceChars), 'a' + allWhitespaceChars, 'all expected whitespace chars are trimmed'); + + st.end(); + }); + + // see https://codeblog.jonskeet.uk/2014/12/01/when-is-an-identifier-not-an-identifier-attack-of-the-mongolian-vowel-separator/ + var mongolianVowelSeparator = '\u180E'; + t.test('unicode >= 4 && < 6.3', { skip: !(/^\s$/).test(mongolianVowelSeparator) }, function (st) { + st.equal(trimStart(mongolianVowelSeparator + 'a' + mongolianVowelSeparator), 'a' + mongolianVowelSeparator, 'mongolian vowel separator is whitespace'); + st.end(); + }); + + t.test('zero-width spaces', function (st) { + var zeroWidth = '\u200b'; + st.equal(trimStart(zeroWidth), zeroWidth, 'zero width space does not trim'); + st.end(); + }); +}; diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..907fccc --- /dev/null +++ b/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..9a593df --- /dev/null +++ b/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..fdab9ab --- /dev/null +++ b/node_modules/strip-ansi/package.json @@ -0,0 +1,86 @@ +{ + "_from": "strip-ansi@^6.0.0", + "_id": "strip-ansi@6.0.0", + "_inBundle": false, + "_integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "_location": "/strip-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-ansi@^6.0.0", + "name": "strip-ansi", + "escapedName": "strip-ansi", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "_shasum": "0b1571dd7669ccd4f3e06e14ef1eed26225ae532", + "_spec": "strip-ansi@^6.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes from a string", + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "6.0.0" +} diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..7c4b56d --- /dev/null +++ b/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/strip-bom/index.js b/node_modules/strip-bom/index.js new file mode 100644 index 0000000..b00feb9 --- /dev/null +++ b/node_modules/strip-bom/index.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = x => { + if (typeof x !== 'string') { + throw new TypeError('Expected a string, got ' + typeof x); + } + + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (x.charCodeAt(0) === 0xFEFF) { + return x.slice(1); + } + + return x; +}; diff --git a/node_modules/strip-bom/license b/node_modules/strip-bom/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/strip-bom/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/strip-bom/package.json b/node_modules/strip-bom/package.json new file mode 100644 index 0000000..b9635bc --- /dev/null +++ b/node_modules/strip-bom/package.json @@ -0,0 +1,73 @@ +{ + "_from": "strip-bom@^3.0.0", + "_id": "strip-bom@3.0.0", + "_inBundle": false, + "_integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "_location": "/strip-bom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-bom@^3.0.0", + "name": "strip-bom", + "escapedName": "strip-bom", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/load-json-file", + "/tsconfig-paths" + ], + "_resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "_shasum": "2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3", + "_spec": "strip-bom@^3.0.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/load-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-bom/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Strip UTF-8 byte order mark (BOM) from a string", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/strip-bom#readme", + "keywords": [ + "strip", + "bom", + "byte", + "order", + "mark", + "unicode", + "utf8", + "utf-8", + "remove", + "delete", + "trim", + "text", + "string" + ], + "license": "MIT", + "name": "strip-bom", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-bom.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/node_modules/strip-bom/readme.md b/node_modules/strip-bom/readme.md new file mode 100644 index 0000000..812a980 --- /dev/null +++ b/node_modules/strip-bom/readme.md @@ -0,0 +1,36 @@ +# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom) + +> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string + +From Wikipedia: + +> The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8. + + +## Install + +``` +$ npm install --save strip-bom +``` + + +## Usage + +```js +const stripBom = require('strip-bom'); + +stripBom('\uFEFFunicorn'); +//=> 'unicorn' +``` + + +## Related + +- [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module +- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module +- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/strip-json-comments/index.d.ts b/node_modules/strip-json-comments/index.d.ts new file mode 100644 index 0000000..28ba3c8 --- /dev/null +++ b/node_modules/strip-json-comments/index.d.ts @@ -0,0 +1,36 @@ +declare namespace stripJsonComments { + interface Options { + /** + Replace comments with whitespace instead of stripping them entirely. + + @default true + */ + readonly whitespace?: boolean; + } +} + +/** +Strip comments from JSON. Lets you use comments in your JSON files! + +It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +@param jsonString - Accepts a string with JSON. +@returns A JSON string without comments. + +@example +``` +const json = `{ + // Rainbows + "unicorn": "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` +*/ +declare function stripJsonComments( + jsonString: string, + options?: stripJsonComments.Options +): string; + +export = stripJsonComments; diff --git a/node_modules/strip-json-comments/index.js b/node_modules/strip-json-comments/index.js new file mode 100644 index 0000000..bb00b38 --- /dev/null +++ b/node_modules/strip-json-comments/index.js @@ -0,0 +1,77 @@ +'use strict'; +const singleComment = Symbol('singleComment'); +const multiComment = Symbol('multiComment'); +const stripWithoutWhitespace = () => ''; +const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); + +const isEscaped = (jsonString, quotePosition) => { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === '\\') { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +}; + +module.exports = (jsonString, options = {}) => { + if (typeof jsonString !== 'string') { + throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``); + } + + const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; + + let insideString = false; + let insideComment = false; + let offset = 0; + let result = ''; + + for (let i = 0; i < jsonString.length; i++) { + const currentCharacter = jsonString[i]; + const nextCharacter = jsonString[i + 1]; + + if (!insideComment && currentCharacter === '"') { + const escaped = isEscaped(jsonString, i); + if (!escaped) { + insideString = !insideString; + } + } + + if (insideString) { + continue; + } + + if (!insideComment && currentCharacter + nextCharacter === '//') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = singleComment; + i++; + } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { + i++; + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + continue; + } else if (insideComment === singleComment && currentCharacter === '\n') { + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + } else if (!insideComment && currentCharacter + nextCharacter === '/*') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = multiComment; + i++; + continue; + } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { + i++; + insideComment = false; + result += strip(jsonString, offset, i + 1); + offset = i + 1; + continue; + } + } + + return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); +}; diff --git a/node_modules/strip-json-comments/license b/node_modules/strip-json-comments/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/strip-json-comments/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-json-comments/package.json b/node_modules/strip-json-comments/package.json new file mode 100644 index 0000000..dbb4074 --- /dev/null +++ b/node_modules/strip-json-comments/package.json @@ -0,0 +1,80 @@ +{ + "_from": "strip-json-comments@^3.1.0", + "_id": "strip-json-comments@3.1.1", + "_inBundle": false, + "_integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "_location": "/strip-json-comments", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-json-comments@^3.1.0", + "name": "strip-json-comments", + "escapedName": "strip-json-comments", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/@eslint/eslintrc", + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "_shasum": "31f1281b3832630434831c310c01cccda8cbe006", + "_spec": "strip-json-comments@^3.1.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-json-comments/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", + "devDependencies": { + "ava": "^1.4.1", + "matcha": "^0.7.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/strip-json-comments#readme", + "keywords": [ + "json", + "strip", + "comments", + "remove", + "delete", + "trim", + "multiline", + "parse", + "config", + "configuration", + "settings", + "util", + "env", + "environment", + "jsonc" + ], + "license": "MIT", + "name": "strip-json-comments", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-json-comments.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "test": "xo && ava && tsd" + }, + "version": "3.1.1" +} diff --git a/node_modules/strip-json-comments/readme.md b/node_modules/strip-json-comments/readme.md new file mode 100644 index 0000000..cc542e5 --- /dev/null +++ b/node_modules/strip-json-comments/readme.md @@ -0,0 +1,78 @@ +# strip-json-comments [![Build Status](https://travis-ci.com/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.com/github/sindresorhus/strip-json-comments) + +> Strip comments from JSON. Lets you use comments in your JSON files! + +This is now possible: + +```js +{ + // Rainbows + "unicorn": /* ❤ */ "cake" +} +``` + +It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +Also available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. + +## Install + +``` +$ npm install strip-json-comments +``` + +## Usage + +```js +const json = `{ + // Rainbows + "unicorn": /* ❤ */ "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` + +## API + +### stripJsonComments(jsonString, options?) + +#### jsonString + +Type: `string` + +Accepts a string with JSON and returns a string without comments. + +#### options + +Type: `object` + +##### whitespace + +Type: `boolean`\ +Default: `true` + +Replace comments with whitespace instead of stripping them entirely. + +## Benchmark + +``` +$ npm run bench +``` + +## Related + +- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module +- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js new file mode 100644 index 0000000..62afa3a --- /dev/null +++ b/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js new file mode 100644 index 0000000..1704131 --- /dev/null +++ b/node_modules/supports-color/index.js @@ -0,0 +1,131 @@ +'use strict'; +const os = require('os'); +const hasFlag = require('has-flag'); + +const env = process.env; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + + const min = forceColor ? 1 : 0; + + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json new file mode 100644 index 0000000..700804b --- /dev/null +++ b/node_modules/supports-color/package.json @@ -0,0 +1,85 @@ +{ + "_from": "supports-color@^5.3.0", + "_id": "supports-color@5.5.0", + "_inBundle": false, + "_integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "_location": "/supports-color", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "supports-color@^5.3.0", + "name": "supports-color", + "escapedName": "supports-color", + "rawSpec": "^5.3.0", + "saveSpec": null, + "fetchSpec": "^5.3.0" + }, + "_requiredBy": [ + "/@babel/highlight/chalk" + ], + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "_shasum": "e2e69a44ac8772f78a1ec0b35b689df6530efc8f", + "_spec": "supports-color@^5.3.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/@babel/highlight/node_modules/chalk", + "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" +} diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md new file mode 100644 index 0000000..f6e4019 --- /dev/null +++ b/node_modules/supports-color/readme.md @@ -0,0 +1,66 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/table/LICENSE b/node_modules/table/LICENSE new file mode 100644 index 0000000..6c41d45 --- /dev/null +++ b/node_modules/table/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) +All rights reserved. + +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. + * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +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 ANUARY BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/table/README.md b/node_modules/table/README.md new file mode 100644 index 0000000..b394204 --- /dev/null +++ b/node_modules/table/README.md @@ -0,0 +1,735 @@ + +# Table + +[![GitSpo Mentions](https://gitspo.com/badges/mentions/gajus/table?style=flat-square)](https://gitspo.com/mentions/gajus/table) +[![Travis build status](http://img.shields.io/travis/gajus/table/master.svg?style=flat-square)](https://travis-ci.org/gajus/table) +[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table) +[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table) +[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical) +[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas) + +* [Table](#table) + * [Features](#table-features) + * [Install](#table-install) + * [Usage](#table-usage) + * [Cell Content Alignment](#table-usage-cell-content-alignment) + * [Column Width](#table-usage-column-width) + * [Custom Border](#table-usage-custom-border) + * [Draw Horizontal Line](#table-usage-draw-horizontal-line) + * [Single Line Mode](#table-usage-single-line-mode) + * [Padding Cell Content](#table-usage-padding-cell-content) + * [Predefined Border Templates](#table-usage-predefined-border-templates) + * [Streaming](#table-usage-streaming) + * [Text Truncation](#table-usage-text-truncation) + * [Text Wrapping](#table-usage-text-wrapping) + + +Produces a string that represents array data in a text table. + +![Demo of table displaying a list of missions to the Moon.](./.README/demo.png) + + +## Features + +* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. +* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). +* Configurable border characters. +* Configurable content alignment per column. +* Configurable content padding per column. +* Configurable column width. +* Text wrapping. + + +## Install + +```bash +npm install table + +``` + +[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/gajus) +[![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/gajus) + + +## Usage + +Table data is described using an array (rows) of array (cells). + +```js +import { + table +} from 'table'; + +// Using commonjs? +// const {table} = require('table'); + +let data, + output; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +/** + * @typedef {string} table~cell + */ + +/** + * @typedef {table~cell[]} table~row + */ + +/** + * @typedef {Object} table~columns + * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). + * @property {number} width Column width (default: auto). + * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). + * @property {number} paddingLeft Cell content padding width left (default: 1). + * @property {number} paddingRight Cell content padding width right (default: 1). + */ + +/** + * @typedef {Object} table~border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * Used to dynamically tell table whether to draw a line separating rows or not. + * The default behavior is to always return true. + * + * @typedef {function} drawHorizontalLine + * @param {number} index + * @param {number} size + * @return {boolean} + */ + +/** + * @typedef {Object} table~config + * @property {table~border} border + * @property {table~columns[]} columns Column specific configuration. + * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. + * @property {table~drawHorizontalLine} drawHorizontalLine + */ + +/** + * Generates a text table. + * + * @param {table~row[]} rows + * @param {table~config} config + * @return {String} + */ +output = table(data); + +console.log(output); +``` + +``` +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════╧════╝ + +``` + + + +### Cell Content Alignment + +`{string} config.columns[{number}].alignment` property controls content horizontal alignment within a cell. + +Valid values are: "left", "right" and "center". + +```js +let config, + data, + output; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + columns: { + 0: { + alignment: 'left', + width: 10 + }, + 1: { + alignment: 'center', + width: 10 + }, + 2: { + alignment: 'right', + width: 10 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔════════════╤════════════╤════════════╗ +║ 0A │ 0B │ 0C ║ +╟────────────┼────────────┼────────────╢ +║ 1A │ 1B │ 1C ║ +╟────────────┼────────────┼────────────╢ +║ 2A │ 2B │ 2C ║ +╚════════════╧════════════╧════════════╝ +``` + + +### Column Width + +`{number} config.columns[{number}].width` property restricts column width to a fixed width. + +```js +let data, + output, + options; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +options = { + columns: { + 1: { + width: 10 + } + } +}; + +output = table(data, options); + +console.log(output); +``` + +``` +╔════╤════════════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────────────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────────────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════════════╧════╝ +``` + + +### Custom Border + +`{object} config.border` property describes characters used to draw the table border. + +```js +let config, + data, + output; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + border: { + topBody: `─`, + topJoin: `┬`, + topLeft: `┌`, + topRight: `┐`, + + bottomBody: `─`, + bottomJoin: `┴`, + bottomLeft: `└`, + bottomRight: `┘`, + + bodyLeft: `│`, + bodyRight: `│`, + bodyJoin: `│`, + + joinBody: `─`, + joinLeft: `├`, + joinRight: `┤`, + joinJoin: `┼` + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +┌────┬────┬────┐ +│ 0A │ 0B │ 0C │ +├────┼────┼────┤ +│ 1A │ 1B │ 1C │ +├────┼────┼────┤ +│ 2A │ 2B │ 2C │ +└────┴────┴────┘ +``` + + +### Draw Horizontal Line + +`{function} config.drawHorizontalLine` property is a function that is called for every non-content row in the table. The result of the function `{boolean}` determines whether a row is drawn. + +```js +let data, + output, + options; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'], + ['3A', '3B', '3C'], + ['4A', '4B', '4C'] +]; + +options = { + /** + * @typedef {function} drawHorizontalLine + * @param {number} index + * @param {number} size + * @return {boolean} + */ + drawHorizontalLine: (index, size) => { + return index === 0 || index === 1 || index === size - 1 || index === size; + } +}; + +output = table(data, options); + +console.log(output); + +``` + +``` +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +║ 2A │ 2B │ 2C ║ +║ 3A │ 3B │ 3C ║ +╟────┼────┼────╢ +║ 4A │ 4B │ 4C ║ +╚════╧════╧════╝ + +``` + + +### Single Line Mode + +Horizontal lines inside the table are not drawn. + +```js +import { + table, + getBorderCharacters +} from 'table'; + +const data = [ + ['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'], + ['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'], + ['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'], + ['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'], + ['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'], + ['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'], + ['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'], + ['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'], +]; + +const config = { + singleLine: true +}; + +const output = table(data, config); +console.log(output); +``` + +``` +╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ +║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║ +║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║ +║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║ +║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║ +║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║ +║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║ +║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║ +║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║ +╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ +``` + + +### Padding Cell Content + +`{number} config.columns[{number}].paddingLeft` and `{number} config.columns[{number}].paddingRight` properties control content padding within a cell. Property value represents a number of whitespaces used to pad the content. + +```js +let config, + data, + output; + +data = [ + ['0A', 'AABBCC', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + columns: { + 0: { + paddingLeft: 3 + }, + 1: { + width: 2, + paddingRight: 3 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════╤══════╤════╗ +║ 0A │ AA │ 0C ║ +║ │ BB │ ║ +║ │ CC │ ║ +╟──────┼──────┼────╢ +║ 1A │ 1B │ 1C ║ +╟──────┼──────┼────╢ +║ 2A │ 2B │ 2C ║ +╚══════╧══════╧════╝ +``` + + +### Predefined Border Templates + +You can load one of the predefined border templates using `getBorderCharacters` function. + +```js +import { + table, + getBorderCharacters +} from 'table'; + +let config, + data; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + border: getBorderCharacters(`name of the template`) +}; + +table(data, config); +``` + +``` +# honeywell + +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════╧════╝ + +# norc + +┌────┬────┬────┐ +│ 0A │ 0B │ 0C │ +├────┼────┼────┤ +│ 1A │ 1B │ 1C │ +├────┼────┼────┤ +│ 2A │ 2B │ 2C │ +└────┴────┴────┘ + +# ramac (ASCII; for use in terminals that do not support Unicode characters) + ++----+----+----+ +| 0A | 0B | 0C | +|----|----|----| +| 1A | 1B | 1C | +|----|----|----| +| 2A | 2B | 2C | ++----+----+----+ + +# void (no borders; see "bordless table" section of the documentation) + + 0A 0B 0C + + 1A 1B 1C + + 2A 2B 2C + +``` + +Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template. + + +#### Borderless Table + +Simply using "void" border character template creates a table with a lot of unnecessary spacing. + +To create a more plesant to the eye table, reset the padding and remove the joining rows, e.g. + +```js +let output; + +output = table(data, { + border: getBorderCharacters(`void`), + columnDefault: { + paddingLeft: 0, + paddingRight: 1 + }, + drawHorizontalLine: () => { + return false + } +}); + +console.log(output); +``` + +``` +0A 0B 0C +1A 1B 1C +2A 2B 2C +``` + + +### Streaming + +`table` package exports `createStream` function used to draw a table and append rows. + +`createStream` requires `{number} columnDefault.width` and `{number} columnCount` configuration properties. + +```js +import { + createStream +} from 'table'; + +let config, + stream; + +config = { + columnDefault: { + width: 50 + }, + columnCount: 1 +}; + +stream = createStream(config); + +setInterval(() => { + stream.write([new Date()]); +}, 500); +``` + +![Streaming current date.](./.README/streaming.gif) + +`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. + +The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691). + +Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g. + +```js +import { + createStream +} from 'table'; + +import _ from 'lodash'; + +let config, + stream, + i; + +config = { + columnDefault: { + width: 50 + }, + columnCount: 3, + columns: { + 0: { + width: 10, + alignment: 'right' + }, + 1: { + alignment: 'center', + }, + 2: { + width: 10 + } + } +}; + +stream = createStream(config); + +i = 0; + +setInterval(() => { + let random; + + random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); + + stream.write([i++, new Date(), random]); +}, 500); +``` + +![Streaming random data.](./.README/streaming-random.gif) + + +### Text Truncation + +To handle a content that overflows the container width, `table` package implements [text wrapping](#table-usage-text-wrapping). However, sometimes you may want to truncate content that is too long to be displayed in the table. + +`{number} config.columns[{number}].truncate` property (default: `Infinity`) truncates the text at the specified length. + +```js +let config, + data, + output; + +data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +config = { + columns: { + 0: { + width: 20, + truncate: 100 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor si ║ +║ t amet, consectetur ║ +║ adipiscing elit. Pha ║ +║ sellus pulvinar nibh ║ +║ sed mauris conva... ║ +╚══════════════════════╝ +``` + + +### Text Wrapping + +`table` package implements auto text wrapping, i.e. text that has width greater than the container width will be separated into multiple lines, e.g. + +```js +let config, + data, + output; + +data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +config = { + columns: { + 0: { + width: 20 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor si ║ +║ t amet, consectetur ║ +║ adipiscing elit. Pha ║ +║ sellus pulvinar nibh ║ +║ sed mauris convallis ║ +║ dapibus. Nunc venena ║ +║ tis tempus nulla sit ║ +║ amet viverra. ║ +╚══════════════════════╝ +``` + +When `wrapWord` is `true` the text is broken at the nearest space or one of the special characters ("-", "_", "\", "/", ".", ",", ";"), e.g. + +```js +let config, + data, + output; + +data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +config = { + columns: { + 0: { + width: 20, + wrapWord: true + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor ║ +║ sit amet, ║ +║ consectetur ║ +║ adipiscing elit. ║ +║ Phasellus pulvinar ║ +║ nibh sed mauris ║ +║ convallis dapibus. ║ +║ Nunc venenatis ║ +║ tempus nulla sit ║ +║ amet viverra. ║ +╚══════════════════════╝ + +``` + diff --git a/node_modules/table/dist/alignString.js b/node_modules/table/dist/alignString.js new file mode 100644 index 0000000..5d98644 --- /dev/null +++ b/node_modules/table/dist/alignString.js @@ -0,0 +1,108 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _isNumber2 = _interopRequireDefault(require("lodash/isNumber")); + +var _isString2 = _interopRequireDefault(require("lodash/isString")); + +var _stringWidth = _interopRequireDefault(require("string-width")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const alignments = ['left', 'right', 'center']; +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ + +const alignLeft = (subject, width) => { + return subject + ' '.repeat(width); +}; +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ + + +const alignRight = (subject, width) => { + return ' '.repeat(width) + subject; +}; +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ + + +const alignCenter = (subject, width) => { + let halfWidth; + halfWidth = width / 2; + + if (halfWidth % 2 === 0) { + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); + } else { + halfWidth = Math.floor(halfWidth); + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); + } +}; +/** + * Pads a string to the left and/or right to position the subject + * text in a desired alignment within a container. + * + * @param {string} subject + * @param {number} containerWidth + * @param {string} alignment One of the valid options (left, right, center). + * @returns {string} + */ + + +const alignString = (subject, containerWidth, alignment) => { + if (!(0, _isString2.default)(subject)) { + throw new TypeError('Subject parameter value must be a string.'); + } + + if (!(0, _isNumber2.default)(containerWidth)) { + throw new TypeError('Container width parameter value must be a number.'); + } + + const subjectWidth = (0, _stringWidth.default)(subject); + + if (subjectWidth > containerWidth) { + // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); + throw new Error('Subject parameter value width cannot be greater than the container width.'); + } + + if (!(0, _isString2.default)(alignment)) { + throw new TypeError('Alignment parameter value must be a string.'); + } + + if (!alignments.includes(alignment)) { + throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); + } + + if (subjectWidth === 0) { + return ' '.repeat(containerWidth); + } + + const availableWidth = containerWidth - subjectWidth; + + if (alignment === 'left') { + return alignLeft(subject, availableWidth); + } + + if (alignment === 'right') { + return alignRight(subject, availableWidth); + } + + return alignCenter(subject, availableWidth); +}; + +var _default = alignString; +exports.default = _default; +//# sourceMappingURL=alignString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/alignString.js.flow b/node_modules/table/dist/alignString.js.flow new file mode 100644 index 0000000..f0383ff --- /dev/null +++ b/node_modules/table/dist/alignString.js.flow @@ -0,0 +1,96 @@ +import _ from 'lodash'; +import stringWidth from 'string-width'; + +const alignments = [ + 'left', + 'right', + 'center' +]; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +const alignLeft = (subject, width) => { + return subject + ' '.repeat(width); +}; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +const alignRight = (subject, width) => { + return ' '.repeat(width) + subject; +}; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +const alignCenter = (subject, width) => { + let halfWidth; + + halfWidth = width / 2; + + if (halfWidth % 2 === 0) { + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); + } else { + halfWidth = Math.floor(halfWidth); + + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); + } +}; + +/** + * Pads a string to the left and/or right to position the subject + * text in a desired alignment within a container. + * + * @param {string} subject + * @param {number} containerWidth + * @param {string} alignment One of the valid options (left, right, center). + * @returns {string} + */ +export default (subject, containerWidth, alignment) => { + if (!_.isString(subject)) { + throw new TypeError('Subject parameter value must be a string.'); + } + + if (!_.isNumber(containerWidth)) { + throw new TypeError('Container width parameter value must be a number.'); + } + + const subjectWidth = stringWidth(subject); + + if (subjectWidth > containerWidth) { + // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); + + throw new Error('Subject parameter value width cannot be greater than the container width.'); + } + + if (!_.isString(alignment)) { + throw new TypeError('Alignment parameter value must be a string.'); + } + + if (!alignments.includes(alignment)) { + throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); + } + + if (subjectWidth === 0) { + return ' '.repeat(containerWidth); + } + + const availableWidth = containerWidth - subjectWidth; + + if (alignment === 'left') { + return alignLeft(subject, availableWidth); + } + + if (alignment === 'right') { + return alignRight(subject, availableWidth); + } + + return alignCenter(subject, availableWidth); +}; diff --git a/node_modules/table/dist/alignString.js.map b/node_modules/table/dist/alignString.js.map new file mode 100644 index 0000000..1cdd609 --- /dev/null +++ b/node_modules/table/dist/alignString.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/alignString.js"],"names":["alignments","alignLeft","subject","width","repeat","alignRight","alignCenter","halfWidth","Math","floor","containerWidth","alignment","TypeError","subjectWidth","Error","includes","availableWidth"],"mappings":";;;;;;;;;;;AACA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,MADiB,EAEjB,OAFiB,EAGjB,QAHiB,CAAnB;AAMA;;;;;;AAKA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAUC,KAAV,KAAoB;AACpC,SAAOD,OAAO,GAAG,IAAIE,MAAJ,CAAWD,KAAX,CAAjB;AACD,CAFD;AAIA;;;;;;;AAKA,MAAME,UAAU,GAAG,CAACH,OAAD,EAAUC,KAAV,KAAoB;AACrC,SAAO,IAAIC,MAAJ,CAAWD,KAAX,IAAoBD,OAA3B;AACD,CAFD;AAIA;;;;;;;AAKA,MAAMI,WAAW,GAAG,CAACJ,OAAD,EAAUC,KAAV,KAAoB;AACtC,MAAII,SAAJ;AAEAA,EAAAA,SAAS,GAAGJ,KAAK,GAAG,CAApB;;AAEA,MAAII,SAAS,GAAG,CAAZ,KAAkB,CAAtB,EAAyB;AACvB,WAAO,IAAIH,MAAJ,CAAWG,SAAX,IAAwBL,OAAxB,GAAkC,IAAIE,MAAJ,CAAWG,SAAX,CAAzC;AACD,GAFD,MAEO;AACLA,IAAAA,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWF,SAAX,CAAZ;AAEA,WAAO,IAAIH,MAAJ,CAAWG,SAAX,IAAwBL,OAAxB,GAAkC,IAAIE,MAAJ,CAAWG,SAAS,GAAG,CAAvB,CAAzC;AACD;AACF,CAZD;AAcA;;;;;;;;;;;qBASgBL,O,EAASQ,c,EAAgBC,S,KAAc;AACrD,MAAI,CAAC,wBAAWT,OAAX,CAAL,EAA0B;AACxB,UAAM,IAAIU,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAED,MAAI,CAAC,wBAAWF,cAAX,CAAL,EAAiC;AAC/B,UAAM,IAAIE,SAAJ,CAAc,mDAAd,CAAN;AACD;;AAED,QAAMC,YAAY,GAAG,0BAAYX,OAAZ,CAArB;;AAEA,MAAIW,YAAY,GAAGH,cAAnB,EAAmC;AACjC;AAEA,UAAM,IAAII,KAAJ,CAAU,2EAAV,CAAN;AACD;;AAED,MAAI,CAAC,wBAAWH,SAAX,CAAL,EAA4B;AAC1B,UAAM,IAAIC,SAAJ,CAAc,6CAAd,CAAN;AACD;;AAED,MAAI,CAACZ,UAAU,CAACe,QAAX,CAAoBJ,SAApB,CAAL,EAAqC;AACnC,UAAM,IAAIG,KAAJ,CAAU,4FAAV,CAAN;AACD;;AAED,MAAID,YAAY,KAAK,CAArB,EAAwB;AACtB,WAAO,IAAIT,MAAJ,CAAWM,cAAX,CAAP;AACD;;AAED,QAAMM,cAAc,GAAGN,cAAc,GAAGG,YAAxC;;AAEA,MAAIF,SAAS,KAAK,MAAlB,EAA0B;AACxB,WAAOV,SAAS,CAACC,OAAD,EAAUc,cAAV,CAAhB;AACD;;AAED,MAAIL,SAAS,KAAK,OAAlB,EAA2B;AACzB,WAAON,UAAU,CAACH,OAAD,EAAUc,cAAV,CAAjB;AACD;;AAED,SAAOV,WAAW,CAACJ,OAAD,EAAUc,cAAV,CAAlB;AACD,C","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\n\nconst alignments = [\n 'left',\n 'right',\n 'center'\n];\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignLeft = (subject, width) => {\n return subject + ' '.repeat(width);\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignRight = (subject, width) => {\n return ' '.repeat(width) + subject;\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignCenter = (subject, width) => {\n let halfWidth;\n\n halfWidth = width / 2;\n\n if (halfWidth % 2 === 0) {\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth);\n } else {\n halfWidth = Math.floor(halfWidth);\n\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);\n }\n};\n\n/**\n * Pads a string to the left and/or right to position the subject\n * text in a desired alignment within a container.\n *\n * @param {string} subject\n * @param {number} containerWidth\n * @param {string} alignment One of the valid options (left, right, center).\n * @returns {string}\n */\nexport default (subject, containerWidth, alignment) => {\n if (!_.isString(subject)) {\n throw new TypeError('Subject parameter value must be a string.');\n }\n\n if (!_.isNumber(containerWidth)) {\n throw new TypeError('Container width parameter value must be a number.');\n }\n\n const subjectWidth = stringWidth(subject);\n\n if (subjectWidth > containerWidth) {\n // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject);\n\n throw new Error('Subject parameter value width cannot be greater than the container width.');\n }\n\n if (!_.isString(alignment)) {\n throw new TypeError('Alignment parameter value must be a string.');\n }\n\n if (!alignments.includes(alignment)) {\n throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');\n }\n\n if (subjectWidth === 0) {\n return ' '.repeat(containerWidth);\n }\n\n const availableWidth = containerWidth - subjectWidth;\n\n if (alignment === 'left') {\n return alignLeft(subject, availableWidth);\n }\n\n if (alignment === 'right') {\n return alignRight(subject, availableWidth);\n }\n\n return alignCenter(subject, availableWidth);\n};\n"],"file":"alignString.js"} \ No newline at end of file diff --git a/node_modules/table/dist/alignTableData.js b/node_modules/table/dist/alignTableData.js new file mode 100644 index 0000000..e01bd55 --- /dev/null +++ b/node_modules/table/dist/alignTableData.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _stringWidth = _interopRequireDefault(require("string-width")); + +var _alignString = _interopRequireDefault(require("./alignString")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +const alignTableData = (rows, config) => { + return rows.map(cells => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + + if ((0, _stringWidth.default)(value) === column.width) { + return value; + } else { + return (0, _alignString.default)(value, column.width, column.alignment); + } + }); + }); +}; + +var _default = alignTableData; +exports.default = _default; +//# sourceMappingURL=alignTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/alignTableData.js.flow b/node_modules/table/dist/alignTableData.js.flow new file mode 100644 index 0000000..8a7be7a --- /dev/null +++ b/node_modules/table/dist/alignTableData.js.flow @@ -0,0 +1,21 @@ +import stringWidth from 'string-width'; +import alignString from './alignString'; + +/** + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +export default (rows, config) => { + return rows.map((cells) => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + + if (stringWidth(value) === column.width) { + return value; + } else { + return alignString(value, column.width, column.alignment); + } + }); + }); +}; diff --git a/node_modules/table/dist/alignTableData.js.map b/node_modules/table/dist/alignTableData.js.map new file mode 100644 index 0000000..183240f --- /dev/null +++ b/node_modules/table/dist/alignTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/alignTableData.js"],"names":["rows","config","map","cells","value","index1","column","columns","width","alignment"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;wBAKgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,KAAD,EAAQC,MAAR,KAAmB;AAClC,YAAMC,MAAM,GAAGL,MAAM,CAACM,OAAP,CAAeF,MAAf,CAAf;;AAEA,UAAI,0BAAYD,KAAZ,MAAuBE,MAAM,CAACE,KAAlC,EAAyC;AACvC,eAAOJ,KAAP;AACD,OAFD,MAEO;AACL,eAAO,0BAAYA,KAAZ,EAAmBE,MAAM,CAACE,KAA1B,EAAiCF,MAAM,CAACG,SAAxC,CAAP;AACD;AACF,KARM,CAAP;AASD,GAVM,CAAP;AAWD,C","sourcesContent":["import stringWidth from 'string-width';\nimport alignString from './alignString';\n\n/**\n * @param {table~row[]} rows\n * @param {Object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((value, index1) => {\n const column = config.columns[index1];\n\n if (stringWidth(value) === column.width) {\n return value;\n } else {\n return alignString(value, column.width, column.alignment);\n }\n });\n });\n};\n"],"file":"alignTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellHeight.js b/node_modules/table/dist/calculateCellHeight.js new file mode 100644 index 0000000..7c11c4f --- /dev/null +++ b/node_modules/table/dist/calculateCellHeight.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _isString2 = _interopRequireDefault(require("lodash/isString")); + +var _wrapCell = _interopRequireDefault(require("./wrapCell")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {string} value + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {number} + */ +const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { + if (!(0, _isString2.default)(value)) { + throw new TypeError('Value must be a string.'); + } + + if (!Number.isInteger(columnWidth)) { + throw new TypeError('Column width must be an integer.'); + } + + if (columnWidth < 1) { + throw new Error('Column width must be greater than 0.'); + } + + return (0, _wrapCell.default)(value, columnWidth, useWrapWord).length; +}; + +var _default = calculateCellHeight; +exports.default = _default; +//# sourceMappingURL=calculateCellHeight.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellHeight.js.flow b/node_modules/table/dist/calculateCellHeight.js.flow new file mode 100644 index 0000000..3eca8d7 --- /dev/null +++ b/node_modules/table/dist/calculateCellHeight.js.flow @@ -0,0 +1,24 @@ +import _ from 'lodash'; +import wrapCell from './wrapCell'; + +/** + * @param {string} value + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {number} + */ +export default (value, columnWidth, useWrapWord = false) => { + if (!_.isString(value)) { + throw new TypeError('Value must be a string.'); + } + + if (!Number.isInteger(columnWidth)) { + throw new TypeError('Column width must be an integer.'); + } + + if (columnWidth < 1) { + throw new Error('Column width must be greater than 0.'); + } + + return wrapCell(value, columnWidth, useWrapWord).length; +}; diff --git a/node_modules/table/dist/calculateCellHeight.js.map b/node_modules/table/dist/calculateCellHeight.js.map new file mode 100644 index 0000000..982d962 --- /dev/null +++ b/node_modules/table/dist/calculateCellHeight.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","TypeError","Number","isInteger","Error","length"],"mappings":";;;;;;;;;AACA;;;;AAEA;;;;;;6BAMgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAAC,wBAAWF,KAAX,CAAL,EAAwB;AACtB,UAAM,IAAIG,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBJ,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAIE,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIF,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIK,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,SAAO,uBAASN,KAAT,EAAgBC,WAAhB,EAA6BC,WAA7B,EAA0CK,MAAjD;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!_.isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n return wrapCell(value, columnWidth, useWrapWord).length;\n};\n"],"file":"calculateCellHeight.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellWidthIndex.js b/node_modules/table/dist/calculateCellWidthIndex.js new file mode 100644 index 0000000..a4df501 --- /dev/null +++ b/node_modules/table/dist/calculateCellWidthIndex.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _stringWidth = _interopRequireDefault(require("string-width")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calculates width of each cell contents. + * + * @param {string[]} cells + * @returns {number[]} + */ +const calculateCellWidthIndex = cells => { + return cells.map(value => { + return Math.max(...value.split('\n').map(line => { + return (0, _stringWidth.default)(line); + })); + }); +}; + +var _default = calculateCellWidthIndex; +exports.default = _default; +//# sourceMappingURL=calculateCellWidthIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellWidthIndex.js.flow b/node_modules/table/dist/calculateCellWidthIndex.js.flow new file mode 100644 index 0000000..6e4f7a5 --- /dev/null +++ b/node_modules/table/dist/calculateCellWidthIndex.js.flow @@ -0,0 +1,17 @@ +import stringWidth from 'string-width'; + +/** + * Calculates width of each cell contents. + * + * @param {string[]} cells + * @returns {number[]} + */ +export default (cells) => { + return cells.map((value) => { + return Math.max( + ...value.split('\n').map((line) => { + return stringWidth(line); + }) + ); + }); +}; diff --git a/node_modules/table/dist/calculateCellWidthIndex.js.map b/node_modules/table/dist/calculateCellWidthIndex.js.map new file mode 100644 index 0000000..c880cd2 --- /dev/null +++ b/node_modules/table/dist/calculateCellWidthIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateCellWidthIndex.js"],"names":["cells","map","value","Math","max","split","line"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;gCAMgBA,K,IAAU;AACxB,SAAOA,KAAK,CAACC,GAAN,CAAWC,KAAD,IAAW;AAC1B,WAAOC,IAAI,CAACC,GAAL,CACL,GAAGF,KAAK,CAACG,KAAN,CAAY,IAAZ,EAAkBJ,GAAlB,CAAuBK,IAAD,IAAU;AACjC,aAAO,0BAAYA,IAAZ,CAAP;AACD,KAFE,CADE,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import stringWidth from 'string-width';\n\n/**\n * Calculates width of each cell contents.\n *\n * @param {string[]} cells\n * @returns {number[]}\n */\nexport default (cells) => {\n return cells.map((value) => {\n return Math.max(\n ...value.split('\\n').map((line) => {\n return stringWidth(line);\n })\n );\n });\n};\n"],"file":"calculateCellWidthIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js new file mode 100644 index 0000000..ea5d4b9 --- /dev/null +++ b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces an array of values that describe the largest value length (width) in every column. + * + * @param {Array[]} rows + * @returns {number[]} + */ +const calculateMaximumColumnWidthIndex = rows => { + if (!rows[0]) { + throw new Error('Dataset must have at least one row.'); + } + + const columns = new Array(rows[0].length).fill(0); + rows.forEach(row => { + const columnWidthIndex = (0, _calculateCellWidthIndex.default)(row); + columnWidthIndex.forEach((valueWidth, index0) => { + if (columns[index0] < valueWidth) { + columns[index0] = valueWidth; + } + }); + }); + return columns; +}; + +var _default = calculateMaximumColumnWidthIndex; +exports.default = _default; +//# sourceMappingURL=calculateMaximumColumnWidthIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow new file mode 100644 index 0000000..5c8c109 --- /dev/null +++ b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow @@ -0,0 +1,27 @@ +import calculateCellWidthIndex from './calculateCellWidthIndex'; + +/** + * Produces an array of values that describe the largest value length (width) in every column. + * + * @param {Array[]} rows + * @returns {number[]} + */ +export default (rows) => { + if (!rows[0]) { + throw new Error('Dataset must have at least one row.'); + } + + const columns = new Array(rows[0].length).fill(0); + + rows.forEach((row) => { + const columnWidthIndex = calculateCellWidthIndex(row); + + columnWidthIndex.forEach((valueWidth, index0) => { + if (columns[index0] < valueWidth) { + columns[index0] = valueWidth; + } + }); + }); + + return columns; +}; diff --git a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map new file mode 100644 index 0000000..c30f4ce --- /dev/null +++ b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateMaximumColumnWidthIndex.js"],"names":["rows","Error","columns","Array","length","fill","forEach","row","columnWidthIndex","valueWidth","index0"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;yCAMgBA,I,IAAS;AACvB,MAAI,CAACA,IAAI,CAAC,CAAD,CAAT,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,QAAMC,OAAO,GAAG,IAAIC,KAAJ,CAAUH,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAlB,EAA0BC,IAA1B,CAA+B,CAA/B,CAAhB;AAEAL,EAAAA,IAAI,CAACM,OAAL,CAAcC,GAAD,IAAS;AACpB,UAAMC,gBAAgB,GAAG,sCAAwBD,GAAxB,CAAzB;AAEAC,IAAAA,gBAAgB,CAACF,OAAjB,CAAyB,CAACG,UAAD,EAAaC,MAAb,KAAwB;AAC/C,UAAIR,OAAO,CAACQ,MAAD,CAAP,GAAkBD,UAAtB,EAAkC;AAChCP,QAAAA,OAAO,CAACQ,MAAD,CAAP,GAAkBD,UAAlB;AACD;AACF,KAJD;AAKD,GARD;AAUA,SAAOP,OAAP;AACD,C","sourcesContent":["import calculateCellWidthIndex from './calculateCellWidthIndex';\n\n/**\n * Produces an array of values that describe the largest value length (width) in every column.\n *\n * @param {Array[]} rows\n * @returns {number[]}\n */\nexport default (rows) => {\n if (!rows[0]) {\n throw new Error('Dataset must have at least one row.');\n }\n\n const columns = new Array(rows[0].length).fill(0);\n\n rows.forEach((row) => {\n const columnWidthIndex = calculateCellWidthIndex(row);\n\n columnWidthIndex.forEach((valueWidth, index0) => {\n if (columns[index0] < valueWidth) {\n columns[index0] = valueWidth;\n }\n });\n });\n\n return columns;\n};\n"],"file":"calculateMaximumColumnWidthIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateRowHeightIndex.js b/node_modules/table/dist/calculateRowHeightIndex.js new file mode 100644 index 0000000..774a755 --- /dev/null +++ b/node_modules/table/dist/calculateRowHeightIndex.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _max2 = _interopRequireDefault(require("lodash/max")); + +var _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean")); + +var _isNumber2 = _interopRequireDefault(require("lodash/isNumber")); + +var _calculateCellHeight = _interopRequireDefault(require("./calculateCellHeight")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calculates the vertical row span index. + * + * @param {Array[]} rows + * @param {Object} config + * @returns {number[]} + */ +const calculateRowHeightIndex = (rows, config) => { + const tableWidth = rows[0].length; + const rowSpanIndex = []; + rows.forEach(cells => { + const cellHeightIndex = new Array(tableWidth).fill(1); + cells.forEach((value, index1) => { + if (!(0, _isNumber2.default)(config.columns[index1].width)) { + throw new TypeError('column[index].width must be a number.'); + } + + if (!(0, _isBoolean2.default)(config.columns[index1].wrapWord)) { + throw new TypeError('column[index].wrapWord must be a boolean.'); + } + + cellHeightIndex[index1] = (0, _calculateCellHeight.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); + }); + rowSpanIndex.push((0, _max2.default)(cellHeightIndex)); + }); + return rowSpanIndex; +}; + +var _default = calculateRowHeightIndex; +exports.default = _default; +//# sourceMappingURL=calculateRowHeightIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateRowHeightIndex.js.flow b/node_modules/table/dist/calculateRowHeightIndex.js.flow new file mode 100644 index 0000000..2687902 --- /dev/null +++ b/node_modules/table/dist/calculateRowHeightIndex.js.flow @@ -0,0 +1,35 @@ +import _ from 'lodash'; +import calculateCellHeight from './calculateCellHeight'; + +/** + * Calculates the vertical row span index. + * + * @param {Array[]} rows + * @param {Object} config + * @returns {number[]} + */ +export default (rows, config) => { + const tableWidth = rows[0].length; + + const rowSpanIndex = []; + + rows.forEach((cells) => { + const cellHeightIndex = new Array(tableWidth).fill(1); + + cells.forEach((value, index1) => { + if (!_.isNumber(config.columns[index1].width)) { + throw new TypeError('column[index].width must be a number.'); + } + + if (!_.isBoolean(config.columns[index1].wrapWord)) { + throw new TypeError('column[index].wrapWord must be a boolean.'); + } + + cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord); + }); + + rowSpanIndex.push(_.max(cellHeightIndex)); + }); + + return rowSpanIndex; +}; diff --git a/node_modules/table/dist/calculateRowHeightIndex.js.map b/node_modules/table/dist/calculateRowHeightIndex.js.map new file mode 100644 index 0000000..009dc00 --- /dev/null +++ b/node_modules/table/dist/calculateRowHeightIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/calculateRowHeightIndex.js"],"names":["rows","config","tableWidth","length","rowSpanIndex","forEach","cells","cellHeightIndex","Array","fill","value","index1","columns","width","TypeError","wrapWord","push"],"mappings":";;;;;;;;;;;;;AACA;;;;AAEA;;;;;;;iCAOgBA,I,EAAMC,M,KAAW;AAC/B,QAAMC,UAAU,GAAGF,IAAI,CAAC,CAAD,CAAJ,CAAQG,MAA3B;AAEA,QAAMC,YAAY,GAAG,EAArB;AAEAJ,EAAAA,IAAI,CAACK,OAAL,CAAcC,KAAD,IAAW;AACtB,UAAMC,eAAe,GAAG,IAAIC,KAAJ,CAAUN,UAAV,EAAsBO,IAAtB,CAA2B,CAA3B,CAAxB;AAEAH,IAAAA,KAAK,CAACD,OAAN,CAAc,CAACK,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAI,CAAC,wBAAWV,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlC,CAAL,EAA+C;AAC7C,cAAM,IAAIC,SAAJ,CAAc,uCAAd,CAAN;AACD;;AAED,UAAI,CAAC,yBAAYb,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAnC,CAAL,EAAmD;AACjD,cAAM,IAAID,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAEDP,MAAAA,eAAe,CAACI,MAAD,CAAf,GAA0B,kCAAoBD,KAApB,EAA2BT,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlD,EAAyDZ,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAhF,CAA1B;AACD,KAVD;AAYAX,IAAAA,YAAY,CAACY,IAAb,CAAkB,mBAAMT,eAAN,CAAlB;AACD,GAhBD;AAkBA,SAAOH,YAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport calculateCellHeight from './calculateCellHeight';\n\n/**\n * Calculates the vertical row span index.\n *\n * @param {Array[]} rows\n * @param {Object} config\n * @returns {number[]}\n */\nexport default (rows, config) => {\n const tableWidth = rows[0].length;\n\n const rowSpanIndex = [];\n\n rows.forEach((cells) => {\n const cellHeightIndex = new Array(tableWidth).fill(1);\n\n cells.forEach((value, index1) => {\n if (!_.isNumber(config.columns[index1].width)) {\n throw new TypeError('column[index].width must be a number.');\n }\n\n if (!_.isBoolean(config.columns[index1].wrapWord)) {\n throw new TypeError('column[index].wrapWord must be a boolean.');\n }\n\n cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord);\n });\n\n rowSpanIndex.push(_.max(cellHeightIndex));\n });\n\n return rowSpanIndex;\n};\n"],"file":"calculateRowHeightIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/createStream.js b/node_modules/table/dist/createStream.js new file mode 100644 index 0000000..269aae9 --- /dev/null +++ b/node_modules/table/dist/createStream.js @@ -0,0 +1,132 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _mapValues2 = _interopRequireDefault(require("lodash/mapValues")); + +var _values2 = _interopRequireDefault(require("lodash/values")); + +var _trimEnd2 = _interopRequireDefault(require("lodash/trimEnd")); + +var _makeStreamConfig = _interopRequireDefault(require("./makeStreamConfig")); + +var _drawRow = _interopRequireDefault(require("./drawRow")); + +var _drawBorder = require("./drawBorder"); + +var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); + +var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); + +var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); + +var _alignTableData = _interopRequireDefault(require("./alignTableData")); + +var _padTableData = _interopRequireDefault(require("./padTableData")); + +var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {Array} data + * @param {Object} config + * @returns {Array} + */ +const prepareData = (data, config) => { + let rows; + rows = (0, _stringifyTableData.default)(data); + rows = (0, _truncateTableData.default)(data, config); + const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); + rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); + rows = (0, _alignTableData.default)(rows, config); + rows = (0, _padTableData.default)(rows, config); + return rows; +}; +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ + + +const create = (row, columnWidthIndex, config) => { + const rows = prepareData([row], config); + const body = rows.map(literalRow => { + return (0, _drawRow.default)(literalRow, config.border); + }).join(''); + let output; + output = ''; + output += (0, _drawBorder.drawBorderTop)(columnWidthIndex, config.border); + output += body; + output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); + output = (0, _trimEnd2.default)(output); + process.stdout.write(output); +}; +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ + + +const append = (row, columnWidthIndex, config) => { + const rows = prepareData([row], config); + const body = rows.map(literalRow => { + return (0, _drawRow.default)(literalRow, config.border); + }).join(''); + let output = ''; + const bottom = (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); + + if (bottom !== '\n') { + output = '\r\u001B[K'; + } + + output += (0, _drawBorder.drawBorderJoin)(columnWidthIndex, config.border); + output += body; + output += bottom; + output = (0, _trimEnd2.default)(output); + process.stdout.write(output); +}; +/** + * @param {Object} userConfig + * @returns {Object} + */ + + +const createStream = (userConfig = {}) => { + const config = (0, _makeStreamConfig.default)(userConfig); // @todo Use 'Object.values' when Node.js v6 support is dropped. + + const columnWidthIndex = (0, _values2.default)((0, _mapValues2.default)(config.columns, column => { + return column.width + column.paddingLeft + column.paddingRight; + })); + let empty; + empty = true; + return { + /** + * @param {string[]} row + * @returns {undefined} + */ + write: row => { + if (row.length !== config.columnCount) { + throw new Error('Row cell count does not match the config.columnCount.'); + } + + if (empty) { + empty = false; + return create(row, columnWidthIndex, config); + } else { + return append(row, columnWidthIndex, config); + } + } + }; +}; + +var _default = createStream; +exports.default = _default; +//# sourceMappingURL=createStream.js.map \ No newline at end of file diff --git a/node_modules/table/dist/createStream.js.flow b/node_modules/table/dist/createStream.js.flow new file mode 100644 index 0000000..fd5eac4 --- /dev/null +++ b/node_modules/table/dist/createStream.js.flow @@ -0,0 +1,127 @@ +import _ from 'lodash'; +import makeStreamConfig from './makeStreamConfig'; +import drawRow from './drawRow'; +import { + drawBorderBottom, + drawBorderJoin, + drawBorderTop +} from './drawBorder'; +import stringifyTableData from './stringifyTableData'; +import truncateTableData from './truncateTableData'; +import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; +import alignTableData from './alignTableData'; +import padTableData from './padTableData'; +import calculateRowHeightIndex from './calculateRowHeightIndex'; + +/** + * @param {Array} data + * @param {Object} config + * @returns {Array} + */ +const prepareData = (data, config) => { + let rows; + + rows = stringifyTableData(data); + + rows = truncateTableData(data, config); + + const rowHeightIndex = calculateRowHeightIndex(rows, config); + + rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); + rows = alignTableData(rows, config); + rows = padTableData(rows, config); + + return rows; +}; + +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ +const create = (row, columnWidthIndex, config) => { + const rows = prepareData([row], config); + + const body = rows.map((literalRow) => { + return drawRow(literalRow, config.border); + }).join(''); + + let output; + + output = ''; + + output += drawBorderTop(columnWidthIndex, config.border); + output += body; + output += drawBorderBottom(columnWidthIndex, config.border); + + output = _.trimEnd(output); + + process.stdout.write(output); +}; + +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ +const append = (row, columnWidthIndex, config) => { + const rows = prepareData([row], config); + + const body = rows.map((literalRow) => { + return drawRow(literalRow, config.border); + }).join(''); + + let output = ''; + const bottom = drawBorderBottom(columnWidthIndex, config.border); + + if (bottom !== '\n') { + output = '\r\u001B[K'; + } + + output += drawBorderJoin(columnWidthIndex, config.border); + output += body; + output += bottom; + + output = _.trimEnd(output); + + process.stdout.write(output); +}; + +/** + * @param {Object} userConfig + * @returns {Object} + */ +export default (userConfig = {}) => { + const config = makeStreamConfig(userConfig); + + // @todo Use 'Object.values' when Node.js v6 support is dropped. + const columnWidthIndex = _.values(_.mapValues(config.columns, (column) => { + return column.width + column.paddingLeft + column.paddingRight; + })); + + let empty; + + empty = true; + + return { + /** + * @param {string[]} row + * @returns {undefined} + */ + write: (row) => { + if (row.length !== config.columnCount) { + throw new Error('Row cell count does not match the config.columnCount.'); + } + + if (empty) { + empty = false; + + return create(row, columnWidthIndex, config); + } else { + return append(row, columnWidthIndex, config); + } + } + }; +}; diff --git a/node_modules/table/dist/createStream.js.map b/node_modules/table/dist/createStream.js.map new file mode 100644 index 0000000..fbd3b78 --- /dev/null +++ b/node_modules/table/dist/createStream.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/createStream.js"],"names":["prepareData","data","config","rows","rowHeightIndex","create","row","columnWidthIndex","body","map","literalRow","border","join","output","process","stdout","write","append","bottom","userConfig","columns","column","width","paddingLeft","paddingRight","empty","length","columnCount","Error"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;;;;;AAKA,MAAMA,WAAW,GAAG,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACpC,MAAIC,IAAJ;AAEAA,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEAE,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBC,MAAxB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBD,IAAxB,EAA8BD,MAA9B,CAAvB;AAEAC,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCC,cAAjC,EAAiDF,MAAjD,CAAP;AACAC,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBD,MAArB,CAAP;AACAC,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBD,MAAnB,CAAP;AAEA,SAAOC,IAAP;AACD,CAdD;AAgBA;;;;;;;;AAMA,MAAME,MAAM,GAAG,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,KAAmC;AAChD,QAAMC,IAAI,GAAGH,WAAW,CAAC,CAACM,GAAD,CAAD,EAAQJ,MAAR,CAAxB;AAEA,QAAMM,IAAI,GAAGL,IAAI,CAACM,GAAL,CAAUC,UAAD,IAAgB;AACpC,WAAO,sBAAQA,UAAR,EAAoBR,MAAM,CAACS,MAA3B,CAAP;AACD,GAFY,EAEVC,IAFU,CAEL,EAFK,CAAb;AAIA,MAAIC,MAAJ;AAEAA,EAAAA,MAAM,GAAG,EAAT;AAEAA,EAAAA,MAAM,IAAI,+BAAcN,gBAAd,EAAgCL,MAAM,CAACS,MAAvC,CAAV;AACAE,EAAAA,MAAM,IAAIL,IAAV;AACAK,EAAAA,MAAM,IAAI,kCAAiBN,gBAAjB,EAAmCL,MAAM,CAACS,MAA1C,CAAV;AAEAE,EAAAA,MAAM,GAAG,uBAAUA,MAAV,CAAT;AAEAC,EAAAA,OAAO,CAACC,MAAR,CAAeC,KAAf,CAAqBH,MAArB;AACD,CAlBD;AAoBA;;;;;;;;AAMA,MAAMI,MAAM,GAAG,CAACX,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,KAAmC;AAChD,QAAMC,IAAI,GAAGH,WAAW,CAAC,CAACM,GAAD,CAAD,EAAQJ,MAAR,CAAxB;AAEA,QAAMM,IAAI,GAAGL,IAAI,CAACM,GAAL,CAAUC,UAAD,IAAgB;AACpC,WAAO,sBAAQA,UAAR,EAAoBR,MAAM,CAACS,MAA3B,CAAP;AACD,GAFY,EAEVC,IAFU,CAEL,EAFK,CAAb;AAIA,MAAIC,MAAM,GAAG,EAAb;AACA,QAAMK,MAAM,GAAG,kCAAiBX,gBAAjB,EAAmCL,MAAM,CAACS,MAA1C,CAAf;;AAEA,MAAIO,MAAM,KAAK,IAAf,EAAqB;AACnBL,IAAAA,MAAM,GAAG,YAAT;AACD;;AAEDA,EAAAA,MAAM,IAAI,gCAAeN,gBAAf,EAAiCL,MAAM,CAACS,MAAxC,CAAV;AACAE,EAAAA,MAAM,IAAIL,IAAV;AACAK,EAAAA,MAAM,IAAIK,MAAV;AAEAL,EAAAA,MAAM,GAAG,uBAAUA,MAAV,CAAT;AAEAC,EAAAA,OAAO,CAACC,MAAR,CAAeC,KAAf,CAAqBH,MAArB;AACD,CArBD;AAuBA;;;;;;sBAIgBM,UAAU,GAAG,E,KAAO;AAClC,QAAMjB,MAAM,GAAG,+BAAiBiB,UAAjB,CAAf,CADkC,CAGlC;;AACA,QAAMZ,gBAAgB,GAAG,sBAAS,yBAAYL,MAAM,CAACkB,OAAnB,EAA6BC,MAAD,IAAY;AACxE,WAAOA,MAAM,CAACC,KAAP,GAAeD,MAAM,CAACE,WAAtB,GAAoCF,MAAM,CAACG,YAAlD;AACD,GAFiC,CAAT,CAAzB;AAIA,MAAIC,KAAJ;AAEAA,EAAAA,KAAK,GAAG,IAAR;AAEA,SAAO;AACL;;;;AAIAT,IAAAA,KAAK,EAAGV,GAAD,IAAS;AACd,UAAIA,GAAG,CAACoB,MAAJ,KAAexB,MAAM,CAACyB,WAA1B,EAAuC;AACrC,cAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAED,UAAIH,KAAJ,EAAW;AACTA,QAAAA,KAAK,GAAG,KAAR;AAEA,eAAOpB,MAAM,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD,OAJD,MAIO;AACL,eAAOe,MAAM,CAACX,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD;AACF;AAjBI,GAAP;AAmBD,C","sourcesContent":["import _ from 'lodash';\nimport makeStreamConfig from './makeStreamConfig';\nimport drawRow from './drawRow';\nimport {\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop\n} from './drawBorder';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport alignTableData from './alignTableData';\nimport padTableData from './padTableData';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\n\n/**\n * @param {Array} data\n * @param {Object} config\n * @returns {Array}\n */\nconst prepareData = (data, config) => {\n let rows;\n\n rows = stringifyTableData(data);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n return rows;\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {Object} config\n * @returns {undefined}\n */\nconst create = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output;\n\n output = '';\n\n output += drawBorderTop(columnWidthIndex, config.border);\n output += body;\n output += drawBorderBottom(columnWidthIndex, config.border);\n\n output = _.trimEnd(output);\n\n process.stdout.write(output);\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {Object} config\n * @returns {undefined}\n */\nconst append = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output = '';\n const bottom = drawBorderBottom(columnWidthIndex, config.border);\n\n if (bottom !== '\\n') {\n output = '\\r\\u001B[K';\n }\n\n output += drawBorderJoin(columnWidthIndex, config.border);\n output += body;\n output += bottom;\n\n output = _.trimEnd(output);\n\n process.stdout.write(output);\n};\n\n/**\n * @param {Object} userConfig\n * @returns {Object}\n */\nexport default (userConfig = {}) => {\n const config = makeStreamConfig(userConfig);\n\n // @todo Use 'Object.values' when Node.js v6 support is dropped.\n const columnWidthIndex = _.values(_.mapValues(config.columns, (column) => {\n return column.width + column.paddingLeft + column.paddingRight;\n }));\n\n let empty;\n\n empty = true;\n\n return {\n /**\n * @param {string[]} row\n * @returns {undefined}\n */\n write: (row) => {\n if (row.length !== config.columnCount) {\n throw new Error('Row cell count does not match the config.columnCount.');\n }\n\n if (empty) {\n empty = false;\n\n return create(row, columnWidthIndex, config);\n } else {\n return append(row, columnWidthIndex, config);\n }\n }\n };\n};\n"],"file":"createStream.js"} \ No newline at end of file diff --git a/node_modules/table/dist/drawBorder.js b/node_modules/table/dist/drawBorder.js new file mode 100644 index 0000000..67227e2 --- /dev/null +++ b/node_modules/table/dist/drawBorder.js @@ -0,0 +1,110 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = void 0; + +/** + * @typedef drawBorder~parts + * @property {string} left + * @property {string} right + * @property {string} body + * @property {string} join + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorder~parts} parts + * @returns {string} + */ +const drawBorder = (columnSizeIndex, parts) => { + const columns = columnSizeIndex.map(size => { + return parts.body.repeat(size); + }).join(parts.join); + return parts.left + columns + parts.right + '\n'; +}; +/** + * @typedef drawBorderTop~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderTop~parts} parts + * @returns {string} + */ + + +exports.drawBorder = drawBorder; + +const drawBorderTop = (columnSizeIndex, parts) => { + const border = drawBorder(columnSizeIndex, { + body: parts.topBody, + join: parts.topJoin, + left: parts.topLeft, + right: parts.topRight + }); + + if (border === '\n') { + return ''; + } + + return border; +}; +/** + * @typedef drawBorderJoin~parts + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinBody + * @property {string} joinJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderJoin~parts} parts + * @returns {string} + */ + + +exports.drawBorderTop = drawBorderTop; + +const drawBorderJoin = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.joinBody, + join: parts.joinJoin, + left: parts.joinLeft, + right: parts.joinRight + }); +}; +/** + * @typedef drawBorderBottom~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderBottom~parts} parts + * @returns {string} + */ + + +exports.drawBorderJoin = drawBorderJoin; + +const drawBorderBottom = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.bottomBody, + join: parts.bottomJoin, + left: parts.bottomLeft, + right: parts.bottomRight + }); +}; + +exports.drawBorderBottom = drawBorderBottom; +//# sourceMappingURL=drawBorder.js.map \ No newline at end of file diff --git a/node_modules/table/dist/drawBorder.js.flow b/node_modules/table/dist/drawBorder.js.flow new file mode 100644 index 0000000..16b2aeb --- /dev/null +++ b/node_modules/table/dist/drawBorder.js.flow @@ -0,0 +1,101 @@ +/** + * @typedef drawBorder~parts + * @property {string} left + * @property {string} right + * @property {string} body + * @property {string} join + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorder~parts} parts + * @returns {string} + */ +const drawBorder = (columnSizeIndex, parts) => { + const columns = columnSizeIndex + .map((size) => { + return parts.body.repeat(size); + }) + .join(parts.join); + + return parts.left + columns + parts.right + '\n'; +}; + +/** + * @typedef drawBorderTop~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderTop~parts} parts + * @returns {string} + */ +const drawBorderTop = (columnSizeIndex, parts) => { + const border = drawBorder(columnSizeIndex, { + body: parts.topBody, + join: parts.topJoin, + left: parts.topLeft, + right: parts.topRight + }); + + if (border === '\n') { + return ''; + } + + return border; +}; + +/** + * @typedef drawBorderJoin~parts + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinBody + * @property {string} joinJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderJoin~parts} parts + * @returns {string} + */ +const drawBorderJoin = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.joinBody, + join: parts.joinJoin, + left: parts.joinLeft, + right: parts.joinRight + }); +}; + +/** + * @typedef drawBorderBottom~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderBottom~parts} parts + * @returns {string} + */ +const drawBorderBottom = (columnSizeIndex, parts) => { + return drawBorder(columnSizeIndex, { + body: parts.bottomBody, + join: parts.bottomJoin, + left: parts.bottomLeft, + right: parts.bottomRight + }); +}; + +export { + drawBorder, + drawBorderBottom, + drawBorderJoin, + drawBorderTop +}; diff --git a/node_modules/table/dist/drawBorder.js.map b/node_modules/table/dist/drawBorder.js.map new file mode 100644 index 0000000..4b1a220 --- /dev/null +++ b/node_modules/table/dist/drawBorder.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/drawBorder.js"],"names":["drawBorder","columnSizeIndex","parts","columns","map","size","body","repeat","join","left","right","drawBorderTop","border","topBody","topJoin","topLeft","topRight","drawBorderJoin","joinBody","joinJoin","joinLeft","joinRight","drawBorderBottom","bottomBody","bottomJoin","bottomLeft","bottomRight"],"mappings":";;;;;;;AAAA;;;;;;;;AAQA;;;;;AAKA,MAAMA,UAAU,GAAG,CAACC,eAAD,EAAkBC,KAAlB,KAA4B;AAC7C,QAAMC,OAAO,GAAGF,eAAe,CAC5BG,GADa,CACRC,IAAD,IAAU;AACb,WAAOH,KAAK,CAACI,IAAN,CAAWC,MAAX,CAAkBF,IAAlB,CAAP;AACD,GAHa,EAIbG,IAJa,CAIRN,KAAK,CAACM,IAJE,CAAhB;AAMA,SAAON,KAAK,CAACO,IAAN,GAAaN,OAAb,GAAuBD,KAAK,CAACQ,KAA7B,GAAqC,IAA5C;AACD,CARD;AAUA;;;;;;;;AAQA;;;;;;;;;AAKA,MAAMC,aAAa,GAAG,CAACV,eAAD,EAAkBC,KAAlB,KAA4B;AAChD,QAAMU,MAAM,GAAGZ,UAAU,CAACC,eAAD,EAAkB;AACzCK,IAAAA,IAAI,EAAEJ,KAAK,CAACW,OAD6B;AAEzCL,IAAAA,IAAI,EAAEN,KAAK,CAACY,OAF6B;AAGzCL,IAAAA,IAAI,EAAEP,KAAK,CAACa,OAH6B;AAIzCL,IAAAA,KAAK,EAAER,KAAK,CAACc;AAJ4B,GAAlB,CAAzB;;AAOA,MAAIJ,MAAM,KAAK,IAAf,EAAqB;AACnB,WAAO,EAAP;AACD;;AAED,SAAOA,MAAP;AACD,CAbD;AAeA;;;;;;;;AAQA;;;;;;;;;AAKA,MAAMK,cAAc,GAAG,CAAChB,eAAD,EAAkBC,KAAlB,KAA4B;AACjD,SAAOF,UAAU,CAACC,eAAD,EAAkB;AACjCK,IAAAA,IAAI,EAAEJ,KAAK,CAACgB,QADqB;AAEjCV,IAAAA,IAAI,EAAEN,KAAK,CAACiB,QAFqB;AAGjCV,IAAAA,IAAI,EAAEP,KAAK,CAACkB,QAHqB;AAIjCV,IAAAA,KAAK,EAAER,KAAK,CAACmB;AAJoB,GAAlB,CAAjB;AAMD,CAPD;AASA;;;;;;;;AAQA;;;;;;;;;AAKA,MAAMC,gBAAgB,GAAG,CAACrB,eAAD,EAAkBC,KAAlB,KAA4B;AACnD,SAAOF,UAAU,CAACC,eAAD,EAAkB;AACjCK,IAAAA,IAAI,EAAEJ,KAAK,CAACqB,UADqB;AAEjCf,IAAAA,IAAI,EAAEN,KAAK,CAACsB,UAFqB;AAGjCf,IAAAA,IAAI,EAAEP,KAAK,CAACuB,UAHqB;AAIjCf,IAAAA,KAAK,EAAER,KAAK,CAACwB;AAJoB,GAAlB,CAAjB;AAMD,CAPD","sourcesContent":["/**\n * @typedef drawBorder~parts\n * @property {string} left\n * @property {string} right\n * @property {string} body\n * @property {string} join\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorder~parts} parts\n * @returns {string}\n */\nconst drawBorder = (columnSizeIndex, parts) => {\n const columns = columnSizeIndex\n .map((size) => {\n return parts.body.repeat(size);\n })\n .join(parts.join);\n\n return parts.left + columns + parts.right + '\\n';\n};\n\n/**\n * @typedef drawBorderTop~parts\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} topBody\n * @property {string} topJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderTop~parts} parts\n * @returns {string}\n */\nconst drawBorderTop = (columnSizeIndex, parts) => {\n const border = drawBorder(columnSizeIndex, {\n body: parts.topBody,\n join: parts.topJoin,\n left: parts.topLeft,\n right: parts.topRight\n });\n\n if (border === '\\n') {\n return '';\n }\n\n return border;\n};\n\n/**\n * @typedef drawBorderJoin~parts\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinBody\n * @property {string} joinJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderJoin~parts} parts\n * @returns {string}\n */\nconst drawBorderJoin = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.joinBody,\n join: parts.joinJoin,\n left: parts.joinLeft,\n right: parts.joinRight\n });\n};\n\n/**\n * @typedef drawBorderBottom~parts\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} topBody\n * @property {string} topJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderBottom~parts} parts\n * @returns {string}\n */\nconst drawBorderBottom = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.bottomBody,\n join: parts.bottomJoin,\n left: parts.bottomLeft,\n right: parts.bottomRight\n });\n};\n\nexport {\n drawBorder,\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop\n};\n"],"file":"drawBorder.js"} \ No newline at end of file diff --git a/node_modules/table/dist/drawRow.js b/node_modules/table/dist/drawRow.js new file mode 100644 index 0000000..800ca25 --- /dev/null +++ b/node_modules/table/dist/drawRow.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** + * @typedef {Object} drawRow~border + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + */ + +/** + * @param {number[]} columns + * @param {drawRow~border} border + * @returns {string} + */ +const drawRow = (columns, border) => { + return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; +}; + +var _default = drawRow; +exports.default = _default; +//# sourceMappingURL=drawRow.js.map \ No newline at end of file diff --git a/node_modules/table/dist/drawRow.js.flow b/node_modules/table/dist/drawRow.js.flow new file mode 100644 index 0000000..fdeceef --- /dev/null +++ b/node_modules/table/dist/drawRow.js.flow @@ -0,0 +1,15 @@ +/** + * @typedef {Object} drawRow~border + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + */ + +/** + * @param {number[]} columns + * @param {drawRow~border} border + * @returns {string} + */ +export default (columns, border) => { + return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; +}; diff --git a/node_modules/table/dist/drawRow.js.map b/node_modules/table/dist/drawRow.js.map new file mode 100644 index 0000000..4541d19 --- /dev/null +++ b/node_modules/table/dist/drawRow.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/drawRow.js"],"names":["columns","border","bodyLeft","join","bodyJoin","bodyRight"],"mappings":";;;;;;;AAAA;;;;;;;AAOA;;;;;iBAKgBA,O,EAASC,M,KAAW;AAClC,SAAOA,MAAM,CAACC,QAAP,GAAkBF,OAAO,CAACG,IAAR,CAAaF,MAAM,CAACG,QAApB,CAAlB,GAAkDH,MAAM,CAACI,SAAzD,GAAqE,IAA5E;AACD,C","sourcesContent":["/**\n * @typedef {Object} drawRow~border\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n */\n\n/**\n * @param {number[]} columns\n * @param {drawRow~border} border\n * @returns {string}\n */\nexport default (columns, border) => {\n return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\\n';\n};\n"],"file":"drawRow.js"} \ No newline at end of file diff --git a/node_modules/table/dist/drawTable.js b/node_modules/table/dist/drawTable.js new file mode 100644 index 0000000..fbfdc20 --- /dev/null +++ b/node_modules/table/dist/drawTable.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _drawBorder = require("./drawBorder"); + +var _drawRow = _interopRequireDefault(require("./drawRow")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {Array} rows + * @param {Object} border + * @param {Array} columnSizeIndex + * @param {Array} rowSpanIndex + * @param {Function} drawHorizontalLine + * @param {boolean} singleLine + * @returns {string} + */ +const drawTable = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => { + let output; + let realRowIndex; + let rowHeight; + const rowCount = rows.length; + realRowIndex = 0; + output = ''; + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += (0, _drawBorder.drawBorderTop)(columnSizeIndex, border); + } + + rows.forEach((row, index0) => { + output += (0, _drawRow.default)(row, border); + + if (!rowHeight) { + rowHeight = rowSpanIndex[realRowIndex]; + realRowIndex++; + } + + rowHeight--; + + if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { + output += (0, _drawBorder.drawBorderJoin)(columnSizeIndex, border); + } + }); + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += (0, _drawBorder.drawBorderBottom)(columnSizeIndex, border); + } + + return output; +}; + +var _default = drawTable; +exports.default = _default; +//# sourceMappingURL=drawTable.js.map \ No newline at end of file diff --git a/node_modules/table/dist/drawTable.js.flow b/node_modules/table/dist/drawTable.js.flow new file mode 100644 index 0000000..cffe956 --- /dev/null +++ b/node_modules/table/dist/drawTable.js.flow @@ -0,0 +1,53 @@ +import { + drawBorderTop, + drawBorderJoin, + drawBorderBottom +} from './drawBorder'; +import drawRow from './drawRow'; + +/** + * @param {Array} rows + * @param {Object} border + * @param {Array} columnSizeIndex + * @param {Array} rowSpanIndex + * @param {Function} drawHorizontalLine + * @param {boolean} singleLine + * @returns {string} + */ +export default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => { + let output; + let realRowIndex; + let rowHeight; + + const rowCount = rows.length; + + realRowIndex = 0; + + output = ''; + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += drawBorderTop(columnSizeIndex, border); + } + + rows.forEach((row, index0) => { + output += drawRow(row, border); + + if (!rowHeight) { + rowHeight = rowSpanIndex[realRowIndex]; + + realRowIndex++; + } + + rowHeight--; + + if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { + output += drawBorderJoin(columnSizeIndex, border); + } + }); + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += drawBorderBottom(columnSizeIndex, border); + } + + return output; +}; diff --git a/node_modules/table/dist/drawTable.js.map b/node_modules/table/dist/drawTable.js.map new file mode 100644 index 0000000..5f55265 --- /dev/null +++ b/node_modules/table/dist/drawTable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/drawTable.js"],"names":["rows","border","columnSizeIndex","rowSpanIndex","drawHorizontalLine","singleLine","output","realRowIndex","rowHeight","rowCount","length","forEach","row","index0"],"mappings":";;;;;;;AAAA;;AAKA;;;;AAEA;;;;;;;;;mBASgBA,I,EAAMC,M,EAAQC,e,EAAiBC,Y,EAAcC,kB,EAAoBC,U,KAAe;AAC9F,MAAIC,MAAJ;AACA,MAAIC,YAAJ;AACA,MAAIC,SAAJ;AAEA,QAAMC,QAAQ,GAAGT,IAAI,CAACU,MAAtB;AAEAH,EAAAA,YAAY,GAAG,CAAf;AAEAD,EAAAA,MAAM,GAAG,EAAT;;AAEA,MAAIF,kBAAkB,CAACG,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,+BAAcJ,eAAd,EAA+BD,MAA/B,CAAV;AACD;;AAEDD,EAAAA,IAAI,CAACW,OAAL,CAAa,CAACC,GAAD,EAAMC,MAAN,KAAiB;AAC5BP,IAAAA,MAAM,IAAI,sBAAQM,GAAR,EAAaX,MAAb,CAAV;;AAEA,QAAI,CAACO,SAAL,EAAgB;AACdA,MAAAA,SAAS,GAAGL,YAAY,CAACI,YAAD,CAAxB;AAEAA,MAAAA,YAAY;AACb;;AAEDC,IAAAA,SAAS;;AAET,QAAI,CAACH,UAAD,IAAeG,SAAS,KAAK,CAA7B,IAAkCK,MAAM,KAAKJ,QAAQ,GAAG,CAAxD,IAA6DL,kBAAkB,CAACG,YAAD,EAAeE,QAAf,CAAnF,EAA6G;AAC3GH,MAAAA,MAAM,IAAI,gCAAeJ,eAAf,EAAgCD,MAAhC,CAAV;AACD;AACF,GAdD;;AAgBA,MAAIG,kBAAkB,CAACG,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,kCAAiBJ,eAAjB,EAAkCD,MAAlC,CAAV;AACD;;AAED,SAAOK,MAAP;AACD,C","sourcesContent":["import {\n drawBorderTop,\n drawBorderJoin,\n drawBorderBottom\n} from './drawBorder';\nimport drawRow from './drawRow';\n\n/**\n * @param {Array} rows\n * @param {Object} border\n * @param {Array} columnSizeIndex\n * @param {Array} rowSpanIndex\n * @param {Function} drawHorizontalLine\n * @param {boolean} singleLine\n * @returns {string}\n */\nexport default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => {\n let output;\n let realRowIndex;\n let rowHeight;\n\n const rowCount = rows.length;\n\n realRowIndex = 0;\n\n output = '';\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderTop(columnSizeIndex, border);\n }\n\n rows.forEach((row, index0) => {\n output += drawRow(row, border);\n\n if (!rowHeight) {\n rowHeight = rowSpanIndex[realRowIndex];\n\n realRowIndex++;\n }\n\n rowHeight--;\n\n if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderJoin(columnSizeIndex, border);\n }\n });\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderBottom(columnSizeIndex, border);\n }\n\n return output;\n};\n"],"file":"drawTable.js"} \ No newline at end of file diff --git a/node_modules/table/dist/getBorderCharacters.js b/node_modules/table/dist/getBorderCharacters.js new file mode 100644 index 0000000..0b9b5b0 --- /dev/null +++ b/node_modules/table/dist/getBorderCharacters.js @@ -0,0 +1,119 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable sort-keys */ + +/** + * @typedef border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * @param {string} name + * @returns {border} + */ +const getBorderCharacters = name => { + if (name === 'honeywell') { + return { + topBody: '═', + topJoin: '╤', + topLeft: '╔', + topRight: '╗', + bottomBody: '═', + bottomJoin: '╧', + bottomLeft: '╚', + bottomRight: '╝', + bodyLeft: '║', + bodyRight: '║', + bodyJoin: '│', + joinBody: '─', + joinLeft: '╟', + joinRight: '╢', + joinJoin: '┼' + }; + } + + if (name === 'norc') { + return { + topBody: '─', + topJoin: '┬', + topLeft: '┌', + topRight: '┐', + bottomBody: '─', + bottomJoin: '┴', + bottomLeft: '└', + bottomRight: '┘', + bodyLeft: '│', + bodyRight: '│', + bodyJoin: '│', + joinBody: '─', + joinLeft: '├', + joinRight: '┤', + joinJoin: '┼' + }; + } + + if (name === 'ramac') { + return { + topBody: '-', + topJoin: '+', + topLeft: '+', + topRight: '+', + bottomBody: '-', + bottomJoin: '+', + bottomLeft: '+', + bottomRight: '+', + bodyLeft: '|', + bodyRight: '|', + bodyJoin: '|', + joinBody: '-', + joinLeft: '|', + joinRight: '|', + joinJoin: '|' + }; + } + + if (name === 'void') { + return { + topBody: '', + topJoin: '', + topLeft: '', + topRight: '', + bottomBody: '', + bottomJoin: '', + bottomLeft: '', + bottomRight: '', + bodyLeft: '', + bodyRight: '', + bodyJoin: '', + joinBody: '', + joinLeft: '', + joinRight: '', + joinJoin: '' + }; + } + + throw new Error('Unknown border template "' + name + '".'); +}; + +var _default = getBorderCharacters; +exports.default = _default; +//# sourceMappingURL=getBorderCharacters.js.map \ No newline at end of file diff --git a/node_modules/table/dist/getBorderCharacters.js.flow b/node_modules/table/dist/getBorderCharacters.js.flow new file mode 100644 index 0000000..916b351 --- /dev/null +++ b/node_modules/table/dist/getBorderCharacters.js.flow @@ -0,0 +1,120 @@ +/* eslint-disable sort-keys */ + +/** + * @typedef border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * @param {string} name + * @returns {border} + */ +export default (name) => { + if (name === 'honeywell') { + return { + topBody: '═', + topJoin: '╤', + topLeft: '╔', + topRight: '╗', + + bottomBody: '═', + bottomJoin: '╧', + bottomLeft: '╚', + bottomRight: '╝', + + bodyLeft: '║', + bodyRight: '║', + bodyJoin: '│', + + joinBody: '─', + joinLeft: '╟', + joinRight: '╢', + joinJoin: '┼' + }; + } + + if (name === 'norc') { + return { + topBody: '─', + topJoin: '┬', + topLeft: '┌', + topRight: '┐', + + bottomBody: '─', + bottomJoin: '┴', + bottomLeft: '└', + bottomRight: '┘', + + bodyLeft: '│', + bodyRight: '│', + bodyJoin: '│', + + joinBody: '─', + joinLeft: '├', + joinRight: '┤', + joinJoin: '┼' + }; + } + + if (name === 'ramac') { + return { + topBody: '-', + topJoin: '+', + topLeft: '+', + topRight: '+', + + bottomBody: '-', + bottomJoin: '+', + bottomLeft: '+', + bottomRight: '+', + + bodyLeft: '|', + bodyRight: '|', + bodyJoin: '|', + + joinBody: '-', + joinLeft: '|', + joinRight: '|', + joinJoin: '|' + }; + } + + if (name === 'void') { + return { + topBody: '', + topJoin: '', + topLeft: '', + topRight: '', + + bottomBody: '', + bottomJoin: '', + bottomLeft: '', + bottomRight: '', + + bodyLeft: '', + bodyRight: '', + bodyJoin: '', + + joinBody: '', + joinLeft: '', + joinRight: '', + joinJoin: '' + }; + } + + throw new Error('Unknown border template "' + name + '".'); +}; diff --git a/node_modules/table/dist/getBorderCharacters.js.map b/node_modules/table/dist/getBorderCharacters.js.map new file mode 100644 index 0000000..543426c --- /dev/null +++ b/node_modules/table/dist/getBorderCharacters.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/getBorderCharacters.js"],"names":["name","topBody","topJoin","topLeft","topRight","bottomBody","bottomJoin","bottomLeft","bottomRight","bodyLeft","bodyRight","bodyJoin","joinBody","joinLeft","joinRight","joinJoin","Error"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;;;;;;;;;;;;AAmBA;;;;4BAIgBA,I,IAAS;AACvB,MAAIA,IAAI,KAAK,WAAb,EAA0B;AACxB,WAAO;AACLC,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,OAAO,EAAE,GAFJ;AAGLC,MAAAA,OAAO,EAAE,GAHJ;AAILC,MAAAA,QAAQ,EAAE,GAJL;AAMLC,MAAAA,UAAU,EAAE,GANP;AAOLC,MAAAA,UAAU,EAAE,GAPP;AAQLC,MAAAA,UAAU,EAAE,GARP;AASLC,MAAAA,WAAW,EAAE,GATR;AAWLC,MAAAA,QAAQ,EAAE,GAXL;AAYLC,MAAAA,SAAS,EAAE,GAZN;AAaLC,MAAAA,QAAQ,EAAE,GAbL;AAeLC,MAAAA,QAAQ,EAAE,GAfL;AAgBLC,MAAAA,QAAQ,EAAE,GAhBL;AAiBLC,MAAAA,SAAS,EAAE,GAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,MAAIf,IAAI,KAAK,MAAb,EAAqB;AACnB,WAAO;AACLC,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,OAAO,EAAE,GAFJ;AAGLC,MAAAA,OAAO,EAAE,GAHJ;AAILC,MAAAA,QAAQ,EAAE,GAJL;AAMLC,MAAAA,UAAU,EAAE,GANP;AAOLC,MAAAA,UAAU,EAAE,GAPP;AAQLC,MAAAA,UAAU,EAAE,GARP;AASLC,MAAAA,WAAW,EAAE,GATR;AAWLC,MAAAA,QAAQ,EAAE,GAXL;AAYLC,MAAAA,SAAS,EAAE,GAZN;AAaLC,MAAAA,QAAQ,EAAE,GAbL;AAeLC,MAAAA,QAAQ,EAAE,GAfL;AAgBLC,MAAAA,QAAQ,EAAE,GAhBL;AAiBLC,MAAAA,SAAS,EAAE,GAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,MAAIf,IAAI,KAAK,OAAb,EAAsB;AACpB,WAAO;AACLC,MAAAA,OAAO,EAAE,GADJ;AAELC,MAAAA,OAAO,EAAE,GAFJ;AAGLC,MAAAA,OAAO,EAAE,GAHJ;AAILC,MAAAA,QAAQ,EAAE,GAJL;AAMLC,MAAAA,UAAU,EAAE,GANP;AAOLC,MAAAA,UAAU,EAAE,GAPP;AAQLC,MAAAA,UAAU,EAAE,GARP;AASLC,MAAAA,WAAW,EAAE,GATR;AAWLC,MAAAA,QAAQ,EAAE,GAXL;AAYLC,MAAAA,SAAS,EAAE,GAZN;AAaLC,MAAAA,QAAQ,EAAE,GAbL;AAeLC,MAAAA,QAAQ,EAAE,GAfL;AAgBLC,MAAAA,QAAQ,EAAE,GAhBL;AAiBLC,MAAAA,SAAS,EAAE,GAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,MAAIf,IAAI,KAAK,MAAb,EAAqB;AACnB,WAAO;AACLC,MAAAA,OAAO,EAAE,EADJ;AAELC,MAAAA,OAAO,EAAE,EAFJ;AAGLC,MAAAA,OAAO,EAAE,EAHJ;AAILC,MAAAA,QAAQ,EAAE,EAJL;AAMLC,MAAAA,UAAU,EAAE,EANP;AAOLC,MAAAA,UAAU,EAAE,EAPP;AAQLC,MAAAA,UAAU,EAAE,EARP;AASLC,MAAAA,WAAW,EAAE,EATR;AAWLC,MAAAA,QAAQ,EAAE,EAXL;AAYLC,MAAAA,SAAS,EAAE,EAZN;AAaLC,MAAAA,QAAQ,EAAE,EAbL;AAeLC,MAAAA,QAAQ,EAAE,EAfL;AAgBLC,MAAAA,QAAQ,EAAE,EAhBL;AAiBLC,MAAAA,SAAS,EAAE,EAjBN;AAkBLC,MAAAA,QAAQ,EAAE;AAlBL,KAAP;AAoBD;;AAED,QAAM,IAAIC,KAAJ,CAAU,8BAA8BhB,IAA9B,GAAqC,IAA/C,CAAN;AACD,C","sourcesContent":["/* eslint-disable sort-keys */\n\n/**\n * @typedef border\n * @property {string} topBody\n * @property {string} topJoin\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} bottomBody\n * @property {string} bottomJoin\n * @property {string} bottomLeft\n * @property {string} bottomRight\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n * @property {string} joinBody\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinJoin\n */\n\n/**\n * @param {string} name\n * @returns {border}\n */\nexport default (name) => {\n if (name === 'honeywell') {\n return {\n topBody: '═',\n topJoin: '╤',\n topLeft: '╔',\n topRight: '╗',\n\n bottomBody: '═',\n bottomJoin: '╧',\n bottomLeft: '╚',\n bottomRight: '╝',\n\n bodyLeft: '║',\n bodyRight: '║',\n bodyJoin: '│',\n\n joinBody: '─',\n joinLeft: '╟',\n joinRight: '╢',\n joinJoin: '┼'\n };\n }\n\n if (name === 'norc') {\n return {\n topBody: '─',\n topJoin: '┬',\n topLeft: '┌',\n topRight: '┐',\n\n bottomBody: '─',\n bottomJoin: '┴',\n bottomLeft: '└',\n bottomRight: '┘',\n\n bodyLeft: '│',\n bodyRight: '│',\n bodyJoin: '│',\n\n joinBody: '─',\n joinLeft: '├',\n joinRight: '┤',\n joinJoin: '┼'\n };\n }\n\n if (name === 'ramac') {\n return {\n topBody: '-',\n topJoin: '+',\n topLeft: '+',\n topRight: '+',\n\n bottomBody: '-',\n bottomJoin: '+',\n bottomLeft: '+',\n bottomRight: '+',\n\n bodyLeft: '|',\n bodyRight: '|',\n bodyJoin: '|',\n\n joinBody: '-',\n joinLeft: '|',\n joinRight: '|',\n joinJoin: '|'\n };\n }\n\n if (name === 'void') {\n return {\n topBody: '',\n topJoin: '',\n topLeft: '',\n topRight: '',\n\n bottomBody: '',\n bottomJoin: '',\n bottomLeft: '',\n bottomRight: '',\n\n bodyLeft: '',\n bodyRight: '',\n bodyJoin: '',\n\n joinBody: '',\n joinLeft: '',\n joinRight: '',\n joinJoin: ''\n };\n }\n\n throw new Error('Unknown border template \"' + name + '\".');\n};\n"],"file":"getBorderCharacters.js"} \ No newline at end of file diff --git a/node_modules/table/dist/index.js b/node_modules/table/dist/index.js new file mode 100644 index 0000000..1f40e66 --- /dev/null +++ b/node_modules/table/dist/index.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "table", { + enumerable: true, + get: function get() { + return _table.default; + } +}); +Object.defineProperty(exports, "createStream", { + enumerable: true, + get: function get() { + return _createStream.default; + } +}); +Object.defineProperty(exports, "getBorderCharacters", { + enumerable: true, + get: function get() { + return _getBorderCharacters.default; + } +}); + +var _table = _interopRequireDefault(require("./table")); + +var _createStream = _interopRequireDefault(require("./createStream")); + +var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/dist/index.js.flow b/node_modules/table/dist/index.js.flow new file mode 100644 index 0000000..76cd830 --- /dev/null +++ b/node_modules/table/dist/index.js.flow @@ -0,0 +1,9 @@ +import table from './table'; +import createStream from './createStream'; +import getBorderCharacters from './getBorderCharacters'; + +export { + table, + createStream, + getBorderCharacters +}; diff --git a/node_modules/table/dist/index.js.map b/node_modules/table/dist/index.js.map new file mode 100644 index 0000000..2f59e09 --- /dev/null +++ b/node_modules/table/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA","sourcesContent":["import table from './table';\nimport createStream from './createStream';\nimport getBorderCharacters from './getBorderCharacters';\n\nexport {\n table,\n createStream,\n getBorderCharacters\n};\n"],"file":"index.js"} \ No newline at end of file diff --git a/node_modules/table/dist/makeConfig.js b/node_modules/table/dist/makeConfig.js new file mode 100644 index 0000000..17fd35d --- /dev/null +++ b/node_modules/table/dist/makeConfig.js @@ -0,0 +1,94 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep")); + +var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined")); + +var _times2 = _interopRequireDefault(require("lodash/times")); + +var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); + +var _validateConfig = _interopRequireDefault(require("./validateConfig")); + +var _calculateMaximumColumnWidthIndex = _interopRequireDefault(require("./calculateMaximumColumnWidthIndex")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +const makeBorder = (border = {}) => { + return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); +}; +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + * + * @param {Array[]} rows + * @param {Object} columns + * @param {Object} columnDefault + * @returns {Object} + */ + + +const makeColumns = (rows, columns = {}, columnDefault = {}) => { + const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex.default)(rows); + (0, _times2.default)(rows[0].length, index => { + if ((0, _isUndefined2.default)(columns[index])) { + columns[index] = {}; + } + + columns[index] = Object.assign({ + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Infinity, + width: maximumColumnWidthIndex[index], + wrapWord: false + }, columnDefault, columns[index]); + }); + return columns; +}; +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + * + * @param {Array[]} rows + * @param {Object} userConfig + * @returns {Object} + */ + + +const makeConfig = (rows, userConfig = {}) => { + (0, _validateConfig.default)('config.json', userConfig); + const config = (0, _cloneDeep2.default)(userConfig); + config.border = makeBorder(config.border); + config.columns = makeColumns(rows, config.columns, config.columnDefault); + + if (!config.drawHorizontalLine) { + /** + * @returns {boolean} + */ + config.drawHorizontalLine = () => { + return true; + }; + } + + if (config.singleLine === undefined) { + config.singleLine = false; + } + + return config; +}; + +var _default = makeConfig; +exports.default = _default; +//# sourceMappingURL=makeConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/makeConfig.js.flow b/node_modules/table/dist/makeConfig.js.flow new file mode 100644 index 0000000..1471afc --- /dev/null +++ b/node_modules/table/dist/makeConfig.js.flow @@ -0,0 +1,76 @@ +import _ from 'lodash'; +import getBorderCharacters from './getBorderCharacters'; +import validateConfig from './validateConfig'; +import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex'; + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +const makeBorder = (border = {}) => { + return Object.assign({}, getBorderCharacters('honeywell'), border); +}; + +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + * + * @param {Array[]} rows + * @param {Object} columns + * @param {Object} columnDefault + * @returns {Object} + */ +const makeColumns = (rows, columns = {}, columnDefault = {}) => { + const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows); + + _.times(rows[0].length, (index) => { + if (_.isUndefined(columns[index])) { + columns[index] = {}; + } + + columns[index] = Object.assign({ + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Infinity, + width: maximumColumnWidthIndex[index], + wrapWord: false + }, columnDefault, columns[index]); + }); + + return columns; +}; + +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + * + * @param {Array[]} rows + * @param {Object} userConfig + * @returns {Object} + */ +export default (rows, userConfig = {}) => { + validateConfig('config.json', userConfig); + + const config = _.cloneDeep(userConfig); + + config.border = makeBorder(config.border); + config.columns = makeColumns(rows, config.columns, config.columnDefault); + + if (!config.drawHorizontalLine) { + /** + * @returns {boolean} + */ + config.drawHorizontalLine = () => { + return true; + }; + } + + if (config.singleLine === undefined) { + config.singleLine = false; + } + + return config; +}; diff --git a/node_modules/table/dist/makeConfig.js.map b/node_modules/table/dist/makeConfig.js.map new file mode 100644 index 0000000..76d5360 --- /dev/null +++ b/node_modules/table/dist/makeConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/makeConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","rows","columns","columnDefault","maximumColumnWidthIndex","length","index","alignment","paddingLeft","paddingRight","truncate","Infinity","width","wrapWord","userConfig","config","drawHorizontalLine","singleLine","undefined"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;;;AAEA;;;;;;AAMA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;;;;;;;;;;;AASA,MAAMG,WAAW,GAAG,CAACC,IAAD,EAAOC,OAAO,GAAG,EAAjB,EAAqBC,aAAa,GAAG,EAArC,KAA4C;AAC9D,QAAMC,uBAAuB,GAAG,+CAAiCH,IAAjC,CAAhC;AAEA,uBAAQA,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAhB,EAAyBC,KAAD,IAAW;AACjC,QAAI,2BAAcJ,OAAO,CAACI,KAAD,CAArB,CAAJ,EAAmC;AACjCJ,MAAAA,OAAO,CAACI,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDJ,IAAAA,OAAO,CAACI,KAAD,CAAP,GAAiBR,MAAM,CAACC,MAAP,CAAc;AAC7BQ,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,QAJmB;AAK7BC,MAAAA,KAAK,EAAER,uBAAuB,CAACE,KAAD,CALD;AAM7BO,MAAAA,QAAQ,EAAE;AANmB,KAAd,EAOdV,aAPc,EAOCD,OAAO,CAACI,KAAD,CAPR,CAAjB;AAQD,GAbD;AAeA,SAAOJ,OAAP;AACD,CAnBD;AAqBA;;;;;;;;;;oBAQgBD,I,EAAMa,UAAU,GAAG,E,KAAO;AACxC,+BAAe,aAAf,EAA8BA,UAA9B;AAEA,QAAMC,MAAM,GAAG,yBAAYD,UAAZ,CAAf;AAEAC,EAAAA,MAAM,CAAClB,MAAP,GAAgBD,UAAU,CAACmB,MAAM,CAAClB,MAAR,CAA1B;AACAkB,EAAAA,MAAM,CAACb,OAAP,GAAiBF,WAAW,CAACC,IAAD,EAAOc,MAAM,CAACb,OAAd,EAAuBa,MAAM,CAACZ,aAA9B,CAA5B;;AAEA,MAAI,CAACY,MAAM,CAACC,kBAAZ,EAAgC;AAC9B;;;AAGAD,IAAAA,MAAM,CAACC,kBAAP,GAA4B,MAAM;AAChC,aAAO,IAAP;AACD,KAFD;AAGD;;AAED,MAAID,MAAM,CAACE,UAAP,KAAsBC,SAA1B,EAAqC;AACnCH,IAAAA,MAAM,CAACE,UAAP,GAAoB,KAApB;AACD;;AAED,SAAOF,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\nimport calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {Object} border\n * @returns {Object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {Object} columns\n * @param {Object} columnDefault\n * @returns {Object}\n */\nconst makeColumns = (rows, columns = {}, columnDefault = {}) => {\n const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);\n\n _.times(rows[0].length, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Infinity,\n width: maximumColumnWidthIndex[index],\n wrapWord: false\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {Object} userConfig\n * @returns {Object}\n */\nexport default (rows, userConfig = {}) => {\n validateConfig('config.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(rows, config.columns, config.columnDefault);\n\n if (!config.drawHorizontalLine) {\n /**\n * @returns {boolean}\n */\n config.drawHorizontalLine = () => {\n return true;\n };\n }\n\n if (config.singleLine === undefined) {\n config.singleLine = false;\n }\n\n return config;\n};\n"],"file":"makeConfig.js"} \ No newline at end of file diff --git a/node_modules/table/dist/makeStreamConfig.js b/node_modules/table/dist/makeStreamConfig.js new file mode 100644 index 0000000..bc949c5 --- /dev/null +++ b/node_modules/table/dist/makeStreamConfig.js @@ -0,0 +1,101 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep")); + +var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined")); + +var _times2 = _interopRequireDefault(require("lodash/times")); + +var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); + +var _validateConfig = _interopRequireDefault(require("./validateConfig")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +const makeBorder = (border = {}) => { + return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); +}; +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + * + * @param {number} columnCount + * @param {Object} columns + * @param {Object} columnDefault + * @returns {Object} + */ + + +const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { + (0, _times2.default)(columnCount, index => { + if ((0, _isUndefined2.default)(columns[index])) { + columns[index] = {}; + } + + columns[index] = Object.assign({ + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Infinity, + wrapWord: false + }, columnDefault, columns[index]); + }); + return columns; +}; +/** + * @typedef {Object} columnConfig + * @property {string} alignment + * @property {number} width + * @property {number} truncate + * @property {number} paddingLeft + * @property {number} paddingRight + */ + +/** + * @typedef {Object} streamConfig + * @property {columnConfig} columnDefault + * @property {Object} border + * @property {columnConfig[]} + * @property {number} columnCount Number of columns in the table (required). + */ + +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + * + * @param {streamConfig} userConfig + * @returns {Object} + */ + + +const makeStreamConfig = (userConfig = {}) => { + (0, _validateConfig.default)('streamConfig.json', userConfig); + const config = (0, _cloneDeep2.default)(userConfig); + + if (!config.columnDefault || !config.columnDefault.width) { + throw new Error('Must provide config.columnDefault.width when creating a stream.'); + } + + if (!config.columnCount) { + throw new Error('Must provide config.columnCount.'); + } + + config.border = makeBorder(config.border); + config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); + return config; +}; + +var _default = makeStreamConfig; +exports.default = _default; +//# sourceMappingURL=makeStreamConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/makeStreamConfig.js.flow b/node_modules/table/dist/makeStreamConfig.js.flow new file mode 100644 index 0000000..884625a --- /dev/null +++ b/node_modules/table/dist/makeStreamConfig.js.flow @@ -0,0 +1,83 @@ +import _ from 'lodash'; +import getBorderCharacters from './getBorderCharacters'; +import validateConfig from './validateConfig'; + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +const makeBorder = (border = {}) => { + return Object.assign({}, getBorderCharacters('honeywell'), border); +}; + +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + * + * @param {number} columnCount + * @param {Object} columns + * @param {Object} columnDefault + * @returns {Object} + */ +const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { + _.times(columnCount, (index) => { + if (_.isUndefined(columns[index])) { + columns[index] = {}; + } + + columns[index] = Object.assign({ + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Infinity, + wrapWord: false + }, columnDefault, columns[index]); + }); + + return columns; +}; + +/** + * @typedef {Object} columnConfig + * @property {string} alignment + * @property {number} width + * @property {number} truncate + * @property {number} paddingLeft + * @property {number} paddingRight + */ + +/** + * @typedef {Object} streamConfig + * @property {columnConfig} columnDefault + * @property {Object} border + * @property {columnConfig[]} + * @property {number} columnCount Number of columns in the table (required). + */ + +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + * + * @param {streamConfig} userConfig + * @returns {Object} + */ +export default (userConfig = {}) => { + validateConfig('streamConfig.json', userConfig); + + const config = _.cloneDeep(userConfig); + + if (!config.columnDefault || !config.columnDefault.width) { + throw new Error('Must provide config.columnDefault.width when creating a stream.'); + } + + if (!config.columnCount) { + throw new Error('Must provide config.columnCount.'); + } + + config.border = makeBorder(config.border); + config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); + + return config; +}; diff --git a/node_modules/table/dist/makeStreamConfig.js.map b/node_modules/table/dist/makeStreamConfig.js.map new file mode 100644 index 0000000..643e1d9 --- /dev/null +++ b/node_modules/table/dist/makeStreamConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/makeStreamConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","columnCount","columns","columnDefault","index","alignment","paddingLeft","paddingRight","truncate","Infinity","wrapWord","userConfig","config","width","Error"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;;;AAEA;;;;;;AAMA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;;;;;;;;;;;AASA,MAAMG,WAAW,GAAG,CAACC,WAAD,EAAcC,OAAO,GAAG,EAAxB,EAA4BC,aAAa,GAAG,EAA5C,KAAmD;AACrE,uBAAQF,WAAR,EAAsBG,KAAD,IAAW;AAC9B,QAAI,2BAAcF,OAAO,CAACE,KAAD,CAArB,CAAJ,EAAmC;AACjCF,MAAAA,OAAO,CAACE,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDF,IAAAA,OAAO,CAACE,KAAD,CAAP,GAAiBN,MAAM,CAACC,MAAP,CAAc;AAC7BM,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,QAJmB;AAK7BC,MAAAA,QAAQ,EAAE;AALmB,KAAd,EAMdP,aANc,EAMCD,OAAO,CAACE,KAAD,CANR,CAAjB;AAOD,GAZD;AAcA,SAAOF,OAAP;AACD,CAhBD;AAkBA;;;;;;;;;AASA;;;;;;;;AAQA;;;;;;;;;0BAOgBS,UAAU,GAAG,E,KAAO;AAClC,+BAAe,mBAAf,EAAoCA,UAApC;AAEA,QAAMC,MAAM,GAAG,yBAAYD,UAAZ,CAAf;;AAEA,MAAI,CAACC,MAAM,CAACT,aAAR,IAAyB,CAACS,MAAM,CAACT,aAAP,CAAqBU,KAAnD,EAA0D;AACxD,UAAM,IAAIC,KAAJ,CAAU,iEAAV,CAAN;AACD;;AAED,MAAI,CAACF,MAAM,CAACX,WAAZ,EAAyB;AACvB,UAAM,IAAIa,KAAJ,CAAU,kCAAV,CAAN;AACD;;AAEDF,EAAAA,MAAM,CAACf,MAAP,GAAgBD,UAAU,CAACgB,MAAM,CAACf,MAAR,CAA1B;AACAe,EAAAA,MAAM,CAACV,OAAP,GAAiBF,WAAW,CAACY,MAAM,CAACX,WAAR,EAAqBW,MAAM,CAACV,OAA5B,EAAqCU,MAAM,CAACT,aAA5C,CAA5B;AAEA,SAAOS,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {Object} border\n * @returns {Object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {number} columnCount\n * @param {Object} columns\n * @param {Object} columnDefault\n * @returns {Object}\n */\nconst makeColumns = (columnCount, columns = {}, columnDefault = {}) => {\n _.times(columnCount, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Infinity,\n wrapWord: false\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * @typedef {Object} columnConfig\n * @property {string} alignment\n * @property {number} width\n * @property {number} truncate\n * @property {number} paddingLeft\n * @property {number} paddingRight\n */\n\n/**\n * @typedef {Object} streamConfig\n * @property {columnConfig} columnDefault\n * @property {Object} border\n * @property {columnConfig[]}\n * @property {number} columnCount Number of columns in the table (required).\n */\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {streamConfig} userConfig\n * @returns {Object}\n */\nexport default (userConfig = {}) => {\n validateConfig('streamConfig.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n if (!config.columnDefault || !config.columnDefault.width) {\n throw new Error('Must provide config.columnDefault.width when creating a stream.');\n }\n\n if (!config.columnCount) {\n throw new Error('Must provide config.columnCount.');\n }\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault);\n\n return config;\n};\n"],"file":"makeStreamConfig.js"} \ No newline at end of file diff --git a/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/node_modules/table/dist/mapDataUsingRowHeightIndex.js new file mode 100644 index 0000000..0a4d11d --- /dev/null +++ b/node_modules/table/dist/mapDataUsingRowHeightIndex.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _flatten2 = _interopRequireDefault(require("lodash/flatten")); + +var _times2 = _interopRequireDefault(require("lodash/times")); + +var _wrapCell = _interopRequireDefault(require("./wrapCell")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {Array} unmappedRows + * @param {number[]} rowHeightIndex + * @param {Object} config + * @returns {Array} + */ +const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { + const tableWidth = unmappedRows[0].length; + const mappedRows = unmappedRows.map((cells, index0) => { + const rowHeight = (0, _times2.default)(rowHeightIndex[index0], () => { + return new Array(tableWidth).fill(''); + }); // rowHeight + // [{row index within rowSaw; index2}] + // [{cell index within a virtual row; index1}] + + cells.forEach((value, index1) => { + const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); + cellLines.forEach((cellLine, index2) => { + rowHeight[index2][index1] = cellLine; + }); + }); + return rowHeight; + }); + return (0, _flatten2.default)(mappedRows); +}; + +var _default = mapDataUsingRowHeightIndex; +exports.default = _default; +//# sourceMappingURL=mapDataUsingRowHeightIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow b/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow new file mode 100644 index 0000000..6562bdf --- /dev/null +++ b/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow @@ -0,0 +1,34 @@ +import _ from 'lodash'; +import wrapCell from './wrapCell'; + +/** + * @param {Array} unmappedRows + * @param {number[]} rowHeightIndex + * @param {Object} config + * @returns {Array} + */ +export default (unmappedRows, rowHeightIndex, config) => { + const tableWidth = unmappedRows[0].length; + + const mappedRows = unmappedRows.map((cells, index0) => { + const rowHeight = _.times(rowHeightIndex[index0], () => { + return new Array(tableWidth).fill(''); + }); + + // rowHeight + // [{row index within rowSaw; index2}] + // [{cell index within a virtual row; index1}] + + cells.forEach((value, index1) => { + const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord); + + cellLines.forEach((cellLine, index2) => { + rowHeight[index2][index1] = cellLine; + }); + }); + + return rowHeight; + }); + + return _.flatten(mappedRows); +}; diff --git a/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map b/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map new file mode 100644 index 0000000..5ac560c --- /dev/null +++ b/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","Array","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2"],"mappings":";;;;;;;;;;;AACA;;;;AAEA;;;;;;oCAMgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAG,qBAAQR,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAIE,KAAJ,CAAUP,UAAV,EAAsBQ,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;AAEAJ,IAAAA,KAAK,CAACK,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBX,MAAM,CAACc,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8Cf,MAAM,CAACc,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCX,QAAAA,SAAS,CAACW,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOV,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAO,uBAAUJ,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {Object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = _.times(rowHeightIndex[index0], () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n cellLines.forEach((cellLine, index2) => {\n rowHeight[index2][index1] = cellLine;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/padTableData.js b/node_modules/table/dist/padTableData.js new file mode 100644 index 0000000..81bd5f5 --- /dev/null +++ b/node_modules/table/dist/padTableData.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +const padTableData = (rows, config) => { + return rows.map(cells => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); + }); + }); +}; + +var _default = padTableData; +exports.default = _default; +//# sourceMappingURL=padTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/padTableData.js.flow b/node_modules/table/dist/padTableData.js.flow new file mode 100644 index 0000000..f23dc02 --- /dev/null +++ b/node_modules/table/dist/padTableData.js.flow @@ -0,0 +1,14 @@ +/** + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +export default (rows, config) => { + return rows.map((cells) => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + + return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); + }); + }); +}; diff --git a/node_modules/table/dist/padTableData.js.map b/node_modules/table/dist/padTableData.js.map new file mode 100644 index 0000000..783f9cc --- /dev/null +++ b/node_modules/table/dist/padTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/padTableData.js"],"names":["rows","config","map","cells","value","index1","column","columns","repeat","paddingLeft","paddingRight"],"mappings":";;;;;;;AAAA;;;;;sBAKgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,KAAD,EAAQC,MAAR,KAAmB;AAClC,YAAMC,MAAM,GAAGL,MAAM,CAACM,OAAP,CAAeF,MAAf,CAAf;AAEA,aAAO,IAAIG,MAAJ,CAAWF,MAAM,CAACG,WAAlB,IAAiCL,KAAjC,GAAyC,IAAII,MAAJ,CAAWF,MAAM,CAACI,YAAlB,CAAhD;AACD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["/**\n * @param {table~row[]} rows\n * @param {Object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((value, index1) => {\n const column = config.columns[index1];\n\n return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight);\n });\n });\n};\n"],"file":"padTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/schemas/config.json b/node_modules/table/dist/schemas/config.json new file mode 100644 index 0000000..1a4a998 --- /dev/null +++ b/node_modules/table/dist/schemas/config.json @@ -0,0 +1,114 @@ +{ + "$id": "config.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "#/definitions/borders" + }, + "columns": { + "$ref": "#/definitions/columns" + }, + "columnDefault": { + "$ref": "#/definitions/column" + }, + "drawHorizontalLine": { + "typeof": "function" + } + }, + "additionalProperties": false, + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": [ + "left", + "right", + "center" + ] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +} diff --git a/node_modules/table/dist/schemas/streamConfig.json b/node_modules/table/dist/schemas/streamConfig.json new file mode 100644 index 0000000..3519984 --- /dev/null +++ b/node_modules/table/dist/schemas/streamConfig.json @@ -0,0 +1,114 @@ +{ + "$id": "streamConfig.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "#/definitions/borders" + }, + "columns": { + "$ref": "#/definitions/columns" + }, + "columnDefault": { + "$ref": "#/definitions/column" + }, + "columnCount": { + "type": "number" + } + }, + "additionalProperties": false, + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": [ + "left", + "right", + "center" + ] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +} diff --git a/node_modules/table/dist/stringifyTableData.js b/node_modules/table/dist/stringifyTableData.js new file mode 100644 index 0000000..0217e3b --- /dev/null +++ b/node_modules/table/dist/stringifyTableData.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** + * Casts all cell values to a string. + * + * @param {table~row[]} rows + * @returns {table~row[]} + */ +const stringifyTableData = rows => { + return rows.map(cells => { + return cells.map(String); + }); +}; + +var _default = stringifyTableData; +exports.default = _default; +//# sourceMappingURL=stringifyTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/stringifyTableData.js.flow b/node_modules/table/dist/stringifyTableData.js.flow new file mode 100644 index 0000000..a4dffac --- /dev/null +++ b/node_modules/table/dist/stringifyTableData.js.flow @@ -0,0 +1,11 @@ +/** + * Casts all cell values to a string. + * + * @param {table~row[]} rows + * @returns {table~row[]} + */ +export default (rows) => { + return rows.map((cells) => { + return cells.map(String); + }); +}; diff --git a/node_modules/table/dist/stringifyTableData.js.map b/node_modules/table/dist/stringifyTableData.js.map new file mode 100644 index 0000000..6cbe5a7 --- /dev/null +++ b/node_modules/table/dist/stringifyTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/stringifyTableData.js"],"names":["rows","map","cells","String"],"mappings":";;;;;;;AAAA;;;;;;2BAMgBA,I,IAAS;AACvB,SAAOA,IAAI,CAACC,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAUE,MAAV,CAAP;AACD,GAFM,CAAP;AAGD,C","sourcesContent":["/**\n * Casts all cell values to a string.\n *\n * @param {table~row[]} rows\n * @returns {table~row[]}\n */\nexport default (rows) => {\n return rows.map((cells) => {\n return cells.map(String);\n });\n};\n"],"file":"stringifyTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/table.js b/node_modules/table/dist/table.js new file mode 100644 index 0000000..bd4e805 --- /dev/null +++ b/node_modules/table/dist/table.js @@ -0,0 +1,110 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _drawTable = _interopRequireDefault(require("./drawTable")); + +var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); + +var _makeConfig = _interopRequireDefault(require("./makeConfig")); + +var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); + +var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); + +var _alignTableData = _interopRequireDefault(require("./alignTableData")); + +var _padTableData = _interopRequireDefault(require("./padTableData")); + +var _validateTableData = _interopRequireDefault(require("./validateTableData")); + +var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); + +var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @typedef {string} table~cell + */ + +/** + * @typedef {table~cell[]} table~row + */ + +/** + * @typedef {Object} table~columns + * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). + * @property {number} width Column width (default: auto). + * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). + * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters + * @property {number} paddingLeft Cell content padding width left (default: 1). + * @property {number} paddingRight Cell content padding width right (default: 1). + */ + +/** + * @typedef {Object} table~border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * Used to tell whether to draw a horizontal line. + * This callback is called for each non-content line of the table. + * The default behavior is to always return true. + * + * @typedef {Function} drawHorizontalLine + * @param {number} index + * @param {number} size + * @returns {boolean} + */ + +/** + * @typedef {Object} table~config + * @property {table~border} border + * @property {table~columns[]} columns Column specific configuration. + * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. + * @property {table~drawHorizontalLine} drawHorizontalLine + * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn. + */ + +/** + * Generates a text table. + * + * @param {table~row[]} data + * @param {table~config} userConfig + * @returns {string} + */ +const table = (data, userConfig = {}) => { + let rows; + (0, _validateTableData.default)(data); + rows = (0, _stringifyTableData.default)(data); + const config = (0, _makeConfig.default)(rows, userConfig); + rows = (0, _truncateTableData.default)(data, config); + const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); + rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); + rows = (0, _alignTableData.default)(rows, config); + rows = (0, _padTableData.default)(rows, config); + const cellWidthIndex = (0, _calculateCellWidthIndex.default)(rows[0]); + return (0, _drawTable.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine); +}; + +var _default = table; +exports.default = _default; +//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/node_modules/table/dist/table.js.flow b/node_modules/table/dist/table.js.flow new file mode 100644 index 0000000..86af744 --- /dev/null +++ b/node_modules/table/dist/table.js.flow @@ -0,0 +1,96 @@ +import drawTable from './drawTable'; +import calculateCellWidthIndex from './calculateCellWidthIndex'; +import makeConfig from './makeConfig'; +import calculateRowHeightIndex from './calculateRowHeightIndex'; +import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; +import alignTableData from './alignTableData'; +import padTableData from './padTableData'; +import validateTableData from './validateTableData'; +import stringifyTableData from './stringifyTableData'; +import truncateTableData from './truncateTableData'; + +/** + * @typedef {string} table~cell + */ + +/** + * @typedef {table~cell[]} table~row + */ + +/** + * @typedef {Object} table~columns + * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). + * @property {number} width Column width (default: auto). + * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). + * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters + * @property {number} paddingLeft Cell content padding width left (default: 1). + * @property {number} paddingRight Cell content padding width right (default: 1). + */ + +/** + * @typedef {Object} table~border + * @property {string} topBody + * @property {string} topJoin + * @property {string} topLeft + * @property {string} topRight + * @property {string} bottomBody + * @property {string} bottomJoin + * @property {string} bottomLeft + * @property {string} bottomRight + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + * @property {string} joinBody + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinJoin + */ + +/** + * Used to tell whether to draw a horizontal line. + * This callback is called for each non-content line of the table. + * The default behavior is to always return true. + * + * @typedef {Function} drawHorizontalLine + * @param {number} index + * @param {number} size + * @returns {boolean} + */ + +/** + * @typedef {Object} table~config + * @property {table~border} border + * @property {table~columns[]} columns Column specific configuration. + * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. + * @property {table~drawHorizontalLine} drawHorizontalLine + * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn. + */ + +/** + * Generates a text table. + * + * @param {table~row[]} data + * @param {table~config} userConfig + * @returns {string} + */ +export default (data, userConfig = {}) => { + let rows; + + validateTableData(data); + + rows = stringifyTableData(data); + + const config = makeConfig(rows, userConfig); + + rows = truncateTableData(data, config); + + const rowHeightIndex = calculateRowHeightIndex(rows, config); + + rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); + rows = alignTableData(rows, config); + rows = padTableData(rows, config); + + const cellWidthIndex = calculateCellWidthIndex(rows[0]); + + return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine); +}; diff --git a/node_modules/table/dist/table.js.map b/node_modules/table/dist/table.js.map new file mode 100644 index 0000000..93f3aaa --- /dev/null +++ b/node_modules/table/dist/table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/table.js"],"names":["data","userConfig","rows","config","rowHeightIndex","cellWidthIndex","border","drawHorizontalLine","singleLine"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;;;;AAIA;;;;AAIA;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;AAWA;;;;;;;;;AASA;;;;;;;eAOgBA,I,EAAMC,UAAU,GAAG,E,KAAO;AACxC,MAAIC,IAAJ;AAEA,kCAAkBF,IAAlB;AAEAE,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEA,QAAMG,MAAM,GAAG,yBAAWD,IAAX,EAAiBD,UAAjB,CAAf;AAEAC,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBG,MAAxB,CAAP;AAEA,QAAMC,cAAc,GAAG,sCAAwBF,IAAxB,EAA8BC,MAA9B,CAAvB;AAEAD,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCE,cAAjC,EAAiDD,MAAjD,CAAP;AACAD,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBC,MAArB,CAAP;AACAD,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBC,MAAnB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBH,IAAI,CAAC,CAAD,CAA5B,CAAvB;AAEA,SAAO,wBAAUA,IAAV,EAAgBC,MAAM,CAACG,MAAvB,EAA+BD,cAA/B,EAA+CD,cAA/C,EAA+DD,MAAM,CAACI,kBAAtE,EAA0FJ,MAAM,CAACK,UAAjG,CAAP;AACD,C","sourcesContent":["import drawTable from './drawTable';\nimport calculateCellWidthIndex from './calculateCellWidthIndex';\nimport makeConfig from './makeConfig';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport alignTableData from './alignTableData';\nimport padTableData from './padTableData';\nimport validateTableData from './validateTableData';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\n\n/**\n * @typedef {string} table~cell\n */\n\n/**\n * @typedef {table~cell[]} table~row\n */\n\n/**\n * @typedef {Object} table~columns\n * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left).\n * @property {number} width Column width (default: auto).\n * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity).\n * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters\n * @property {number} paddingLeft Cell content padding width left (default: 1).\n * @property {number} paddingRight Cell content padding width right (default: 1).\n */\n\n/**\n * @typedef {Object} table~border\n * @property {string} topBody\n * @property {string} topJoin\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} bottomBody\n * @property {string} bottomJoin\n * @property {string} bottomLeft\n * @property {string} bottomRight\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n * @property {string} joinBody\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinJoin\n */\n\n/**\n * Used to tell whether to draw a horizontal line.\n * This callback is called for each non-content line of the table.\n * The default behavior is to always return true.\n *\n * @typedef {Function} drawHorizontalLine\n * @param {number} index\n * @param {number} size\n * @returns {boolean}\n */\n\n/**\n * @typedef {Object} table~config\n * @property {table~border} border\n * @property {table~columns[]} columns Column specific configuration.\n * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values.\n * @property {table~drawHorizontalLine} drawHorizontalLine\n * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn.\n */\n\n/**\n * Generates a text table.\n *\n * @param {table~row[]} data\n * @param {table~config} userConfig\n * @returns {string}\n */\nexport default (data, userConfig = {}) => {\n let rows;\n\n validateTableData(data);\n\n rows = stringifyTableData(data);\n\n const config = makeConfig(rows, userConfig);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n const cellWidthIndex = calculateCellWidthIndex(rows[0]);\n\n return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine);\n};\n"],"file":"table.js"} \ No newline at end of file diff --git a/node_modules/table/dist/truncateTableData.js b/node_modules/table/dist/truncateTableData.js new file mode 100644 index 0000000..89e1777 --- /dev/null +++ b/node_modules/table/dist/truncateTableData.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _truncate2 = _interopRequireDefault(require("lodash/truncate")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @todo Make it work with ASCII content. + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +const truncateTableData = (rows, config) => { + return rows.map(cells => { + return cells.map((content, index) => { + return (0, _truncate2.default)(content, { + length: config.columns[index].truncate + }); + }); + }); +}; + +var _default = truncateTableData; +exports.default = _default; +//# sourceMappingURL=truncateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/truncateTableData.js.flow b/node_modules/table/dist/truncateTableData.js.flow new file mode 100644 index 0000000..1052c92 --- /dev/null +++ b/node_modules/table/dist/truncateTableData.js.flow @@ -0,0 +1,17 @@ +import _ from 'lodash'; + +/** + * @todo Make it work with ASCII content. + * @param {table~row[]} rows + * @param {Object} config + * @returns {table~row[]} + */ +export default (rows, config) => { + return rows.map((cells) => { + return cells.map((content, index) => { + return _.truncate(content, { + length: config.columns[index].truncate + }); + }); + }); +}; diff --git a/node_modules/table/dist/truncateTableData.js.map b/node_modules/table/dist/truncateTableData.js.map new file mode 100644 index 0000000..e4ceaf8 --- /dev/null +++ b/node_modules/table/dist/truncateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/truncateTableData.js"],"names":["rows","config","map","cells","content","index","length","columns","truncate"],"mappings":";;;;;;;;;;;AAEA;;;;;;2BAMgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,OAAD,EAAUC,KAAV,KAAoB;AACnC,aAAO,wBAAWD,OAAX,EAAoB;AACzBE,QAAAA,MAAM,EAAEL,MAAM,CAACM,OAAP,CAAeF,KAAf,EAAsBG;AADL,OAApB,CAAP;AAGD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import _ from 'lodash';\n\n/**\n * @todo Make it work with ASCII content.\n * @param {table~row[]} rows\n * @param {Object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((content, index) => {\n return _.truncate(content, {\n length: config.columns[index].truncate\n });\n });\n });\n};\n"],"file":"truncateTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/validateConfig.js b/node_modules/table/dist/validateConfig.js new file mode 100644 index 0000000..40d8127 --- /dev/null +++ b/node_modules/table/dist/validateConfig.js @@ -0,0 +1,752 @@ +'use strict'; +var equal = require('ajv/lib/compile/equal'); +var validate = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + var refVal = []; + var refVal1 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0)); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data.topBody !== undefined) { + var errs_1 = errors; + if (!refVal2(data.topBody, (dataPath || '') + '.topBody', data, 'topBody', rootData)) { + if (vErrors === null) vErrors = refVal2.errors; + else vErrors = vErrors.concat(refVal2.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.topJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.topJoin, (dataPath || '') + '.topJoin', data, 'topJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.topLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.topLeft, (dataPath || '') + '.topLeft', data, 'topLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.topRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.topRight, (dataPath || '') + '.topRight', data, 'topRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomBody !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomBody, (dataPath || '') + '.bottomBody', data, 'bottomBody', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomJoin, (dataPath || '') + '.bottomJoin', data, 'bottomJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomLeft, (dataPath || '') + '.bottomLeft', data, 'bottomLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomRight, (dataPath || '') + '.bottomRight', data, 'bottomRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bodyLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bodyLeft, (dataPath || '') + '.bodyLeft', data, 'bodyLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bodyRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bodyRight, (dataPath || '') + '.bodyRight', data, 'bodyRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bodyJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bodyJoin, (dataPath || '') + '.bodyJoin', data, 'bodyJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinBody !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinBody, (dataPath || '') + '.joinBody', data, 'joinBody', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinLeft, (dataPath || '') + '.joinLeft', data, 'joinLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinRight, (dataPath || '') + '.joinRight', data, 'joinRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinJoin, (dataPath || '') + '.joinJoin', data, 'joinJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal1.schema = { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }; + refVal1.errors = null; + refVal[1] = refVal1; + var refVal2 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if (typeof data !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal2.schema = { + "type": "string" + }; + refVal2.errors = null; + refVal[2] = refVal2; + var refVal3 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || pattern0.test(key0)); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + for (var key0 in data) { + if (pattern0.test(key0)) { + var errs_1 = errors; + if (!refVal4(data[key0], (dataPath || '') + '[\'' + key0 + '\']', data, key0, rootData)) { + if (vErrors === null) vErrors = refVal4.errors; + else vErrors = vErrors.concat(refVal4.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal3.schema = { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }; + refVal3.errors = null; + refVal[3] = refVal3; + var refVal4 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight'); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var data1 = data.alignment; + if (data1 !== undefined) { + var errs_1 = errors; + if (typeof data1 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.alignment', + schemaPath: '#/properties/alignment/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema1 = validate.schema.properties.alignment.enum; + var valid1; + valid1 = false; + for (var i1 = 0; i1 < schema1.length; i1++) + if (equal(data1, schema1[i1])) { + valid1 = true; + break; + } if (!valid1) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.alignment', + schemaPath: '#/properties/alignment/enum', + params: { + allowedValues: schema1 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.width !== undefined) { + var errs_1 = errors; + if (typeof data.width !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.width', + schemaPath: '#/properties/width/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.wrapWord !== undefined) { + var errs_1 = errors; + if (typeof data.wrapWord !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.wrapWord', + schemaPath: '#/properties/wrapWord/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.truncate !== undefined) { + var errs_1 = errors; + if (typeof data.truncate !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.truncate', + schemaPath: '#/properties/truncate/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.paddingLeft !== undefined) { + var errs_1 = errors; + if (typeof data.paddingLeft !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.paddingLeft', + schemaPath: '#/properties/paddingLeft/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.paddingRight !== undefined) { + var errs_1 = errors; + if (typeof data.paddingRight !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.paddingRight', + schemaPath: '#/properties/paddingRight/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal4.schema = { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": ["left", "right", "center"] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }; + refVal4.errors = null; + refVal[4] = refVal4; + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=config.json */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || key0 == 'border' || key0 == 'columns' || key0 == 'columnDefault' || key0 == 'drawHorizontalLine'); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data.border !== undefined) { + var errs_1 = errors; + if (!refVal1(data.border, (dataPath || '') + '.border', data, 'border', rootData)) { + if (vErrors === null) vErrors = refVal1.errors; + else vErrors = vErrors.concat(refVal1.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.columns !== undefined) { + var errs_1 = errors; + if (!refVal3(data.columns, (dataPath || '') + '.columns', data, 'columns', rootData)) { + if (vErrors === null) vErrors = refVal3.errors; + else vErrors = vErrors.concat(refVal3.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.columnDefault !== undefined) { + var errs_1 = errors; + if (!refVal[4](data.columnDefault, (dataPath || '') + '.columnDefault', data, 'columnDefault', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.drawHorizontalLine !== undefined) { + var errs_1 = errors; + var errs__1 = errors; + var valid1; + valid1 = typeof data.drawHorizontalLine == "function"; + if (!valid1) { + if (errs__1 == errors) { + var err = { + keyword: 'typeof', + dataPath: (dataPath || '') + '.drawHorizontalLine', + schemaPath: '#/properties/drawHorizontalLine/typeof', + params: { + keyword: 'typeof' + }, + message: 'should pass "typeof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + for (var i1 = errs__1; i1 < errors; i1++) { + var ruleErr1 = vErrors[i1]; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '.drawHorizontalLine'; + if (ruleErr1.schemaPath === undefined) { + ruleErr1.schemaPath = "#/properties/drawHorizontalLine/typeof"; + } + } + } + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; +})(); +validate.schema = { + "$id": "config.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "#/definitions/borders" + }, + "columns": { + "$ref": "#/definitions/columns" + }, + "columnDefault": { + "$ref": "#/definitions/column" + }, + "drawHorizontalLine": { + "typeof": "function" + } + }, + "additionalProperties": false, + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": ["left", "right", "center"] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +}; +validate.errors = null; +module.exports = validate; \ No newline at end of file diff --git a/node_modules/table/dist/validateConfig.js.flow b/node_modules/table/dist/validateConfig.js.flow new file mode 100644 index 0000000..14b9710 --- /dev/null +++ b/node_modules/table/dist/validateConfig.js.flow @@ -0,0 +1,34 @@ +// eslint-disable-next-line import/default +import validateConfig from '../dist/validateConfig'; +// eslint-disable-next-line import/default +import validateStreamConfig from '../dist/validateStreamConfig'; + +const validate = { + 'config.json': validateConfig, + 'streamConfig.json': validateStreamConfig +}; + +/** + * @param {string} schemaId + * @param {formatData~config} config + * @returns {undefined} + */ +export default (schemaId, config = {}) => { + if (!validate[schemaId](config)) { + const errors = validate[schemaId].errors.map((error) => { + return { + dataPath: error.dataPath, + message: error.message, + params: error.params, + schemaPath: error.schemaPath + }; + }); + + /* eslint-disable no-console */ + console.log('config', config); + console.log('errors', errors); + /* eslint-enable no-console */ + + throw new Error('Invalid config.'); + } +}; diff --git a/node_modules/table/dist/validateConfig.js.map b/node_modules/table/dist/validateConfig.js.map new file mode 100644 index 0000000..43bebf7 --- /dev/null +++ b/node_modules/table/dist/validateConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/validateConfig.js"],"names":["validate","validateConfig","validateStreamConfig","schemaId","config","errors","map","error","dataPath","message","params","schemaPath","console","log","Error"],"mappings":";;;;;;;AACA;;AAEA;;;;AAHA;AAEA;AAGA,MAAMA,QAAQ,GAAG;AACf,iBAAeC,uBADA;AAEf,uBAAqBC;AAFN,CAAjB;AAKA;;;;;;yBAKgBC,Q,EAAUC,MAAM,GAAG,E,KAAO;AACxC,MAAI,CAACJ,QAAQ,CAACG,QAAD,CAAR,CAAmBC,MAAnB,CAAL,EAAiC;AAC/B,UAAMC,MAAM,GAAGL,QAAQ,CAACG,QAAD,CAAR,CAAmBE,MAAnB,CAA0BC,GAA1B,CAA+BC,KAAD,IAAW;AACtD,aAAO;AACLC,QAAAA,QAAQ,EAAED,KAAK,CAACC,QADX;AAELC,QAAAA,OAAO,EAAEF,KAAK,CAACE,OAFV;AAGLC,QAAAA,MAAM,EAAEH,KAAK,CAACG,MAHT;AAILC,QAAAA,UAAU,EAAEJ,KAAK,CAACI;AAJb,OAAP;AAMD,KAPc,CAAf;AASA;;AACAC,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBT,MAAtB;AACAQ,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBR,MAAtB;AACA;;AAEA,UAAM,IAAIS,KAAJ,CAAU,iBAAV,CAAN;AACD;AACF,C","sourcesContent":["// eslint-disable-next-line import/default\nimport validateConfig from '../dist/validateConfig';\n// eslint-disable-next-line import/default\nimport validateStreamConfig from '../dist/validateStreamConfig';\n\nconst validate = {\n 'config.json': validateConfig,\n 'streamConfig.json': validateStreamConfig\n};\n\n/**\n * @param {string} schemaId\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (schemaId, config = {}) => {\n if (!validate[schemaId](config)) {\n const errors = validate[schemaId].errors.map((error) => {\n return {\n dataPath: error.dataPath,\n message: error.message,\n params: error.params,\n schemaPath: error.schemaPath\n };\n });\n\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('errors', errors);\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"file":"validateConfig.js"} \ No newline at end of file diff --git a/node_modules/table/dist/validateStreamConfig.js b/node_modules/table/dist/validateStreamConfig.js new file mode 100644 index 0000000..ff10e59 --- /dev/null +++ b/node_modules/table/dist/validateStreamConfig.js @@ -0,0 +1,739 @@ +'use strict'; +var equal = require('ajv/lib/compile/equal'); +var validate = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + var refVal = []; + var refVal1 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0)); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data.topBody !== undefined) { + var errs_1 = errors; + if (!refVal2(data.topBody, (dataPath || '') + '.topBody', data, 'topBody', rootData)) { + if (vErrors === null) vErrors = refVal2.errors; + else vErrors = vErrors.concat(refVal2.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.topJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.topJoin, (dataPath || '') + '.topJoin', data, 'topJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.topLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.topLeft, (dataPath || '') + '.topLeft', data, 'topLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.topRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.topRight, (dataPath || '') + '.topRight', data, 'topRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomBody !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomBody, (dataPath || '') + '.bottomBody', data, 'bottomBody', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomJoin, (dataPath || '') + '.bottomJoin', data, 'bottomJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomLeft, (dataPath || '') + '.bottomLeft', data, 'bottomLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bottomRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bottomRight, (dataPath || '') + '.bottomRight', data, 'bottomRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bodyLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bodyLeft, (dataPath || '') + '.bodyLeft', data, 'bodyLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bodyRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bodyRight, (dataPath || '') + '.bodyRight', data, 'bodyRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.bodyJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.bodyJoin, (dataPath || '') + '.bodyJoin', data, 'bodyJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinBody !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinBody, (dataPath || '') + '.joinBody', data, 'joinBody', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinLeft !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinLeft, (dataPath || '') + '.joinLeft', data, 'joinLeft', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinRight !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinRight, (dataPath || '') + '.joinRight', data, 'joinRight', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.joinJoin !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.joinJoin, (dataPath || '') + '.joinJoin', data, 'joinJoin', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal1.schema = { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }; + refVal1.errors = null; + refVal[1] = refVal1; + var refVal2 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if (typeof data !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal2.schema = { + "type": "string" + }; + refVal2.errors = null; + refVal[2] = refVal2; + var refVal3 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || pattern0.test(key0)); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + for (var key0 in data) { + if (pattern0.test(key0)) { + var errs_1 = errors; + if (!refVal4(data[key0], (dataPath || '') + '[\'' + key0 + '\']', data, key0, rootData)) { + if (vErrors === null) vErrors = refVal4.errors; + else vErrors = vErrors.concat(refVal4.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal3.schema = { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }; + refVal3.errors = null; + refVal[3] = refVal3; + var refVal4 = (function() { + var pattern0 = new RegExp('^[0-9]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; + var errors = 0; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight'); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var data1 = data.alignment; + if (data1 !== undefined) { + var errs_1 = errors; + if (typeof data1 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.alignment', + schemaPath: '#/properties/alignment/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema1 = validate.schema.properties.alignment.enum; + var valid1; + valid1 = false; + for (var i1 = 0; i1 < schema1.length; i1++) + if (equal(data1, schema1[i1])) { + valid1 = true; + break; + } if (!valid1) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.alignment', + schemaPath: '#/properties/alignment/enum', + params: { + allowedValues: schema1 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.width !== undefined) { + var errs_1 = errors; + if (typeof data.width !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.width', + schemaPath: '#/properties/width/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.wrapWord !== undefined) { + var errs_1 = errors; + if (typeof data.wrapWord !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.wrapWord', + schemaPath: '#/properties/wrapWord/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.truncate !== undefined) { + var errs_1 = errors; + if (typeof data.truncate !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.truncate', + schemaPath: '#/properties/truncate/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.paddingLeft !== undefined) { + var errs_1 = errors; + if (typeof data.paddingLeft !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.paddingLeft', + schemaPath: '#/properties/paddingLeft/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.paddingRight !== undefined) { + var errs_1 = errors; + if (typeof data.paddingRight !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.paddingRight', + schemaPath: '#/properties/paddingRight/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal4.schema = { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": ["left", "right", "center"] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }; + refVal4.errors = null; + refVal[4] = refVal4; + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=streamConfig.json */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + for (var key0 in data) { + var isAdditional0 = !(false || key0 == 'border' || key0 == 'columns' || key0 == 'columnDefault' || key0 == 'columnCount'); + if (isAdditional0) { + valid1 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/additionalProperties', + params: { + additionalProperty: '' + key0 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data.border !== undefined) { + var errs_1 = errors; + if (!refVal1(data.border, (dataPath || '') + '.border', data, 'border', rootData)) { + if (vErrors === null) vErrors = refVal1.errors; + else vErrors = vErrors.concat(refVal1.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.columns !== undefined) { + var errs_1 = errors; + if (!refVal3(data.columns, (dataPath || '') + '.columns', data, 'columns', rootData)) { + if (vErrors === null) vErrors = refVal3.errors; + else vErrors = vErrors.concat(refVal3.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.columnDefault !== undefined) { + var errs_1 = errors; + if (!refVal[4](data.columnDefault, (dataPath || '') + '.columnDefault', data, 'columnDefault', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.columnCount !== undefined) { + var errs_1 = errors; + if (typeof data.columnCount !== "number") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.columnCount', + schemaPath: '#/properties/columnCount/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; +})(); +validate.schema = { + "$id": "streamConfig.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "#/definitions/borders" + }, + "columns": { + "$ref": "#/definitions/columns" + }, + "columnDefault": { + "$ref": "#/definitions/column" + }, + "columnCount": { + "type": "number" + } + }, + "additionalProperties": false, + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": ["left", "right", "center"] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +}; +validate.errors = null; +module.exports = validate; \ No newline at end of file diff --git a/node_modules/table/dist/validateTableData.js b/node_modules/table/dist/validateTableData.js new file mode 100644 index 0000000..bbd51ff --- /dev/null +++ b/node_modules/table/dist/validateTableData.js @@ -0,0 +1,96 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** + * @typedef {string} cell + */ + +/** + * @typedef {cell[]} validateData~column + */ + +/** + * @param {column[]} rows + * @returns {undefined} + */ +const validateTableData = rows => { + if (!Array.isArray(rows)) { + throw new TypeError('Table data must be an array.'); + } + + if (rows.length === 0) { + throw new Error('Table must define at least one row.'); + } + + if (rows[0].length === 0) { + throw new Error('Table must define at least one column.'); + } + + const columnNumber = rows[0].length; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = rows[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + const cells = _step.value; + + if (!Array.isArray(cells)) { + throw new TypeError('Table row data must be an array.'); + } + + if (cells.length !== columnNumber) { + throw new Error('Table must have a consistent number of cells.'); + } + + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = cells[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + const cell = _step2.value; + + // eslint-disable-next-line no-control-regex + if (/[\u0001-\u0006\u0008-\u0009\u000B-\u001A]/.test(cell)) { + throw new Error('Table data must not contain control characters.'); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } +}; + +var _default = validateTableData; +exports.default = _default; +//# sourceMappingURL=validateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/validateTableData.js.flow b/node_modules/table/dist/validateTableData.js.flow new file mode 100644 index 0000000..304ab0d --- /dev/null +++ b/node_modules/table/dist/validateTableData.js.flow @@ -0,0 +1,44 @@ +/** + * @typedef {string} cell + */ + +/** + * @typedef {cell[]} validateData~column + */ + +/** + * @param {column[]} rows + * @returns {undefined} + */ +export default (rows) => { + if (!Array.isArray(rows)) { + throw new TypeError('Table data must be an array.'); + } + + if (rows.length === 0) { + throw new Error('Table must define at least one row.'); + } + + if (rows[0].length === 0) { + throw new Error('Table must define at least one column.'); + } + + const columnNumber = rows[0].length; + + for (const cells of rows) { + if (!Array.isArray(cells)) { + throw new TypeError('Table row data must be an array.'); + } + + if (cells.length !== columnNumber) { + throw new Error('Table must have a consistent number of cells.'); + } + + for (const cell of cells) { + // eslint-disable-next-line no-control-regex + if (/[\u0001-\u0006\u0008-\u0009\u000B-\u001A]/.test(cell)) { + throw new Error('Table data must not contain control characters.'); + } + } + } +}; diff --git a/node_modules/table/dist/validateTableData.js.map b/node_modules/table/dist/validateTableData.js.map new file mode 100644 index 0000000..4114f4a --- /dev/null +++ b/node_modules/table/dist/validateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/validateTableData.js"],"names":["rows","Array","isArray","TypeError","length","Error","columnNumber","cells","cell","test"],"mappings":";;;;;;;AAAA;;;;AAIA;;;;AAIA;;;;0BAIgBA,I,IAAS;AACvB,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,IAAd,CAAL,EAA0B;AACxB,UAAM,IAAIG,SAAJ,CAAc,8BAAd,CAAN;AACD;;AAED,MAAIH,IAAI,CAACI,MAAL,KAAgB,CAApB,EAAuB;AACrB,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,MAAIL,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAR,KAAmB,CAAvB,EAA0B;AACxB,UAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;AACD;;AAED,QAAMC,YAAY,GAAGN,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAA7B;AAbuB;AAAA;AAAA;;AAAA;AAevB,yBAAoBJ,IAApB,8HAA0B;AAAA,YAAfO,KAAe;;AACxB,UAAI,CAACN,KAAK,CAACC,OAAN,CAAcK,KAAd,CAAL,EAA2B;AACzB,cAAM,IAAIJ,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,UAAII,KAAK,CAACH,MAAN,KAAiBE,YAArB,EAAmC;AACjC,cAAM,IAAID,KAAJ,CAAU,+CAAV,CAAN;AACD;;AAPuB;AAAA;AAAA;;AAAA;AASxB,8BAAmBE,KAAnB,mIAA0B;AAAA,gBAAfC,IAAe;;AACxB;AACA,cAAI,4CAA4CC,IAA5C,CAAiDD,IAAjD,CAAJ,EAA4D;AAC1D,kBAAM,IAAIH,KAAJ,CAAU,iDAAV,CAAN;AACD;AACF;AAduB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAezB;AA9BsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BxB,C","sourcesContent":["/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {column[]} rows\n * @returns {undefined}\n */\nexport default (rows) => {\n if (!Array.isArray(rows)) {\n throw new TypeError('Table data must be an array.');\n }\n\n if (rows.length === 0) {\n throw new Error('Table must define at least one row.');\n }\n\n if (rows[0].length === 0) {\n throw new Error('Table must define at least one column.');\n }\n\n const columnNumber = rows[0].length;\n\n for (const cells of rows) {\n if (!Array.isArray(cells)) {\n throw new TypeError('Table row data must be an array.');\n }\n\n if (cells.length !== columnNumber) {\n throw new Error('Table must have a consistent number of cells.');\n }\n\n for (const cell of cells) {\n // eslint-disable-next-line no-control-regex\n if (/[\\u0001-\\u0006\\u0008-\\u0009\\u000B-\\u001A]/.test(cell)) {\n throw new Error('Table data must not contain control characters.');\n }\n }\n }\n};\n"],"file":"validateTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/wrapCell.js b/node_modules/table/dist/wrapCell.js new file mode 100644 index 0000000..3bddc4c --- /dev/null +++ b/node_modules/table/dist/wrapCell.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _wrapString = _interopRequireDefault(require("./wrapString")); + +var _wrapWord = _interopRequireDefault(require("./wrapWord")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wrap a single cell value into a list of lines + * + * Always wraps on newlines, for the remainder uses either word or string wrapping + * depending on user configuration. + * + * @param {string} cellValue + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {Array} + */ +const wrapCell = (cellValue, columnWidth, useWrapWord) => { + // First split on literal newlines + const cellLines = cellValue.split('\n'); // Then iterate over the list and word-wrap every remaining line if necessary. + + for (let lineNr = 0; lineNr < cellLines.length;) { + let lineChunks; + + if (useWrapWord) { + lineChunks = (0, _wrapWord.default)(cellLines[lineNr], columnWidth); + } else { + lineChunks = (0, _wrapString.default)(cellLines[lineNr], columnWidth); + } // Replace our original array element with whatever the wrapping returned + + + cellLines.splice(lineNr, 1, ...lineChunks); + lineNr += lineChunks.length; + } + + return cellLines; +}; + +var _default = wrapCell; +exports.default = _default; +//# sourceMappingURL=wrapCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/wrapCell.js.flow b/node_modules/table/dist/wrapCell.js.flow new file mode 100644 index 0000000..0c66260 --- /dev/null +++ b/node_modules/table/dist/wrapCell.js.flow @@ -0,0 +1,35 @@ +import wrapString from './wrapString'; +import wrapWord from './wrapWord'; + +/** + * Wrap a single cell value into a list of lines + * + * Always wraps on newlines, for the remainder uses either word or string wrapping + * depending on user configuration. + * + * @param {string} cellValue + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {Array} + */ +export default (cellValue, columnWidth, useWrapWord) => { + // First split on literal newlines + const cellLines = cellValue.split('\n'); + + // Then iterate over the list and word-wrap every remaining line if necessary. + for (let lineNr = 0; lineNr < cellLines.length;) { + let lineChunks; + + if (useWrapWord) { + lineChunks = wrapWord(cellLines[lineNr], columnWidth); + } else { + lineChunks = wrapString(cellLines[lineNr], columnWidth); + } + + // Replace our original array element with whatever the wrapping returned + cellLines.splice(lineNr, 1, ...lineChunks); + lineNr += lineChunks.length; + } + + return cellLines; +}; diff --git a/node_modules/table/dist/wrapCell.js.map b/node_modules/table/dist/wrapCell.js.map new file mode 100644 index 0000000..79b36d1 --- /dev/null +++ b/node_modules/table/dist/wrapCell.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/wrapCell.js"],"names":["cellValue","columnWidth","useWrapWord","cellLines","split","lineNr","length","lineChunks","splice"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;;;;;;kBAWgBA,S,EAAWC,W,EAAaC,W,KAAgB;AACtD;AACA,QAAMC,SAAS,GAAGH,SAAS,CAACI,KAAV,CAAgB,IAAhB,CAAlB,CAFsD,CAItD;;AACA,OAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,MAAM,GAAGF,SAAS,CAACG,MAAxC,GAAiD;AAC/C,QAAIC,UAAJ;;AAEA,QAAIL,WAAJ,EAAiB;AACfK,MAAAA,UAAU,GAAG,uBAASJ,SAAS,CAACE,MAAD,CAAlB,EAA4BJ,WAA5B,CAAb;AACD,KAFD,MAEO;AACLM,MAAAA,UAAU,GAAG,yBAAWJ,SAAS,CAACE,MAAD,CAApB,EAA8BJ,WAA9B,CAAb;AACD,KAP8C,CAS/C;;;AACAE,IAAAA,SAAS,CAACK,MAAV,CAAiBH,MAAjB,EAAyB,CAAzB,EAA4B,GAAGE,UAA/B;AACAF,IAAAA,MAAM,IAAIE,UAAU,CAACD,MAArB;AACD;;AAED,SAAOH,SAAP;AACD,C","sourcesContent":["import wrapString from './wrapString';\nimport wrapWord from './wrapWord';\n\n/**\n * Wrap a single cell value into a list of lines\n *\n * Always wraps on newlines, for the remainder uses either word or string wrapping\n * depending on user configuration.\n *\n * @param {string} cellValue\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {Array}\n */\nexport default (cellValue, columnWidth, useWrapWord) => {\n // First split on literal newlines\n const cellLines = cellValue.split('\\n');\n\n // Then iterate over the list and word-wrap every remaining line if necessary.\n for (let lineNr = 0; lineNr < cellLines.length;) {\n let lineChunks;\n\n if (useWrapWord) {\n lineChunks = wrapWord(cellLines[lineNr], columnWidth);\n } else {\n lineChunks = wrapString(cellLines[lineNr], columnWidth);\n }\n\n // Replace our original array element with whatever the wrapping returned\n cellLines.splice(lineNr, 1, ...lineChunks);\n lineNr += lineChunks.length;\n }\n\n return cellLines;\n};\n"],"file":"wrapCell.js"} \ No newline at end of file diff --git a/node_modules/table/dist/wrapString.js b/node_modules/table/dist/wrapString.js new file mode 100644 index 0000000..c0dd8c8 --- /dev/null +++ b/node_modules/table/dist/wrapString.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); + +var _stringWidth = _interopRequireDefault(require("string-width")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Creates an array of strings split into groups the length of size. + * This function works with strings that contain ASCII characters. + * + * wrapText is different from would-be "chunk" implementation + * in that whitespace characters that occur on a chunk size limit are trimmed. + * + * @param {string} subject + * @param {number} size + * @returns {Array} + */ +const wrapString = (subject, size) => { + let subjectSlice; + subjectSlice = subject; + const chunks = []; + + do { + chunks.push((0, _sliceAnsi.default)(subjectSlice, 0, size)); + subjectSlice = (0, _sliceAnsi.default)(subjectSlice, size).trim(); + } while ((0, _stringWidth.default)(subjectSlice)); + + return chunks; +}; + +var _default = wrapString; +exports.default = _default; +//# sourceMappingURL=wrapString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/wrapString.js.flow b/node_modules/table/dist/wrapString.js.flow new file mode 100644 index 0000000..bbb4072 --- /dev/null +++ b/node_modules/table/dist/wrapString.js.flow @@ -0,0 +1,29 @@ +import slice from 'slice-ansi'; +import stringWidth from 'string-width'; + +/** + * Creates an array of strings split into groups the length of size. + * This function works with strings that contain ASCII characters. + * + * wrapText is different from would-be "chunk" implementation + * in that whitespace characters that occur on a chunk size limit are trimmed. + * + * @param {string} subject + * @param {number} size + * @returns {Array} + */ +export default (subject, size) => { + let subjectSlice; + + subjectSlice = subject; + + const chunks = []; + + do { + chunks.push(slice(subjectSlice, 0, size)); + + subjectSlice = slice(subjectSlice, size).trim(); + } while (stringWidth(subjectSlice)); + + return chunks; +}; diff --git a/node_modules/table/dist/wrapString.js.map b/node_modules/table/dist/wrapString.js.map new file mode 100644 index 0000000..3d1d7b3 --- /dev/null +++ b/node_modules/table/dist/wrapString.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/wrapString.js"],"names":["subject","size","subjectSlice","chunks","push","trim"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;;;;;;oBAWgBA,O,EAASC,I,KAAS;AAChC,MAAIC,YAAJ;AAEAA,EAAAA,YAAY,GAAGF,OAAf;AAEA,QAAMG,MAAM,GAAG,EAAf;;AAEA,KAAG;AACDA,IAAAA,MAAM,CAACC,IAAP,CAAY,wBAAMF,YAAN,EAAoB,CAApB,EAAuBD,IAAvB,CAAZ;AAEAC,IAAAA,YAAY,GAAG,wBAAMA,YAAN,EAAoBD,IAApB,EAA0BI,IAA1B,EAAf;AACD,GAJD,QAIS,0BAAYH,YAAZ,CAJT;;AAMA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * Creates an array of strings split into groups the length of size.\n * This function works with strings that contain ASCII characters.\n *\n * wrapText is different from would-be \"chunk\" implementation\n * in that whitespace characters that occur on a chunk size limit are trimmed.\n *\n * @param {string} subject\n * @param {number} size\n * @returns {Array}\n */\nexport default (subject, size) => {\n let subjectSlice;\n\n subjectSlice = subject;\n\n const chunks = [];\n\n do {\n chunks.push(slice(subjectSlice, 0, size));\n\n subjectSlice = slice(subjectSlice, size).trim();\n } while (stringWidth(subjectSlice));\n\n return chunks;\n};\n"],"file":"wrapString.js"} \ No newline at end of file diff --git a/node_modules/table/dist/wrapWord.js b/node_modules/table/dist/wrapWord.js new file mode 100644 index 0000000..790b20b --- /dev/null +++ b/node_modules/table/dist/wrapWord.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); + +var _stringWidth = _interopRequireDefault(require("string-width")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {string} input + * @param {number} size + * @returns {Array} + */ +const wrapWord = (input, size) => { + let subject; + subject = input; + const chunks = []; // https://regex101.com/r/gY5kZ1/1 + + const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); + + do { + let chunk; + chunk = subject.match(re); + + if (chunk) { + chunk = chunk[0]; + subject = (0, _sliceAnsi.default)(subject, (0, _stringWidth.default)(chunk)); + chunk = chunk.trim(); + } else { + chunk = (0, _sliceAnsi.default)(subject, 0, size); + subject = (0, _sliceAnsi.default)(subject, size); + } + + chunks.push(chunk); + } while ((0, _stringWidth.default)(subject)); + + return chunks; +}; + +var _default = wrapWord; +exports.default = _default; +//# sourceMappingURL=wrapWord.js.map \ No newline at end of file diff --git a/node_modules/table/dist/wrapWord.js.flow b/node_modules/table/dist/wrapWord.js.flow new file mode 100644 index 0000000..02a8d45 --- /dev/null +++ b/node_modules/table/dist/wrapWord.js.flow @@ -0,0 +1,39 @@ +import slice from 'slice-ansi'; +import stringWidth from 'string-width'; + +/** + * @param {string} input + * @param {number} size + * @returns {Array} + */ +export default (input, size) => { + let subject; + + subject = input; + + const chunks = []; + + // https://regex101.com/r/gY5kZ1/1 + const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); + + do { + let chunk; + + chunk = subject.match(re); + + if (chunk) { + chunk = chunk[0]; + + subject = slice(subject, stringWidth(chunk)); + + chunk = chunk.trim(); + } else { + chunk = slice(subject, 0, size); + subject = slice(subject, size); + } + + chunks.push(chunk); + } while (stringWidth(subject)); + + return chunks; +}; diff --git a/node_modules/table/dist/wrapWord.js.map b/node_modules/table/dist/wrapWord.js.map new file mode 100644 index 0000000..5e7aa9c --- /dev/null +++ b/node_modules/table/dist/wrapWord.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/wrapWord.js"],"names":["input","size","subject","chunks","re","RegExp","chunk","match","trim","push"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;kBAKgBA,K,EAAOC,I,KAAS;AAC9B,MAAIC,OAAJ;AAEAA,EAAAA,OAAO,GAAGF,KAAV;AAEA,QAAMG,MAAM,GAAG,EAAf,CAL8B,CAO9B;;AACA,QAAMC,EAAE,GAAG,IAAIC,MAAJ,CAAW,WAAWJ,IAAX,GAAkB,mBAAlB,IAAyCA,IAAI,GAAG,CAAhD,IAAqD,wBAAhE,CAAX;;AAEA,KAAG;AACD,QAAIK,KAAJ;AAEAA,IAAAA,KAAK,GAAGJ,OAAO,CAACK,KAAR,CAAcH,EAAd,CAAR;;AAEA,QAAIE,KAAJ,EAAW;AACTA,MAAAA,KAAK,GAAGA,KAAK,CAAC,CAAD,CAAb;AAEAJ,MAAAA,OAAO,GAAG,wBAAMA,OAAN,EAAe,0BAAYI,KAAZ,CAAf,CAAV;AAEAA,MAAAA,KAAK,GAAGA,KAAK,CAACE,IAAN,EAAR;AACD,KAND,MAMO;AACLF,MAAAA,KAAK,GAAG,wBAAMJ,OAAN,EAAe,CAAf,EAAkBD,IAAlB,CAAR;AACAC,MAAAA,OAAO,GAAG,wBAAMA,OAAN,EAAeD,IAAf,CAAV;AACD;;AAEDE,IAAAA,MAAM,CAACM,IAAP,CAAYH,KAAZ;AACD,GAjBD,QAiBS,0BAAYJ,OAAZ,CAjBT;;AAmBA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * @param {string} input\n * @param {number} size\n * @returns {Array}\n */\nexport default (input, size) => {\n let subject;\n\n subject = input;\n\n const chunks = [];\n\n // https://regex101.com/r/gY5kZ1/1\n const re = new RegExp('(^.{1,' + size + '}(\\\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\\\\\|/|_|\\\\.|,|;|-))');\n\n do {\n let chunk;\n\n chunk = subject.match(re);\n\n if (chunk) {\n chunk = chunk[0];\n\n subject = slice(subject, stringWidth(chunk));\n\n chunk = chunk.trim();\n } else {\n chunk = slice(subject, 0, size);\n subject = slice(subject, size);\n }\n\n chunks.push(chunk);\n } while (stringWidth(subject));\n\n return chunks;\n};\n"],"file":"wrapWord.js"} \ No newline at end of file diff --git a/node_modules/table/package.json b/node_modules/table/package.json new file mode 100644 index 0000000..4c35eaa --- /dev/null +++ b/node_modules/table/package.json @@ -0,0 +1,113 @@ +{ + "_from": "table@^5.2.3", + "_id": "table@5.4.6", + "_inBundle": false, + "_integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "_location": "/table", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "table@^5.2.3", + "name": "table", + "escapedName": "table", + "rawSpec": "^5.2.3", + "saveSpec": null, + "fetchSpec": "^5.2.3" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "_shasum": "1292d19500ce3f86053b05f0e8e7e4a3bb21079e", + "_spec": "table@^5.2.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Gajus Kuizinas", + "email": "gajus@gajus.com", + "url": "http://gajus.com" + }, + "bugs": { + "url": "https://github.com/gajus/table/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "deprecated": false, + "description": "Formats data into a string table.", + "devDependencies": { + "@babel/cli": "^7.5.0", + "@babel/core": "^7.5.4", + "@babel/node": "^7.5.0", + "@babel/plugin-transform-flow-strip-types": "^7.4.4", + "@babel/preset-env": "^7.5.4", + "@babel/register": "^7.4.4", + "ajv-cli": "^3.0.0", + "ajv-keywords": "^3.4.1", + "babel-plugin-istanbul": "^5.1.4", + "babel-plugin-lodash": "^3.3.4", + "babel-plugin-transform-export-default-name": "^2.0.4", + "chai": "^4.2.0", + "chalk": "^2.4.2", + "coveralls": "^3.0.5", + "eslint": "^5.13.0", + "eslint-config-canonical": "^16.1.0", + "flow-bin": "^0.102.0", + "flow-copy-source": "^2.0.7", + "gitdown": "^3.1.1", + "husky": "^3.0.0", + "mocha": "^6.1.4", + "nyc": "^14.1.1", + "semantic-release": "^15.13.18", + "sinon": "^7.3.2" + }, + "engines": { + "node": ">=6.0.0" + }, + "homepage": "https://github.com/gajus/table#readme", + "husky": { + "hooks": { + "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", + "pre-commit": "npm run lint && npm run test && npm run build" + } + }, + "keywords": [ + "ascii", + "text", + "table", + "align", + "ansi" + ], + "license": "BSD-3-Clause", + "main": "./dist/index.js", + "name": "table", + "nyc": { + "include": [ + "src/**/*.js" + ], + "instrument": false, + "reporter": [ + "text-lcov" + ], + "require": [ + "@babel/register" + ], + "sourceMap": false + }, + "repository": { + "type": "git", + "url": "git+https://github.com/gajus/table.git" + }, + "scripts": { + "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && npm run create-validators && flow-copy-source src dist", + "create-readme": "gitdown ./.README/README.md --output-file ./README.md", + "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -c ajv-keywords/keywords/typeof -o dist/validateConfig.js && ajv compile --all-errors --inline-refs=false -s src/schemas/streamConfig -c ajv-keywords/keywords/typeof -o dist/validateStreamConfig.js", + "lint": "npm run build && eslint ./src ./test && flow", + "test": "mocha --require @babel/register" + }, + "version": "5.4.6" +} diff --git a/node_modules/text-table/.travis.yml b/node_modules/text-table/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/node_modules/text-table/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/text-table/LICENSE b/node_modules/text-table/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/node_modules/text-table/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/node_modules/text-table/example/align.js b/node_modules/text-table/example/align.js new file mode 100644 index 0000000..9be4309 --- /dev/null +++ b/node_modules/text-table/example/align.js @@ -0,0 +1,8 @@ +var table = require('../'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '33450' ], + [ 'foo', '1006' ], + [ 'bar', '45' ] +], { align: [ 'l', 'r' ] }); +console.log(t); diff --git a/node_modules/text-table/example/center.js b/node_modules/text-table/example/center.js new file mode 100644 index 0000000..52b1c69 --- /dev/null +++ b/node_modules/text-table/example/center.js @@ -0,0 +1,8 @@ +var table = require('../'); +var t = table([ + [ 'beep', '1024', 'xyz' ], + [ 'boop', '3388450', 'tuv' ], + [ 'foo', '10106', 'qrstuv' ], + [ 'bar', '45', 'lmno' ] +], { align: [ 'l', 'c', 'l' ] }); +console.log(t); diff --git a/node_modules/text-table/example/dotalign.js b/node_modules/text-table/example/dotalign.js new file mode 100644 index 0000000..2cea629 --- /dev/null +++ b/node_modules/text-table/example/dotalign.js @@ -0,0 +1,9 @@ +var table = require('../'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '334.212' ], + [ 'foo', '1006' ], + [ 'bar', '45.6' ], + [ 'baz', '123.' ] +], { align: [ 'l', '.' ] }); +console.log(t); diff --git a/node_modules/text-table/example/doubledot.js b/node_modules/text-table/example/doubledot.js new file mode 100644 index 0000000..bab983b --- /dev/null +++ b/node_modules/text-table/example/doubledot.js @@ -0,0 +1,11 @@ +var table = require('../'); +var t = table([ + [ '0.1.2' ], + [ '11.22.33' ], + [ '5.6.7' ], + [ '1.22222' ], + [ '12345.' ], + [ '5555.' ], + [ '123' ] +], { align: [ '.' ] }); +console.log(t); diff --git a/node_modules/text-table/example/table.js b/node_modules/text-table/example/table.js new file mode 100644 index 0000000..903ea4c --- /dev/null +++ b/node_modules/text-table/example/table.js @@ -0,0 +1,6 @@ +var table = require('../'); +var t = table([ + [ 'master', '0123456789abcdef' ], + [ 'staging', 'fedcba9876543210' ] +]); +console.log(t); diff --git a/node_modules/text-table/index.js b/node_modules/text-table/index.js new file mode 100644 index 0000000..5c0ba98 --- /dev/null +++ b/node_modules/text-table/index.js @@ -0,0 +1,86 @@ +module.exports = function (rows_, opts) { + if (!opts) opts = {}; + var hsep = opts.hsep === undefined ? ' ' : opts.hsep; + var align = opts.align || []; + var stringLength = opts.stringLength + || function (s) { return String(s).length; } + ; + + var dotsizes = reduce(rows_, function (acc, row) { + forEach(row, function (c, ix) { + var n = dotindex(c); + if (!acc[ix] || n > acc[ix]) acc[ix] = n; + }); + return acc; + }, []); + + var rows = map(rows_, function (row) { + return map(row, function (c_, ix) { + var c = String(c_); + if (align[ix] === '.') { + var index = dotindex(c); + var size = dotsizes[ix] + (/\./.test(c) ? 1 : 2) + - (stringLength(c) - index) + ; + return c + Array(size).join(' '); + } + else return c; + }); + }); + + var sizes = reduce(rows, function (acc, row) { + forEach(row, function (c, ix) { + var n = stringLength(c); + if (!acc[ix] || n > acc[ix]) acc[ix] = n; + }); + return acc; + }, []); + + return map(rows, function (row) { + return map(row, function (c, ix) { + var n = (sizes[ix] - stringLength(c)) || 0; + var s = Array(Math.max(n + 1, 1)).join(' '); + if (align[ix] === 'r' || align[ix] === '.') { + return s + c; + } + if (align[ix] === 'c') { + return Array(Math.ceil(n / 2 + 1)).join(' ') + + c + Array(Math.floor(n / 2 + 1)).join(' ') + ; + } + + return c + s; + }).join(hsep).replace(/\s+$/, ''); + }).join('\n'); +}; + +function dotindex (c) { + var m = /\.[^.]*$/.exec(c); + return m ? m.index + 1 : c.length; +} + +function reduce (xs, f, init) { + if (xs.reduce) return xs.reduce(f, init); + var i = 0; + var acc = arguments.length >= 3 ? init : xs[i++]; + for (; i < xs.length; i++) { + f(acc, xs[i], i); + } + return acc; +} + +function forEach (xs, f) { + if (xs.forEach) return xs.forEach(f); + for (var i = 0; i < xs.length; i++) { + f.call(xs, xs[i], i); + } +} + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f.call(xs, xs[i], i)); + } + return res; +} diff --git a/node_modules/text-table/package.json b/node_modules/text-table/package.json new file mode 100644 index 0000000..de22162 --- /dev/null +++ b/node_modules/text-table/package.json @@ -0,0 +1,73 @@ +{ + "_from": "text-table@^0.2.0", + "_id": "text-table@0.2.0", + "_inBundle": false, + "_integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "_location": "/text-table", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "text-table@^0.2.0", + "name": "text-table", + "escapedName": "text-table", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", + "_spec": "text-table@^0.2.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/text-table/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "borderless text tables with alignment", + "devDependencies": { + "cli-color": "~0.2.3", + "tap": "~0.4.0", + "tape": "~1.0.2" + }, + "homepage": "https://github.com/substack/text-table", + "keywords": [ + "text", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "license": "MIT", + "main": "index.js", + "name": "text-table", + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "version": "0.2.0" +} diff --git a/node_modules/text-table/readme.markdown b/node_modules/text-table/readme.markdown new file mode 100644 index 0000000..18806ac --- /dev/null +++ b/node_modules/text-table/readme.markdown @@ -0,0 +1,134 @@ +# text-table + +generate borderless text table strings suitable for printing to stdout + +[![build status](https://secure.travis-ci.org/substack/text-table.png)](http://travis-ci.org/substack/text-table) + +[![browser support](https://ci.testling.com/substack/text-table.png)](http://ci.testling.com/substack/text-table) + +# example + +## default align + +``` js +var table = require('text-table'); +var t = table([ + [ 'master', '0123456789abcdef' ], + [ 'staging', 'fedcba9876543210' ] +]); +console.log(t); +``` + +``` +master 0123456789abcdef +staging fedcba9876543210 +``` + +## left-right align + +``` js +var table = require('text-table'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '33450' ], + [ 'foo', '1006' ], + [ 'bar', '45' ] +], { align: [ 'l', 'r' ] }); +console.log(t); +``` + +``` +beep 1024 +boop 33450 +foo 1006 +bar 45 +``` + +## dotted align + +``` js +var table = require('text-table'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '334.212' ], + [ 'foo', '1006' ], + [ 'bar', '45.6' ], + [ 'baz', '123.' ] +], { align: [ 'l', '.' ] }); +console.log(t); +``` + +``` +beep 1024 +boop 334.212 +foo 1006 +bar 45.6 +baz 123. +``` + +## centered + +``` js +var table = require('text-table'); +var t = table([ + [ 'beep', '1024', 'xyz' ], + [ 'boop', '3388450', 'tuv' ], + [ 'foo', '10106', 'qrstuv' ], + [ 'bar', '45', 'lmno' ] +], { align: [ 'l', 'c', 'l' ] }); +console.log(t); +``` + +``` +beep 1024 xyz +boop 3388450 tuv +foo 10106 qrstuv +bar 45 lmno +``` + +# methods + +``` js +var table = require('text-table') +``` + +## var s = table(rows, opts={}) + +Return a formatted table string `s` from an array of `rows` and some options +`opts`. + +`rows` should be an array of arrays containing strings, numbers, or other +printable values. + +options can be: + +* `opts.hsep` - separator to use between columns, default `' '` +* `opts.align` - array of alignment types for each column, default `['l','l',...]` +* `opts.stringLength` - callback function to use when calculating the string length + +alignment types are: + +* `'l'` - left +* `'r'` - right +* `'c'` - center +* `'.'` - decimal + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install text-table +``` + +# Use with ANSI-colors + +Since the string length of ANSI color schemes does not equal the length +JavaScript sees internally it is necessary to pass the a custom string length +calculator during the main function call. + +See the `test/ansi-colors.js` file for an example. + +# license + +MIT diff --git a/node_modules/text-table/test/align.js b/node_modules/text-table/test/align.js new file mode 100644 index 0000000..245357f --- /dev/null +++ b/node_modules/text-table/test/align.js @@ -0,0 +1,18 @@ +var test = require('tape'); +var table = require('../'); + +test('align', function (t) { + t.plan(1); + var s = table([ + [ 'beep', '1024' ], + [ 'boop', '33450' ], + [ 'foo', '1006' ], + [ 'bar', '45' ] + ], { align: [ 'l', 'r' ] }); + t.equal(s, [ + 'beep 1024', + 'boop 33450', + 'foo 1006', + 'bar 45' + ].join('\n')); +}); diff --git a/node_modules/text-table/test/ansi-colors.js b/node_modules/text-table/test/ansi-colors.js new file mode 100644 index 0000000..fbc5bb1 --- /dev/null +++ b/node_modules/text-table/test/ansi-colors.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var table = require('../'); +var color = require('cli-color'); +var ansiTrim = require('cli-color/lib/trim'); + +test('center', function (t) { + t.plan(1); + var opts = { + align: [ 'l', 'c', 'l' ], + stringLength: function(s) { return ansiTrim(s).length } + }; + var s = table([ + [ + color.red('Red'), color.green('Green'), color.blue('Blue') + ], + [ + color.bold('Bold'), color.underline('Underline'), + color.italic('Italic') + ], + [ + color.inverse('Inverse'), color.strike('Strike'), + color.blink('Blink') + ], + [ 'bar', '45', 'lmno' ] + ], opts); + t.equal(ansiTrim(s), [ + 'Red Green Blue', + 'Bold Underline Italic', + 'Inverse Strike Blink', + 'bar 45 lmno' + ].join('\n')); +}); diff --git a/node_modules/text-table/test/center.js b/node_modules/text-table/test/center.js new file mode 100644 index 0000000..c2c7a62 --- /dev/null +++ b/node_modules/text-table/test/center.js @@ -0,0 +1,18 @@ +var test = require('tape'); +var table = require('../'); + +test('center', function (t) { + t.plan(1); + var s = table([ + [ 'beep', '1024', 'xyz' ], + [ 'boop', '3388450', 'tuv' ], + [ 'foo', '10106', 'qrstuv' ], + [ 'bar', '45', 'lmno' ] + ], { align: [ 'l', 'c', 'l' ] }); + t.equal(s, [ + 'beep 1024 xyz', + 'boop 3388450 tuv', + 'foo 10106 qrstuv', + 'bar 45 lmno' + ].join('\n')); +}); diff --git a/node_modules/text-table/test/dotalign.js b/node_modules/text-table/test/dotalign.js new file mode 100644 index 0000000..f804f92 --- /dev/null +++ b/node_modules/text-table/test/dotalign.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var table = require('../'); + +test('dot align', function (t) { + t.plan(1); + var s = table([ + [ 'beep', '1024' ], + [ 'boop', '334.212' ], + [ 'foo', '1006' ], + [ 'bar', '45.6' ], + [ 'baz', '123.' ] + ], { align: [ 'l', '.' ] }); + t.equal(s, [ + 'beep 1024', + 'boop 334.212', + 'foo 1006', + 'bar 45.6', + 'baz 123.' + ].join('\n')); +}); diff --git a/node_modules/text-table/test/doubledot.js b/node_modules/text-table/test/doubledot.js new file mode 100644 index 0000000..659b57c --- /dev/null +++ b/node_modules/text-table/test/doubledot.js @@ -0,0 +1,24 @@ +var test = require('tape'); +var table = require('../'); + +test('dot align', function (t) { + t.plan(1); + var s = table([ + [ '0.1.2' ], + [ '11.22.33' ], + [ '5.6.7' ], + [ '1.22222' ], + [ '12345.' ], + [ '5555.' ], + [ '123' ] + ], { align: [ '.' ] }); + t.equal(s, [ + ' 0.1.2', + '11.22.33', + ' 5.6.7', + ' 1.22222', + '12345.', + ' 5555.', + ' 123' + ].join('\n')); +}); diff --git a/node_modules/text-table/test/table.js b/node_modules/text-table/test/table.js new file mode 100644 index 0000000..9c67014 --- /dev/null +++ b/node_modules/text-table/test/table.js @@ -0,0 +1,14 @@ +var test = require('tape'); +var table = require('../'); + +test('table', function (t) { + t.plan(1); + var s = table([ + [ 'master', '0123456789abcdef' ], + [ 'staging', 'fedcba9876543210' ] + ]); + t.equal(s, [ + 'master 0123456789abcdef', + 'staging fedcba9876543210' + ].join('\n')); +}); diff --git a/node_modules/tsconfig-paths/.nycrc.json b/node_modules/tsconfig-paths/.nycrc.json new file mode 100644 index 0000000..08e0ea0 --- /dev/null +++ b/node_modules/tsconfig-paths/.nycrc.json @@ -0,0 +1,8 @@ +{ + "include": ["src/**/*.{ts,tsx}"], + "exclude": ["src/register.ts"], + "extension": [".ts", ".tsx"], + "reporter": ["json"], + "sourceMap": true, + "all": true +} diff --git a/node_modules/tsconfig-paths/CHANGELOG.md b/node_modules/tsconfig-paths/CHANGELOG.md new file mode 100644 index 0000000..03bdc18 --- /dev/null +++ b/node_modules/tsconfig-paths/CHANGELOG.md @@ -0,0 +1,307 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] + +## [3.8.0] - 2019-02-05 + +### Added + +- Add option to avoid adding a match-all rule. See PR [#73](https://github.com/dividab/tsconfig-paths/pull/73) and issue [72](https://github.com/dividab/tsconfig-paths/issues/72). Thanks to [@Swatinem](https://github.com/Swatinem) for this addition! + +## [3.7.0] - 2018-11-11 + +### Added + +- Allow cleanup of register(). See PR [#64](https://github.com/dividab/tsconfig-paths/pull/64) and issue [63](https://github.com/dividab/tsconfig-paths/issues/63). Thanks to [@TylorS](https://github.com/TylorS) for this addition! + +## [3.6.0] - 2018-09-10 + +### Added + +- Prefer Node's core modules over file modules. See PR [#60](https://github.com/dividab/tsconfig-paths/pull/60) and issue [56](https://github.com/dividab/tsconfig-paths/issues/56). Thanks to @ljani for this addition! + +## [3.5.0] - 2018-07-28 + +### Added + +- Add support for trailing commas in tsconfig.json (use JSON5 to parse). See issue [#48](https://github.com/dividab/tsconfig-paths/issues/48), and PR [#58](https://github.com/dividab/tsconfig-paths/pull/58). Thanks to [@jshado1](https://github.com/jshado1) for this addition! + +## [3.4.2] - 2018-06-30 + +### Fixed + +- Do not resolve directories, only files, sse issue [#51](https://github.com/dividab/tsconfig-paths/issues/51). + +## [3.4.1] - 2018-06-24 + +### Fixed + +- Ignore field name mappings in package.json files that are not paths of existing files [#46](https://github.com/dividab/tsconfig-paths/pull/45). Thanks to [@christoffer](https://github.com/christoffer) for this fix! + +## [3.4.0] - 2018-06-12 + +### Added + +- Add support for providing a list of field names to try instead of just using "main", [#45](https://github.com/dividab/tsconfig-paths/pull/45). Thanks to [@christoffer-dropbox](https://github.com/christoffer-dropbox) for this addition! + +## [3.3.2] - 2018-05-07 + +### Fixed + +- Adding json file extention to extends property, [#40](https://github.com/dividab/tsconfig-paths/pull/40). Thanks to [@cwhite-connectfirst](https://github.com/cwhite-connectfirst) for this fixing this! + +## [3.3.1] - 2018-04-17 + +### Fixed + +- Fix project undefined error when calling register, [#37](https://github.com/dividab/tsconfig-paths/issues/37). Thanks to [@natedanner](https://github.com/natedanner) for this fixing this! + +## [3.3.0] - 2018-04-14 + +### Added + +- Add possibility to indicate explicitly tsconfig location, [#35](https://github.com/dividab/tsconfig-paths/issues/35). Thanks to [@procopenco](https://github.com/procopenco) for this adding this! + +## [3.2.0] - 2018-03-31 + +### Added + +- Added support for passing a filename as cwd, see issue [#31](https://github.com/dividab/tsconfig-paths/issues/31) and PR [#32](https://github.com/dividab/tsconfig-paths/pull/32). Thanks to [@amodm](https://github.com/amodm) for this adding this! + +## [3.1.3] - 2018-03-14 + +### Fixed + +- Fix async recursion, see [#30](https://github.com/dividab/tsconfig-paths/pull/30). Thanks to [@Nayni](https://github.com/Nayni) for this fix! + +## [3.1.2] - 2018-03-13 + +### Fixed + +- Fix a forgotten return when doneCallback is invoked, see [#29](https://github.com/dividab/tsconfig-paths/pull/29). Thanks to [@Nayni](https://github.com/Nayni) for this fix! + +## [3.1.1] - 2018-01-13 + +### Fixed + +- Fix read json async when it does not exist + +## [3.1.0] - 2018-01-13 + +### Added + +- Implement default async json reader function. + +## [3.0.0] - 2018-01-13 + +### Changed + +- Remove parameter `absoluteSourceFileName` from the `MatchPath` and `matchFromAbsolutePaths` functions. It was not used internally. +- `matchFromAbsolutePaths` now accepts a pre-sorted array of `MappingEntry`s instead of a dictionary. This was done so the sorting could be done once which should give better performance. + +### Added + +- `createMatchPathAsync`, creates an async version of the `MatchPath` function. Can be used for example by webpack plugins. +- `matchFromAbsolutePathsAsync`, async version of `matchFromAbsolutePaths`. + +## [2.7.3] + +### Fixed + +- Only resolve path if tsconfig present [#25](https://github.com/dividab/tsconfig-paths/pull/25). Thanks to @nicoschoenmaker for the PR. + +## [2.7.2] + +### Fixed + +- Return absolute path to tsconfig.json. + +## [2.7.1] + +### Fixed + +- Remove left over console.log. + +## [2.7.0] + +### Added + +- Support `baseUrl` to exist in base tsconfig.json when using `extends`, see [#23](https://github.com/dividab/tsconfig-paths/issues/23). + +## [2.6.0] + +### Added + +- Add `baseUrl` and `configFileAbsolutePath` to the result of `loadConfig`. + +## [2.5.0] + +### Added + +- New function in Programmatic API `loadConfig`. + +## [2.4.3] + +### Fixed + +- Export MatchPth typing. + +## [2.4.2] + +### Fixed + +- Add missing types field in package.json. + +## [2.4.1] + +### Fixed + +- Include declaration files. Fixes [#22](https://github.com/dividab/tsconfig-paths/issues/22). + +## [2.4.0] + +### Changed + +- Removed dependency for package `tsconfig`. + +### Fixed + +- Support for config inheritance with `extends`. Fixes [#17](https://github.com/dividab/tsconfig-paths/issues/17). + +## [2.2.0] + +### Fixed + +- Fixed issue [#7](https://github.com/dividab/tsconfig-paths/issues/7). + +## [2.1.2] + +### Fixed + +- Fixed issue [#6](https://github.com/dividab/tsconfig-paths/issues/6). + +## [2.1.1] + +### Fixed + +- Fixed issue [#4](https://github.com/dividab/tsconfig-paths/issues/4) + +## [2.1.0] + +### Fixed + +- Fixed issue [#3](https://github.com/dividab/tsconfig-paths/issues/3) + +## [2.0.0] + +### Added + +- We now look at `process.env.TS_NODE_PROJECT` +- Functionality to bootstrap tsconfig-paths. Documentation in [README](https://github.com/dividab/tsconfig-paths/blob/master/README.md) + +### Changed + +- Changed signature for `createMatchPath`. Now only takes absoluteUrl and paths. + +## [1.1.0] + +### Added + +- More explanation to readme. +- Match all extensions in require.extensions. +- Match longest pattern prefix first as typesript does. +- Match file in main field of package.json. +- Check for index files explicitly. + +## [1.0.0] - 2016-12-30 + +- First stable release. + +## [0.4.0] - 2016-12-30 + +### Changed + +- Renamed project to `tsocnfig-paths`. + +## [0.3.0] - 2016-12-30 + +### Added + +- API documentation. +- `createMatchPath` function. +- `matchFromAbsolutePaths` function. + +### Removed + +- `findPath` function. + +## [0.2.1] - 2016-12-29 + +### Fixed + +- `tsconfig-paths/register` was not available. + +## [0.2.0] - 2016-12-29 + +### Fixed + +- Paths for files in sub-dirs. + +### Added + +- Programmatic use. + +## [0.1.2] - 2016-12-28 + +### Fixed + +- Fixed wrong name of the package in README. +- Add missing files on publish. + +## [0.1.1] - 2016-12-28 + +### Added + +- Loading of tsconfig. +- Example. +- Publish scripts. + +## [0.1.0] - 2016-12-28 + +- Initial version. + +[unreleased]: https://github.com/dividab/tsconfig-paths/compare/3.8.0...master +[3.8.0]: https://github.com/dividab/tsconfig-paths/compare/3.7.0...3.8.0 +[3.7.0]: https://github.com/dividab/tsconfig-paths/compare/3.6.0...3.7.0 +[3.6.0]: https://github.com/dividab/tsconfig-paths/compare/3.5.0...3.6.0 +[3.5.0]: https://github.com/dividab/tsconfig-paths/compare/3.4.2...3.5.0 +[3.4.2]: https://github.com/dividab/tsconfig-paths/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/dividab/tsconfig-paths/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/dividab/tsconfig-paths/compare/3.3.2...3.4.0 +[3.3.2]: https://github.com/dividab/tsconfig-paths/compare/3.3.1...3.3.2 +[3.3.1]: https://github.com/dividab/tsconfig-paths/compare/3.3.0...3.3.1 +[3.3.0]: https://github.com/dividab/tsconfig-paths/compare/3.2.0...3.3.0 +[3.2.0]: https://github.com/dividab/tsconfig-paths/compare/3.1.3...3.2.0 +[3.1.3]: https://github.com/dividab/tsconfig-paths/compare/3.1.2...3.1.3 +[3.1.2]: https://github.com/dividab/tsconfig-paths/compare/3.1.1...3.1.2 +[3.1.1]: https://github.com/dividab/tsconfig-paths/compare/3.1.0...3.1.1 +[3.1.0]: https://github.com/dividab/tsconfig-paths/compare/3.0.0...3.1.0 +[3.0.0]: https://github.com/dividab/tsconfig-paths/compare/2.7.3...3.0.0 +[2.7.3]: https://github.com/dividab/tsconfig-paths/compare/2.7.2...2.7.3 +[2.7.2]: https://github.com/dividab/tsconfig-paths/compare/2.7.1...2.7.2 +[2.7.1]: https://github.com/dividab/tsconfig-paths/compare/2.7.0...2.7.1 +[2.7.0]: https://github.com/dividab/tsconfig-paths/compare/2.6.0...2.7.0 +[2.6.0]: https://github.com/dividab/tsconfig-paths/compare/2.5.0...2.6.0 +[2.5.0]: https://github.com/dividab/tsconfig-paths/compare/2.4.3...2.5.0 +[2.4.3]: https://github.com/dividab/tsconfig-paths/compare/2.4.2...2.4.3 +[2.4.2]: https://github.com/dividab/tsconfig-paths/compare/2.4.1...2.4.2 +[2.4.1]: https://github.com/dividab/tsconfig-paths/compare/2.4.0...2.4.1 +[2.4.0]: https://github.com/dividab/tsconfig-paths/compare/2.2.0...2.4.0 +[2.2.0]: https://github.com/dividab/tsconfig-paths/compare/2.1.2...2.2.0 +[2.1.2]: https://github.com/dividab/tsconfig-paths/compare/2.1.1...2.1.2 +[2.1.1]: https://github.com/dividab/tsconfig-paths/compare/2.1.0...2.1.1 diff --git a/node_modules/tsconfig-paths/LICENSE b/node_modules/tsconfig-paths/LICENSE new file mode 100644 index 0000000..884c7e3 --- /dev/null +++ b/node_modules/tsconfig-paths/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Jonas Kello + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/tsconfig-paths/README.md b/node_modules/tsconfig-paths/README.md new file mode 100644 index 0000000..491e637 --- /dev/null +++ b/node_modules/tsconfig-paths/README.md @@ -0,0 +1,231 @@ +# tsconfig-paths + +[![npm version][version-image]][version-url] +[![travis build][travis-image]][travis-url] +[![Coverage Status][codecov-image]][codecov-url] +[![MIT license][license-image]][license-url] +[![code style: prettier][prettier-image]][prettier-url] + +Use this to load modules whose location is specified in the `paths` section of `tsconfig.json`. Both loading at run-time and via API are supported. + +Typescript by default mimics the Node.js runtime resolution strategy of modules. But it also allows the use of [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html) which allows arbitrary module paths (that doesn't start with "/" or ".") to be specified and mapped to physical paths in the filesystem. The typescript compiler can resolve these paths from `tsconfig` so it will compile OK. But if you then try to execute the compiled files with node (or ts-node), it will only look in the `node_modules` folders all the way up to the root of the filesystem and thus will not find the modules specified by `paths` in `tsconfig`. + +If you require this package's `tsconfig-paths/register` module it will read the `paths` from `tsconfig.json` and convert node's module loading calls into to physcial file paths that node can load. + +## How to install + +``` +yarn add --dev tsconfig-paths +``` + +or + +``` +npm install --save-dev tsconfig-paths +``` + +## How to use + +### With node + +`node -r tsconfig-paths/register main.js` + +### With ts-node + +`ts-node -r tsconfig-paths/register main.ts` + +If `process.env.TS_NODE_PROJECT` is set it will be used to resolved tsconfig.json + +### With webpack + +For webpack please use the [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin). + +### With mocha and ts-node + +As of Mocha >= 4.0.0 the `--compiler` was [deprecated](https://github.com/mochajs/mocha/wiki/compilers-deprecation). Instead `--require` should be used. You also have to specify a glob that includes `.ts` files because mocha looks after files with `.js` extension by default. + +```bash +mocha -r ts-node/register -r tsconfig-paths/register "test/**/*.ts" +``` + +### With other commands + +As long as the command has something similar to a `--require` option that can load a module before it starts, tsconfig-paths should be able to work with it. + +## Bootstraping with explicit params + +If you want more granular control over tsconfig-paths you can bootstrap it. This can be useful if you for instance have compiled with `tsc` to another directory where `tsconfig.json` doesn't exists. + +```javascript +const tsConfig = require("./tsconfig.json"); +const tsConfigPaths = require("tsconfig-paths"); + +const baseUrl = "./"; // Either absolute or relative path. If relative it's resolved to current working directory. +const cleanup = tsConfigPaths.register({ + baseUrl, + paths: tsConfig.compilerOptions.paths +}); + +// When path registration is no longer needed +cleanup(); +``` + +Then run with: + +`node -r ./tsconfig-paths-bootstrap.js main.js` + +## Configuration Options + +You can set options by passing them before the script path, via programmatic usage or via environment variables. + +```bash +ts-node --project customLocation/tsconfig.json -r tsconfig-paths/register "test/**/*.ts" +``` + +### CLI and Programmatic Options + +_Environment variable denoted in parentheses._ + +- `-P, --project [path]` Path to TypeScript JSON project file (`TS_NODE_PROJECT`) + +## Config loading process + +1. Use explicit params passed to register +2. Use `process.env.TS_NODE_PROJECT` to resolve tsConfig.json and the specified baseUrl and paths. +3. Resolves tsconfig.json from current working directory and the specified baseUrl and paths. + +## Programmatic use + +The public API consists of these functions: + +- [register](#register) +- [loadConfig](#loadConfig) +- [createMatchPath](#createMatchPath) / [createMatchPathAsync](#createMatchPathAsync) +- [matchFromAbsolutePaths](#matchFromAbsolutePaths) / [matchFromAbsolutePathsAsync](#matchFromAbsolutePathsAsync) + +### register + +```typescript +export interface ExplicitParams { + baseUrl: string; + paths: { [key: string]: Array }; + mainFields?: Array; + addMatchAll?: boolean; +} + +/** + * Installs a custom module load function that can adhere to paths in tsconfig. + */ +export function register(explicitParams: ExplicitParams): () => void; +``` + +This function will patch the node's module loading so it will look for modules in paths specified by tsconfig.json. +A function is returned for you to reinstate Node's original module loading. + +### loadConfig + +```typescript +export function loadConfig(cwd: string = process.cwd()): ConfigLoaderResult; + +export type ConfigLoaderResult = + | ConfigLoaderSuccessResult + | ConfigLoaderFailResult; + +export interface ConfigLoaderSuccessResult { + resultType: "success"; + absoluteBaseUrl: string; + paths: { [key: string]: Array }; +} + +export interface ConfigLoaderFailResult { + resultType: "failed"; + message: string; +} +``` + +This function loads the tsconfig.json. It will start searching from the specified `cwd` directory. Passing the tsconfig.json file directly instead of a directory also works. + +### createMatchPath + +```typescript +/** + * Function that can match a path + */ +export interface MatchPath { + ( + requestedModule: string, + readJson?: Filesystem.ReadJsonSync, + fileExists?: (name: string) => boolean, + extensions?: ReadonlyArray + ): string | undefined; +} + +/** + * Creates a function that can resolve paths according to tsconfig paths property. + * @param absoluteBaseUrl Absolute version of baseUrl as specified in tsconfig. + * @param paths The paths as specified in tsconfig. + * @param mainFields A list of package.json field names to try when resolving module files. + * @param addMatchAll Add a match-all "*" rule if none is present + * @returns a function that can resolve paths. + */ +export function createMatchPath( + absoluteBaseUrl: string, + paths: { [key: string]: Array }, + mainFields: string[] = ["main"], + addMatchAll: boolean = true +): MatchPath { +``` + +The `createMatchPath` function will create a function that can match paths. It accepts `baseUrl` and `paths` directly as they are specified in tsconfig and will handle resolving paths to absolute form. The created function has the signare specified by the type `MatchPath` above. + +### matchFromAbsolutePaths + +```typescript +/** + * Finds a path from tsconfig that matches a module load request. + * @param absolutePathMappings The paths to try as specified in tsconfig but resolved to absolute form. + * @param requestedModule The required module name. + * @param readJson Function that can read json from a path (useful for testing). + * @param fileExists Function that checks for existance of a file at a path (useful for testing). + * @param extensions File extensions to probe for (useful for testing). + * @param mainFields A list of package.json field names to try when resolving module files. + * @returns the found path, or undefined if no path was found. + */ +export function matchFromAbsolutePaths( + absolutePathMappings: ReadonlyArray, + requestedModule: string, + readJson: Filesystem.ReadJsonSync = Filesystem.readJsonFromDiskSync, + fileExists: Filesystem.FileExistsSync = Filesystem.fileExistsSync, + extensions: Array = Object.keys(require.extensions), + mainFields: string[] = ["main"] +): string | undefined { +``` + +This function is lower level and requries that the paths as already been resolved to absolute form and sorted in correct order into an array. + +### createMatchPathAsync + +This is the async version of `createMatchPath`. It has the same signature but with a callback parameter for the result. + +### matchFromAbsolutePathsAsync + +This is the async version of `matchFromAbsolutePaths`. It has the same signature but with a callback parameter for the result. + +## How to publish + +``` +yarn version --patch +yarn version --minor +yarn version --major +``` + +[version-image]: https://img.shields.io/npm/v/tsconfig-paths.svg?style=flat +[version-url]: https://www.npmjs.com/package/tsconfig-paths +[travis-image]: https://travis-ci.com/dividab/tsconfig-paths.svg?branch=master&style=flat +[travis-url]: https://travis-ci.com/dividab/tsconfig-paths +[codecov-image]: https://codecov.io/gh/dividab/tsconfig-paths/branch/master/graph/badge.svg +[codecov-url]: https://codecov.io/gh/dividab/tsconfig-paths +[license-image]: https://img.shields.io/github/license/dividab/tsconfig-paths.svg?style=flat +[license-url]: https://opensource.org/licenses/MIT +[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg +[prettier-url]: https://github.com/prettier/prettier diff --git a/node_modules/tsconfig-paths/lib/config-loader.d.ts b/node_modules/tsconfig-paths/lib/config-loader.d.ts new file mode 100644 index 0000000..537ac22 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/config-loader.d.ts @@ -0,0 +1,33 @@ +import * as TsConfigLoader from "./tsconfig-loader"; +export interface ExplicitParams { + baseUrl: string; + paths: { + [key: string]: Array; + }; + mainFields?: Array; + addMatchAll?: boolean; +} +export declare type TsConfigLoader = (params: TsConfigLoader.TsConfigLoaderParams) => TsConfigLoader.TsConfigLoaderResult; +export interface ConfigLoaderParams { + cwd: string; + explicitParams?: ExplicitParams; + tsConfigLoader?: TsConfigLoader; +} +export interface ConfigLoaderSuccessResult { + resultType: "success"; + configFileAbsolutePath: string; + baseUrl: string; + absoluteBaseUrl: string; + paths: { + [key: string]: Array; + }; + mainFields?: Array; + addMatchAll?: boolean; +} +export interface ConfigLoaderFailResult { + resultType: "failed"; + message: string; +} +export declare type ConfigLoaderResult = ConfigLoaderSuccessResult | ConfigLoaderFailResult; +export declare function loadConfig(cwd?: string): ConfigLoaderResult; +export declare function configLoader({ cwd, explicitParams, tsConfigLoader }: ConfigLoaderParams): ConfigLoaderResult; diff --git a/node_modules/tsconfig-paths/lib/config-loader.js b/node_modules/tsconfig-paths/lib/config-loader.js new file mode 100644 index 0000000..aa145b6 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/config-loader.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var TsConfigLoader = require("./tsconfig-loader"); +var path = require("path"); +var options_1 = require("./options"); +function loadConfig(cwd) { + if (cwd === void 0) { cwd = options_1.options.cwd; } + return configLoader({ cwd: cwd }); +} +exports.loadConfig = loadConfig; +function configLoader(_a) { + var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader.tsConfigLoader : _b; + if (explicitParams) { + // tslint:disable-next-line:no-shadowed-variable + var absoluteBaseUrl_1 = path.isAbsolute(explicitParams.baseUrl) + ? explicitParams.baseUrl + : path.join(cwd, explicitParams.baseUrl); + return { + resultType: "success", + configFileAbsolutePath: "", + baseUrl: explicitParams.baseUrl, + absoluteBaseUrl: absoluteBaseUrl_1, + paths: explicitParams.paths, + mainFields: explicitParams.mainFields, + addMatchAll: explicitParams.addMatchAll + }; + } + // Load tsconfig and create path matching function + var loadResult = tsConfigLoader({ + cwd: cwd, + getEnv: function (key) { return process.env[key]; } + }); + if (!loadResult.tsConfigPath) { + return { + resultType: "failed", + message: "Couldn't find tsconfig.json" + }; + } + if (!loadResult.baseUrl) { + return { + resultType: "failed", + message: "Missing baseUrl in compilerOptions" + }; + } + var tsConfigDir = path.dirname(loadResult.tsConfigPath); + var absoluteBaseUrl = path.join(tsConfigDir, loadResult.baseUrl); + return { + resultType: "success", + configFileAbsolutePath: loadResult.tsConfigPath, + baseUrl: loadResult.baseUrl, + absoluteBaseUrl: absoluteBaseUrl, + paths: loadResult.paths || {} + }; +} +exports.configLoader = configLoader; diff --git a/node_modules/tsconfig-paths/lib/filesystem.d.ts b/node_modules/tsconfig-paths/lib/filesystem.d.ts new file mode 100644 index 0000000..44cfdae --- /dev/null +++ b/node_modules/tsconfig-paths/lib/filesystem.d.ts @@ -0,0 +1,33 @@ +/** + * Typing for the fields of package.json we care about + */ +export interface PackageJson { + [key: string]: string; +} +/** + * A function that json from a file + */ +export interface ReadJsonSync { + (packageJsonPath: string): any | undefined; +} +export interface FileExistsSync { + (name: string): boolean; +} +export interface FileExistsAsync { + (path: string, callback: (err?: Error, exists?: boolean) => void): void; +} +export interface ReadJsonAsyncCallback { + (err?: Error, content?: any): void; +} +export interface ReadJsonAsync { + (path: string, callback: ReadJsonAsyncCallback): void; +} +export declare function fileExistsSync(path: string): boolean; +/** + * Reads package.json from disk + * @param file Path to package.json + */ +export declare function readJsonFromDiskSync(packageJsonPath: string): any | undefined; +export declare function readJsonFromDiskAsync(path: string, callback: (err?: Error, content?: any) => void): void; +export declare function fileExistsAsync(path2: string, callback2: (err?: Error, exists?: boolean) => void): void; +export declare function removeExtension(path: string): string; diff --git a/node_modules/tsconfig-paths/lib/filesystem.js b/node_modules/tsconfig-paths/lib/filesystem.js new file mode 100644 index 0000000..eb6397d --- /dev/null +++ b/node_modules/tsconfig-paths/lib/filesystem.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var fs = require("fs"); +function fileExistsSync(path) { + try { + var stats = fs.statSync(path); + return stats.isFile(); + } + catch (err) { + // If error, assume file did not exist + return false; + } +} +exports.fileExistsSync = fileExistsSync; +/** + * Reads package.json from disk + * @param file Path to package.json + */ +// tslint:disable-next-line:no-any +function readJsonFromDiskSync(packageJsonPath) { + if (!fs.existsSync(packageJsonPath)) { + return undefined; + } + return require(packageJsonPath); +} +exports.readJsonFromDiskSync = readJsonFromDiskSync; +function readJsonFromDiskAsync(path, +// tslint:disable-next-line:no-any +callback) { + fs.readFile(path, "utf8", function (err, result) { + // If error, assume file did not exist + if (err || !result) { + return callback(); + } + var json = JSON.parse(result); + return callback(undefined, json); + }); +} +exports.readJsonFromDiskAsync = readJsonFromDiskAsync; +function fileExistsAsync(path2, callback2) { + fs.stat(path2, function (err, stats) { + if (err) { + // If error assume file does not exist + return callback2(undefined, false); + } + callback2(undefined, stats ? stats.isFile() : false); + }); +} +exports.fileExistsAsync = fileExistsAsync; +function removeExtension(path) { + return path.substring(0, path.lastIndexOf(".")) || path; +} +exports.removeExtension = removeExtension; diff --git a/node_modules/tsconfig-paths/lib/index.d.ts b/node_modules/tsconfig-paths/lib/index.d.ts new file mode 100644 index 0000000..02373e9 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/index.d.ts @@ -0,0 +1,5 @@ +export { createMatchPath, matchFromAbsolutePaths, MatchPath } from "./match-path-sync"; +export { createMatchPathAsync, matchFromAbsolutePathsAsync, MatchPathAsync } from "./match-path-async"; +export { register } from "./register"; +export { loadConfig, ConfigLoaderResult, ConfigLoaderSuccessResult, ConfigLoaderFailResult } from "./config-loader"; +export { ReadJsonSync, ReadJsonAsync, FileExistsSync, FileExistsAsync } from "./filesystem"; diff --git a/node_modules/tsconfig-paths/lib/index.js b/node_modules/tsconfig-paths/lib/index.js new file mode 100644 index 0000000..c08ca7f --- /dev/null +++ b/node_modules/tsconfig-paths/lib/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// register is used from register.js in root dir +var match_path_sync_1 = require("./match-path-sync"); +exports.createMatchPath = match_path_sync_1.createMatchPath; +exports.matchFromAbsolutePaths = match_path_sync_1.matchFromAbsolutePaths; +var match_path_async_1 = require("./match-path-async"); +exports.createMatchPathAsync = match_path_async_1.createMatchPathAsync; +exports.matchFromAbsolutePathsAsync = match_path_async_1.matchFromAbsolutePathsAsync; +var register_1 = require("./register"); +exports.register = register_1.register; +var config_loader_1 = require("./config-loader"); +exports.loadConfig = config_loader_1.loadConfig; diff --git a/node_modules/tsconfig-paths/lib/mapping-entry.d.ts b/node_modules/tsconfig-paths/lib/mapping-entry.d.ts new file mode 100644 index 0000000..35669f7 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/mapping-entry.d.ts @@ -0,0 +1,17 @@ +export interface MappingEntry { + readonly pattern: string; + readonly paths: ReadonlyArray; +} +export interface Paths { + readonly [key: string]: ReadonlyArray; +} +/** + * Converts an absolute baseUrl and paths to an array of absolute mapping entries. + * The array is sorted by longest prefix. + * Having an array with entries allows us to keep a sorting order rather than + * sort by keys each time we use the mappings. + * @param absoluteBaseUrl + * @param paths + * @param addMatchAll + */ +export declare function getAbsoluteMappingEntries(absoluteBaseUrl: string, paths: Paths, addMatchAll: boolean): ReadonlyArray; diff --git a/node_modules/tsconfig-paths/lib/mapping-entry.js b/node_modules/tsconfig-paths/lib/mapping-entry.js new file mode 100644 index 0000000..a8762f7 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/mapping-entry.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +/** + * Converts an absolute baseUrl and paths to an array of absolute mapping entries. + * The array is sorted by longest prefix. + * Having an array with entries allows us to keep a sorting order rather than + * sort by keys each time we use the mappings. + * @param absoluteBaseUrl + * @param paths + * @param addMatchAll + */ +function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) { + // Resolve all paths to absolute form once here, and sort them by + // longest prefix once here, this saves time on each request later. + // We need to put them in an array to preseve the sorting order. + var sortedKeys = sortByLongestPrefix(Object.keys(paths)); + var absolutePaths = []; + for (var _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) { + var key = sortedKeys_1[_i]; + absolutePaths.push({ + pattern: key, + paths: paths[key].map(function (pathToResolve) { + return path.join(absoluteBaseUrl, pathToResolve); + }) + }); + } + // If there is no match-all path specified in the paths section of tsconfig, then try to match + // all paths relative to baseUrl, this is how typescript works. + if (!paths["*"] && addMatchAll) { + absolutePaths.push({ + pattern: "*", + paths: [absoluteBaseUrl.replace(/\/$/, "") + "/*"] + }); + } + return absolutePaths; +} +exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries; +/** + * Sort path patterns. + * If a module name can be matched with multiple patterns then pattern with the longest prefix will be picked. + */ +function sortByLongestPrefix(arr) { + return arr + .concat() + .sort(function (a, b) { return getPrefixLength(b) - getPrefixLength(a); }); +} +function getPrefixLength(pattern) { + var prefixLength = pattern.indexOf("*"); + return pattern.substr(0, prefixLength).length; +} diff --git a/node_modules/tsconfig-paths/lib/match-path-async.d.ts b/node_modules/tsconfig-paths/lib/match-path-async.d.ts new file mode 100644 index 0000000..c199f9f --- /dev/null +++ b/node_modules/tsconfig-paths/lib/match-path-async.d.ts @@ -0,0 +1,21 @@ +import * as MappingEntry from "./mapping-entry"; +import * as Filesystem from "./filesystem"; +/** + * Function that can match a path async + */ +export interface MatchPathAsync { + (requestedModule: string, readJson: Filesystem.ReadJsonAsync | undefined, fileExists: Filesystem.FileExistsAsync | undefined, extensions: ReadonlyArray | undefined, callback: MatchPathAsyncCallback): void; +} +export interface MatchPathAsyncCallback { + (err?: Error, path?: string): void; +} +/** + * See the sync version for docs. + */ +export declare function createMatchPathAsync(absoluteBaseUrl: string, paths: { + [key: string]: Array; +}, mainFields?: string[], addMatchAll?: boolean): MatchPathAsync; +/** + * See the sync version for docs. + */ +export declare function matchFromAbsolutePathsAsync(absolutePathMappings: ReadonlyArray, requestedModule: string, readJson: Filesystem.ReadJsonAsync | undefined, fileExists: Filesystem.FileExistsAsync | undefined, extensions: ReadonlyArray | undefined, callback: MatchPathAsyncCallback, mainFields?: string[]): void; diff --git a/node_modules/tsconfig-paths/lib/match-path-async.js b/node_modules/tsconfig-paths/lib/match-path-async.js new file mode 100644 index 0000000..511cfb7 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/match-path-async.js @@ -0,0 +1,113 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var TryPath = require("./try-path"); +var MappingEntry = require("./mapping-entry"); +var Filesystem = require("./filesystem"); +/** + * See the sync version for docs. + */ +function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) { + if (mainFields === void 0) { mainFields = ["main"]; } + if (addMatchAll === void 0) { addMatchAll = true; } + var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll); + return function (requestedModule, readJson, fileExists, extensions, callback) { + return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields); + }; +} +exports.createMatchPathAsync = createMatchPathAsync; +/** + * See the sync version for docs. + */ +function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) { + if (readJson === void 0) { readJson = Filesystem.readJsonFromDiskAsync; } + if (fileExists === void 0) { fileExists = Filesystem.fileExistsAsync; } + if (extensions === void 0) { extensions = Object.keys(require.extensions); } + if (mainFields === void 0) { mainFields = ["main"]; } + var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule); + if (!tryPaths) { + return callback(); + } + findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields); +} +exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync; +function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index) { + if (index === void 0) { index = 0; } + if (index >= mainFields.length) { + return doneCallback(undefined, undefined); + } + var tryNext = function () { + return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index + 1); + }; + var mainFieldMapping = packageJson[mainFields[index]]; + if (typeof mainFieldMapping !== "string") { + // Skip mappings that are not pointers to replacement files + return tryNext(); + } + var mappedFilePath = path.join(path.dirname(packageJsonPath), mainFieldMapping); + fileExistsAsync(mappedFilePath, function (err, exists) { + if (err) { + return doneCallback(err); + } + if (exists) { + return doneCallback(undefined, mappedFilePath); + } + return tryNext(); + }); +} +// Recursive loop to probe for physical files +function findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index, mainFields) { + if (index === void 0) { index = 0; } + if (mainFields === void 0) { mainFields = ["main"]; } + var tryPath = tryPaths[index]; + if (tryPath.type === "file" || + tryPath.type === "extension" || + tryPath.type === "index") { + fileExists(tryPath.path, function (err, exists) { + if (err) { + return doneCallback(err); + } + if (exists) { + // Not sure why we don't just return the full path? Why strip it? + return doneCallback(undefined, TryPath.getStrippedPath(tryPath)); + } + if (index === tryPaths.length - 1) { + return doneCallback(); + } + // Continue with the next path + return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields); + }); + } + else if (tryPath.type === "package") { + readJson(tryPath.path, function (err, packageJson) { + if (err) { + return doneCallback(err); + } + if (packageJson) { + return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function (mainFieldErr, mainFieldMappedFile) { + if (mainFieldErr) { + return doneCallback(mainFieldErr); + } + if (mainFieldMappedFile) { + // Not sure why we don't just return the full path? Why strip it? + return doneCallback(undefined, Filesystem.removeExtension(mainFieldMappedFile)); + } + // No field in package json was a valid option. Continue with the next path. + return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields); + }); + } + // This is async code, we need to return unconditionally, otherwise the code still falls + // through and keeps recursing. While this might work in general, libraries that use neo-async + // like Webpack will actually not allow you to call the same callback twice. + // + // An example of where this caused issues: + // https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/11 + // + // Continue with the next path + return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields); + }); + } + else { + TryPath.exhaustiveTypeException(tryPath.type); + } +} diff --git a/node_modules/tsconfig-paths/lib/match-path-sync.d.ts b/node_modules/tsconfig-paths/lib/match-path-sync.d.ts new file mode 100644 index 0000000..090d438 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/match-path-sync.d.ts @@ -0,0 +1,30 @@ +import * as Filesystem from "./filesystem"; +import * as MappingEntry from "./mapping-entry"; +/** + * Function that can match a path + */ +export interface MatchPath { + (requestedModule: string, readJson?: Filesystem.ReadJsonSync, fileExists?: (name: string) => boolean, extensions?: ReadonlyArray): string | undefined; +} +/** + * Creates a function that can resolve paths according to tsconfig paths property. + * @param absoluteBaseUrl Absolute version of baseUrl as specified in tsconfig. + * @param paths The paths as specified in tsconfig. + * @param mainFields A list of package.json field names to try when resolving module files. + * @param addMatchAll Add a match-all "*" rule if none is present + * @returns a function that can resolve paths. + */ +export declare function createMatchPath(absoluteBaseUrl: string, paths: { + [key: string]: Array; +}, mainFields?: string[], addMatchAll?: boolean): MatchPath; +/** + * Finds a path from tsconfig that matches a module load request. + * @param absolutePathMappings The paths to try as specified in tsconfig but resolved to absolute form. + * @param requestedModule The required module name. + * @param readJson Function that can read json from a path (useful for testing). + * @param fileExists Function that checks for existance of a file at a path (useful for testing). + * @param extensions File extensions to probe for (useful for testing). + * @param mainFields A list of package.json field names to try when resolving module files. + * @returns the found path, or undefined if no path was found. + */ +export declare function matchFromAbsolutePaths(absolutePathMappings: ReadonlyArray, requestedModule: string, readJson?: Filesystem.ReadJsonSync, fileExists?: Filesystem.FileExistsSync, extensions?: Array, mainFields?: string[]): string | undefined; diff --git a/node_modules/tsconfig-paths/lib/match-path-sync.js b/node_modules/tsconfig-paths/lib/match-path-sync.js new file mode 100644 index 0000000..b701337 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/match-path-sync.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var Filesystem = require("./filesystem"); +var MappingEntry = require("./mapping-entry"); +var TryPath = require("./try-path"); +/** + * Creates a function that can resolve paths according to tsconfig paths property. + * @param absoluteBaseUrl Absolute version of baseUrl as specified in tsconfig. + * @param paths The paths as specified in tsconfig. + * @param mainFields A list of package.json field names to try when resolving module files. + * @param addMatchAll Add a match-all "*" rule if none is present + * @returns a function that can resolve paths. + */ +function createMatchPath(absoluteBaseUrl, paths, mainFields, addMatchAll) { + if (mainFields === void 0) { mainFields = ["main"]; } + if (addMatchAll === void 0) { addMatchAll = true; } + var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll); + return function (requestedModule, readJson, fileExists, extensions) { + return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields); + }; +} +exports.createMatchPath = createMatchPath; +/** + * Finds a path from tsconfig that matches a module load request. + * @param absolutePathMappings The paths to try as specified in tsconfig but resolved to absolute form. + * @param requestedModule The required module name. + * @param readJson Function that can read json from a path (useful for testing). + * @param fileExists Function that checks for existance of a file at a path (useful for testing). + * @param extensions File extensions to probe for (useful for testing). + * @param mainFields A list of package.json field names to try when resolving module files. + * @returns the found path, or undefined if no path was found. + */ +function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) { + if (readJson === void 0) { readJson = Filesystem.readJsonFromDiskSync; } + if (fileExists === void 0) { fileExists = Filesystem.fileExistsSync; } + if (extensions === void 0) { extensions = Object.keys(require.extensions); } + if (mainFields === void 0) { mainFields = ["main"]; } + var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule); + if (!tryPaths) { + return undefined; + } + return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields); +} +exports.matchFromAbsolutePaths = matchFromAbsolutePaths; +function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) { + for (var index = 0; index < mainFields.length; index++) { + var mainFieldName = mainFields[index]; + var candidateMapping = packageJson[mainFieldName]; + if (candidateMapping && typeof candidateMapping === "string") { + var candidateFilePath = path.join(path.dirname(packageJsonPath), candidateMapping); + if (fileExists(candidateFilePath)) { + return candidateFilePath; + } + } + } + return undefined; +} +function findFirstExistingPath(tryPaths, readJson, fileExists, mainFields) { + if (readJson === void 0) { readJson = Filesystem.readJsonFromDiskSync; } + if (mainFields === void 0) { mainFields = ["main"]; } + for (var _i = 0, tryPaths_1 = tryPaths; _i < tryPaths_1.length; _i++) { + var tryPath = tryPaths_1[_i]; + if (tryPath.type === "file" || + tryPath.type === "extension" || + tryPath.type === "index") { + if (fileExists(tryPath.path)) { + // Not sure why we don't just return the full path? Why strip it? + return TryPath.getStrippedPath(tryPath); + } + } + else if (tryPath.type === "package") { + var packageJson = readJson(tryPath.path); + if (packageJson) { + var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists); + if (mainFieldMappedFile) { + // Not sure why we don't just return the full path? Why strip it? + return Filesystem.removeExtension(mainFieldMappedFile); + } + } + } + else { + TryPath.exhaustiveTypeException(tryPath.type); + } + } + return undefined; +} diff --git a/node_modules/tsconfig-paths/lib/options.d.ts b/node_modules/tsconfig-paths/lib/options.d.ts new file mode 100644 index 0000000..dc7748e --- /dev/null +++ b/node_modules/tsconfig-paths/lib/options.d.ts @@ -0,0 +1,4 @@ +export interface Options { + cwd: string; +} +export declare const options: Options; diff --git a/node_modules/tsconfig-paths/lib/options.js b/node_modules/tsconfig-paths/lib/options.js new file mode 100644 index 0000000..2581f9a --- /dev/null +++ b/node_modules/tsconfig-paths/lib/options.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var minimist = require("minimist"); +var argv = minimist(process.argv.slice(2), { + string: ["project"], + alias: { + project: ["P"] + } +}); +var project = argv && argv.project; +exports.options = { + cwd: project || process.cwd() +}; diff --git a/node_modules/tsconfig-paths/lib/register.d.ts b/node_modules/tsconfig-paths/lib/register.d.ts new file mode 100644 index 0000000..7487226 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/register.d.ts @@ -0,0 +1,6 @@ +import { ExplicitParams } from "./config-loader"; +/** + * Installs a custom module load function that can adhere to paths in tsconfig. + * Returns a function to undo paths registration. + */ +export declare function register(explicitParams: ExplicitParams): () => void; diff --git a/node_modules/tsconfig-paths/lib/register.js b/node_modules/tsconfig-paths/lib/register.js new file mode 100644 index 0000000..c12b996 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/register.js @@ -0,0 +1,82 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var match_path_sync_1 = require("./match-path-sync"); +var config_loader_1 = require("./config-loader"); +var options_1 = require("./options"); +var noOp = function () { return void 0; }; +function getCoreModules(builtinModules) { + builtinModules = builtinModules || [ + "assert", + "buffer", + "child_process", + "cluster", + "crypto", + "dgram", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "net", + "os", + "path", + "punycode", + "querystring", + "readline", + "stream", + "string_decoder", + "tls", + "tty", + "url", + "util", + "v8", + "vm", + "zlib" + ]; + var coreModules = {}; + for (var _i = 0, builtinModules_1 = builtinModules; _i < builtinModules_1.length; _i++) { + var module_1 = builtinModules_1[_i]; + coreModules[module_1] = true; + } + return coreModules; +} +/** + * Installs a custom module load function that can adhere to paths in tsconfig. + * Returns a function to undo paths registration. + */ +function register(explicitParams) { + var configLoaderResult = config_loader_1.configLoader({ + cwd: options_1.options.cwd, + explicitParams: explicitParams + }); + if (configLoaderResult.resultType === "failed") { + console.warn(configLoaderResult.message + ". tsconfig-paths will be skipped"); + return noOp; + } + var matchPath = match_path_sync_1.createMatchPath(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll); + // Patch node's module loading + // tslint:disable-next-line:no-require-imports variable-name + var Module = require("module"); + var originalResolveFilename = Module._resolveFilename; + var coreModules = getCoreModules(Module.builtinModules); + // tslint:disable-next-line:no-any + Module._resolveFilename = function (request, _parent) { + var isCoreModule = coreModules.hasOwnProperty(request); + if (!isCoreModule) { + var found = matchPath(request); + if (found) { + var modifiedArguments = [found].concat([].slice.call(arguments, 1)); // Passes all arguments. Even those that is not specified above. + // tslint:disable-next-line:no-invalid-this + return originalResolveFilename.apply(this, modifiedArguments); + } + } + // tslint:disable-next-line:no-invalid-this + return originalResolveFilename.apply(this, arguments); + }; + return function () { + // Return node's module loading to original state. + Module._resolveFilename = originalResolveFilename; + }; +} +exports.register = register; diff --git a/node_modules/tsconfig-paths/lib/try-path.d.ts b/node_modules/tsconfig-paths/lib/try-path.d.ts new file mode 100644 index 0000000..5130fc5 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/try-path.d.ts @@ -0,0 +1,15 @@ +import { MappingEntry } from "./mapping-entry"; +export interface TryPath { + readonly type: "file" | "extension" | "index" | "package"; + readonly path: string; +} +/** + * Builds a list of all physical paths to try by: + * 1. Check for file named exactly as request. + * 2. Check for files named as request ending in any of the extensions. + * 3. Check for file specified in package.json's main property. + * 4. Check for files named as request ending in "index" with any of the extensions. + */ +export declare function getPathsToTry(extensions: ReadonlyArray, absolutePathMappings: ReadonlyArray, requestedModule: string): ReadonlyArray | undefined; +export declare function getStrippedPath(tryPath: TryPath): string; +export declare function exhaustiveTypeException(check: never): never; diff --git a/node_modules/tsconfig-paths/lib/try-path.js b/node_modules/tsconfig-paths/lib/try-path.js new file mode 100644 index 0000000..26d4b21 --- /dev/null +++ b/node_modules/tsconfig-paths/lib/try-path.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var path_1 = require("path"); +var filesystem_1 = require("./filesystem"); +/** + * Builds a list of all physical paths to try by: + * 1. Check for file named exactly as request. + * 2. Check for files named as request ending in any of the extensions. + * 3. Check for file specified in package.json's main property. + * 4. Check for files named as request ending in "index" with any of the extensions. + */ +function getPathsToTry(extensions, absolutePathMappings, requestedModule) { + if (!absolutePathMappings || + !requestedModule || + requestedModule[0] === "." || + requestedModule[0] === path.sep) { + return undefined; + } + var pathsToTry = []; + for (var _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) { + var entry = absolutePathMappings_1[_i]; + var starMatch = entry.pattern === requestedModule + ? "" + : matchStar(entry.pattern, requestedModule); + if (starMatch !== undefined) { + var _loop_1 = function (physicalPathPattern) { + var physicalPath = physicalPathPattern.replace("*", starMatch); + pathsToTry.push({ type: "file", path: physicalPath }); + pathsToTry.push.apply(pathsToTry, extensions.map(function (e) { return ({ type: "extension", path: physicalPath + e }); })); + pathsToTry.push({ + type: "package", + path: path.join(physicalPath, "/package.json") + }); + var indexPath = path.join(physicalPath, "/index"); + pathsToTry.push.apply(pathsToTry, extensions.map(function (e) { return ({ type: "index", path: indexPath + e }); })); + }; + for (var _a = 0, _b = entry.paths; _a < _b.length; _a++) { + var physicalPathPattern = _b[_a]; + _loop_1(physicalPathPattern); + } + } + } + return pathsToTry.length === 0 ? undefined : pathsToTry; +} +exports.getPathsToTry = getPathsToTry; +// Not sure why we don't just return the full found path? +function getStrippedPath(tryPath) { + return tryPath.type === "index" + ? path_1.dirname(tryPath.path) + : tryPath.type === "file" + ? tryPath.path + : tryPath.type === "extension" + ? filesystem_1.removeExtension(tryPath.path) + : tryPath.type === "package" + ? tryPath.path + : exhaustiveTypeException(tryPath.type); +} +exports.getStrippedPath = getStrippedPath; +function exhaustiveTypeException(check) { + throw new Error("Unknown type " + check); +} +exports.exhaustiveTypeException = exhaustiveTypeException; +/** + * Matches pattern with a single star against search. + * Star must match at least one character to be considered a match. + * @param patttern for example "foo*" + * @param search for example "fooawesomebar" + * @returns the part of search that * matches, or undefined if no match. + */ +function matchStar(pattern, search) { + if (search.length < pattern.length) { + return undefined; + } + if (pattern === "*") { + return search; + } + var star = pattern.indexOf("*"); + if (star === -1) { + return undefined; + } + var part1 = pattern.substring(0, star); + var part2 = pattern.substring(star + 1); + if (search.substr(0, star) !== part1) { + return undefined; + } + if (search.substr(search.length - part2.length) !== part2) { + return undefined; + } + return search.substr(star, search.length - part2.length); +} diff --git a/node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts b/node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts new file mode 100644 index 0000000..bcf5ace --- /dev/null +++ b/node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts @@ -0,0 +1,28 @@ +/** + * Typing for the parts of tsconfig that we care about + */ +export interface Tsconfig { + extends?: string; + compilerOptions?: { + baseUrl?: string; + paths?: { + [key: string]: Array; + }; + strict?: boolean; + }; +} +export interface TsConfigLoaderResult { + tsConfigPath: string | undefined; + baseUrl: string | undefined; + paths: { + [key: string]: Array; + } | undefined; +} +export interface TsConfigLoaderParams { + getEnv: (key: string) => string | undefined; + cwd: string; + loadSync?(cwd: string, filename?: string): TsConfigLoaderResult; +} +export declare function tsConfigLoader({ getEnv, cwd, loadSync }: TsConfigLoaderParams): TsConfigLoaderResult; +export declare function walkForTsConfig(directory: string, existsSync?: (path: string) => boolean): string | undefined; +export declare function loadTsconfig(configFilePath: string, existsSync?: (path: string) => boolean, readFileSync?: (filename: string) => string): Tsconfig | undefined; diff --git a/node_modules/tsconfig-paths/lib/tsconfig-loader.js b/node_modules/tsconfig-paths/lib/tsconfig-loader.js new file mode 100644 index 0000000..684247d --- /dev/null +++ b/node_modules/tsconfig-paths/lib/tsconfig-loader.js @@ -0,0 +1,97 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var fs = require("fs"); +// tslint:disable:no-require-imports +var JSON5 = require("json5"); +var StripBom = require("strip-bom"); +function tsConfigLoader(_a) { + var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b; + var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT"); + // tsconfig.loadSync handles if TS_NODE_PROJECT is a file or directory + var loadResult = loadSync(cwd, TS_NODE_PROJECT); + return loadResult; +} +exports.tsConfigLoader = tsConfigLoader; +function loadSyncDefault(cwd, filename) { + // Tsconfig.loadSync uses path.resolve. This is why we can use an absolute path as filename + var configPath = resolveConfigPath(cwd, filename); + if (!configPath) { + return { + tsConfigPath: undefined, + baseUrl: undefined, + paths: undefined + }; + } + var config = loadTsconfig(configPath); + return { + tsConfigPath: configPath, + baseUrl: config && config.compilerOptions && config.compilerOptions.baseUrl, + paths: config && config.compilerOptions && config.compilerOptions.paths + }; +} +function resolveConfigPath(cwd, filename) { + if (filename) { + var absolutePath = fs.lstatSync(filename).isDirectory() + ? path.resolve(filename, "./tsconfig.json") + : path.resolve(cwd, filename); + return absolutePath; + } + if (fs.statSync(cwd).isFile()) { + return path.resolve(cwd); + } + var configAbsolutePath = walkForTsConfig(cwd); + return configAbsolutePath ? path.resolve(configAbsolutePath) : undefined; +} +function walkForTsConfig(directory, existsSync) { + if (existsSync === void 0) { existsSync = fs.existsSync; } + var configPath = path.join(directory, "./tsconfig.json"); + if (existsSync(configPath)) { + return configPath; + } + var parentDirectory = path.join(directory, "../"); + // If we reached the top + if (directory === parentDirectory) { + return undefined; + } + return walkForTsConfig(parentDirectory, existsSync); +} +exports.walkForTsConfig = walkForTsConfig; +function loadTsconfig(configFilePath, existsSync, readFileSync) { + if (existsSync === void 0) { existsSync = fs.existsSync; } + if (readFileSync === void 0) { readFileSync = function (filename) { + return fs.readFileSync(filename, "utf8"); + }; } + if (!existsSync(configFilePath)) { + return undefined; + } + var configString = readFileSync(configFilePath); + var cleanedJson = StripBom(configString); + var config = JSON5.parse(cleanedJson); + var extendedConfig = config.extends; + if (extendedConfig) { + if (typeof extendedConfig === "string" && + extendedConfig.indexOf(".json") === -1) { + extendedConfig += ".json"; + } + var currentDir = path.dirname(configFilePath); + var base = loadTsconfig(path.join(currentDir, extendedConfig), existsSync, readFileSync) || {}; + // baseUrl should be interpreted as relative to the base tsconfig, + // but we need to update it so it is relative to the original tsconfig being loaded + if (base && base.compilerOptions && base.compilerOptions.baseUrl) { + var extendsDir = path.dirname(extendedConfig); + base.compilerOptions.baseUrl = path.join(extendsDir, base.compilerOptions.baseUrl); + } + return __assign({}, base, config, { compilerOptions: __assign({}, base.compilerOptions, config.compilerOptions) }); + } + return config; +} +exports.loadTsconfig = loadTsconfig; diff --git a/node_modules/tsconfig-paths/package.json b/node_modules/tsconfig-paths/package.json new file mode 100644 index 0000000..1f31859 --- /dev/null +++ b/node_modules/tsconfig-paths/package.json @@ -0,0 +1,97 @@ +{ + "_from": "tsconfig-paths@^3.9.0", + "_id": "tsconfig-paths@3.9.0", + "_inBundle": false, + "_integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "_location": "/tsconfig-paths", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "tsconfig-paths@^3.9.0", + "name": "tsconfig-paths", + "escapedName": "tsconfig-paths", + "rawSpec": "^3.9.0", + "saveSpec": null, + "fetchSpec": "^3.9.0" + }, + "_requiredBy": [ + "/eslint-plugin-import" + ], + "_resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "_shasum": "098547a6c4448807e8fcb8eae081064ee9a3c90b", + "_spec": "tsconfig-paths@^3.9.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint-plugin-import", + "author": { + "name": "Jonas Kello" + }, + "bugs": { + "url": "https://github.com/dividab/tsconfig-paths/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "deprecated": false, + "description": "Load node modules according to tsconfig paths, in run-time or via API.", + "devDependencies": { + "@types/chai": "^4.1.4", + "@types/minimist": "^1.2.0", + "@types/mocha": "^5.2.3", + "@types/node": "^6.0.54", + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "^0.0.30", + "chai": "^4.1.2", + "codecov": "^3.1.0", + "husky": "^0.14.3", + "lint-staged": "^4.3.0", + "mocha": "^5.2.0", + "nyc": "^11.4.1", + "prettier": "1.7.4", + "rimraf": "^2.6.2", + "shelljs": "^0.7.5", + "ts-node": "^7.0.0", + "tslint": "^5.8.0", + "typescript": "^2.4.1" + }, + "homepage": "https://github.com/dividab/tsconfig-paths#readme", + "license": "MIT", + "lint-staged": { + "*.ts": [ + "tslint", + "prettier --write", + "git add" + ] + }, + "main": "lib/index.js", + "name": "tsconfig-paths", + "repository": { + "type": "git", + "url": "git+https://github.com/dividab/tsconfig-paths.git" + }, + "scripts": { + "build": "rimraf lib && tsc -p src", + "build:test": "rimraf ./test/js_out && tsc -p test", + "coverage": "rimraf coverage .nyc_output && nyc yarn test", + "example:api": "cd example/api && ts-node main.ts", + "example:node": "yarn build && cd ./example/node && ts-node -r ../register.js main.ts", + "example:perf": "cd example/perf && ts-node main.ts", + "example:project": "yarn build && ts-node -r ./register.js -P ./example/project/tsconfig.json ./example/project/main.ts", + "lint": "tslint './{src,tests}/**/*.ts{,x}'", + "postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\"", + "precommit": "lint-staged", + "preversion": "yarn verify", + "publish:major": "yarn build && node scripts/publish.js major", + "publish:minor": "yarn build && node scripts/publish.js minor", + "publish:patch": "yarn build && node scripts/publish.js patch", + "report-coverage": "codecov -f coverage/*.json", + "start": "cd src && ts-node index.ts", + "test": "mocha", + "verify": "yarn build && yarn lint && yarn coverage" + }, + "types": "lib/index", + "version": "3.9.0" +} diff --git a/node_modules/tsconfig-paths/register.js b/node_modules/tsconfig-paths/register.js new file mode 100644 index 0000000..c7d41ea --- /dev/null +++ b/node_modules/tsconfig-paths/register.js @@ -0,0 +1 @@ +require('./').register(); diff --git a/node_modules/tsconfig-paths/test/config-loader-tests.ts b/node_modules/tsconfig-paths/test/config-loader-tests.ts new file mode 100644 index 0000000..483ba43 --- /dev/null +++ b/node_modules/tsconfig-paths/test/config-loader-tests.ts @@ -0,0 +1,90 @@ +import { assert } from "chai"; +import { + configLoader, + loadConfig, + ConfigLoaderFailResult, + ConfigLoaderSuccessResult +} from "../src/config-loader"; +import { join } from "path"; + +describe("config-loader", (): void => { + it("should use explicitParams when set", () => { + const result = configLoader({ + explicitParams: { + baseUrl: "/foo/bar", + paths: { + asd: ["asd"] + } + }, + cwd: "/baz" + }); + + const successResult = result as ConfigLoaderSuccessResult; + assert.equal(successResult.resultType, "success"); + assert.equal(successResult.absoluteBaseUrl, "/foo/bar"); + assert.equal(successResult.paths["asd"][0], "asd"); + }); + + it("should use explicitParams when set and add cwd when path is relative", () => { + const result = configLoader({ + explicitParams: { + baseUrl: "bar/", + paths: { + asd: ["asd"] + } + }, + cwd: "/baz" + }); + + const successResult = result as ConfigLoaderSuccessResult; + assert.equal(successResult.resultType, "success"); + assert.equal(successResult.absoluteBaseUrl, join("/baz", "bar/")); + }); + + it("should fallback to tsConfigLoader when explicitParams is not set", () => { + const result = configLoader({ + explicitParams: undefined, + cwd: "/baz", + // tslint:disable-next-line:no-any + tsConfigLoader: (_: any) => ({ + tsConfigPath: "/baz/tsconfig.json", + baseUrl: "./src", + paths: {} + }) + }); + + const successResult = result as ConfigLoaderSuccessResult; + assert.equal(successResult.resultType, "success"); + assert.equal(successResult.absoluteBaseUrl, join("/baz", "src")); + }); + + it("should show an error message when baseUrl is missing", () => { + const result = configLoader({ + explicitParams: undefined, + cwd: "/baz", + // tslint:disable-next-line:no-any + tsConfigLoader: (_: any) => ({ + tsConfigPath: "/baz/tsconfig.json", + baseUrl: undefined, + paths: {} + }) + }); + + const failResult = result as ConfigLoaderFailResult; + assert.equal(failResult.resultType, "failed"); + assert.isTrue(failResult.message.indexOf("baseUrl") > -1); + }); + + it("should presume cwd to be a tsconfig file when loadConfig is called with absolute path to tsconfig.json", () => { + // using tsconfig-named.json to ensure that future changes to fix + // https://github.com/dividab/tsconfig-paths/issues/31 + // do not pass this test case just because of a directory walk looking + // for tsconfig.json + const configFile = join(__dirname, "tsconfig-named.json"); + const result = loadConfig(configFile); + + const successResult = result as ConfigLoaderSuccessResult; + assert.equal(successResult.resultType, "success"); + assert.equal(successResult.configFileAbsolutePath, configFile); + }); +}); diff --git a/node_modules/tsconfig-paths/test/data/match-path-data.ts b/node_modules/tsconfig-paths/test/data/match-path-data.ts new file mode 100644 index 0000000..d0c60a1 --- /dev/null +++ b/node_modules/tsconfig-paths/test/data/match-path-data.ts @@ -0,0 +1,212 @@ +import { join, dirname } from "path"; +import { removeExtension } from "../../src/filesystem"; + +export interface OneTest { + readonly name: string; + readonly only?: boolean; + readonly skip?: boolean; + readonly absoluteBaseUrl: string; + readonly paths: { [key: string]: Array }; + readonly mainFields?: string[]; + readonly addMatchAll?: boolean; + readonly existingFiles: ReadonlyArray; + readonly requestedModule: string; + readonly extensions?: ReadonlyArray; + readonly packageJson?: {}; + readonly expectedPath: string | undefined; +} + +export const tests: ReadonlyArray = [ + { + name: "should locate path that matches with star and exists", + absoluteBaseUrl: "/root/", + paths: { + "lib/*": ["location/*"] + }, + existingFiles: [join("/root", "location", "mylib", "index.ts")], + requestedModule: "lib/mylib", + expectedPath: dirname(join("/root", "location", "mylib", "index.ts")) + }, + { + name: "should resolve to correct path when many are specified", + absoluteBaseUrl: "/root/", + paths: { + "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"] + }, + existingFiles: [join("/root", "location", "mylib", "index.ts")], + requestedModule: "lib/mylib", + extensions: [".ts"], + expectedPath: dirname(join("/root", "location", "mylib", "index.ts")) + }, + { + name: + "should locate path that matches with star and prioritize pattern with longest prefix", + absoluteBaseUrl: "/root/", + paths: { + "*": ["location/*"], + "lib/*": ["location/*"] + }, + existingFiles: [ + join("/root", "location", "lib", "mylib", "index.ts"), + join("/root", "location", "mylib", "index.ts") + ], + requestedModule: "lib/mylib", + expectedPath: dirname(join("/root", "location", "mylib", "index.ts")) + }, + { + name: "should locate path that matches with star and exists with extension", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("/root", "location", "mylib.myext")], + requestedModule: "lib/mylib", + extensions: [".js", ".myext"], + expectedPath: removeExtension(join("/root", "location", "mylib.myext")) + }, + { + name: "should resolve request with extension specified", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("/root", "location", "test.jpg")], + requestedModule: "lib/test.jpg", + expectedPath: join("/root", "location", "test.jpg") + }, + { + name: "should locate path that matches without star and exists", + absoluteBaseUrl: "/root/", + paths: { + "lib/foo": ["location/foo"] + }, + existingFiles: [join("/root", "location", "foo.ts")], + requestedModule: "lib/foo", + expectedPath: removeExtension(join("/root", "location", "foo.ts")) + }, + { + name: "should resolve to parent folder when filename is in subfolder", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("/root", "location", "mylib", "index.ts")], + requestedModule: "lib/mylib", + expectedPath: dirname(join("/root", "location", "mylib", "index.ts")) + }, + { + name: "should resolve from main field in package.json", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("/root", "location", "mylib", "kalle.ts")], + packageJson: { main: "./kalle.ts" }, + requestedModule: "lib/mylib", + expectedPath: removeExtension( + join("/root", "location", "mylib", "kalle.ts") + ) + }, + { + name: "should resolve from main field in package.json (js)", + absoluteBaseUrl: "/root", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("/root", "location", "mylib.js", "kalle.js")], + packageJson: { main: "./kalle.js" }, + requestedModule: "lib/mylib.js", + extensions: [".ts", ".js"], + expectedPath: removeExtension( + join("/root", "location", "mylib.js", "kalle.js") + ) + }, + { + name: + "should resolve from main field in package.json and correctly remove file extension", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("/root", "location", "mylibjs", "kalle.js")], + packageJson: { main: "./kalle.js" }, + extensions: [".ts", ".js"], + requestedModule: "lib/mylibjs", + expectedPath: removeExtension( + join("/root", "location", "mylibjs", "kalle.js") + ) + }, + { + name: "should resolve from list of fields by priority in package.json", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + mainFields: ["missing", "browser", "main"], + packageJson: { main: "./main.js", browser: "./browser.js" }, + existingFiles: [ + join("/root", "location", "mylibjs", "main.js"), // mainFilePath + join("/root", "location", "mylibjs", "browser.js") // browserFilePath + ], + extensions: [".ts", ".js"], + requestedModule: "lib/mylibjs", + expectedPath: removeExtension( + join("/root", "location", "mylibjs", "browser.js") + ) + }, + { + name: "should ignore field mappings to missing files in package.json", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + mainFields: ["browser", "main"], + existingFiles: [join("/root", "location", "mylibjs", "kalle.js")], + requestedModule: "lib/mylibjs", + packageJson: { + main: "./kalle.js", + browser: "./nope.js" + }, + extensions: [".ts", ".js"], + expectedPath: removeExtension( + join("/root", "location", "mylibjs", "kalle.js") + ) + }, + { + name: "should ignore advanced field mappings in package.json", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [ + join("/root", "location", "mylibjs", "kalle.js"), + join("/root", "location", "mylibjs", "browser.js") + ], + requestedModule: "lib/mylibjs", + packageJson: { + main: "./kalle.js", + browser: { mylibjs: "./browser.js", "./kalle.js": "./browser.js" } + }, + extensions: [".ts", ".js"], + expectedPath: removeExtension( + join("/root", "location", "mylibjs", "kalle.js") + ) + }, + { + name: "should resolve to with the help of baseUrl when not explicitly set", + absoluteBaseUrl: "/root/", + paths: {}, + existingFiles: [join("/root", "mylib", "index.ts")], + requestedModule: "mylib", + expectedPath: dirname(join("/root", "mylib", "index.ts")) + }, + { + name: "should not resolve with the help of baseUrl when asked not to", + absoluteBaseUrl: "/root/", + paths: {}, + addMatchAll: false, + existingFiles: [join("/root", "mylib", "index.ts")], + requestedModule: "mylib", + expectedPath: undefined + }, + { + name: "should not locate path that does not match", + absoluteBaseUrl: "/root/", + paths: { "lib/*": ["location/*"] }, + existingFiles: [join("root", "location", "mylib")], + requestedModule: "mylib", + expectedPath: undefined + }, + { + name: "should not resolve typings file (index.d.ts)", + absoluteBaseUrl: "/root/", + paths: { + "lib/*": ["location/*"] + }, + existingFiles: [join("/root", "location", "mylib", "index.d.ts")], + requestedModule: "lib/mylib", + expectedPath: undefined + } +]; diff --git a/node_modules/tsconfig-paths/test/filesystem-tests.ts b/node_modules/tsconfig-paths/test/filesystem-tests.ts new file mode 100644 index 0000000..49d6058 --- /dev/null +++ b/node_modules/tsconfig-paths/test/filesystem-tests.ts @@ -0,0 +1,46 @@ +import { assert } from "chai"; +import * as Filesystem from "../src/filesystem"; +import * as path from "path"; + +describe("filesystem", () => { + const fileThatExists = path.join(__dirname, "../package.json"); + const fileThatNotExists = path.join(__dirname, "../package2.json"); + + it("should find file that exists, sync", () => { + const result = Filesystem.fileExistsSync(fileThatExists); + assert.equal(result, true); + }); + + it("should not find file that not exists, sync", () => { + const result = Filesystem.fileExistsSync(fileThatNotExists); + assert.equal(result, false); + }); + + it("should find file that exists, async", done => { + Filesystem.fileExistsAsync(fileThatExists, (_err, result) => { + assert.equal(result, true); + done(); + }); + }); + + it("should not find file that not exists, async", done => { + Filesystem.fileExistsAsync(fileThatNotExists, (_err, result) => { + assert.equal(result, false); + done(); + }); + }); + + it("should load json, sync", () => { + const result = Filesystem.readJsonFromDiskSync(fileThatExists); + assert.isOk(result); + assert.equal(result.main, "lib/index.js"); + }); + + it("should load json, async", done => { + Filesystem.readJsonFromDiskAsync(fileThatExists, (_err, result) => { + assert.isOk(result); + assert.equal(result.main, "lib/index.js"); + done(); + }); + }); +}); diff --git a/node_modules/tsconfig-paths/test/mapping-entry-test.ts b/node_modules/tsconfig-paths/test/mapping-entry-test.ts new file mode 100644 index 0000000..004888f --- /dev/null +++ b/node_modules/tsconfig-paths/test/mapping-entry-test.ts @@ -0,0 +1,47 @@ +import { assert } from "chai"; +import { getAbsoluteMappingEntries } from "../src/mapping-entry"; +import { join } from "path"; + +describe("mapping-entry", () => { + it("should change to absolute paths and sort in longest prefix order", () => { + const result = getAbsoluteMappingEntries( + "/absolute/base/url", + { + "*": ["/foo1", "/foo2"], + "longest/pre/fix/*": ["/foo2/bar"], + "pre/fix/*": ["/foo3"] + }, + true + ); + assert.deepEqual(result, [ + { + pattern: "longest/pre/fix/*", + paths: [join("/absolute", "base", "url", "foo2", "bar")] + }, + { + pattern: "pre/fix/*", + paths: [join("/absolute", "base", "url", "foo3")] + }, + { + pattern: "*", + paths: [ + join("/absolute", "base", "url", "foo1"), + join("/absolute", "base", "url", "foo2") + ] + } + ]); + }); + + it("should should add a match-all pattern when requested", () => { + let result = getAbsoluteMappingEntries("/absolute/base/url", {}, true); + assert.deepEqual(result, [ + { + pattern: "*", + paths: [join("/absolute", "base", "url", "*")] + } + ]); + + result = getAbsoluteMappingEntries("/absolute/base/url", {}, false); + assert.deepEqual(result, []); + }); +}); diff --git a/node_modules/tsconfig-paths/test/match-path-async-tests.ts b/node_modules/tsconfig-paths/test/match-path-async-tests.ts new file mode 100644 index 0000000..e55bcc6 --- /dev/null +++ b/node_modules/tsconfig-paths/test/match-path-async-tests.ts @@ -0,0 +1,27 @@ +import { assert } from "chai"; +import { createMatchPathAsync } from "../src/match-path-async"; +import * as Tests from "./data/match-path-data"; + +describe("match-path-async", () => { + Tests.tests.forEach(t => + it(t.name, done => { + const matchPath = createMatchPathAsync( + t.absoluteBaseUrl, + t.paths, + t.mainFields, + t.addMatchAll + ); + matchPath( + t.requestedModule, + (_path, callback) => callback(undefined, t.packageJson), + (path, callback) => + callback(undefined, t.existingFiles.indexOf(path) !== -1), + t.extensions, + (_err, result) => { + assert.equal(result, t.expectedPath); + done(); + } + ); + }) + ); +}); diff --git a/node_modules/tsconfig-paths/test/match-path-sync-tests.ts b/node_modules/tsconfig-paths/test/match-path-sync-tests.ts new file mode 100644 index 0000000..668bc4a --- /dev/null +++ b/node_modules/tsconfig-paths/test/match-path-sync-tests.ts @@ -0,0 +1,23 @@ +import { assert } from "chai"; +import { createMatchPath } from "../src/match-path-sync"; +import * as Tests from "./data/match-path-data"; + +describe("match-path-sync", () => { + Tests.tests.forEach(t => + it(t.name, () => { + const matchPath = createMatchPath( + t.absoluteBaseUrl, + t.paths, + t.mainFields, + t.addMatchAll + ); + const result = matchPath( + t.requestedModule, + (_: string) => t.packageJson, + (name: string) => t.existingFiles.indexOf(name) !== -1, // fileExists + t.extensions + ); + assert.equal(result, t.expectedPath); + }) + ); +}); diff --git a/node_modules/tsconfig-paths/test/mocha.opts b/node_modules/tsconfig-paths/test/mocha.opts new file mode 100644 index 0000000..1c00f5f --- /dev/null +++ b/node_modules/tsconfig-paths/test/mocha.opts @@ -0,0 +1,3 @@ +--require ts-node/register +--recursive test/ +test/**/*.ts diff --git a/node_modules/tsconfig-paths/test/try-path-tests.ts b/node_modules/tsconfig-paths/test/try-path-tests.ts new file mode 100644 index 0000000..da8efdf --- /dev/null +++ b/node_modules/tsconfig-paths/test/try-path-tests.ts @@ -0,0 +1,99 @@ +import { assert } from "chai"; +import { getPathsToTry } from "../src/try-path"; +import { join } from "path"; + +describe("mapping-entry", () => { + const abosolutePathMappings = [ + { + pattern: "longest/pre/fix/*", + paths: [join("/absolute", "base", "url", "foo2", "bar")] + }, + { pattern: "pre/fix/*", paths: [join("/absolute", "base", "url", "foo3")] }, + { pattern: "*", paths: [join("/absolute", "base", "url", "foo1")] } + ]; + it("should return no paths for relative requested module", () => { + const result = getPathsToTry( + [".ts", "tsx"], + abosolutePathMappings, + "./requested-module" + ); + assert.deepEqual(result, undefined); + }); + + it("should return no paths if no pattern match the requested module", () => { + const result = getPathsToTry( + [".ts", "tsx"], + [ + { + pattern: "longest/pre/fix/*", + paths: [join("/absolute", "base", "url", "foo2", "bar")] + }, + { + pattern: "pre/fix/*", + paths: [join("/absolute", "base", "url", "foo3")] + } + ], + "requested-module" + ); + assert.deepEqual(result, undefined); + }); + + it("should get all paths that matches requested module", () => { + const result = getPathsToTry( + [".ts", ".tsx"], + abosolutePathMappings, + "longest/pre/fix/requested-module" + ); + assert.deepEqual(result, [ + // "longest/pre/fix/*" + { type: "file", path: join("/absolute", "base", "url", "foo2", "bar") }, + { + type: "extension", + path: join("/absolute", "base", "url", "foo2", "bar.ts") + }, + { + type: "extension", + path: join("/absolute", "base", "url", "foo2", "bar.tsx") + }, + { + type: "package", + path: join("/absolute", "base", "url", "foo2", "bar", "package.json") + }, + { + type: "index", + path: join("/absolute", "base", "url", "foo2", "bar", "index.ts") + }, + { + type: "index", + path: join("/absolute", "base", "url", "foo2", "bar", "index.tsx") + }, + // "*" + { type: "file", path: join("/absolute", "base", "url", "foo1") }, + { type: "extension", path: join("/absolute", "base", "url", "foo1.ts") }, + { type: "extension", path: join("/absolute", "base", "url", "foo1.tsx") }, + { + type: "package", + path: join("/absolute", "base", "url", "foo1", "package.json") + }, + { + type: "index", + path: join("/absolute", "base", "url", "foo1", "index.ts") + }, + { + type: "index", + path: join("/absolute", "base", "url", "foo1", "index.tsx") + } + ]); + }); +}); + +// describe("match-star", () => { +// it("should match star in last position", () => { +// const result = matchStar("lib/*", "lib/mylib"); +// assert.equal(result, "mylib"); +// }); +// it("should match star in first position", () => { +// const result = matchStar("*/lib", "mylib/lib"); +// assert.equal(result, "mylib"); +// }); +// }); diff --git a/node_modules/tsconfig-paths/test/tsconfig-loader-tests.ts b/node_modules/tsconfig-paths/test/tsconfig-loader-tests.ts new file mode 100644 index 0000000..002bcb4 --- /dev/null +++ b/node_modules/tsconfig-paths/test/tsconfig-loader-tests.ts @@ -0,0 +1,203 @@ +import { assert } from "chai"; +import { + loadTsconfig, + tsConfigLoader, + walkForTsConfig +} from "../src/tsconfig-loader"; +import { join } from "path"; + +describe("tsconfig-loader", () => { + it("should find tsconfig in cwd", () => { + const result = tsConfigLoader({ + cwd: "/foo/bar", + getEnv: (_: string) => undefined, + loadSync: (cwd: string) => { + return { + tsConfigPath: `${cwd}/tsconfig.json`, + baseUrl: "./", + paths: {} + }; + } + }); + + assert.equal(result.tsConfigPath, "/foo/bar/tsconfig.json"); + }); + + it("should return loaderResult.tsConfigPath as undefined when not found", () => { + const result = tsConfigLoader({ + cwd: "/foo/bar", + getEnv: (_: string) => undefined, + loadSync: (_: string) => { + return { + tsConfigPath: undefined, + baseUrl: "./", + paths: {} + }; + } + }); + + assert.isUndefined(result.tsConfigPath); + }); + + it("should use TS_NODE_PROJECT env if exists", () => { + const result = tsConfigLoader({ + cwd: "/foo/bar", + getEnv: (key: string) => + key === "TS_NODE_PROJECT" ? "/foo/baz" : undefined, + loadSync: (cwd: string, fileName: string) => { + if (cwd === "/foo/bar" && fileName === "/foo/baz") { + return { + tsConfigPath: "/foo/baz/tsconfig.json", + baseUrl: "./", + paths: {} + }; + } + + return { + tsConfigPath: undefined, + baseUrl: "./", + paths: {} + }; + } + }); + + assert.equal(result.tsConfigPath, "/foo/baz/tsconfig.json"); + }); +}); + +describe("walkForTsConfig", () => { + it("should find tsconfig in starting directory", () => { + const pathToTsconfig = join("/root", "dir1", "tsconfig.json"); + const res = walkForTsConfig( + join("/root", "dir1"), + path => path === pathToTsconfig + ); + assert.equal(res, pathToTsconfig); + }); + + it("should find tsconfig in parent directory", () => { + const pathToTsconfig = join("/root", "tsconfig.json"); + const res = walkForTsConfig( + join("/root", "dir1"), + path => path === pathToTsconfig + ); + assert.equal(res, pathToTsconfig); + }); + + it("should return undefined when reaching the top", () => { + const res = walkForTsConfig(join("/root", "dir1", "kalle"), () => false); + assert.equal(res, undefined); + }); +}); + +describe("loadConfig", () => { + it("It should load a config", () => { + const config = { compilerOptions: { baseUrl: "hej" } }; + const res = loadTsconfig( + "/root/dir1/tsconfig.json", + path => path === "/root/dir1/tsconfig.json", + _ => JSON.stringify(config) + ); + assert.deepEqual(res, config); + }); + + it("It should load a config with comments", () => { + const config = { compilerOptions: { baseUrl: "hej" } }; + const res = loadTsconfig( + "/root/dir1/tsconfig.json", + path => path === "/root/dir1/tsconfig.json", + _ => `{ + // my comment + "compilerOptions": { + "baseUrl": "hej" + } + }` + ); + assert.deepEqual(res, config); + }); + + it("It should load a config with trailing commas", () => { + const config = { compilerOptions: { baseUrl: "hej" } }; + const res = loadTsconfig( + "/root/dir1/tsconfig.json", + path => path === "/root/dir1/tsconfig.json", + _ => `{ + "compilerOptions": { + "baseUrl": "hej", + }, + }` + ); + assert.deepEqual(res, config); + }); + + it("It should load a config with extends and overwrite all options", () => { + const firstConfig = { + extends: "../base-config.json", + compilerOptions: { baseUrl: "kalle", paths: { foo: ["bar2"] } } + }; + const firstConfigPath = join("/root", "dir1", "tsconfig.json"); + const baseConfig = { + compilerOptions: { + baseUrl: "olle", + paths: { foo: ["bar1"] }, + strict: true + } + }; + const baseConfigPath = join("/root", "base-config.json"); + const res = loadTsconfig( + join("/root", "dir1", "tsconfig.json"), + path => path === firstConfigPath || path === baseConfigPath, + path => { + if (path === firstConfigPath) { + return JSON.stringify(firstConfig); + } + if (path === baseConfigPath) { + return JSON.stringify(baseConfig); + } + return ""; + } + ); + + assert.deepEqual(res, { + extends: "../base-config.json", + compilerOptions: { + baseUrl: "kalle", + paths: { foo: ["bar2"] }, + strict: true + } + }); + }); + + it("Should use baseUrl relative to location of extended tsconfig", () => { + const firstConfig = { compilerOptions: { baseUrl: "." } }; + const firstConfigPath = join("/root", "first-config.json"); + const secondConfig = { extends: "../first-config.json" }; + const secondConfigPath = join("/root", "dir1", "second-config.json"); + const thirdConfig = { extends: "../second-config.json" }; + const thirdConfigPath = join("/root", "dir1", "dir2", "third-config.json"); + const res = loadTsconfig( + join("/root", "dir1", "dir2", "third-config.json"), + path => + path === firstConfigPath || + path === secondConfigPath || + path === thirdConfigPath, + path => { + if (path === firstConfigPath) { + return JSON.stringify(firstConfig); + } + if (path === secondConfigPath) { + return JSON.stringify(secondConfig); + } + if (path === thirdConfigPath) { + return JSON.stringify(thirdConfig); + } + return ""; + } + ); + + assert.deepEqual(res, { + extends: "../second-config.json", + compilerOptions: { baseUrl: join("..", "..") } + }); + }); +}); diff --git a/node_modules/tsconfig-paths/test/tsconfig-named.json b/node_modules/tsconfig-paths/test/tsconfig-named.json new file mode 100644 index 0000000..a337580 --- /dev/null +++ b/node_modules/tsconfig-paths/test/tsconfig-named.json @@ -0,0 +1,10 @@ +{ + "extends": "../base-tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "module": "commonjs", + "target": "es6", + "sourceMap": true, + "outDir": "./js_out" + } +} diff --git a/node_modules/tsconfig-paths/test/tsconfig.json b/node_modules/tsconfig-paths/test/tsconfig.json new file mode 100644 index 0000000..12f379d --- /dev/null +++ b/node_modules/tsconfig-paths/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../base-tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "sourceMap": true, + "outDir": "./js_out" + } +} diff --git a/node_modules/tsconfig-paths/tslint.json b/node_modules/tsconfig-paths/tslint.json new file mode 100644 index 0000000..4cb0bca --- /dev/null +++ b/node_modules/tsconfig-paths/tslint.json @@ -0,0 +1,88 @@ +{ + "rules": { + "no-any": true, + "no-internal-module": true, + "no-namespace": true, + "no-reference": true, + "no-var-requires": true, + "typedef": [true, "call-signature", "parameter", "property-declaration"], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "curly": true, + "forin": true, + "label-position": true, + "no-arg": true, + "no-bitwise": true, + "no-conditional-assignment": true, + // "no-console": [ + // true, + // "log" + // ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-eval": true, + "no-invalid-this": true, + // "no-null-keyword": true, + "no-shadowed-variable": true, + // "no-string-literal": true, + "no-switch-case-fall-through": true, + "no-unsafe-finally": true, + "no-unused-expression": true, + "no-var-keyword": true, + "radix": true, + "switch-default": true, + "triple-equals": true, + "use-isnan": true, + "eofline": true, + "indent": [true, "spaces"], + "max-file-line-count": [true, 800], + "max-line-length": [true, 160], + "no-default-export": true, + "no-mergeable-namespace": true, + "no-require-imports": true, + "align": [true, "statements"], + //"arrow-parens": true, + "class-name": true, + "jsdoc-format": true, + "new-parens": true, + "no-angle-bracket-type-assertion": true, + "no-consecutive-blank-lines": [true, 1], + "no-parameter-properties": true, + // "object-literal-key-quotes": [ + // true, + // "as-needed" + // ], + "one-line": [ + true, + "check-catch", + "check-finally", + "check-else", + "check-open-brace", + "check-whitespace" + ], + "one-variable-per-declaration": [true], + "variable-name": [ + true, + "ban-keywords", + "check-format", + "allow-leading-underscore" + ] + } +} diff --git a/node_modules/type-check/LICENSE b/node_modules/type-check/LICENSE new file mode 100644 index 0000000..525b118 --- /dev/null +++ b/node_modules/type-check/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) George Zahariev + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/type-check/README.md b/node_modules/type-check/README.md new file mode 100644 index 0000000..b170d67 --- /dev/null +++ b/node_modules/type-check/README.md @@ -0,0 +1,210 @@ +# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check) + + + +`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.4.0. Check out the [demo](http://gkz.github.io/type-check/). + +For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev). + + npm install type-check + +## Quick Examples + +```js +// Basic types: +var typeCheck = require('type-check').typeCheck; +typeCheck('Number', 1); // true +typeCheck('Number', 'str'); // false +typeCheck('Error', new Error); // true +typeCheck('Undefined', undefined); // true + +// Comment +typeCheck('count::Number', 1); // true + +// One type OR another type: +typeCheck('Number | String', 2); // true +typeCheck('Number | String', 'str'); // true + +// Wildcard, matches all types: +typeCheck('*', 2) // true + +// Array, all elements of a single type: +typeCheck('[Number]', [1, 2, 3]); // true +typeCheck('[Number]', [1, 'str', 3]); // false + +// Tuples, or fixed length arrays with elements of different types: +typeCheck('(String, Number)', ['str', 2]); // true +typeCheck('(String, Number)', ['str']); // false +typeCheck('(String, Number)', ['str', 2, 5]); // false + +// Object properties: +typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true +typeCheck('{x: Number, y: Boolean}', {x: 2}); // false +typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true +typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false +typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true + +// A particular type AND object properties: +typeCheck('RegExp{source: String, ...}', /re/i); // true +typeCheck('RegExp{source: String, ...}', {source: 're'}); // false + +// Custom types: +var opt = {customTypes: + {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}}; +typeCheck('Even', 2, opt); // true + +// Nested: +var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}' +typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true +``` + +Check out the [type syntax format](#syntax) and [guide](#guide). + +## Usage + +`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions. + +```js +// typeCheck(type, input, options); +typeCheck('Number', 2); // true + +// parseType(type); +var parsedType = parseType('Number'); // object + +// parsedTypeCheck(parsedType, input, options); +parsedTypeCheck(parsedType, 2); // true +``` + +### typeCheck(type, input, options) + +`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`. + +##### arguments +* type - `String` - the type written in the [type format](#type-format) which to check against +* input - `*` - any JavaScript value, which is to be checked against the type +* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) + +##### returns +`Boolean` - whether the input matches the type + +##### example +```js +typeCheck('Number', 2); // true +``` + +### parseType(type) + +`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type. + +##### arguments +* type - `String` - the type written in the [type format](#type-format) which to parse + +##### returns +`Object` - an object in the parsed type format representing the parsed type + +##### example +```js +parseType('Number'); // [{type: 'Number'}] +``` +### parsedTypeCheck(parsedType, input, options) + +`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once. + +##### arguments +* type - `Object` - the type in the parsed type format which to check against +* input - `*` - any JavaScript value, which is to be checked against the type +* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) + +##### returns +`Boolean` - whether the input matches the type + +##### example +```js +parsedTypeCheck([{type: 'Number'}], 2); // true +var parsedType = parseType('String'); +parsedTypeCheck(parsedType, 'str'); // true +``` + + +## Type Format + +### Syntax + +White space is ignored. The root node is a __Types__. + +* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String` +* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*` +* __Types__ = optionally a comment (an `Identifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String` +* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]` +* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}` +* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean` +* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)` +* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]` + +### Guide + +`type-check` uses `Object.toString` to find out the basic type of a value. Specifically, + +```js +{}.toString.call(VALUE).slice(8, -1) +{}.toString.call(true).slice(8, -1) // 'Boolean' +``` +A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`. + +You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false. + +Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`. + +You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out. + +The wildcard `*` matches all types. + +There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'. + +If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`. + +To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`. + +If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null). + +If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties. + +For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`. + +A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`. + +An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all. + +Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check. + +## Options + +Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`. + + +### Custom Types + +__Example:__ + +```js +var options = { + customTypes: { + Even: { + typeOf: 'Number', + validate: function(x) { + return x % 2 === 0; + } + } + } +}; +typeCheck('Even', 2, options); // true +typeCheck('Even', 3, options); // false +``` + +`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function. + +The `typeOf` property is the type the value should be (optional - if not set only `validate` will be used), and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking. + +## Technical About + +`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/type-check/lib/check.js b/node_modules/type-check/lib/check.js new file mode 100644 index 0000000..f78687e --- /dev/null +++ b/node_modules/type-check/lib/check.js @@ -0,0 +1,128 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var ref$, any, all, isItNaN, types, defaultType, toString$ = {}.toString; + ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; + types = { + Number: { + typeOf: 'Number', + validate: function(it){ + return !isItNaN(it); + } + }, + NaN: { + typeOf: 'Number', + validate: isItNaN + }, + Int: { + typeOf: 'Number', + validate: function(it){ + return !isItNaN(it) && it % 1 === 0; + } + }, + Float: { + typeOf: 'Number', + validate: function(it){ + return !isItNaN(it); + } + }, + Date: { + typeOf: 'Date', + validate: function(it){ + return !isItNaN(it.getTime()); + } + } + }; + defaultType = { + array: 'Array', + tuple: 'Array' + }; + function checkArray(input, type, options){ + return all(function(it){ + return checkMultiple(it, type.of, options); + }, input); + } + function checkTuple(input, type, options){ + var i, i$, ref$, len$, types; + i = 0; + for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { + types = ref$[i$]; + if (!checkMultiple(input[i], types, options)) { + return false; + } + i++; + } + return input.length <= i; + } + function checkFields(input, type, options){ + var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types; + inputKeys = {}; + numInputKeys = 0; + for (k in input) { + inputKeys[k] = true; + numInputKeys++; + } + numOfKeys = 0; + for (key in ref$ = type.of) { + types = ref$[key]; + if (!checkMultiple(input[key], types, options)) { + return false; + } + if (inputKeys[key]) { + numOfKeys++; + } + } + return type.subset || numInputKeys === numOfKeys; + } + function checkStructure(input, type, options){ + if (!(input instanceof Object)) { + return false; + } + switch (type.structure) { + case 'fields': + return checkFields(input, type, options); + case 'array': + return checkArray(input, type, options); + case 'tuple': + return checkTuple(input, type, options); + } + } + function check(input, typeObj, options){ + var type, structure, setting, that; + type = typeObj.type, structure = typeObj.structure; + if (type) { + if (type === '*') { + return true; + } + setting = options.customTypes[type] || types[type]; + if (setting) { + return (setting.typeOf === void 8 || setting.typeOf === toString$.call(input).slice(8, -1)) && setting.validate(input); + } else { + return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj, options)); + } + } else if (structure) { + if (that = defaultType[structure]) { + if (that !== toString$.call(input).slice(8, -1)) { + return false; + } + } + return checkStructure(input, typeObj, options); + } else { + throw new Error("No type defined. Input: " + input + "."); + } + } + function checkMultiple(input, types, options){ + if (toString$.call(types).slice(8, -1) !== 'Array') { + throw new Error("Types must be in an array. Input: " + input + "."); + } + return any(function(it){ + return check(input, it, options); + }, types); + } + module.exports = function(parsedType, input, options){ + options == null && (options = {}); + if (options.customTypes == null) { + options.customTypes = {}; + } + return checkMultiple(input, parsedType, options); + }; +}).call(this); diff --git a/node_modules/type-check/lib/index.js b/node_modules/type-check/lib/index.js new file mode 100644 index 0000000..09db4cb --- /dev/null +++ b/node_modules/type-check/lib/index.js @@ -0,0 +1,16 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var VERSION, parseType, parsedTypeCheck, typeCheck; + VERSION = '0.4.0'; + parseType = require('./parse-type'); + parsedTypeCheck = require('./check'); + typeCheck = function(type, input, options){ + return parsedTypeCheck(parseType(type), input, options); + }; + module.exports = { + VERSION: VERSION, + typeCheck: typeCheck, + parsedTypeCheck: parsedTypeCheck, + parseType: parseType + }; +}).call(this); diff --git a/node_modules/type-check/lib/parse-type.js b/node_modules/type-check/lib/parse-type.js new file mode 100644 index 0000000..c360c97 --- /dev/null +++ b/node_modules/type-check/lib/parse-type.js @@ -0,0 +1,198 @@ +// Generated by LiveScript 1.6.0 +(function(){ + var identifierRegex, tokenRegex; + identifierRegex = /[\$\w]+/; + function peek(tokens){ + var token; + token = tokens[0]; + if (token == null) { + throw new Error('Unexpected end of input.'); + } + return token; + } + function consumeIdent(tokens){ + var token; + token = peek(tokens); + if (!identifierRegex.test(token)) { + throw new Error("Expected text, got '" + token + "' instead."); + } + return tokens.shift(); + } + function consumeOp(tokens, op){ + var token; + token = peek(tokens); + if (token !== op) { + throw new Error("Expected '" + op + "', got '" + token + "' instead."); + } + return tokens.shift(); + } + function maybeConsumeOp(tokens, op){ + var token; + token = tokens[0]; + if (token === op) { + return tokens.shift(); + } else { + return null; + } + } + function consumeArray(tokens){ + var types; + consumeOp(tokens, '['); + if (peek(tokens) === ']') { + throw new Error("Must specify type of Array - eg. [Type], got [] instead."); + } + types = consumeTypes(tokens); + consumeOp(tokens, ']'); + return { + structure: 'array', + of: types + }; + } + function consumeTuple(tokens){ + var components; + components = []; + consumeOp(tokens, '('); + if (peek(tokens) === ')') { + throw new Error("Tuple must be of at least length 1 - eg. (Type), got () instead."); + } + for (;;) { + components.push(consumeTypes(tokens)); + maybeConsumeOp(tokens, ','); + if (')' === peek(tokens)) { + break; + } + } + consumeOp(tokens, ')'); + return { + structure: 'tuple', + of: components + }; + } + function consumeFields(tokens){ + var fields, subset, ref$, key, types; + fields = {}; + consumeOp(tokens, '{'); + subset = false; + for (;;) { + if (maybeConsumeOp(tokens, '...')) { + subset = true; + break; + } + ref$ = consumeField(tokens), key = ref$[0], types = ref$[1]; + fields[key] = types; + maybeConsumeOp(tokens, ','); + if ('}' === peek(tokens)) { + break; + } + } + consumeOp(tokens, '}'); + return { + structure: 'fields', + of: fields, + subset: subset + }; + } + function consumeField(tokens){ + var key, types; + key = consumeIdent(tokens); + consumeOp(tokens, ':'); + types = consumeTypes(tokens); + return [key, types]; + } + function maybeConsumeStructure(tokens){ + switch (tokens[0]) { + case '[': + return consumeArray(tokens); + case '(': + return consumeTuple(tokens); + case '{': + return consumeFields(tokens); + } + } + function consumeType(tokens){ + var token, wildcard, type, structure; + token = peek(tokens); + wildcard = token === '*'; + if (wildcard || identifierRegex.test(token)) { + type = wildcard + ? consumeOp(tokens, '*') + : consumeIdent(tokens); + structure = maybeConsumeStructure(tokens); + if (structure) { + return structure.type = type, structure; + } else { + return { + type: type + }; + } + } else { + structure = maybeConsumeStructure(tokens); + if (!structure) { + throw new Error("Unexpected character: " + token); + } + return structure; + } + } + function consumeTypes(tokens){ + var lookahead, types, typesSoFar, typeObj, type, structure; + if ('::' === peek(tokens)) { + throw new Error("No comment before comment separator '::' found."); + } + lookahead = tokens[1]; + if (lookahead != null && lookahead === '::') { + tokens.shift(); + tokens.shift(); + } + types = []; + typesSoFar = {}; + if ('Maybe' === peek(tokens)) { + tokens.shift(); + types = [ + { + type: 'Undefined' + }, { + type: 'Null' + } + ]; + typesSoFar = { + Undefined: true, + Null: true + }; + } + for (;;) { + typeObj = consumeType(tokens), type = typeObj.type, structure = typeObj.structure; + if (!typesSoFar[type]) { + types.push(typeObj); + } + if (structure == null) { + typesSoFar[type] = true; + } + if (!maybeConsumeOp(tokens, '|')) { + break; + } + } + return types; + } + tokenRegex = RegExp('\\.\\.\\.|::|->|' + identifierRegex.source + '|\\S', 'g'); + module.exports = function(input){ + var tokens, e; + if (!input.length) { + throw new Error('No type specified.'); + } + tokens = input.match(tokenRegex) || []; + if (in$('->', tokens)) { + throw new Error("Function types are not supported.\ To validate that something is a function, you may use 'Function'."); + } + try { + return consumeTypes(tokens); + } catch (e$) { + e = e$; + throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'"); + } + }; + function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; + } +}).call(this); diff --git a/node_modules/type-check/package.json b/node_modules/type-check/package.json new file mode 100644 index 0000000..8a1b91c --- /dev/null +++ b/node_modules/type-check/package.json @@ -0,0 +1,70 @@ +{ + "_from": "type-check@~0.4.0", + "_id": "type-check@0.4.0", + "_inBundle": false, + "_integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "_location": "/type-check", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "type-check@~0.4.0", + "name": "type-check", + "escapedName": "type-check", + "rawSpec": "~0.4.0", + "saveSpec": null, + "fetchSpec": "~0.4.0" + }, + "_requiredBy": [ + "/levn", + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "_shasum": "07b8203bfa7056c0657050e3ccd2c37730bab8f1", + "_spec": "type-check@~0.4.0", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/levn", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/type-check/issues" + }, + "bundleDependencies": false, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "deprecated": false, + "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", + "devDependencies": { + "browserify": "^16.5.1", + "livescript": "^1.6.0", + "mocha": "^7.1.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "homepage": "https://github.com/gkz/type-check", + "keywords": [ + "type", + "check", + "checking", + "library" + ], + "license": "MIT", + "main": "./lib/", + "name": "type-check", + "repository": { + "type": "git", + "url": "git://github.com/gkz/type-check.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.4.0" +} diff --git a/node_modules/type-fest/index.d.ts b/node_modules/type-fest/index.d.ts new file mode 100644 index 0000000..520df22 --- /dev/null +++ b/node_modules/type-fest/index.d.ts @@ -0,0 +1,20 @@ +// Basic +export * from './source/basic'; + +// Utilities +export {Except} from './source/except'; +export {Mutable} from './source/mutable'; +export {Merge} from './source/merge'; +export {MergeExclusive} from './source/merge-exclusive'; +export {RequireAtLeastOne} from './source/require-at-least-one'; +export {RequireExactlyOne} from './source/require-exactly-one'; +export {PartialDeep} from './source/partial-deep'; +export {ReadonlyDeep} from './source/readonly-deep'; +export {LiteralUnion} from './source/literal-union'; +export {Promisable} from './source/promisable'; +export {Opaque} from './source/opaque'; +export {SetOptional} from './source/set-optional'; +export {SetRequired} from './source/set-required'; + +// Miscellaneous +export {PackageJson} from './source/package-json'; diff --git a/node_modules/type-fest/license b/node_modules/type-fest/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/type-fest/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/type-fest/package.json b/node_modules/type-fest/package.json new file mode 100644 index 0000000..59cfdf8 --- /dev/null +++ b/node_modules/type-fest/package.json @@ -0,0 +1,83 @@ +{ + "_from": "type-fest@^0.8.1", + "_id": "type-fest@0.8.1", + "_inBundle": false, + "_integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "_location": "/type-fest", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "type-fest@^0.8.1", + "name": "type-fest", + "escapedName": "type-fest", + "rawSpec": "^0.8.1", + "saveSpec": null, + "fetchSpec": "^0.8.1" + }, + "_requiredBy": [ + "/globals" + ], + "_resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "_shasum": "09e249ebde851d3b1e48d27c105444667f17b83d", + "_spec": "type-fest@^0.8.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/globals", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/type-fest/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A collection of essential TypeScript types", + "devDependencies": { + "@sindresorhus/tsconfig": "^0.4.0", + "@typescript-eslint/eslint-plugin": "^2.2.0", + "@typescript-eslint/parser": "^2.2.0", + "eslint-config-xo-typescript": "^0.18.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.d.ts", + "source" + ], + "homepage": "https://github.com/sindresorhus/type-fest#readme", + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "license": "(MIT OR CC0-1.0)", + "name": "type-fest", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/type-fest.git" + }, + "scripts": { + "test": "xo && tsd" + }, + "version": "0.8.1", + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "rules": { + "import/no-unresolved": "off", + "@typescript-eslint/indent": "off" + } + } +} diff --git a/node_modules/type-fest/readme.md b/node_modules/type-fest/readme.md new file mode 100644 index 0000000..1824bda --- /dev/null +++ b/node_modules/type-fest/readme.md @@ -0,0 +1,635 @@ +
+
+
+ type-fest +
+
+ A collection of essential TypeScript types +
+
+
+
+
+ +[![Build Status](https://travis-ci.com/sindresorhus/type-fest.svg?branch=master)](https://travis-ci.com/sindresorhus/type-fest) +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.2* + + +## Usage + +```ts +import {Except} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Except; +//=> {unicorn: string} +``` + + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). +- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. +- [`RequireExactlyOne`](source/require-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. +- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). +- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. +- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). +- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. +- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). + + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. +- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. + + +## Tips + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/KYOwrgtgBAMg9gcxsAbsANlA3gKClAeQDMiAaPKAEWACMwFz8BRAJxbhcagDEBDAF17ocAXxw4AliH7AWRXgGNgUAHJwAJsADCcEEQkJsFXgAcTK3hGAAuKAGd+LKQgDcFEx363wEGrLf46IjIaOi28EioGG5iOArovHZ2qhrAAIJmAEJgEuiaLEb4Jk4oAsoKuvoIYCwCErq2apo6egZQALyF+FCm5pY2UABETelmg1xFnrYAzAAM8xNQQZGh4cFR6AB0xEQUIm4UFa0IABRHVbYACrws-BJCADwjLVUAfACUXfhEHFBnug4oABrYAATygcCIhBoACtgAp+JsQaC7P9ju9Prhut0joCwCZ1GUAGpCMDKTrnAwAbWRPWSyMhKWalQMAF0Dtj8BIoSd8YSZCT0GSOu1OmAQJp9CBgOpPkc7uBgBzOfwABYSOybSnVWp3XQ0sF04FgxnPFkIVkdKB84mkpUUfCxbEsYD8GogKBqjUBKBiWIAen9UGut3u6CeqReBlePXQQQA7skwMl+HAoMU4CgJJoISB0ODeOmbvwIVC1cAcIGmdpzVApDI5IpgJscNL49WMiZsrl8id3lrzScsD0zBYrLZBgAVOCUOCdwa+95uIA) + + ```ts + interface NodeConfig { + appName: string; + port: number; + } + + class NodeAppBuilder { + private configuration: NodeConfig = { + appName: 'NodeApp', + port: 3000 + }; + + config(config: Partial) { + type NodeConfigKey = keyof NodeConfig; + + for (const key of Object.keys(config) as NodeConfigKey[]) { + const updateValue = config[key]; + + if (updateValue === undefined) { + continue; + } + + this.configuration[key] = updateValue; + } + + return this; + } + } + + // `Partial`` allows us to provide only a part of the + // NodeConfig interface. + new NodeAppBuilder().config({appName: 'ToDoApp'}); + ``` +
+ +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) + + ```ts + interface ContactForm { + email?: string; + message?: string; + } + + function submitContactForm(formData: Required) { + // Send the form data to the server. + } + + submitContactForm({ + email: 'ex@mple.com', + message: 'Hi! Could you tell me more about…', + }); + + // TypeScript error: missing property 'message' + submitContactForm({ + email: 'ex@mple.com', + }); + ``` +
+ +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) + + ```ts + enum LogLevel { + Off, + Debug, + Error, + Fatal + }; + + interface LoggerConfig { + name: string; + level: LogLevel; + } + + class Logger { + config: Readonly; + + constructor({name, level}: LoggerConfig) { + this.config = {name, level}; + Object.freeze(this.config); + } + } + + const config: LoggerConfig = { + name: 'MyApp', + level: LogLevel.Debug + }; + + const logger = new Logger(config); + + // TypeScript Error: cannot assign to read-only property. + logger.config.level = LogLevel.Error; + + // We are able to edit config variable as we please. + config.level = LogLevel.Error; + ``` +
+ +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) + + ```ts + interface Article { + title: string; + thumbnail: string; + content: string; + } + + // Creates new type out of the `Article` interface composed + // from the Articles' two properties: `title` and `thumbnail`. + // `ArticlePreview = {title: string; thumbnail: string}` + type ArticlePreview = Pick; + + // Render a list of articles using only title and description. + function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { + const articles = document.createElement('div'); + + for (const preview of previews) { + // Append preview to the articles. + } + + return articles; + } + + const articles = renderArticlePreviews([ + { + title: 'TypeScript tutorial!', + thumbnail: '/assets/ts.jpg' + } + ]); + ``` +
+ +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) + + ```ts + // Positions of employees in our company. + type MemberPosition = 'intern' | 'developer' | 'tech-lead'; + + // Interface describing properties of a single employee. + interface Employee { + firstName: string; + lastName: string; + yearsOfExperience: number; + } + + // Create an object that has all possible `MemberPosition` values set as keys. + // Those keys will store a collection of Employees of the same position. + const team: Record = { + intern: [], + developer: [], + 'tech-lead': [], + }; + + // Our team has decided to help John with his dream of becoming Software Developer. + team.intern.push({ + firstName: 'John', + lastName: 'Doe', + yearsOfExperience: 0 + }); + + // `Record` forces you to initialize all of the property keys. + // TypeScript Error: "tech-lead" property is missing + const teamEmpty: Record = { + intern: null, + developer: null, + }; + ``` +
+ +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) + + ```ts + interface ServerConfig { + port: null | string | number; + } + + type RequestHandler = (request: Request, response: Response) => void; + + // Exclude `null` type from `null | string | number`. + // In case the port is equal to `null`, we will use default value. + function getPortValue(port: Exclude): number { + if (typeof port === 'string') { + return parseInt(port, 10); + } + + return port; + } + + function startServer(handler: RequestHandler, config: ServerConfig): void { + const server = require('http').createServer(handler); + + const port = config.port === null ? 3000 : getPortValue(config.port); + server.listen(port); + } + ``` +
+ +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) + + ```ts + declare function uniqueId(): number; + + const ID = Symbol('ID'); + + interface Person { + [ID]: number; + name: string; + age: number; + } + + // Allows changing the person data as long as the property key is of string type. + function changePersonData< + Obj extends Person, + Key extends Extract, + Value extends Obj[Key] + > (obj: Obj, key: Key, value: Value): void { + obj[key] = value; + } + + // Tiny Andrew was born. + const andrew = { + [ID]: uniqueId(), + name: 'Andrew', + age: 0, + }; + + // Cool, we're fine with that. + changePersonData(andrew, 'name', 'Pony'); + + // Goverment didn't like the fact that you wanted to change your identity. + changePersonData(andrew, ID, uniqueId()); + ``` +
+ +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +
+ + Example + + Works with strictNullChecks set to true. (Read more here) + + [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) + + ```ts + type PortNumber = string | number | null; + + /** Part of a class definition that is used to build a server */ + class ServerBuilder { + portNumber!: NonNullable; + + port(this: ServerBuilder, port: PortNumber): ServerBuilder { + if (port == null) { + this.portNumber = 8000; + } else { + this.portNumber = port; + } + + return this; + } + } + + const serverBuilder = new ServerBuilder(); + + serverBuilder + .port('8000') // portNumber = '8000' + .port(null) // portNumber = 8000 + .port(3000); // portNumber = 3000 + + // TypeScript error + serverBuilder.portNumber = null; + ``` +
+ +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) + + ```ts + function shuffle(input: any[]): void { + // Mutate array randomly changing its' elements indexes. + } + + function callNTimes any> (func: Fn, callCount: number) { + // Type that represents the type of the received function parameters. + type FunctionParameters = Parameters; + + return function (...args: FunctionParameters) { + for (let i = 0; i < callCount; i++) { + func(...args); + } + } + } + + const shuffleTwice = callNTimes(shuffle, 2); + ``` +
+ +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) + + ```ts + class ArticleModel { + title: string; + content?: string; + + constructor(title: string) { + this.title = title; + } + } + + class InstanceCache any)> { + private ClassConstructor: T; + private cache: Map> = new Map(); + + constructor (ctr: T) { + this.ClassConstructor = ctr; + } + + getInstance (...args: ConstructorParameters): InstanceType { + const hash = this.calculateArgumentsHash(...args); + + const existingInstance = this.cache.get(hash); + if (existingInstance !== undefined) { + return existingInstance; + } + + return new this.ClassConstructor(...args); + } + + private calculateArgumentsHash(...args: any[]): string { + // Calculate hash. + return 'hash'; + } + } + + const articleCache = new InstanceCache(ArticleModel); + const amazonArticle = articleCache.getInstance('Amazon forests burining!'); + ``` +
+ +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ + function mapIter< + Elem, + Func extends (elem: Elem) => any, + Ret extends ReturnType + >(iter: Iterable, callback: Func): Ret[] { + const mapped: Ret[] = []; + + for (const elem of iter) { + mapped.push(callback(elem)); + } + + return mapped; + } + + const setObject: Set = new Set(); + const mapObject: Map = new Map(); + + mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] + + mapIter(mapObject, ([key, value]: [number, string]) => { + return key % 2 === 0 ? value : 'Odd'; + }); // string[] + ``` +
+ +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + class IdleService { + doNothing (): void {} + } + + class News { + title: string; + content: string; + + constructor(title: string, content: string) { + this.title = title; + this.content = content; + } + } + + const instanceCounter: Map = new Map(); + + interface Constructor { + new(...args: any[]): any; + } + + // Keep track how many instances of `Constr` constructor have been created. + function getInstance< + Constr extends Constructor, + Args extends ConstructorParameters + >(constructor: Constr, ...args: Args): InstanceType { + let count = instanceCounter.get(constructor) || 0; + + const instance = new constructor(...args); + + instanceCounter.set(constructor, count + 1); + + console.log(`Created ${count + 1} instances of ${Constr.name} class`); + + return instance; + } + + + const idleService = getInstance(IdleService); + // Will log: `Created 1 instances of IdleService class` + const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); + // Will log: `Created 1 instances of News class` + ``` +
+ +- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) + + ```ts + interface Animal { + imageUrl: string; + species: string; + images: string[]; + paragraphs: string[]; + } + + // Creates new type with all properties of the `Animal` interface + // except 'images' and 'paragraphs' properties. We can use this + // type to render small hover tooltip for a wiki entry list. + type AnimalShortInfo = Omit; + + function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { + const container = document.createElement('div'); + // Internal implementation. + return container; + } + ``` +
+ +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) + + +## License + +(MIT OR CC0-1.0) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/type-fest/source/basic.d.ts b/node_modules/type-fest/source/basic.d.ts new file mode 100644 index 0000000..5969ce5 --- /dev/null +++ b/node_modules/type-fest/source/basic.d.ts @@ -0,0 +1,67 @@ +/// + +// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out. +/** +Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +*/ +export type Primitive = + | null + | undefined + | string + | number + | boolean + | symbol + | bigint; + +// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default +/** +Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +*/ +export type Class = new(...arguments_: Arguments) => T; + +/** +Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +*/ +export type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; + +/** +Matches a JSON object. + +This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. +*/ +export type JsonObject = {[key: string]: JsonValue}; + +/** +Matches a JSON array. +*/ +export interface JsonArray extends Array {} + +/** +Matches any valid JSON value. +*/ +export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; + +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). +*/ +export interface ObservableLike { + subscribe(observer: (value: unknown) => void): void; + [Symbol.observable](): ObservableLike; +} diff --git a/node_modules/type-fest/source/except.d.ts b/node_modules/type-fest/source/except.d.ts new file mode 100644 index 0000000..7dedbaa --- /dev/null +++ b/node_modules/type-fest/source/except.d.ts @@ -0,0 +1,22 @@ +/** +Create a type from an object type without certain keys. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/30825) if you want to have the stricter version as a built-in in TypeScript. + +@example +``` +import {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; + c: boolean; +}; + +type FooWithoutA = Except; +//=> {b: string}; +``` +*/ +export type Except = Pick>; diff --git a/node_modules/type-fest/source/literal-union.d.ts b/node_modules/type-fest/source/literal-union.d.ts new file mode 100644 index 0000000..52e8de6 --- /dev/null +++ b/node_modules/type-fest/source/literal-union.d.ts @@ -0,0 +1,33 @@ +import {Primitive} from './basic'; + +/** +Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. + +Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. + +This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. + +@example +``` +import {LiteralUnion} from 'type-fest'; + +// Before + +type Pet = 'dog' | 'cat' | string; + +const pet: Pet = ''; +// Start typing in your TypeScript-enabled IDE. +// You **will not** get auto-completion for `dog` and `cat` literals. + +// After + +type Pet2 = LiteralUnion<'dog' | 'cat', string>; + +const pet: Pet2 = ''; +// You **will** get auto-completion for `dog` and `cat` literals. +``` + */ +export type LiteralUnion< + LiteralType extends BaseType, + BaseType extends Primitive +> = LiteralType | (BaseType & {_?: never}); diff --git a/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/type-fest/source/merge-exclusive.d.ts new file mode 100644 index 0000000..059bd2c --- /dev/null +++ b/node_modules/type-fest/source/merge-exclusive.d.ts @@ -0,0 +1,39 @@ +// Helper type. Not useful on its own. +type Without = {[KeyType in Exclude]?: never}; + +/** +Create a type that has mutually exclusive keys. + +This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604). + +This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`. + +@example +``` +import {MergeExclusive} from 'type-fest'; + +interface ExclusiveVariation1 { + exclusive1: boolean; +} + +interface ExclusiveVariation2 { + exclusive2: string; +} + +type ExclusiveOptions = MergeExclusive; + +let exclusiveOptions: ExclusiveOptions; + +exclusiveOptions = {exclusive1: true}; +//=> Works +exclusiveOptions = {exclusive2: 'hi'}; +//=> Works +exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; +//=> Error +``` +*/ +export type MergeExclusive = + (FirstType | SecondType) extends object ? + (Without & SecondType) | (Without & FirstType) : + FirstType | SecondType; + diff --git a/node_modules/type-fest/source/merge.d.ts b/node_modules/type-fest/source/merge.d.ts new file mode 100644 index 0000000..4b3920b --- /dev/null +++ b/node_modules/type-fest/source/merge.d.ts @@ -0,0 +1,22 @@ +import {Except} from './except'; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import {Merge} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type Bar = { + b: number; +}; + +const ab: Merge = {a: 1, b: 2}; +``` +*/ +export type Merge = Except> & SecondType; diff --git a/node_modules/type-fest/source/mutable.d.ts b/node_modules/type-fest/source/mutable.d.ts new file mode 100644 index 0000000..03d0dda --- /dev/null +++ b/node_modules/type-fest/source/mutable.d.ts @@ -0,0 +1,22 @@ +/** +Convert an object with `readonly` keys into a mutable object. Inverse of `Readonly`. + +This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509). + +@example +``` +import {Mutable} from 'type-fest'; + +type Foo = { + readonly a: number; + readonly b: string; +}; + +const mutableFoo: Mutable = {a: 1, b: '2'}; +mutableFoo.a = 3; +``` +*/ +export type Mutable = { + // For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the key. + -readonly [KeyType in keyof ObjectType]: ObjectType[KeyType]; +}; diff --git a/node_modules/type-fest/source/opaque.d.ts b/node_modules/type-fest/source/opaque.d.ts new file mode 100644 index 0000000..5311c1b --- /dev/null +++ b/node_modules/type-fest/source/opaque.d.ts @@ -0,0 +1,40 @@ +/** +Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly. + +The generic type parameter can be anything. It doesn't have to be an object. + +[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/) + +There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward: + - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408) + - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807) + +@example +``` +import {Opaque} from 'type-fest'; + +type AccountNumber = Opaque; +type AccountBalance = Opaque; + +function createAccountNumber(): AccountNumber { + return 2 as AccountNumber; +} + +function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance { + return 4 as AccountBalance; +} + +// This will compile successfully. +getMoneyForAccount(createAccountNumber()); + +// But this won't, because it has to be explicitly passed as an `AccountNumber` type. +getMoneyForAccount(2); + +// You can use opaque values like they aren't opaque too. +const accountNumber = createAccountNumber(); + +// This will compile successfully. +accountNumber + 2; +``` +*/ +export type Opaque = Type & {readonly __opaque__: unique symbol}; diff --git a/node_modules/type-fest/source/package-json.d.ts b/node_modules/type-fest/source/package-json.d.ts new file mode 100644 index 0000000..3179e58 --- /dev/null +++ b/node_modules/type-fest/source/package-json.d.ts @@ -0,0 +1,501 @@ +import {LiteralUnion} from '..'; + +declare namespace PackageJson { + /** + A person who has been involved in creating or maintaining the package. + */ + export type Person = + | string + | { + name: string; + url?: string; + email?: string; + }; + + export type BugsLocation = + | string + | { + /** + The URL to the package's issue tracker. + */ + url?: string; + + /** + The email address to which issues should be reported. + */ + email?: string; + }; + + export interface DirectoryLocations { + /** + Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. + */ + bin?: string; + + /** + Location for Markdown files. + */ + doc?: string; + + /** + Location for example scripts. + */ + example?: string; + + /** + Location for the bulk of the library. + */ + lib?: string; + + /** + Location for man pages. Sugar to generate a `man` array by walking the folder. + */ + man?: string; + + /** + Location for test files. + */ + test?: string; + + [directoryType: string]: unknown; + } + + export type Scripts = { + /** + Run **before** the package is published (Also run on local `npm install` without any arguments). + */ + prepublish?: string; + + /** + Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. + */ + prepare?: string; + + /** + Run **before** the package is prepared and packed, **only** on `npm publish`. + */ + prepublishOnly?: string; + + /** + Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). + */ + prepack?: string; + + /** + Run **after** the tarball has been generated and moved to its final destination. + */ + postpack?: string; + + /** + Run **after** the package is published. + */ + publish?: string; + + /** + Run **after** the package is published. + */ + postpublish?: string; + + /** + Run **before** the package is installed. + */ + preinstall?: string; + + /** + Run **after** the package is installed. + */ + install?: string; + + /** + Run **after** the package is installed and after `install`. + */ + postinstall?: string; + + /** + Run **before** the package is uninstalled and before `uninstall`. + */ + preuninstall?: string; + + /** + Run **before** the package is uninstalled. + */ + uninstall?: string; + + /** + Run **after** the package is uninstalled. + */ + postuninstall?: string; + + /** + Run **before** bump the package version and before `version`. + */ + preversion?: string; + + /** + Run **before** bump the package version. + */ + version?: string; + + /** + Run **after** bump the package version. + */ + postversion?: string; + + /** + Run with the `npm test` command, before `test`. + */ + pretest?: string; + + /** + Run with the `npm test` command. + */ + test?: string; + + /** + Run with the `npm test` command, after `test`. + */ + posttest?: string; + + /** + Run with the `npm stop` command, before `stop`. + */ + prestop?: string; + + /** + Run with the `npm stop` command. + */ + stop?: string; + + /** + Run with the `npm stop` command, after `stop`. + */ + poststop?: string; + + /** + Run with the `npm start` command, before `start`. + */ + prestart?: string; + + /** + Run with the `npm start` command. + */ + start?: string; + + /** + Run with the `npm start` command, after `start`. + */ + poststart?: string; + + /** + Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + prerestart?: string; + + /** + Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + restart?: string; + + /** + Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + postrestart?: string; + } & { + [scriptName: string]: string; + }; + + /** + Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. + */ + export interface Dependency { + [packageName: string]: string; + } + + export interface NonStandardEntryPoints { + /** + An ECMAScript module ID that is the primary entry point to the program. + */ + module?: string; + + /** + A module ID with untranspiled code that is the primary entry point to the program. + */ + esnext?: + | string + | { + main?: string; + browser?: string; + [moduleName: string]: string | undefined; + }; + + /** + A hint to JavaScript bundlers or component tools when packaging modules for client side use. + */ + browser?: + | string + | { + [moduleName: string]: string | false; + }; + } + + export interface TypeScriptConfiguration { + /** + Location of the bundled TypeScript declaration file. + */ + types?: string; + + /** + Location of the bundled TypeScript declaration file. Alias of `types`. + */ + typings?: string; + } + + export interface YarnConfiguration { + /** + If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command line, set this to `true`. + + Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an application), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. + */ + flat?: boolean; + + /** + Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. + */ + resolutions?: Dependency; + } + + export interface JSPMConfiguration { + /** + JSPM configuration. + */ + jspm?: PackageJson; + } +} + +/** +Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. +*/ +export type PackageJson = { + /** + The name of the package. + */ + name?: string; + + /** + Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). + */ + version?: string; + + /** + Package description, listed in `npm search`. + */ + description?: string; + + /** + Keywords associated with package, listed in `npm search`. + */ + keywords?: string[]; + + /** + The URL to the package's homepage. + */ + homepage?: LiteralUnion<'.', string>; + + /** + The URL to the package's issue tracker and/or the email address to which issues should be reported. + */ + bugs?: PackageJson.BugsLocation; + + /** + The license for the package. + */ + license?: string; + + /** + The licenses for the package. + */ + licenses?: Array<{ + type?: string; + url?: string; + }>; + + author?: PackageJson.Person; + + /** + A list of people who contributed to the package. + */ + contributors?: PackageJson.Person[]; + + /** + A list of people who maintain the package. + */ + maintainers?: PackageJson.Person[]; + + /** + The files included in the package. + */ + files?: string[]; + + /** + The module ID that is the primary entry point to the program. + */ + main?: string; + + /** + The executable files that should be installed into the `PATH`. + */ + bin?: + | string + | { + [binary: string]: string; + }; + + /** + Filenames to put in place for the `man` program to find. + */ + man?: string | string[]; + + /** + Indicates the structure of the package. + */ + directories?: PackageJson.DirectoryLocations; + + /** + Location for the code repository. + */ + repository?: + | string + | { + type: string; + url: string; + }; + + /** + Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. + */ + scripts?: PackageJson.Scripts; + + /** + Is used to set configuration parameters used in package scripts that persist across upgrades. + */ + config?: { + [configKey: string]: unknown; + }; + + /** + The dependencies of the package. + */ + dependencies?: PackageJson.Dependency; + + /** + Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. + */ + devDependencies?: PackageJson.Dependency; + + /** + Dependencies that are skipped if they fail to install. + */ + optionalDependencies?: PackageJson.Dependency; + + /** + Dependencies that will usually be required by the package user directly or via another dependency. + */ + peerDependencies?: PackageJson.Dependency; + + /** + Package names that are bundled when the package is published. + */ + bundledDependencies?: string[]; + + /** + Alias of `bundledDependencies`. + */ + bundleDependencies?: string[]; + + /** + Engines that this package runs on. + */ + engines?: { + [EngineName in 'npm' | 'node' | string]: string; + }; + + /** + @deprecated + */ + engineStrict?: boolean; + + /** + Operating systems the module runs on. + */ + os?: Array>; + + /** + CPU architectures the module runs on. + */ + cpu?: Array>; + + /** + If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. + + @deprecated + */ + preferGlobal?: boolean; + + /** + If set to `true`, then npm will refuse to publish it. + */ + private?: boolean; + + /** + * A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. + */ + publishConfig?: { + [config: string]: unknown; + }; +} & +PackageJson.NonStandardEntryPoints & +PackageJson.TypeScriptConfiguration & +PackageJson.YarnConfiguration & +PackageJson.JSPMConfiguration & { + [key: string]: unknown; +}; diff --git a/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/type-fest/source/partial-deep.d.ts new file mode 100644 index 0000000..b962b84 --- /dev/null +++ b/node_modules/type-fest/source/partial-deep.d.ts @@ -0,0 +1,72 @@ +import {Primitive} from './basic'; + +/** +Create a type from another type with all keys and nested keys set to optional. + +Use-cases: +- Merging a default settings/config object with another object, the second object would be a deep partial of the default object. +- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. + +@example +``` +import {PartialDeep} from 'type-fest'; + +const settings: Settings = { + textEditor: { + fontSize: 14; + fontColor: '#000000'; + fontWeight: 400; + } + autocomplete: false; + autosave: true; +}; + +const applySavedSettings = (savedSettings: PartialDeep) => { + return {...settings, ...savedSettings}; +} + +settings = applySavedSettings({textEditor: {fontWeight: 500}}); +``` +*/ +export type PartialDeep = T extends Primitive + ? Partial + : T extends Map + ? PartialMapDeep + : T extends Set + ? PartialSetDeep + : T extends ReadonlyMap + ? PartialReadonlyMapDeep + : T extends ReadonlySet + ? PartialReadonlySetDeep + : T extends ((...arguments: any[]) => unknown) + ? T | undefined + : T extends object + ? PartialObjectDeep + : unknown; + +/** +Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialMapDeep extends Map, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialSetDeep extends Set> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlyMapDeep extends ReadonlyMap, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlySetDeep extends ReadonlySet> {} + +/** +Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. +*/ +type PartialObjectDeep = { + [KeyType in keyof ObjectType]?: PartialDeep +}; diff --git a/node_modules/type-fest/source/promisable.d.ts b/node_modules/type-fest/source/promisable.d.ts new file mode 100644 index 0000000..71242a5 --- /dev/null +++ b/node_modules/type-fest/source/promisable.d.ts @@ -0,0 +1,23 @@ +/** +Create a type that represents either the value or the value wrapped in `PromiseLike`. + +Use-cases: +- A function accepts a callback that may either return a value synchronously or may return a promised value. +- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. + +@example +``` +import {Promisable} from 'type-fest'; + +async function logger(getLogEntry: () => Promisable): Promise { + const entry = await getLogEntry(); + console.log(entry); +} + +logger(() => 'foo'); +logger(() => Promise.resolve('bar')); +``` +*/ +export type Promisable = T | PromiseLike; diff --git a/node_modules/type-fest/source/readonly-deep.d.ts b/node_modules/type-fest/source/readonly-deep.d.ts new file mode 100644 index 0000000..b8c04de --- /dev/null +++ b/node_modules/type-fest/source/readonly-deep.d.ts @@ -0,0 +1,59 @@ +import {Primitive} from './basic'; + +/** +Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. + +This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + "foo": ["bar"] +} + +// main.ts +import {ReadonlyDeep} from 'type-fest'; +import dataJson = require('./data.json'); + +const data: ReadonlyDeep = dataJson; + +export default data; + +// test.ts +import data from './main'; + +data.foo.push('bar'); +//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' +``` +*/ +export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) + ? T + : T extends ReadonlyMap + ? ReadonlyMapDeep + : T extends ReadonlySet + ? ReadonlySetDeep + : T extends object + ? ReadonlyObjectDeep + : unknown; + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlyMapDeep + extends ReadonlyMap, ReadonlyDeep> {} + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlySetDeep + extends ReadonlySet> {} + +/** +Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +type ReadonlyObjectDeep = { + readonly [KeyType in keyof ObjectType]: ReadonlyDeep +}; diff --git a/node_modules/type-fest/source/require-at-least-one.d.ts b/node_modules/type-fest/source/require-at-least-one.d.ts new file mode 100644 index 0000000..337379f --- /dev/null +++ b/node_modules/type-fest/source/require-at-least-one.d.ts @@ -0,0 +1,32 @@ +import {Except} from './except'; + +/** +Create a type that requires at least one of the given keys. The remaining keys are kept as is. + +@example +``` +import {RequireAtLeastOne} from 'type-fest'; + +type Responder = { + text?: () => string; + json?: () => string; + + secure?: boolean; +}; + +const responder: RequireAtLeastOne = { + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireAtLeastOne = + { + // For each Key in KeysType make a mapped type + [Key in KeysType]: ( + // …by picking that Key's type and making it required + Required> + ) + }[KeysType] + // …then, make intersection types by adding the remaining keys to each mapped type. + & Except; diff --git a/node_modules/type-fest/source/require-exactly-one.d.ts b/node_modules/type-fest/source/require-exactly-one.d.ts new file mode 100644 index 0000000..d8c71b7 --- /dev/null +++ b/node_modules/type-fest/source/require-exactly-one.d.ts @@ -0,0 +1,36 @@ +// TODO: Remove this when we target TypeScript >=3.5. +// eslint-disable-next-line @typescript-eslint/generic-type-naming +type _Omit = Pick>; + +/** +Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is. + +Use-cases: +- Creating interfaces for components that only need one of the keys to display properly. +- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`. + +The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about. + +@example +``` +import {RequireExactlyOne} from 'type-fest'; + +type Responder = { + text: () => string; + json: () => string; + secure: boolean; +}; + +const responder: RequireExactlyOne = { + // Adding a `text` key here would cause a compile error. + + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireExactlyOne = + {[Key in KeysType]: ( + Required> & + Partial, never>> + )}[KeysType] & _Omit; diff --git a/node_modules/type-fest/source/set-optional.d.ts b/node_modules/type-fest/source/set-optional.d.ts new file mode 100644 index 0000000..a9a256a --- /dev/null +++ b/node_modules/type-fest/source/set-optional.d.ts @@ -0,0 +1,32 @@ +/** +Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional. + +@example +``` +import {SetOptional} from 'type-fest'; + +type Foo = { + a: number; + b?: string; + c: boolean; +} + +type SomeOptional = SetOptional; +// type SomeOptional = { +// a: number; +// b?: string; // Was already optional and still is. +// c?: boolean; // Is now optional. +// } +``` +*/ +export type SetOptional = + // Pick just the keys that are not optional from the base type. + Pick> & + // Pick the keys that should be optional from the base type and make them optional. + Partial> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/type-fest/source/set-required.d.ts b/node_modules/type-fest/source/set-required.d.ts new file mode 100644 index 0000000..2572bc1 --- /dev/null +++ b/node_modules/type-fest/source/set-required.d.ts @@ -0,0 +1,32 @@ +/** +Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. + +@example +``` +import {SetRequired} from 'type-fest'; + +type Foo = { + a?: number; + b: string; + c?: boolean; +} + +type SomeRequired = SetRequired; +// type SomeRequired = { +// a?: number; +// b: string; // Was already required and still is. +// c: boolean; // Is now required. +// } +``` +*/ +export type SetRequired = + // Pick just the keys that are not required from the base type. + Pick> & + // Pick the keys that should be required from the base type and make them required. + Required> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/v8-compile-cache/CHANGELOG.md b/node_modules/v8-compile-cache/CHANGELOG.md new file mode 100644 index 0000000..eb82ad5 --- /dev/null +++ b/node_modules/v8-compile-cache/CHANGELOG.md @@ -0,0 +1,45 @@ +# `v8-module-cache` Changelog + +## 2020-05-30, Version 2.1.1 + +* Stop using process.umask() [#28](https://github.com/zertosh/v8-compile-cache/pull/28). + +## 2019-08-04, Version 2.1.0 + +* Fix Electron by calling the module wrapper with `Buffer` [#10](https://github.com/zertosh/v8-compile-cache/pull/10). + +## 2019-05-10, Version 2.0.3 + +* Add `LICENSE` file [#19](https://github.com/zertosh/v8-compile-cache/pull/19). +* Add "repository" to `package.json` (see [eea336e](https://github.com/zertosh/v8-compile-cache/commit/eea336eaa8360f9ded9342b8aa928e56ac6a7529)). +* Support `require.resolve.paths` (added in Node v8.9.0) [#20](https://github.com/zertosh/v8-compile-cache/pull/20)/[#22](https://github.com/zertosh/v8-compile-cache/pull/22). + +## 2018-08-06, Version 2.0.2 + +* Re-publish. + +## 2018-08-06, Version 2.0.1 + +* Support `require.resolve` options (added in Node v8.9.0). + +## 2018-04-30, Version 2.0.0 + +* Use `Buffer.alloc` instead of `new Buffer()`. +* Drop support for Node 5.x. + +## 2018-01-23, Version 1.1.2 + +* Instead of checking for `process.versions.v8`, check that `script.cachedDataProduced` is `true` (rather than `null`/`undefined`) for support to be considered existent. + +## 2018-01-23, Version 1.1.1 + +* Check for the existence of `process.versions.v8` before attaching hook (see [f8b0388](https://github.com/zertosh/v8-compile-cache/commit/f8b038848be94bc2c905880dd50447c73393f364)). + +## 2017-03-27, Version 1.1.0 + +* Safer cache directory creation (see [bcb3b12](https://github.com/zertosh/v8-compile-cache/commit/bcb3b12c819ab0927ec4408e70f612a6d50a9617)). + - The cache is now suffixed with the user's uid on POSIX systems (i.e. `/path/to/tmp/v8-compile-cache-1234`). + +## 2017-02-21, Version 1.0.0 + +* Initial release. diff --git a/node_modules/v8-compile-cache/LICENSE b/node_modules/v8-compile-cache/LICENSE new file mode 100644 index 0000000..b72b670 --- /dev/null +++ b/node_modules/v8-compile-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Andres Suarez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/v8-compile-cache/README.md b/node_modules/v8-compile-cache/README.md new file mode 100644 index 0000000..9580f69 --- /dev/null +++ b/node_modules/v8-compile-cache/README.md @@ -0,0 +1,53 @@ +# v8-compile-cache + +[![Build Status](https://travis-ci.org/zertosh/v8-compile-cache.svg?branch=master)](https://travis-ci.org/zertosh/v8-compile-cache) + +`v8-compile-cache` attaches a `require` hook to use [V8's code cache](https://v8project.blogspot.com/2015/07/code-caching.html) to speed up instantiation time. The "code cache" is the work of parsing and compiling done by V8. + +The ability to tap into V8 to produce/consume this cache was introduced in [Node v5.7.0](https://nodejs.org/en/blog/release/v5.7.0/). + +## Usage + +1. Add the dependency: + + ```sh + $ npm install --save v8-compile-cache + ``` + +2. Then, in your entry module add: + + ```js + require('v8-compile-cache'); + ``` + +**Requiring `v8-compile-cache` in Node <5.7.0 is a noop – but you need at least Node 4.0.0 to support the ES2015 syntax used by `v8-compile-cache`.** + +## Options + +Set the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache. + +## Internals + +The caches are stored in `$TMP/v8-compile-cache/V8_VERSION`, where there are `.BLOB` and `.MAP` files corresponding to the entry module that required `v8-compile-cache`. The cache is _entry module specific_ because it is faster to load the entire code cache into memory at once, than it is to read it from disk on a file-by-file basis. + +## Benchmarks + +See https://github.com/zertosh/v8-compile-cache/tree/master/bench. + +**Load Times:** + +| Module | Without Cache | With Cache | +| ---------------- | -------------:| ----------:| +| `babel-core` | `218ms` | `185ms` | +| `yarn` | `153ms` | `113ms` | +| `yarn` (bundled) | `228ms` | `105ms` | + +_^ Includes the overhead of loading the cache itself._ + +## Acknowledgements + +* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: + - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js + - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js +* `mkdirpSync` is based on: + - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 diff --git a/node_modules/v8-compile-cache/package.json b/node_modules/v8-compile-cache/package.json new file mode 100644 index 0000000..299ae1f --- /dev/null +++ b/node_modules/v8-compile-cache/package.json @@ -0,0 +1,65 @@ +{ + "_from": "v8-compile-cache@^2.0.3", + "_id": "v8-compile-cache@2.1.1", + "_inBundle": false, + "_integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "_location": "/v8-compile-cache", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "v8-compile-cache@^2.0.3", + "name": "v8-compile-cache", + "escapedName": "v8-compile-cache", + "rawSpec": "^2.0.3", + "saveSpec": null, + "fetchSpec": "^2.0.3" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "_shasum": "54bc3cdd43317bca91e35dcaf305b1a7237de745", + "_spec": "v8-compile-cache@^2.0.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/eslint", + "author": { + "name": "Andres Suarez", + "email": "zertosh@gmail.com" + }, + "bugs": { + "url": "https://github.com/zertosh/v8-compile-cache/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Require hook for automatic V8 compile cache persistence", + "devDependencies": { + "babel-core": "6.23.1", + "eslint": "^3.15.0", + "flow-parser": "0.38.0", + "rimraf": "^2.5.4", + "rxjs": "5.2.0", + "semver": "^5.3.0", + "tap": "^10.1.1", + "temp": "^0.8.3", + "yarn": "0.20.3" + }, + "files": [ + "v8-compile-cache.js" + ], + "homepage": "https://github.com/zertosh/v8-compile-cache#readme", + "license": "MIT", + "main": "v8-compile-cache.js", + "name": "v8-compile-cache", + "repository": { + "type": "git", + "url": "git+https://github.com/zertosh/v8-compile-cache.git" + }, + "scripts": { + "bench": "bench/run.sh", + "lint": "eslint --max-warnings=0 .", + "posttest": "npm run lint", + "test": "tap test/*-test.js" + }, + "version": "2.1.1" +} diff --git a/node_modules/v8-compile-cache/v8-compile-cache.js b/node_modules/v8-compile-cache/v8-compile-cache.js new file mode 100644 index 0000000..69f0536 --- /dev/null +++ b/node_modules/v8-compile-cache/v8-compile-cache.js @@ -0,0 +1,367 @@ +'use strict'; + +const Module = require('module'); +const crypto = require('crypto'); +const fs = require('fs'); +const path = require('path'); +const vm = require('vm'); +const os = require('os'); + +const hasOwnProperty = Object.prototype.hasOwnProperty; + +//------------------------------------------------------------------------------ +// FileSystemBlobStore +//------------------------------------------------------------------------------ + +class FileSystemBlobStore { + constructor(directory, prefix) { + const name = prefix ? slashEscape(prefix + '.') : ''; + this._blobFilename = path.join(directory, name + 'BLOB'); + this._mapFilename = path.join(directory, name + 'MAP'); + this._lockFilename = path.join(directory, name + 'LOCK'); + this._directory = directory; + this._load(); + } + + has(key, invalidationKey) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + return this._invalidationKeys[key] === invalidationKey; + } else if (hasOwnProperty.call(this._storedMap, key)) { + return this._storedMap[key][0] === invalidationKey; + } + return false; + } + + get(key, invalidationKey) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + if (this._invalidationKeys[key] === invalidationKey) { + return this._memoryBlobs[key]; + } + } else if (hasOwnProperty.call(this._storedMap, key)) { + const mapping = this._storedMap[key]; + if (mapping[0] === invalidationKey) { + return this._storedBlob.slice(mapping[1], mapping[2]); + } + } + } + + set(key, invalidationKey, buffer) { + this._invalidationKeys[key] = invalidationKey; + this._memoryBlobs[key] = buffer; + this._dirty = true; + } + + delete(key) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + this._dirty = true; + delete this._memoryBlobs[key]; + } + if (hasOwnProperty.call(this._invalidationKeys, key)) { + this._dirty = true; + delete this._invalidationKeys[key]; + } + if (hasOwnProperty.call(this._storedMap, key)) { + this._dirty = true; + delete this._storedMap[key]; + } + } + + isDirty() { + return this._dirty; + } + + save() { + const dump = this._getDump(); + const blobToStore = Buffer.concat(dump[0]); + const mapToStore = JSON.stringify(dump[1]); + + try { + mkdirpSync(this._directory); + fs.writeFileSync(this._lockFilename, 'LOCK', {flag: 'wx'}); + } catch (error) { + // Swallow the exception if we fail to acquire the lock. + return false; + } + + try { + fs.writeFileSync(this._blobFilename, blobToStore); + fs.writeFileSync(this._mapFilename, mapToStore); + } catch (error) { + throw error; + } finally { + fs.unlinkSync(this._lockFilename); + } + + return true; + } + + _load() { + try { + this._storedBlob = fs.readFileSync(this._blobFilename); + this._storedMap = JSON.parse(fs.readFileSync(this._mapFilename)); + } catch (e) { + this._storedBlob = Buffer.alloc(0); + this._storedMap = {}; + } + this._dirty = false; + this._memoryBlobs = {}; + this._invalidationKeys = {}; + } + + _getDump() { + const buffers = []; + const newMap = {}; + let offset = 0; + + function push(key, invalidationKey, buffer) { + buffers.push(buffer); + newMap[key] = [invalidationKey, offset, offset + buffer.length]; + offset += buffer.length; + } + + for (const key of Object.keys(this._memoryBlobs)) { + const buffer = this._memoryBlobs[key]; + const invalidationKey = this._invalidationKeys[key]; + push(key, invalidationKey, buffer); + } + + for (const key of Object.keys(this._storedMap)) { + if (hasOwnProperty.call(newMap, key)) continue; + const mapping = this._storedMap[key]; + const buffer = this._storedBlob.slice(mapping[1], mapping[2]); + push(key, mapping[0], buffer); + } + + return [buffers, newMap]; + } +} + +//------------------------------------------------------------------------------ +// NativeCompileCache +//------------------------------------------------------------------------------ + +class NativeCompileCache { + constructor() { + this._cacheStore = null; + this._previousModuleCompile = null; + } + + setCacheStore(cacheStore) { + this._cacheStore = cacheStore; + } + + install() { + const self = this; + const hasRequireResolvePaths = typeof require.resolve.paths === 'function'; + this._previousModuleCompile = Module.prototype._compile; + Module.prototype._compile = function(content, filename) { + const mod = this; + + function require(id) { + return mod.require(id); + } + + // https://github.com/nodejs/node/blob/v10.15.3/lib/internal/modules/cjs/helpers.js#L28 + function resolve(request, options) { + return Module._resolveFilename(request, mod, false, options); + } + require.resolve = resolve; + + // https://github.com/nodejs/node/blob/v10.15.3/lib/internal/modules/cjs/helpers.js#L37 + // resolve.resolve.paths was added in v8.9.0 + if (hasRequireResolvePaths) { + resolve.paths = function paths(request) { + return Module._resolveLookupPaths(request, mod, true); + }; + } + + require.main = process.mainModule; + + // Enable support to add extra extension types + require.extensions = Module._extensions; + require.cache = Module._cache; + + const dirname = path.dirname(filename); + + const compiledWrapper = self._moduleCompile(filename, content); + + // We skip the debugger setup because by the time we run, node has already + // done that itself. + + // `Buffer` is included for Electron. + // See https://github.com/zertosh/v8-compile-cache/pull/10#issuecomment-518042543 + const args = [mod.exports, require, mod, filename, dirname, process, global, Buffer]; + return compiledWrapper.apply(mod.exports, args); + }; + } + + uninstall() { + Module.prototype._compile = this._previousModuleCompile; + } + + _moduleCompile(filename, content) { + // https://github.com/nodejs/node/blob/v7.5.0/lib/module.js#L511 + + // Remove shebang + var contLen = content.length; + if (contLen >= 2) { + if (content.charCodeAt(0) === 35/*#*/ && + content.charCodeAt(1) === 33/*!*/) { + if (contLen === 2) { + // Exact match + content = ''; + } else { + // Find end of shebang line and slice it off + var i = 2; + for (; i < contLen; ++i) { + var code = content.charCodeAt(i); + if (code === 10/*\n*/ || code === 13/*\r*/) break; + } + if (i === contLen) { + content = ''; + } else { + // Note that this actually includes the newline character(s) in the + // new output. This duplicates the behavior of the regular + // expression that was previously used to replace the shebang line + content = content.slice(i); + } + } + } + } + + // create wrapper function + var wrapper = Module.wrap(content); + + var invalidationKey = crypto + .createHash('sha1') + .update(content, 'utf8') + .digest('hex'); + + var buffer = this._cacheStore.get(filename, invalidationKey); + + var script = new vm.Script(wrapper, { + filename: filename, + lineOffset: 0, + displayErrors: true, + cachedData: buffer, + produceCachedData: true, + }); + + if (script.cachedDataProduced) { + this._cacheStore.set(filename, invalidationKey, script.cachedData); + } else if (script.cachedDataRejected) { + this._cacheStore.delete(filename); + } + + var compiledWrapper = script.runInThisContext({ + filename: filename, + lineOffset: 0, + columnOffset: 0, + displayErrors: true, + }); + + return compiledWrapper; + } +} + +//------------------------------------------------------------------------------ +// utilities +// +// https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 +// https://github.com/zertosh/slash-escape/blob/e7ebb99/slash-escape.js +//------------------------------------------------------------------------------ + +function mkdirpSync(p_) { + _mkdirpSync(path.resolve(p_), 0o777); +} + +function _mkdirpSync(p, mode) { + try { + fs.mkdirSync(p, mode); + } catch (err0) { + if (err0.code === 'ENOENT') { + _mkdirpSync(path.dirname(p)); + _mkdirpSync(p); + } else { + try { + const stat = fs.statSync(p); + if (!stat.isDirectory()) { throw err0; } + } catch (err1) { + throw err0; + } + } + } +} + +function slashEscape(str) { + const ESCAPE_LOOKUP = { + '\\': 'zB', + ':': 'zC', + '/': 'zS', + '\x00': 'z0', + 'z': 'zZ', + }; + return str.replace(/[\\:\/\x00z]/g, match => (ESCAPE_LOOKUP[match])); +} + +function supportsCachedData() { + const script = new vm.Script('""', {produceCachedData: true}); + // chakracore, as of v1.7.1.0, returns `false`. + return script.cachedDataProduced === true; +} + +function getCacheDir() { + // Avoid cache ownership issues on POSIX systems. + const dirname = typeof process.getuid === 'function' + ? 'v8-compile-cache-' + process.getuid() + : 'v8-compile-cache'; + const version = typeof process.versions.v8 === 'string' + ? process.versions.v8 + : typeof process.versions.chakracore === 'string' + ? 'chakracore-' + process.versions.chakracore + : 'node-' + process.version; + const cacheDir = path.join(os.tmpdir(), dirname, version); + return cacheDir; +} + +function getParentName() { + // `module.parent.filename` is undefined or null when: + // * node -e 'require("v8-compile-cache")' + // * node -r 'v8-compile-cache' + // * Or, requiring from the REPL. + const parentName = module.parent && typeof module.parent.filename === 'string' + ? module.parent.filename + : process.cwd(); + return parentName; +} + +//------------------------------------------------------------------------------ +// main +//------------------------------------------------------------------------------ + +if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { + const cacheDir = getCacheDir(); + const prefix = getParentName(); + const blobStore = new FileSystemBlobStore(cacheDir, prefix); + + const nativeCompileCache = new NativeCompileCache(); + nativeCompileCache.setCacheStore(blobStore); + nativeCompileCache.install(); + + process.once('exit', code => { + if (blobStore.isDirty()) { + blobStore.save(); + } + nativeCompileCache.uninstall(); + }); +} + +module.exports.__TEST__ = { + FileSystemBlobStore, + NativeCompileCache, + mkdirpSync, + slashEscape, + supportsCachedData, + getCacheDir, + getParentName, +}; diff --git a/node_modules/validate-npm-package-license/LICENSE b/node_modules/validate-npm-package-license/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/validate-npm-package-license/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/validate-npm-package-license/README.md b/node_modules/validate-npm-package-license/README.md new file mode 100644 index 0000000..702bc7b --- /dev/null +++ b/node_modules/validate-npm-package-license/README.md @@ -0,0 +1,113 @@ +validate-npm-package-license +============================ + +Give me a string and I'll tell you if it's a valid npm package license string. + +```javascript +var valid = require('validate-npm-package-license'); +``` + +SPDX license identifiers are valid license strings: + +```javascript + +var assert = require('assert'); +var validSPDXExpression = { + validForNewPackages: true, + validForOldPackages: true, + spdx: true +}; + +assert.deepEqual(valid('MIT'), validSPDXExpression); +assert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression); +assert.deepEqual(valid('Apache-2.0'), validSPDXExpression); +assert.deepEqual(valid('ISC'), validSPDXExpression); +``` +The function will return a warning and suggestion for nearly-correct license identifiers: + +```javascript +assert.deepEqual( + valid('Apache 2.0'), + { + validForOldPackages: false, + validForNewPackages: false, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + 'license is similar to the valid expression "Apache-2.0"' + ] + } +); +``` + +SPDX expressions are valid, too ... + +```javascript +// Simple SPDX license expression for dual licensing +assert.deepEqual( + valid('(GPL-3.0-only OR BSD-2-Clause)'), + validSPDXExpression +); +``` + +... except if they contain `LicenseRef`: + +```javascript +var warningAboutLicenseRef = { + validForOldPackages: false, + validForNewPackages: false, + spdx: true, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + ] +}; + +assert.deepEqual( + valid('LicenseRef-Made-Up'), + warningAboutLicenseRef +); + +assert.deepEqual( + valid('(MIT OR LicenseRef-Made-Up)'), + warningAboutLicenseRef +); +``` + +If you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there: + +```javascript +assert.deepEqual( + valid('SEE LICENSE IN LICENSE.txt'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'LICENSE.txt' + } +); + +assert.deepEqual( + valid('SEE LICENSE IN license.md'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'license.md' + } +); +``` + +If there aren't any licensing terms, use `UNLICENSED`: + +```javascript +var unlicensed = { + validForNewPackages: true, + validForOldPackages: true, + unlicensed: true +}; +assert.deepEqual(valid('UNLICENSED'), unlicensed); +assert.deepEqual(valid('UNLICENCED'), unlicensed); +``` diff --git a/node_modules/validate-npm-package-license/index.js b/node_modules/validate-npm-package-license/index.js new file mode 100644 index 0000000..35eaa73 --- /dev/null +++ b/node_modules/validate-npm-package-license/index.js @@ -0,0 +1,86 @@ +var parse = require('spdx-expression-parse'); +var correct = require('spdx-correct'); + +var genericWarning = ( + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "' +); + +var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; + +function startsWith(prefix, string) { + return string.slice(0, prefix.length) === prefix; +} + +function usesLicenseRef(ast) { + if (ast.hasOwnProperty('license')) { + var license = ast.license; + return ( + startsWith('LicenseRef', license) || + startsWith('DocumentRef', license) + ); + } else { + return ( + usesLicenseRef(ast.left) || + usesLicenseRef(ast.right) + ); + } +} + +module.exports = function(argument) { + var ast; + + try { + ast = parse(argument); + } catch (e) { + var match + if ( + argument === 'UNLICENSED' || + argument === 'UNLICENCED' + ) { + return { + validForOldPackages: true, + validForNewPackages: true, + unlicensed: true + }; + } else if (match = fileReferenceRE.exec(argument)) { + return { + validForOldPackages: true, + validForNewPackages: true, + inFile: match[1] + }; + } else { + var result = { + validForOldPackages: false, + validForNewPackages: false, + warnings: [genericWarning] + }; + if (argument.trim().length !== 0) { + var corrected = correct(argument); + if (corrected) { + result.warnings.push( + 'license is similar to the valid expression "' + corrected + '"' + ); + } + } + return result; + } + } + + if (usesLicenseRef(ast)) { + return { + validForNewPackages: false, + validForOldPackages: false, + spdx: true, + warnings: [genericWarning] + }; + } else { + return { + validForNewPackages: true, + validForOldPackages: true, + spdx: true + }; + } +}; diff --git a/node_modules/validate-npm-package-license/package.json b/node_modules/validate-npm-package-license/package.json new file mode 100644 index 0000000..5c4cb0b --- /dev/null +++ b/node_modules/validate-npm-package-license/package.json @@ -0,0 +1,67 @@ +{ + "_from": "validate-npm-package-license@^3.0.1", + "_id": "validate-npm-package-license@3.0.4", + "_inBundle": false, + "_integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "_location": "/validate-npm-package-license", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "validate-npm-package-license@^3.0.1", + "name": "validate-npm-package-license", + "escapedName": "validate-npm-package-license", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/normalize-package-data" + ], + "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "_shasum": "fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a", + "_spec": "validate-npm-package-license@^3.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/normalize-package-data", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + "bugs": { + "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mark Stacey", + "email": "markjstacey@gmail.com" + } + ], + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + }, + "deprecated": false, + "description": "Give me a string and I'll tell you if it's a valid npm package license string", + "devDependencies": { + "defence-cli": "^2.0.1", + "replace-require-self": "^1.0.0" + }, + "homepage": "https://github.com/kemitchell/validate-npm-package-license.js#readme", + "keywords": [ + "license", + "npm", + "package", + "validation" + ], + "license": "Apache-2.0", + "name": "validate-npm-package-license", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/validate-npm-package-license.js.git" + }, + "scripts": { + "test": "defence README.md | replace-require-self | node" + }, + "version": "3.0.4" +} diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md new file mode 100644 index 0000000..7fb1f20 --- /dev/null +++ b/node_modules/which/CHANGELOG.md @@ -0,0 +1,166 @@ +# Changes + + +## 2.0.2 + +* Rename bin to `node-which` + +## 2.0.1 + +* generate changelog and publish on version bump +* enforce 100% test coverage +* Promise interface + +## 2.0.0 + +* Parallel tests, modern JavaScript, and drop support for node < 8 + +## 1.3.1 + +* update deps +* update travis + +## v1.3.0 + +* Add nothrow option to which.sync +* update tap + +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + +## v1.2.12 + +* Removed unused require + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/which/README.md b/node_modules/which/README.md new file mode 100644 index 0000000..cd83350 --- /dev/null +++ b/node_modules/which/README.md @@ -0,0 +1,54 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// or promise +which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... }) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +resolved = which.sync('node', {nothrow: true}) + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/node_modules/which/bin/node-which b/node_modules/which/bin/node-which new file mode 100755 index 0000000..7cee372 --- /dev/null +++ b/node_modules/which/bin/node-which @@ -0,0 +1,52 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') + process.exit(1) +} + +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } + } + return false +}) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/node_modules/which/package.json b/node_modules/which/package.json new file mode 100644 index 0000000..c670d24 --- /dev/null +++ b/node_modules/which/package.json @@ -0,0 +1,76 @@ +{ + "_from": "which@^2.0.1", + "_id": "which@2.0.2", + "_inBundle": false, + "_integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "_location": "/which", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "which@^2.0.1", + "name": "which", + "escapedName": "which", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/cross-spawn" + ], + "_resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "_shasum": "7c6a8dd0a636a0327e10b59c9286eee93f3f51b1", + "_spec": "which@^2.0.1", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/cross-spawn", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bin": { + "node-which": "bin/node-which" + }, + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "bundleDependencies": false, + "dependencies": { + "isexe": "^2.0.0" + }, + "deprecated": false, + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.6.2", + "tap": "^14.6.9" + }, + "engines": { + "node": ">= 8" + }, + "files": [ + "which.js", + "bin/node-which" + ], + "homepage": "https://github.com/isaacs/node-which#readme", + "license": "ISC", + "main": "which.js", + "name": "which", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "scripts": { + "changelog": "git add CHANGELOG.md", + "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "prechangelog": "bash gen-changelog.sh", + "prepublish": "npm run changelog", + "preversion": "npm test", + "test": "tap" + }, + "tap": { + "check-coverage": true + }, + "version": "2.0.2" +} diff --git a/node_modules/which/which.js b/node_modules/which/which.js new file mode 100644 index 0000000..82afffd --- /dev/null +++ b/node_modules/which/which.js @@ -0,0 +1,125 @@ +const isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +const path = require('path') +const COLON = isWindows ? ';' : ':' +const isexe = require('isexe') + +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) + +const getPathInfo = (cmd, opt) => { + const colon = opt.colon || COLON + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] + : ( + [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(opt.path || process.env.PATH || + /* istanbul ignore next: very unusual */ '').split(colon), + ] + ) + const pathExtExe = isWindows + ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' + : '' + const pathExt = isWindows ? pathExtExe.split(colon) : [''] + + if (isWindows) { + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + return { + pathEnv, + pathExt, + pathExtExe, + } +} + +const which = (cmd, opt, cb) => { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + if (!opt) + opt = {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + const step = i => new Promise((resolve, reject) => { + if (i === pathEnv.length) + return opt.all && found.length ? resolve(found) + : reject(getNotFoundError(cmd)) + + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + resolve(subStep(p, i, 0)) + }) + + const subStep = (p, i, ii) => new Promise((resolve, reject) => { + if (ii === pathExt.length) + return resolve(step(i + 1)) + const ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return resolve(p + ext) + } + return resolve(subStep(p, i, ii + 1)) + }) + }) + + return cb ? step(0).then(res => cb(null, res), cb) : step(0) +} + +const whichSync = (cmd, opt) => { + opt = opt || {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (let i = 0; i < pathEnv.length; i ++) { + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + for (let j = 0; j < pathExt.length; j ++) { + const cur = p + pathExt[j] + try { + const is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} + +module.exports = which +which.sync = whichSync diff --git a/node_modules/word-wrap/LICENSE b/node_modules/word-wrap/LICENSE new file mode 100644 index 0000000..d734237 --- /dev/null +++ b/node_modules/word-wrap/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/word-wrap/README.md b/node_modules/word-wrap/README.md new file mode 100644 index 0000000..88b9684 --- /dev/null +++ b/node_modules/word-wrap/README.md @@ -0,0 +1,182 @@ +# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap) + +> Wrap words to a specified length. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save word-wrap +``` + +## Usage + +```js +var wrap = require('word-wrap'); + +wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); +``` + +Results in: + +``` + Lorem ipsum dolor sit amet, consectetur adipiscing + elit, sed do eiusmod tempor incididunt ut labore + et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +``` + +## Options + +![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png) + +### options.width + +Type: `Number` + +Default: `50` + +The width of the text before wrapping to a new line. + +**Example:** + +```js +wrap(str, {width: 60}); +``` + +### options.indent + +Type: `String` + +Default: `` (two spaces) + +The string to use at the beginning of each line. + +**Example:** + +```js +wrap(str, {indent: ' '}); +``` + +### options.newline + +Type: `String` + +Default: `\n` + +The string to use at the end of each line. + +**Example:** + +```js +wrap(str, {newline: '\n\n'}); +``` + +### options.escape + +Type: `function` + +Default: `function(str){return str;}` + +An escape function to run on each line after splitting them. + +**Example:** + +```js +var xmlescape = require('xml-escape'); +wrap(str, { + escape: function(string){ + return xmlescape(string); + } +}); +``` + +### options.trim + +Type: `Boolean` + +Default: `false` + +Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line. + +**Example:** + +```js +wrap(str, {trim: true}); +``` + +### options.cut + +Type: `Boolean` + +Default: `false` + +Break a word between any two letters when the word is longer than the specified width. + +**Example:** + +```js +wrap(str, {cut: true}); +``` + +## About + +### Related projects + +* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.") +* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.") +* [unique-words](https://www.npmjs.com/package/unique-words): Return the unique words in a string or array. | [homepage](https://github.com/jonschlinkert/unique-words "Return the unique words in a string or array.") +* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 43 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [lordvlad](https://github.com/lordvlad) | +| 2 | [hildjj](https://github.com/hildjj) | +| 1 | [danilosampaio](https://github.com/danilosampaio) | +| 1 | [2fd](https://github.com/2fd) | +| 1 | [toddself](https://github.com/toddself) | +| 1 | [wolfgang42](https://github.com/wolfgang42) | +| 1 | [zachhale](https://github.com/zachhale) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._ \ No newline at end of file diff --git a/node_modules/word-wrap/index.d.ts b/node_modules/word-wrap/index.d.ts new file mode 100644 index 0000000..54ee5f2 --- /dev/null +++ b/node_modules/word-wrap/index.d.ts @@ -0,0 +1,50 @@ +/** + * Wrap words to a specified length. + */ +export = wrap; + +declare function wrap(str: string, options?: wrap.IOptions): string; + +declare namespace wrap { + export interface IOptions { + + /** + * The width of the text before wrapping to a new line. + * @default ´50´ + */ + width?: number; + + /** + * The string to use at the beginning of each line. + * @default ´ ´ (two spaces) + */ + indent?: string; + + /** + * The string to use at the end of each line. + * @default ´\n´ + */ + newline?: string; + + /** + * An escape function to run on each line after splitting them. + * @default (str: string) => string; + */ + escape?: (str: string) => string; + + /** + * Trim trailing whitespace from the returned string. + * This option is included since .trim() would also strip + * the leading indentation from the first line. + * @default true + */ + trim?: boolean; + + /** + * Break a word between any two letters when the word is longer + * than the specified width. + * @default false + */ + cut?: boolean; + } +} \ No newline at end of file diff --git a/node_modules/word-wrap/index.js b/node_modules/word-wrap/index.js new file mode 100644 index 0000000..45373c6 --- /dev/null +++ b/node_modules/word-wrap/index.js @@ -0,0 +1,46 @@ +/*! + * word-wrap + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(str, options) { + options = options || {}; + if (str == null) { + return str; + } + + var width = options.width || 50; + var indent = (typeof options.indent === 'string') + ? options.indent + : ' '; + + var newline = options.newline || '\n' + indent; + var escape = typeof options.escape === 'function' + ? options.escape + : identity; + + var regexString = '.{1,' + width + '}'; + if (options.cut !== true) { + regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)'; + } + + var re = new RegExp(regexString, 'g'); + var lines = str.match(re) || []; + var result = indent + lines.map(function(line) { + if (line.slice(-1) === '\n') { + line = line.slice(0, line.length - 1); + } + return escape(line); + }).join(newline); + + if (options.trim === true) { + result = result.replace(/[ \t]*$/gm, ''); + } + return result; +}; + +function identity(str) { + return str; +} diff --git a/node_modules/word-wrap/package.json b/node_modules/word-wrap/package.json new file mode 100644 index 0000000..f68ceef --- /dev/null +++ b/node_modules/word-wrap/package.json @@ -0,0 +1,137 @@ +{ + "_from": "word-wrap@^1.2.3", + "_id": "word-wrap@1.2.3", + "_inBundle": false, + "_integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "_location": "/word-wrap", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "word-wrap@^1.2.3", + "name": "word-wrap", + "escapedName": "word-wrap", + "rawSpec": "^1.2.3", + "saveSpec": null, + "fetchSpec": "^1.2.3" + }, + "_requiredBy": [ + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "_shasum": "610636f6b1f703891bd34771ccb17fb93b47079c", + "_spec": "word-wrap@^1.2.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/optionator", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/word-wrap/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Danilo Sampaio", + "email": "danilo.sampaio@gmail.com", + "url": "localhost:8080" + }, + { + "name": "Fede Ramirez", + "email": "i@2fd.me", + "url": "https://2fd.github.io" + }, + { + "name": "Joe Hildebrand", + "email": "joe-github@cursive.net", + "url": "https://twitter.com/hildjj" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Todd Kennedy", + "url": "https://tck.io" + }, + { + "name": "Waldemar Reusch", + "url": "https://github.com/lordvlad" + }, + { + "name": "Wolfgang Faust", + "url": "http://www.linestarve.com" + }, + { + "name": "Zach Hale", + "email": "zachhale@gmail.com", + "url": "http://zachhale.com" + } + ], + "deprecated": false, + "description": "Wrap words to a specified length.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/jonschlinkert/word-wrap", + "keywords": [ + "break", + "carriage", + "line", + "new-line", + "newline", + "return", + "soft", + "text", + "word", + "word-wrap", + "words", + "wrap" + ], + "license": "MIT", + "main": "index.js", + "name": "word-wrap", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/word-wrap.git" + }, + "scripts": { + "test": "mocha" + }, + "typings": "index.d.ts", + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "common-words", + "shuffle-words", + "unique-words", + "wordcount" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "1.2.3" +} diff --git a/node_modules/write/LICENSE b/node_modules/write/LICENSE new file mode 100644 index 0000000..943e71d --- /dev/null +++ b/node_modules/write/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/write/README.md b/node_modules/write/README.md new file mode 100644 index 0000000..31c9597 --- /dev/null +++ b/node_modules/write/README.md @@ -0,0 +1,178 @@ +# write [![NPM version](https://img.shields.io/npm/v/write.svg?style=flat)](https://www.npmjs.com/package/write) [![NPM monthly downloads](https://img.shields.io/npm/dm/write.svg?style=flat)](https://npmjs.org/package/write) [![NPM total downloads](https://img.shields.io/npm/dt/write.svg?style=flat)](https://npmjs.org/package/write) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/write.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/write) + +> Write data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Thin wrapper around node's native fs methods. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save write +``` + +## Usage + +```js +var writeFile = require('write'); +``` + +## API + +### [writeFile](index.js#L40) + +Asynchronously writes data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Data can be a string or a buffer. Returns a promise if a callback function is not passed. + +**Params** + +* `filepath` **{string|Buffer|integer}**: filepath or file descriptor. +* `data` **{string|Buffer|Uint8Array}**: String to write to disk. +* `options` **{object}**: Options to pass to [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) and/or [mkdirp](https://github.com/substack/node-mkdirp) +* `callback` **{Function}**: (optional) If no callback is provided, a promise is returned. + +**Example** + +```js +var writeFile = require('write'); +writeFile('foo.txt', 'This is content...', function(err) { + if (err) console.log(err); +}); + +// promise +writeFile('foo.txt', 'This is content...') + .then(function() { + // do stuff + }); +``` + +### [.promise](index.js#L82) + +The promise version of [writeFile](#writefile). Returns a promise. + +**Params** + +* `filepath` **{string|Buffer|integer}**: filepath or file descriptor. +* `val` **{string|Buffer|Uint8Array}**: String or buffer to write to disk. +* `options` **{object}**: Options to pass to [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) and/or [mkdirp](https://github.com/substack/node-mkdirp) +* `returns` **{Promise}** + +**Example** + +```js +var writeFile = require('write'); +writeFile.promise('foo.txt', 'This is content...') + .then(function() { + // do stuff + }); +``` + +### [.sync](index.js#L120) + +The synchronous version of [writeFile](#writefile). Returns undefined. + +**Params** + +* `filepath` **{string|Buffer|integer}**: filepath or file descriptor. +* `data` **{string|Buffer|Uint8Array}**: String or buffer to write to disk. +* `options` **{object}**: Options to pass to [fs.writeFileSync](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) and/or [mkdirp](https://github.com/substack/node-mkdirp) +* `returns` **{undefined}** + +**Example** + +```js +var writeFile = require('write'); +writeFile.sync('foo.txt', 'This is content...'); +``` + +### [.stream](index.js#L151) + +Uses `fs.createWriteStream` to write data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Data can be a string or a buffer. Returns a new [WriteStream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) object. + +**Params** + +* `filepath` **{string|Buffer|integer}**: filepath or file descriptor. +* `options` **{object}**: Options to pass to [mkdirp](https://github.com/substack/node-mkdirp) and [fs.createWriteStream](https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options) +* `returns` **{Stream}**: Returns a new [WriteStream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) object. (See [Writable Stream](https://nodejs.org/api/stream.html#stream_class_stream_writable)). + +**Example** + +```js +var fs = require('fs'); +var writeFile = require('write'); +fs.createReadStream('README.md') + .pipe(writeFile.stream('a/b/c/other-file.md')) + .on('close', function() { + // do stuff + }); +``` + +## Release history + +### v1.0.2 - 2017-07-11 + +* improved documentation + +### v1.0.0 - 2017-07-09 + +**Added** + +* [promise support](#promise) + +**Changed** + +* The main export will now return a promise if no callback is passed + +## About + +### Related projects + +* [delete](https://www.npmjs.com/package/delete): Delete files and folders and any intermediate directories if they exist (sync and async). | [homepage](https://github.com/jonschlinkert/delete "Delete files and folders and any intermediate directories if they exist (sync and async).") +* [read-data](https://www.npmjs.com/package/read-data): Read JSON or YAML files. | [homepage](https://github.com/jonschlinkert/read-data "Read JSON or YAML files.") +* [read-yaml](https://www.npmjs.com/package/read-yaml): Very thin wrapper around js-yaml for directly reading in YAML files. | [homepage](https://github.com/jonschlinkert/read-yaml "Very thin wrapper around js-yaml for directly reading in YAML files.") +* [write-data](https://www.npmjs.com/package/write-data): Write a YAML or JSON file to disk. Automatically detects the format to write based… [more](https://github.com/jonschlinkert/write-data) | [homepage](https://github.com/jonschlinkert/write-data "Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.") +* [write-json](https://www.npmjs.com/package/write-json): Write a JSON file to disk, also creates intermediate directories in the destination path if… [more](https://github.com/jonschlinkert/write-json) | [homepage](https://github.com/jonschlinkert/write-json "Write a JSON file to disk, also creates intermediate directories in the destination path if they don't already exist.") +* [write-yaml](https://www.npmjs.com/package/write-yaml): Write YAML. Converts JSON to YAML writes it to the specified file. | [homepage](https://github.com/jonschlinkert/write-yaml "Write YAML. Converts JSON to YAML writes it to the specified file.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 33 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [tunnckoCore](https://github.com/tunnckoCore) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._ \ No newline at end of file diff --git a/node_modules/write/index.js b/node_modules/write/index.js new file mode 100644 index 0000000..b2b4b43 --- /dev/null +++ b/node_modules/write/index.js @@ -0,0 +1,160 @@ +/*! + * write + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +/** + * Asynchronously writes data to a file, replacing the file if it already + * exists and creating any intermediate directories if they don't already + * exist. Data can be a string or a buffer. Returns a promise if a callback + * function is not passed. + * + * ```js + * var writeFile = require('write'); + * writeFile('foo.txt', 'This is content...', function(err) { + * if (err) console.log(err); + * }); + * + * // promise + * writeFile('foo.txt', 'This is content...') + * .then(function() { + * // do stuff + * }); + * ``` + * @name writeFile + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {string|Buffer|Uint8Array} `data` String to write to disk. + * @param {object} `options` Options to pass to [fs.writeFile][fs]{#fs_fs_writefile_file_data_options_callback} and/or [mkdirp][] + * @param {Function} `callback` (optional) If no callback is provided, a promise is returned. + * @api public + */ + +function writeFile(filepath, data, options, cb) { + if (typeof options === 'function') { + cb = options; + options = {}; + } + + if (typeof cb !== 'function') { + return writeFile.promise.apply(null, arguments); + } + + if (typeof filepath !== 'string') { + cb(new TypeError('expected filepath to be a string')); + return; + } + + mkdirp(path.dirname(filepath), options, function(err) { + if (err) { + cb(err); + return; + } + fs.writeFile(filepath, data, options, cb); + }); +}; + +/** + * The promise version of [writeFile](#writefile). Returns a promise. + * + * ```js + * var writeFile = require('write'); + * writeFile.promise('foo.txt', 'This is content...') + * .then(function() { + * // do stuff + * }); + * ``` + * @name .promise + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {string|Buffer|Uint8Array} `val` String or buffer to write to disk. + * @param {object} `options` Options to pass to [fs.writeFile][fs]{#fs_fs_writefile_file_data_options_callback} and/or [mkdirp][] + * @return {Promise} + * @api public + */ + +writeFile.promise = function(filepath, val, options) { + if (typeof filepath !== 'string') { + return Promise.reject(new TypeError('expected filepath to be a string')); + } + + return new Promise(function(resolve, reject) { + mkdirp(path.dirname(filepath), options, function(err) { + if (err) { + reject(err); + return; + } + + fs.writeFile(filepath, val, options, function(err) { + if (err) { + reject(err); + return; + } + resolve(val); + }); + }); + }); +}; + +/** + * The synchronous version of [writeFile](#writefile). Returns undefined. + * + * ```js + * var writeFile = require('write'); + * writeFile.sync('foo.txt', 'This is content...'); + * ``` + * @name .sync + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {string|Buffer|Uint8Array} `data` String or buffer to write to disk. + * @param {object} `options` Options to pass to [fs.writeFileSync][fs]{#fs_fs_writefilesync_file_data_options} and/or [mkdirp][] + * @return {undefined} + * @api public + */ + +writeFile.sync = function(filepath, data, options) { + if (typeof filepath !== 'string') { + throw new TypeError('expected filepath to be a string'); + } + mkdirp.sync(path.dirname(filepath), options); + fs.writeFileSync(filepath, data, options); +}; + +/** + * Uses `fs.createWriteStream` to write data to a file, replacing the + * file if it already exists and creating any intermediate directories + * if they don't already exist. Data can be a string or a buffer. Returns + * a new [WriteStream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) + * object. + * + * ```js + * var fs = require('fs'); + * var writeFile = require('write'); + * fs.createReadStream('README.md') + * .pipe(writeFile.stream('a/b/c/other-file.md')) + * .on('close', function() { + * // do stuff + * }); + * ``` + * @name .stream + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {object} `options` Options to pass to [mkdirp][] and [fs.createWriteStream][fs]{#fs_fs_createwritestream_path_options} + * @return {Stream} Returns a new [WriteStream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) object. (See [Writable Stream](https://nodejs.org/api/stream.html#stream_class_stream_writable)). + * @api public + */ + +writeFile.stream = function(filepath, options) { + mkdirp.sync(path.dirname(filepath), options); + return fs.createWriteStream(filepath, options); +}; + +/** + * Expose `writeFile` + */ + +module.exports = writeFile; diff --git a/node_modules/write/package.json b/node_modules/write/package.json new file mode 100644 index 0000000..ebef2c8 --- /dev/null +++ b/node_modules/write/package.json @@ -0,0 +1,111 @@ +{ + "_from": "write@1.0.3", + "_id": "write@1.0.3", + "_inBundle": false, + "_integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "_location": "/write", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "write@1.0.3", + "name": "write", + "escapedName": "write", + "rawSpec": "1.0.3", + "saveSpec": null, + "fetchSpec": "1.0.3" + }, + "_requiredBy": [ + "/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "_shasum": "0800e14523b923a387e415123c865616aae0f5c3", + "_spec": "write@1.0.3", + "_where": "/home/tristan.helmich/code/matrix-chat-message/node_modules/flat-cache", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/write/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Charlike Mike Reagent", + "url": "https://i.am.charlike.online" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "mkdirp": "^0.5.1" + }, + "deprecated": false, + "description": "Write data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Thin wrapper around node's native fs methods.", + "devDependencies": { + "async-each": "^1.0.1", + "delete": "^1.1.0", + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/write", + "keywords": [ + "file", + "filepath", + "files", + "filesystem", + "folder", + "fs", + "fs.writeFile", + "fs.writeFileSync", + "path", + "write" + ], + "license": "MIT", + "main": "index.js", + "name": "write", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/write.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "delete", + "read-data", + "read-yaml", + "write-data", + "write-json", + "write-yaml" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.3" +} diff --git a/package-lock.json b/package-lock.json index 1ea541d..b9aa6c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,45 @@ "tunnel": "0.0.6" } }, + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, "@babel/runtime": { "version": "7.11.2", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", @@ -36,6 +75,24 @@ "regenerator-runtime": "^0.13.4" } }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, "@octokit/auth-token": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", @@ -127,11 +184,29 @@ "@types/node": ">= 8" } }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/node": { "version": "14.11.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, "ajv": { "version": "6.12.5", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", @@ -148,6 +223,99 @@ "resolved": "https://registry.npmjs.org/another-json/-/another-json-0.2.0.tgz", "integrity": "sha1-tfQBnJc7bdXGUGotk0acttMq7tw=" }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -161,6 +329,12 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -176,6 +350,12 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, "base-x": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", @@ -197,6 +377,16 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "browser-request": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", @@ -210,11 +400,83 @@ "base-x": "^3.0.2" } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -223,6 +485,24 @@ "delayed-stream": "~1.0.0" } }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "confusing-browser-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", + "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -233,6 +513,17 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -241,6 +532,30 @@ "assert-plus": "^1.0.0" } }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -251,6 +566,15 @@ "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -260,6 +584,313 @@ "safer-buffer": "^2.1.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz", + "integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.3.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-airbnb-base": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz", + "integrity": "sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.9", + "object.assign": "^4.1.0", + "object.entries": "^1.1.2" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -280,6 +911,47 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -295,6 +967,24 @@ "mime-types": "^2.1.12" } }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -303,6 +993,44 @@ "assert-plus": "^1.0.0" } }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -317,6 +1045,33 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -327,21 +1082,156 @@ "sshpk": "^1.7.0" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -357,11 +1247,26 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -373,6 +1278,44 @@ "verror": "1.10.0" } }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, "loglevel": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.0.tgz", @@ -407,16 +1350,161 @@ "mime-db": "1.44.0" } }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", + "integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -425,11 +1513,127 @@ "wrappy": "1" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -445,11 +1649,38 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, "regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -484,6 +1715,30 @@ } } }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -494,6 +1749,76 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -510,6 +1835,144 @@ "tweetnacl": "~0.14.0" } }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -519,6 +1982,18 @@ "punycode": "^2.1.1" } }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -537,6 +2012,21 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "unhomoglyph": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/unhomoglyph/-/unhomoglyph-1.0.6.tgz", @@ -560,6 +2050,22 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -570,10 +2076,34 @@ "extsprintf": "^1.2.0" } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } } } } diff --git a/package.json b/package.json index f05fc8a..dfec2c2 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,10 @@ "@actions/core": "^1.2.6", "@actions/github": "^4.0.0", "matrix-js-sdk": "^8.4.1" + }, + "devDependencies": { + "eslint": "^7.10.0", + "eslint-config-airbnb-base": "^14.2.0", + "eslint-plugin-import": "^2.22.1" } }